Skip to content

Commit

Permalink
Bundle Universal CRT libraries when creating NVDA distribution. (#10347)
Browse files Browse the repository at this point in the history
This makes it again possible to use NVDA on clean installs of Windows versions older than Windows 10.
Fixes #10031
  • Loading branch information
lukaszgo1 authored and michaelDCurran committed Oct 7, 2019
1 parent 49365d1 commit b40bc9e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions sconstruct
Expand Up @@ -19,6 +19,7 @@ from glob import glob
import sourceEnv
from py2exe.dllfinder import pydll
import importlib.util
import winreg

def recursiveCopy(env,targetDir,sourceDir):
targets=[]
Expand Down Expand Up @@ -279,6 +280,19 @@ def NVDADistGenerator(target, source, env, for_signature):
# Therefore, copy a fresh version of the dll one more time once py2exe has completed.
action.append(Copy(target[0],pydll))

# #10031: Apps written in Python 3 require Universal CRT to be installed. We cannot assume users have it on their systems.
# Therefore , copy required libraries from Windows 10 SDK.
try:
with winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r'SOFTWARE\Microsoft\Microsoft SDKs\Windows\v10.0', 0,winreg.KEY_READ|winreg.KEY_WOW64_32KEY) as SDKKey:
CRTDir = os.path.join(winreg.QueryValueEx(SDKKey, 'InstallationFolder')[0], "Redist", "ucrt", "DLLs", "x86")
except WindowsError:
raise RuntimeError("Windows 10 SDK not found")
if os.path.isdir(CRTDir):
with os.scandir(CRTDir) as dir:
for file in dir:
if file.name.endswith(".dll") and file.is_file():
action.append(Copy(target[0], file.path))

if certFile:
for prog in "nvda_noUIAccess.exe", "nvda_uiAccess.exe", "nvda_slave.exe", "nvda_eoaProxy.exe":
action.append(lambda target,source,env, progByVal=prog: signExec([target[0].File(progByVal)],source,env))
Expand Down

0 comments on commit b40bc9e

Please sign in to comment.