Skip to content

Commit

Permalink
Setup: download current VC Redist
Browse files Browse the repository at this point in the history
  • Loading branch information
Berserker66 committed Nov 25, 2023
1 parent 3c56f9b commit 525d026
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 525d026

Please sign in to comment.