--- a/uninstall.py Sat Jul 19 15:39:38 2014 +0200 +++ b/uninstall.py Sun Jul 20 13:05:58 2014 +0200 @@ -27,6 +27,8 @@ pyModDir = None progLanguages = ["Python", "Ruby", "QSS"] includePythonVariant = False +defaultMacAppBundleName = "eric5.app" +defaultMacAppBundlePath = "/Applications" # Define file name markers for Python variants PythonMarkers = { @@ -188,13 +190,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( 'Error: {0}\nTry uninstall with admin rights.\n'.format(msg))