install.py

changeset 2577
14296525eff5
parent 2480
30477cebf808
child 2583
92b902f6455e
--- a/install.py	Sat Apr 13 14:58:04 2013 +0200
+++ b/install.py	Sat Apr 13 15:25:07 2013 +0200
@@ -25,6 +25,7 @@
 modDir = None
 pyModDir = None
 platBinDir = None
+scriptsDir = None
 distDir = None
 apisDir = None
 doCleanup = True
@@ -87,7 +88,7 @@
 
     @param rcode the return code passed back to the calling process.
     """
-    global progName, platBinDir, modDir, distDir, apisDir, macAppBundleName
+    global progName, scriptsDir, modDir, distDir, apisDir, macAppBundleName
     global macPythonExe
 
     print()
@@ -109,7 +110,7 @@
     else:
         print("              (no default value)")
     print("    -b dir    where the binaries will be installed")
-    print("              (default: {0})".format(platBinDir))
+    print("              (default: {0})".format(scriptsDir))
     print("    -d dir    where eric5 python files will be installed")
     print("              (default: {0})".format(modDir))
     print("    -f file   configuration file naming the various installation paths")
@@ -140,14 +141,16 @@
     """
     Sets the values of globals that need more than a simple assignment.
     """
-    global platBinDir, modDir, pyModDir, apisDir
+    global platBinDir, scriptsDir, modDir, pyModDir, apisDir
 
     if sys.platform.startswith("win"):
         platBinDir = sys.exec_prefix
         if platBinDir.endswith("\\"):
             platBinDir = platBinDir[:-1]
+        scriptsDir = os.path.join(platBinDir, "Scripts")
     else:
         platBinDir = "/usr/local/bin"
+        scriptsDir = platBinDir
 
     modDir = distutils.sysconfig.get_python_lib(True)
     pyModDir = modDir
@@ -221,7 +224,7 @@
             wrapper = \
                 '''@"{0}\\python" "{1}\\{2}.py"''' \
                 ''' %1 %2 %3 %4 %5 %6 %7 %8 %9\n'''.format(
-                    platBinDir, pydir, wfile)
+                    sys.exec_prefix, pydir, wfile)
 
     # Mac OS X
     elif sys.platform == "darwin":
@@ -312,7 +315,7 @@
     """
     Uninstall the old eric files.
     """
-    global macAppBundleName
+    global macAppBundleName, platBinDir, scriptsDir
     
     try:
         from eric5config import getConfig
@@ -358,9 +361,10 @@
     
     try:
         for rem_wname in rem_wnames:
-            rwname = wrapperName(getConfig('bindir'), rem_wname)
-            if os.path.exists(rwname):
-                os.remove(rwname)
+            for d in [platBinDir, scriptsDir, getConfig('bindir')]:
+                rwname = wrapperName(d, rem_wname)
+                if os.path.exists(rwname):
+                    os.remove(rwname)
         
         # Cleanup our config file(s)
         for name in ['eric5config.py', 'eric5config.pyc', 'eric5.pth']:
@@ -681,7 +685,7 @@
     """
     Create the installation config dictionary.
     """
-    global modDir, platBinDir, cfg, apisDir
+    global modDir, scriptsDir, cfg, apisDir
         
     ericdir = os.path.join(modDir, "eric5")
     cfg = {
@@ -697,7 +701,7 @@
         'ericTemplatesDir': os.path.join(ericdir, "DesignerTemplates"),
         'ericCodeTemplatesDir': os.path.join(ericdir, 'CodeTemplates'),
         'ericOthersDir': ericdir,
-        'bindir': platBinDir,
+        'bindir': scriptsDir,
         'mdir': modDir,
     }
     if apisDir:
@@ -1025,7 +1029,7 @@
     except getopt.GetoptError:
         usage()
 
-    global platBinDir
+    global scriptsDir
     
     depChecks = True
 
@@ -1035,7 +1039,7 @@
         elif opt == "-a":
             apisDir = arg
         elif opt == "-b":
-            platBinDir = arg
+            scriptsDir = arg
         elif opt == "-d":
             modDir = arg
         elif opt == "-i":

eric ide

mercurial