install.py

branch
5_4_x
changeset 3713
cebe99c3ca18
parent 3707
ea1db3ec60b3
child 3754
57e71efb769f
--- a/install.py	Sat Jul 19 15:41:46 2014 +0200
+++ b/install.py	Sun Jul 20 13:08:15 2014 +0200
@@ -34,6 +34,7 @@
 sourceDir = "eric"
 configName = 'eric5config.py'
 defaultMacAppBundleName = "eric5.app"
+defaultMacAppBundlePath = "/Applications"
 macAppBundleName = "eric5.app"
 macAppBundlePath = "/Applications"
 macPythonExe = "{0}/Resources/Python.app/Contents/MacOS/Python".format(
@@ -427,13 +428,15 @@
                 macAppBundlePath = getConfig("macAppBundlePath")
                 macAppBundleName = getConfig("macAppBundleName")
             except AttributeError:
-                macAppBundlePath = "/Applications"
-                macAppBundleName = "eric5.app"
-            if os.path.exists("/Applications/" + macAppBundleName):
-                shutil.rmtree("/Applications/" + macAppBundleName)
-            bundlePath = os.path.join(macAppBundlePath, macAppBundleName)
-            if os.path.exists(bundlePath):
-                shutil.rmtree(bundlePath)
+                macAppBundlePath = defaultMacAppBundlePath
+                macAppBundleName = defaultMacAppBundleName
+            for bundlePath in [os.path.join(defaultMacAppBundleName,
+                                            macAppBundleName),
+                               os.path.join(macAppBundlePath,
+                                            macAppBundleName),
+                               ]:
+                if os.path.exists(bundlePath):
+                    shutil.rmtree(bundlePath)
         
     except (IOError, OSError) as msg:
         sys.stderr.write(

eric ide

mercurial