install.py

changeset 4456
9a2304647d95
parent 4455
ca13a6f6c452
child 4512
23e8b848efb0
equal deleted inserted replaced
4455:ca13a6f6c452 4456:9a2304647d95
36 progName = None 36 progName = None
37 currDir = os.getcwd() 37 currDir = os.getcwd()
38 modDir = None 38 modDir = None
39 pyModDir = None 39 pyModDir = None
40 platBinDir = None 40 platBinDir = None
41 # TODO: change the installation location on Win to the Scripts directory
42 # following entry is needed to uninstall the scripts from the former location
43 platBinDirOld = None 41 platBinDirOld = None
44 distDir = None 42 distDir = None
45 apisDir = None 43 apisDir = None
46 installApis = True 44 installApis = True
47 doCleanup = True 45 doCleanup = True
227 def initGlobals(): 225 def initGlobals():
228 """ 226 """
229 Module function to set the values of globals that need more than a 227 Module function to set the values of globals that need more than a
230 simple assignment. 228 simple assignment.
231 """ 229 """
232 global platBinDir, modDir, pyModDir, apisDir, pyqtVariant 230 global platBinDir, modDir, pyModDir, apisDir, pyqtVariant, platBinDirOld
233 231
234 if sys.platform.startswith("win"): 232 if sys.platform.startswith("win"):
235 platBinDir = sys.exec_prefix 233 platBinDir = sys.exec_prefix
236 if platBinDir.endswith("\\"): 234 if platBinDir.endswith("\\"):
237 platBinDir = platBinDir[:-1] 235 platBinDir = platBinDir[:-1]
236 platBinDirOld = platBinDir
237 platBinDir = os.path.join(platBinDir, "Scripts")
238 if not os.path.exists(platBinDir):
239 platBinDir = platBinDirOld
238 else: 240 else:
239 platBinDir = "/usr/local/bin" 241 platBinDir = "/usr/local/bin"
240 242
241 modDir = distutils.sysconfig.get_python_lib(True) 243 modDir = distutils.sysconfig.get_python_lib(True)
242 pyModDir = modDir 244 pyModDir = modDir
485 487
486 def cleanUp(): 488 def cleanUp():
487 """ 489 """
488 Uninstall the old eric files. 490 Uninstall the old eric files.
489 """ 491 """
490 global platBinDir, includePythonVariant 492 global platBinDir, platBinDirOld, includePythonVariant
491 493
492 try: 494 try:
493 from eric6config import getConfig 495 from eric6config import getConfig
494 except ImportError: 496 except ImportError:
495 # eric6 wasn't installed previously 497 # eric6 wasn't installed previously
531 if includePythonVariant: 533 if includePythonVariant:
532 marker = PythonMarkers[sys.version_info.major] 534 marker = PythonMarkers[sys.version_info.major]
533 rem_wnames = [n + marker for n in rem_wnames] 535 rem_wnames = [n + marker for n in rem_wnames]
534 536
535 try: 537 try:
538 dirs = [platBinDir, getConfig('bindir')]
539 if platBinDirOld:
540 dirs.append(platBinDirOld)
536 for rem_wname in rem_wnames: 541 for rem_wname in rem_wnames:
537 for d in [platBinDir, getConfig('bindir')]: 542 for d in dirs:
538 rwname = wrapperName(d, rem_wname) 543 rwname = wrapperName(d, rem_wname)
539 if os.path.exists(rwname): 544 if os.path.exists(rwname):
540 os.remove(rwname) 545 os.remove(rwname)
541 546
542 # Cleanup our config file(s) 547 # Cleanup our config file(s)

eric ide

mercurial