Changeset View
Changeset View
Standalone View
Standalone View
bin/CraftSetupHelper.py
Context not available. | |||||
158 | return os.environ | 158 | return os.environ | ||
---|---|---|---|---|---|
159 | 159 | | |||
160 | @staticmethod | 160 | @staticmethod | ||
161 | def _callVCVER(version : int, args : []=None, native : bool=True) -> str: | 161 | def _callVCVER(version : int, args : []=None, native : bool=True, Prerelease : bool = False) -> str: | ||
162 | if not args: | 162 | if not args: | ||
163 | args = [] | 163 | args = [] | ||
164 | vswhere = os.path.join(CraftCore.standardDirs.craftBin(), "3rdparty", "vswhere", "vswhere.exe") | 164 | vswhere = os.path.join(CraftCore.standardDirs.craftBin(), "3rdparty", "vswhere", "vswhere.exe") | ||
165 | command = [vswhere, "-property", "installationPath", "-nologo", "-latest"] | 165 | command = [vswhere, "-property", "installationPath", "-nologo", "-latest"] | ||
166 | if Prerelease: | ||||
167 | command += ["-prerelease"] | ||||
166 | if version: | 168 | if version: | ||
167 | command += ["-version", f"[{version},{version+1})"] | 169 | command += ["-version", f"[{version},{version+1})"] | ||
168 | if version < 15: | 170 | if version < 15: | ||
Context not available. | |||||
195 | 197 | | |||
196 | if not path: | 198 | if not path: | ||
197 | path = SetupHelper._callVCVER(version, native=native) | 199 | path = SetupHelper._callVCVER(version, native=native) | ||
200 | if not path: | ||||
201 | path = SetupHelper._callVCVER(version, native=native, Prerelease=True) | ||||
202 | if path: | ||||
203 | log("Found MSVS only in a prerelease version. I will use that.") | ||||
198 | if not path: | 204 | if not path: | ||
199 | log("Please ensure that you have installed the C++ component", critical=True) | 205 | log("Unable to locate Visual Studio. Please install it with the C++ component. Aborting.", critical=True) | ||
200 | 206 | | |||
201 | path = os.path.join(path, "VC") | 207 | path = os.path.join(path, "VC") | ||
202 | if not os.path.exists(os.path.join(path, "vcvarsall.bat")): | 208 | if not os.path.exists(os.path.join(path, "vcvarsall.bat")): | ||
Context not available. | |||||
343 | 349 | | |||
344 | self.prependEnvVar("PATH", CraftStandardDirs.craftBin()) | 350 | self.prependEnvVar("PATH", CraftStandardDirs.craftBin()) | ||
345 | 351 | | |||
346 | # make sure thate craftroot bin is the first to look for dlls etc | 352 | # make sure that craftroot bin is the first to look for dlls etc | ||
347 | self.prependEnvVar("PATH", os.path.join(CraftStandardDirs.craftRoot(), "bin")) | 353 | self.prependEnvVar("PATH", os.path.join(CraftStandardDirs.craftRoot(), "bin")) | ||
348 | self.prependEnvVar("PATH", os.path.join(CraftStandardDirs.craftRoot(), "dev-utils", "bin")) | 354 | self.prependEnvVar("PATH", os.path.join(CraftStandardDirs.craftRoot(), "dev-utils", "bin")) | ||
349 | 355 | | |||
Context not available. |