uninstall.py

changeset 3714
4080395e3426
parent 3697
c947a7eaace4
child 3751
3b5476d5420c
diff -r 191ccdf78966 -r 4080395e3426 uninstall.py
--- a/uninstall.py	Sat Jul 19 15:38:53 2014 +0200
+++ b/uninstall.py	Sun Jul 20 13:08:49 2014 +0200
@@ -27,6 +27,8 @@
 pyModDir = None
 progLanguages = ["Python", "Ruby", "QSS"]
 includePythonVariant = False
+defaultMacAppBundleName = "eric6.app"
+defaultMacAppBundlePath = "/Applications"
 
 # Define file name markers for Python variants
 PythonMarkers = {
@@ -174,13 +176,15 @@
                 macAppBundlePath = getConfig("macAppBundlePath")
                 macAppBundleName = getConfig("macAppBundleName")
             except AttributeError:
-                macAppBundlePath = "/Applications"
-                macAppBundleName = "eric6.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(
             'Error: {0}\nTry uninstall with admin rights.\n'.format(msg))

eric ide

mercurial