Skip to content

Commit

Permalink
Merge 6067ff0 into 348c350
Browse files Browse the repository at this point in the history
  • Loading branch information
LeonarddeR committed Sep 17, 2019
2 parents 348c350 + 6067ff0 commit 19010f2
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 24 deletions.
2 changes: 1 addition & 1 deletion appveyor.yml
@@ -1,4 +1,4 @@
os: Visual Studio 2017
os: Visual Studio 2019
version: "{branch}-{build}"

branches:
Expand Down
2 changes: 1 addition & 1 deletion include/scons
Submodule scons updated from 73b2c0 to 72ae09
6 changes: 3 additions & 3 deletions nvdaHelper/archBuild_sconscript
Expand Up @@ -73,9 +73,9 @@ def COMProxyDllBuilder(env,target,source,proxyClsid):
return proxyDll
env.AddMethod(COMProxyDllBuilder,'COMProxyDll')

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


TARGET_ARCH=env['TARGET_ARCH']
Expand Down
5 changes: 3 additions & 2 deletions nvdaHelper/localWin10/sconscript
Expand Up @@ -41,9 +41,10 @@ localWin10Lib = env.SharedLibrary(
# Therefore, we must include it.
# VS 2017 keeps changing the path to reflect the latest major.minor.build version which we canot easily find out.
# Therefore Search these versioned directories from newest to oldest to collect all the files we need.
msvc = env.get('MSVC_VERSION')
vcRedistDirs = glob.glob(os.path.join(
find_vc_pdir(env.get("MSVC_VERSION")),
r"Redist\MSVC\%s*\x86\Microsoft.VC141.CRT" % env.get("MSVC_VERSION")
find_vc_pdir(msvc),
rf"Redist\MSVC\{msvc}*\x86\Microsoft.VC{msvc.replace('.', '')}.CRT"
))
if len(vcRedistDirs)==0:
raise RuntimeError("Could not locate vc redistributables. Perhaps the Universal Windows Platform component in visual Studio is not installed")
Expand Down
20 changes: 10 additions & 10 deletions readme.md
Expand Up @@ -37,19 +37,19 @@ The following dependencies need to be installed on your system:

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


### Git Submodules
Expand Down Expand Up @@ -83,7 +83,7 @@ Additionally, the following build time dependencies are included in Git submodul
* [Py2Exe](http://github.com/albertosottile/py2exe/), version 0.9.3.2 commit b372a8e
* [Python Windows Extensions](http://sourceforge.net/projects/pywin32/ ), build 224, required by py2exe
* [txt2tags](http://txt2tags.sourceforge.net/), version 2.5
* [SCons](http://www.scons.org/), version 3.0.4
* [SCons](http://www.scons.org/), version 3.1.1
* [Nulsoft Install System](http://nsis.sourceforge.net/), version 2.51
* [NSIS UAC plug-in](http://nsis.sourceforge.net/UAC_plug-in), version 0.2.4, ansi
* xgettext and msgfmt from [GNU gettext](http://sourceforge.net/projects/cppcms/files/boost_locale/gettext_for_windows/)
Expand Down
1 change: 1 addition & 0 deletions sconstruct
Expand Up @@ -38,6 +38,7 @@ def recursiveCopy(env,targetDir,sourceDir):
import gettext
gettext.install("nvda")
sys.path.append("source")
import comtypesMonkeyPatches
import versionInfo
del sys.path[-1]

Expand Down
4 changes: 1 addition & 3 deletions source/comInterfaces_sconscript
Expand Up @@ -31,11 +31,9 @@ interfaceBuilder=env.Builder(
)
env['BUILDERS']['comtypesInterface']=interfaceBuilder

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

COM_INTERFACES = {
"IAccessible2Lib.py": "typelibs/ia2.tlb",
Expand Down
22 changes: 18 additions & 4 deletions source/comtypesMonkeyPatches.py
@@ -1,10 +1,12 @@
#A part of NonVisual Desktop Access (NVDA)
#Copyright (C) 2009-2016 NV Access Limited
#This file is covered by the GNU General Public License.
#See the file COPYING for more details.
# A part of NonVisual Desktop Access (NVDA)
# Copyright (C) 2009-2019 NV Access Limited, Babbage B.V.
# This file is covered by the GNU General Public License.
# See the file COPYING for more details.

import ctypes
import _ctypes
import importlib
import comtypes.client._generate

# A version of ctypes.WINFUNCTYPE
# that produces a WinFunctionType class whose instance will convert COMError into a CallCancelled exception when called as a function.
Expand Down Expand Up @@ -125,3 +127,15 @@ def _check_version(actual):
if actual != required:
raise ImportError("Wrong version")
comtypes._check_version = _check_version


# Monkeypatch comtypes to clear the importlib cache when importing a new module
old_my_import = comtypes.client._generate._my_import


def new_my_import(fullname):
importlib.invalidate_caches()
return old_my_import(fullname)


comtypes.client._generate._my_import = new_my_import

0 comments on commit 19010f2

Please sign in to comment.