scripts/uninstall.py

branch
eric7
changeset 10264
f06151820839
parent 10261
fa560567d555
child 10272
7ae72d1df070
child 10300
60e8f2175b3b
equal deleted inserted replaced
10263:f4bb67586615 10264:f06151820839
22 progName = None 22 progName = None
23 currDir = os.getcwd() 23 currDir = os.getcwd()
24 pyModDir = None 24 pyModDir = None
25 progLanguages = ["MicroPython", "Python3", "QSS"] 25 progLanguages = ["MicroPython", "Python3", "QSS"]
26 defaultMacAppBundleName = "eric7.app" 26 defaultMacAppBundleName = "eric7.app"
27 if os.getuid() == 0: 27 defaultMacAppBundlePath = "/Applications"
28 defaultMacAppBundlePath = "/Applications" 28 defaultMacUserAppBundlePath = os.path.expanduser("~/Applications")
29 else:
30 defaultMacAppBundlePath = os.path.expanduser("~/Applications")
31 settingsNameOrganization = "Eric7" 29 settingsNameOrganization = "Eric7"
32 settingsNameGlobal = "eric7" 30 settingsNameGlobal = "eric7"
33 31
34 32
35 def exit(rcode=0): 33 def exit(rcode=0):
341 shutil.rmtree("/Developer/Applications/Eric7") 339 shutil.rmtree("/Developer/Applications/Eric7")
342 try: 340 try:
343 macAppBundlePath = getConfig("macAppBundlePath") 341 macAppBundlePath = getConfig("macAppBundlePath")
344 macAppBundleName = getConfig("macAppBundleName") 342 macAppBundleName = getConfig("macAppBundleName")
345 except AttributeError: 343 except AttributeError:
346 macAppBundlePath = defaultMacAppBundlePath 344 macAppBundlePath = (
345 defaultMacAppBundlePath
346 if os.getpid() == 0
347 else defaultMacUserAppBundlePath
348 )
347 macAppBundleName = defaultMacAppBundleName 349 macAppBundleName = defaultMacAppBundleName
348 for bundlePath in [ 350 for bundlePath in [
349 os.path.join(defaultMacAppBundlePath, macAppBundleName), 351 os.path.join(defaultMacAppBundlePath, macAppBundleName),
352 os.path.join(defaultMacUserAppBundlePath, macAppBundleName),
350 os.path.join(macAppBundlePath, macAppBundleName), 353 os.path.join(macAppBundlePath, macAppBundleName),
351 ]: 354 ]:
352 if os.path.exists(bundlePath): 355 if os.path.exists(bundlePath):
353 shutil.rmtree(bundlePath) 356 shutil.rmtree(bundlePath)
354 357

eric ide

mercurial