Skip to content

Commit 19010f2

Browse files
authored
Merge 6067ff0 into 348c350
2 parents 348c350 + 6067ff0 commit 19010f2

8 files changed

Lines changed: 38 additions & 24 deletions

File tree

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
os: Visual Studio 2017
1+
os: Visual Studio 2019
22
version: "{branch}-{build}"
33

44
branches:

include/scons

Submodule scons updated from 73b2c02 to 72ae09d

nvdaHelper/archBuild_sconscript

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ def COMProxyDllBuilder(env,target,source,proxyClsid):
7373
return proxyDll
7474
env.AddMethod(COMProxyDllBuilder,'COMProxyDll')
7575

76-
# We only support compiling with MSVC 14.1 (2017)
77-
if not env.get('MSVC_VERSION')=='14.1':
78-
raise RuntimeError("Visual C++ 14.1 (Visual Studio 2017) not found")
76+
# We only support compiling with MSVC 14.2 (2019)
77+
if not env.get('MSVC_VERSION')=='14.2':
78+
raise RuntimeError("Visual C++ 14.2 (Visual Studio 2019) not found")
7979

8080

8181
TARGET_ARCH=env['TARGET_ARCH']

nvdaHelper/localWin10/sconscript

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,10 @@ localWin10Lib = env.SharedLibrary(
4141
# Therefore, we must include it.
4242
# VS 2017 keeps changing the path to reflect the latest major.minor.build version which we canot easily find out.
4343
# Therefore Search these versioned directories from newest to oldest to collect all the files we need.
44+
msvc = env.get('MSVC_VERSION')
4445
vcRedistDirs = glob.glob(os.path.join(
45-
find_vc_pdir(env.get("MSVC_VERSION")),
46-
r"Redist\MSVC\%s*\x86\Microsoft.VC141.CRT" % env.get("MSVC_VERSION")
46+
find_vc_pdir(msvc),
47+
rf"Redist\MSVC\{msvc}*\x86\Microsoft.VC{msvc.replace('.', '')}.CRT"
4748
))
4849
if len(vcRedistDirs)==0:
4950
raise RuntimeError("Could not locate vc redistributables. Perhaps the Universal Windows Platform component in visual Studio is not installed")

readme.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,19 @@ The following dependencies need to be installed on your system:
3737

3838
* [Python](http://www.python.org/), version 3.7, 32 bit
3939
* Use latest minor version if possible.
40-
* Microsoft Visual Studio 2017 Community, Version 15.3 or later:
40+
* Microsoft Visual Studio 2019 Community, Version 16.2 or later:
4141
* Download from https://visualstudio.microsoft.com/downloads/
4242
* When installing Visual Studio, you need to enable the following:
43-
On the Workloads tab, in the Windows group:
44-
* Universal Windows Platform Development
43+
* On the Workloads tab, in the Windows group:
4544
* Desktop development with C++
4645
* Then in the Installation details section, under Desktop for C++, Optional grouping, ensure the following are selected:
47-
* VC++ 2017 v141 toolset (x86,x64)
48-
* Windows 10 SDK (10.0.17134.0) for Desktop C++ x86 and x64
49-
* Visual C++ ATL for x86 and x64
50-
* In the Installation details section, under Individual components, ensure the following are selected:
51-
* Visual C++ compilers and libraries for ARM64
52-
* Visual C++ ATL for ARM64
46+
* MSVC v142 - VS 2019 C++ x64/x86 build tools
47+
* Windows 10 SDK (10.0.18362.0)
48+
* C++ ATL for v142 build tools (x86 & x64)
49+
* C++ Clang tools for Windows
50+
On the Individual components tab, ensure the following items are selected:
51+
* MSVC v142 - VS 2019 C++ ARM64 build tools
52+
* C++ ATL for v142 build tools (ARM64)
5353

5454

5555
### Git Submodules
@@ -83,7 +83,7 @@ Additionally, the following build time dependencies are included in Git submodul
8383
* [Py2Exe](http://github.com/albertosottile/py2exe/), version 0.9.3.2 commit b372a8e
8484
* [Python Windows Extensions](http://sourceforge.net/projects/pywin32/ ), build 224, required by py2exe
8585
* [txt2tags](http://txt2tags.sourceforge.net/), version 2.5
86-
* [SCons](http://www.scons.org/), version 3.0.4
86+
* [SCons](http://www.scons.org/), version 3.1.1
8787
* [Nulsoft Install System](http://nsis.sourceforge.net/), version 2.51
8888
* [NSIS UAC plug-in](http://nsis.sourceforge.net/UAC_plug-in), version 0.2.4, ansi
8989
* xgettext and msgfmt from [GNU gettext](http://sourceforge.net/projects/cppcms/files/boost_locale/gettext_for_windows/)

sconstruct

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ def recursiveCopy(env,targetDir,sourceDir):
3838
import gettext
3939
gettext.install("nvda")
4040
sys.path.append("source")
41+
import comtypesMonkeyPatches
4142
import versionInfo
4243
del sys.path[-1]
4344

source/comInterfaces_sconscript

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,9 @@ interfaceBuilder=env.Builder(
3131
)
3232
env['BUILDERS']['comtypesInterface']=interfaceBuilder
3333

34-
#Bit of a dance to force comtypes generated interfaces in to our directory
34+
# Force comtypes generated interfaces in to our directory
3535
import comtypes.client
3636
comtypes.client.gen_dir=Dir('comInterfaces').abspath
37-
import sys
38-
sys.modules['comtypes.gen']=comtypes.gen=__import__("comInterfaces",globals(),locals(),[])
3937

4038
COM_INTERFACES = {
4139
"IAccessible2Lib.py": "typelibs/ia2.tlb",

source/comtypesMonkeyPatches.py

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
#A part of NonVisual Desktop Access (NVDA)
2-
#Copyright (C) 2009-2016 NV Access Limited
3-
#This file is covered by the GNU General Public License.
4-
#See the file COPYING for more details.
1+
# A part of NonVisual Desktop Access (NVDA)
2+
# Copyright (C) 2009-2019 NV Access Limited, Babbage B.V.
3+
# This file is covered by the GNU General Public License.
4+
# See the file COPYING for more details.
55

66
import ctypes
77
import _ctypes
8+
import importlib
9+
import comtypes.client._generate
810

911
# A version of ctypes.WINFUNCTYPE
1012
# that produces a WinFunctionType class whose instance will convert COMError into a CallCancelled exception when called as a function.
@@ -125,3 +127,15 @@ def _check_version(actual):
125127
if actual != required:
126128
raise ImportError("Wrong version")
127129
comtypes._check_version = _check_version
130+
131+
132+
# Monkeypatch comtypes to clear the importlib cache when importing a new module
133+
old_my_import = comtypes.client._generate._my_import
134+
135+
136+
def new_my_import(fullname):
137+
importlib.invalidate_caches()
138+
return old_my_import(fullname)
139+
140+
141+
comtypes.client._generate._my_import = new_my_import

0 commit comments

Comments
 (0)