From 525d026df32b2b4590f499a928b2f1237fde190f Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Sat, 25 Nov 2023 13:34:25 +0100 Subject: [PATCH] Setup: download current VC Redist --- setup.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/setup.py b/setup.py index 0d2da0bb1818..8618fbf16371 100644 --- a/setup.py +++ b/setup.py @@ -353,6 +353,18 @@ def run(self): for folder in sdl2.dep_bins + glew.dep_bins: shutil.copytree(folder, self.libfolder, dirs_exist_ok=True) print(f"copying {folder} -> {self.libfolder}") + # windows needs Visual Studio C++ Redistributable + # Installer works for x64 and arm64 + print("Downloading VC Redist") + import certifi + import ssl + context = ssl.create_default_context(ssl.Purpose.SERVER_AUTH, cafile=certifi.where()) + with urllib.request.urlopen(r"https://aka.ms/vs/17/release/vc_redist.x64.exe", + context=context) as download: + vc_redist = download.read() + print(f"Download complete, {len(vc_redist) / 1024 / 1024:.2f} MBytes downloaded.", ) + with open("VC_redist.x64.exe", "wb") as f: + f.write(vc_redist) for data in self.extra_data: self.installfile(Path(data))