install.py

changeset 3714
4080395e3426
parent 3705
a88eb398a4ed
child 3724
0848df91249f
equal deleted inserted replaced
3709:191ccdf78966 3714:4080395e3426
41 cfg = {} 41 cfg = {}
42 progLanguages = ["Python", "Ruby", "QSS"] 42 progLanguages = ["Python", "Ruby", "QSS"]
43 sourceDir = "eric" 43 sourceDir = "eric"
44 configName = 'eric6config.py' 44 configName = 'eric6config.py'
45 defaultMacAppBundleName = "eric6.app" 45 defaultMacAppBundleName = "eric6.app"
46 defaultMacAppBundlePath = "/Applications"
46 macAppBundleName = "eric6.app" 47 macAppBundleName = "eric6.app"
47 macAppBundlePath = "/Applications" 48 macAppBundlePath = "/Applications"
48 macPythonExe = "{0}/Resources/Python.app/Contents/MacOS/Python".format( 49 macPythonExe = "{0}/Resources/Python.app/Contents/MacOS/Python".format(
49 sys.exec_prefix) 50 sys.exec_prefix)
50 51
473 except AttributeError: 474 except AttributeError:
474 pass 475 pass
475 476
476 if sys.platform == "darwin": 477 if sys.platform == "darwin":
477 # delete the Mac app bundle 478 # delete the Mac app bundle
478 if os.path.exists("/Developer/Applications/Eric6"):
479 shutil.rmtree("/Developer/Applications/Eric6")
480 try: 479 try:
481 macAppBundlePath = getConfig("macAppBundlePath") 480 macAppBundlePath = getConfig("macAppBundlePath")
482 macAppBundleName = getConfig("macAppBundleName") 481 macAppBundleName = getConfig("macAppBundleName")
483 except AttributeError: 482 except AttributeError:
484 macAppBundlePath = "/Applications" 483 macAppBundlePath = defaultMacAppBundlePath
485 macAppBundleName = "eric6.app" 484 macAppBundleName = defaultMacAppBundleName
486 if os.path.exists("/Applications/" + macAppBundleName): 485 for bundlePath in [os.path.join(defaultMacAppBundleName,
487 shutil.rmtree("/Applications/" + macAppBundleName) 486 macAppBundleName),
488 bundlePath = os.path.join(macAppBundlePath, macAppBundleName) 487 os.path.join(macAppBundlePath,
489 if os.path.exists(bundlePath): 488 macAppBundleName),
490 shutil.rmtree(bundlePath) 489 ]:
490 if os.path.exists(bundlePath):
491 shutil.rmtree(bundlePath)
491 except (IOError, OSError) as msg: 492 except (IOError, OSError) as msg:
492 sys.stderr.write( 493 sys.stderr.write(
493 'Error: {0}\nTry install with admin rights.\n'.format(msg)) 494 'Error: {0}\nTry install with admin rights.\n'.format(msg))
494 exit(7) 495 exit(7)
495 496

eric ide

mercurial