install.py

branch
5_3_x
changeset 2422
21509a6de6e0
parent 2384
ab316924b76a
child 2429
a68c882ad6cc
equal deleted inserted replaced
2419:ae6f93678a6e 2422:21509a6de6e0
401 if os.path.exists("/Developer/Applications/Eric5"): 401 if os.path.exists("/Developer/Applications/Eric5"):
402 shutil.rmtree("/Developer/Applications/Eric5") 402 shutil.rmtree("/Developer/Applications/Eric5")
403 if os.path.exists("/Applications/" + macAppBundleName): 403 if os.path.exists("/Applications/" + macAppBundleName):
404 shutil.rmtree("/Applications/" + macAppBundleName) 404 shutil.rmtree("/Applications/" + macAppBundleName)
405 405
406 except IOError as msg: 406 except (IOError, OSError) as msg:
407 sys.stderr.write('IOError: {0}\nTry install with admin rights.\n'.format(msg)) 407 sys.stderr.write('Error: {0}\nTry install with admin rights.\n'.format(msg))
408 exit(7)
409
410 except OSError as msg:
411 sys.stderr.write('OSError: {0}\nTry install with admin rights.\n'.format(msg))
412 exit(7) 408 exit(7)
413 409
414 410
415 def shutilCopy(src, dst, perm=0o644): 411 def shutilCopy(src, dst, perm=0o644):
416 """ 412 """
520 shutilCopy('{1}{0}LICENSE.GPL3'.format(os.sep, sourceDir), cfg['ericDir']) 516 shutilCopy('{1}{0}LICENSE.GPL3'.format(os.sep, sourceDir), cfg['ericDir'])
521 517
522 # create the global plugins directory 518 # create the global plugins directory
523 createGlobalPluginsDir() 519 createGlobalPluginsDir()
524 520
525 except IOError as msg: 521 except (IOError, OSError) as msg:
526 sys.stderr.write('IOError: {0}\nTry install with admin rights.\n'.format(msg)) 522 sys.stderr.write('Error: {0}\nTry install with admin rights.\n'.format(msg))
527 return(7)
528
529 except OSError as msg:
530 sys.stderr.write('OSError: {0}\nTry install with admin rights.\n'.format(msg))
531 return(7) 523 return(7)
532 524
533 # copy some text files to the doc area 525 # copy some text files to the doc area
534 for name in ["LICENSE.GPL3", "THANKS", "changelog"]: 526 for name in ["LICENSE.GPL3", "THANKS", "changelog"]:
535 try: 527 try:
1100 if doCleanup: 1092 if doCleanup:
1101 if distDir: 1093 if distDir:
1102 shutil.rmtree(distDir, True) 1094 shutil.rmtree(distDir, True)
1103 else: 1095 else:
1104 cleanUp() 1096 cleanUp()
1105 except IOError as msg: 1097 except (IOError, OSError) as msg:
1106 sys.stderr.write('IOError: {0}\nTry install as root.\n'.format(msg)) 1098 sys.stderr.write('Error: {0}\nTry install as root.\n'.format(msg))
1099 exit(7)
1107 1100
1108 # Create a config file and delete the default one 1101 # Create a config file and delete the default one
1109 createConfig() 1102 createConfig()
1110 1103
1111 # Compile .ui files 1104 # Compile .ui files

eric ide

mercurial