Remove portable MSVC script, we use portablebuildtools, fix python unclosed quote
This commit is contained in:
-76
@@ -90,82 +90,6 @@ if args.with_dev_apps:
|
||||
|
||||
install_script_path = pathlib.Path(devenver.script_dir, "install.py")
|
||||
if is_windows:
|
||||
# Install MSVC
|
||||
# --------------------------------------------------------------------------
|
||||
devenver.print_header("Install MSVC & Windows 10 SDK")
|
||||
msvc_script = devenver.script_dir / "win_portable_msvc.py"
|
||||
msvc_version = "14.34"
|
||||
win10_sdk_version = "22621"
|
||||
|
||||
msvc_install_dir = install_dir / "msvc"
|
||||
|
||||
# Basic heuristic to see if we"ve already installed the MSVC/SDK version
|
||||
msvc_installed = False
|
||||
win10_sdk_installed = False
|
||||
|
||||
msvc_find_test_dir = msvc_install_dir / "VC/Tools/MSVC"
|
||||
win10_sdk_find_test_dir = msvc_install_dir / "Windows Kits/10"
|
||||
|
||||
if os.path.exists(msvc_find_test_dir):
|
||||
for file_name in os.listdir(msvc_find_test_dir):
|
||||
msvc_installed = file_name.startswith(msvc_version)
|
||||
if msvc_installed == True:
|
||||
devenver.lprint(f"MSVC {msvc_version} install detected (skip download) in {msvc_find_test_dir}\\{file_name}")
|
||||
break
|
||||
if not msvc_installed:
|
||||
devenver.lprint(f"MSVC {msvc_version} install not detected (need to download) in {msvc_find_test_dir}")
|
||||
|
||||
if os.path.exists(win10_sdk_find_test_dir):
|
||||
for file_name in os.listdir(win10_sdk_find_test_dir / "bin"):
|
||||
# Check if directory contains version substring, 22621, e.g. "10.0.22621.0"
|
||||
win10_sdk_installed = file_name.count(win10_sdk_version) > 0
|
||||
if win10_sdk_installed == True:
|
||||
install_locations = f"{win10_sdk_find_test_dir}\\*\\{file_name}"
|
||||
devenver.lprint(f"Windows 10 SDK {win10_sdk_version} install detected (skip download) in {install_locations}")
|
||||
break
|
||||
if not win10_sdk_installed:
|
||||
devenver.lprint(f"Windows 10 SDK {win10_sdk_version} not detected (need to download) in {win10_sdk_find_test_dir}")
|
||||
|
||||
# Install MSVC
|
||||
if msvc_installed == False or win10_sdk_installed == False:
|
||||
with tempfile.TemporaryDirectory() as temp_dir:
|
||||
|
||||
# Invoke the MSVC script to download MSVC to disk
|
||||
command = f"\"{sys.executable}\" \"{msvc_script}\" --accept-license"
|
||||
line = "Invoking MSVC script to install"
|
||||
if msvc_installed:
|
||||
command += " --no-msvc"
|
||||
else:
|
||||
command += f" --msvc-version {msvc_version}"
|
||||
line += f" MSVC {msvc_version}"
|
||||
|
||||
if win10_sdk_installed:
|
||||
command += " --no-sdk"
|
||||
else:
|
||||
command += f" --sdk-version {win10_sdk_version}"
|
||||
line += f" Windows 10 SDK {win10_sdk_version}"
|
||||
|
||||
devenver.lprint(line)
|
||||
devenver.lprint(f"Command: {command}")
|
||||
run_result = subprocess.run(command, cwd=temp_dir, check=True)
|
||||
|
||||
# Merge the download MSVC installation to our unified install dir
|
||||
temp_msvc_dir = pathlib.Path(temp_dir, "msvc")
|
||||
for src_dir, dirs, files in os.walk(temp_msvc_dir):
|
||||
msvc_working_dir = src_dir.replace(str(temp_msvc_dir), str(msvc_install_dir), 1)
|
||||
if not os.path.exists(msvc_working_dir):
|
||||
os.makedirs(msvc_working_dir)
|
||||
for file_ in files:
|
||||
src = os.path.join(src_dir, file_)
|
||||
dest = os.path.join(msvc_working_dir, file_)
|
||||
if os.path.exists(dest):
|
||||
if os.path.samefile(src, dest):
|
||||
continue
|
||||
os.remove(dest)
|
||||
shutil.move(src, msvc_working_dir)
|
||||
|
||||
devenver.lprint(f"MSVC {msvc_version} Windows 10 SDK {win10_sdk_version} installed: {msvc_install_dir}")
|
||||
|
||||
# Install apps dependent on Git
|
||||
# --------------------------------------------------------------------------
|
||||
devenver.print_header("Install apps that rely on Git")
|
||||
|
||||
Reference in New Issue
Block a user