scripts/install.py

branch
eric7
changeset 10983
8b9913066b8c
parent 10959
377ef1594e36
child 10994
e37149c2e4f9
equal deleted inserted replaced
10979:960fe726594c 10983:8b9913066b8c
66 66
67 createInstallInfoFile = True 67 createInstallInfoFile = True
68 installInfoName = "eric7install.json" 68 installInfoName = "eric7install.json"
69 installInfo = {} 69 installInfo = {}
70 installCwd = "" 70 installCwd = ""
71
72 # Windows specific stuff
73 pywin32_installed = False
71 74
72 # Define blocklisted versions of the prerequisites 75 # Define blocklisted versions of the prerequisites
73 BlockLists = { 76 BlockLists = {
74 "sip": [], 77 "sip": [],
75 "PyQt6": [], 78 "PyQt6": [],
1117 1120
1118 def createWindowsLinks(): 1121 def createWindowsLinks():
1119 """ 1122 """
1120 Create Desktop and Start Menu links. 1123 Create Desktop and Start Menu links.
1121 """ 1124 """
1122 if importlib.util.find_spec("win32com") is None: 1125 if pywin32_installed:
1123 installed = pipInstall( 1126 # create the links via an external script to get around some
1124 "pywin32", 1127 # startup magic done by pywin32.pth
1125 "\nThe Python package 'pywin32' could not be imported.", 1128 args = [
1126 force=False, 1129 sys.executable,
1127 ) 1130 os.path.join(os.path.dirname(__file__), "create_windows_links.py"),
1128 if installed: 1131 ]
1129 # create the links via an external script to get around some 1132 subprocess.run(args) # secok
1130 # startup magic done by pywin32.pth
1131 args = [
1132 sys.executable,
1133 os.path.join(os.path.dirname(__file__), "create_windows_links.py"),
1134 ]
1135 subprocess.run(args) # secok
1136 else:
1137 print(
1138 "\nThe Python package 'pywin32' is not installed. Desktop and"
1139 " Start Menu entries will not be created."
1140 )
1141 return 1133 return
1142 1134
1143 regPath = ( 1135 regPath = (
1144 "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders" 1136 "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders"
1145 ) 1137 )
1585 1577
1586 def doDependancyChecks(): 1578 def doDependancyChecks():
1587 """ 1579 """
1588 Perform some dependency checks. 1580 Perform some dependency checks.
1589 """ 1581 """
1590 global verbose 1582 global pywin32_installed, verbose
1591 1583
1592 requiredVersions = { 1584 requiredVersions = {
1593 "pyqt6": 0x60200, # v6.2.0 1585 "pyqt6": 0x60200, # v6.2.0
1594 "pyqt6-charts": 0x60200, # v6.2.0 1586 "pyqt6-charts": 0x60200, # v6.2.0
1595 "pyqt6-webengine": 0x60200, # v6.2.0 1587 "pyqt6-webengine": 0x60200, # v6.2.0
1806 optionalMissing = True 1798 optionalMissing = True
1807 else: 1799 else:
1808 msg = "Optional '{0}' could not be detected.{1}".format( 1800 msg = "Optional '{0}' could not be detected.{1}".format(
1809 optPackage, "\nError: {0}".format(err) if verbose else "" 1801 optPackage, "\nError: {0}".format(err) if verbose else ""
1810 ) 1802 )
1811 pipInstall(optPackage + optModulesDict[optPackage][1], msg) 1803 ok = pipInstall(optPackage + optModulesDict[optPackage][1], msg)
1804 if optPackage == "pywin32" and ok:
1805 pywin32_installed = True
1812 if optionalMissing: 1806 if optionalMissing:
1813 print("Some optional packages are missing and could not be installed.") 1807 print("Some optional packages are missing and could not be installed.")
1814 print("Install them manually with:") 1808 print("Install them manually with:")
1815 print(" {0} install-dependencies.py --optional".format(sys.executable)) 1809 print(" {0} install-dependencies.py --optional".format(sys.executable))
1816 1810

eric ide

mercurial