diff -r 0060733678b0 -r 09b6f92a82ca install.py --- a/install.py Sat Jul 19 15:39:38 2014 +0200 +++ b/install.py Sun Jul 20 13:05:58 2014 +0200 @@ -47,6 +47,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( @@ -499,13 +500,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 install with admin rights.\n'.format(msg))