Changed installation destination on Windows to be the Scripts subdirectory of the Python installation.

Sat, 12 Sep 2015 15:25:11 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 12 Sep 2015 15:25:11 +0200
changeset 4456
9a2304647d95
parent 4455
ca13a6f6c452
child 4457
6faeea06e9b6

Changed installation destination on Windows to be the Scripts subdirectory of the Python installation.

install.py file | annotate | diff | comparison | revisions
--- a/install.py	Sat Sep 12 12:54:12 2015 +0200
+++ b/install.py	Sat Sep 12 15:25:11 2015 +0200
@@ -38,8 +38,6 @@
 modDir = None
 pyModDir = None
 platBinDir = None
-# TODO: change the installation location on Win to the Scripts directory
-# following entry is needed to uninstall the scripts from the former location
 platBinDirOld = None
 distDir = None
 apisDir = None
@@ -229,12 +227,16 @@
     Module function to set the values of globals that need more than a
     simple assignment.
     """
-    global platBinDir, modDir, pyModDir, apisDir, pyqtVariant
+    global platBinDir, modDir, pyModDir, apisDir, pyqtVariant, platBinDirOld
 
     if sys.platform.startswith("win"):
         platBinDir = sys.exec_prefix
         if platBinDir.endswith("\\"):
             platBinDir = platBinDir[:-1]
+        platBinDirOld = platBinDir
+        platBinDir = os.path.join(platBinDir, "Scripts")
+        if not os.path.exists(platBinDir):
+            platBinDir = platBinDirOld
     else:
         platBinDir = "/usr/local/bin"
 
@@ -487,7 +489,7 @@
     """
     Uninstall the old eric files.
     """
-    global platBinDir, includePythonVariant
+    global platBinDir, platBinDirOld, includePythonVariant
     
     try:
         from eric6config import getConfig
@@ -533,8 +535,11 @@
         rem_wnames = [n + marker for n in rem_wnames]
     
     try:
+        dirs = [platBinDir, getConfig('bindir')]
+        if platBinDirOld:
+            dirs.append(platBinDirOld)
         for rem_wname in rem_wnames:
-            for d in [platBinDir, getConfig('bindir')]:
+            for d in dirs:
                 rwname = wrapperName(d, rem_wname)
                 if os.path.exists(rwname):
                     os.remove(rwname)

eric ide

mercurial