We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
When BRLTTY for Windows is installed scons fails to bundle BrlAPI
Discovered while debugging #10228
### Steps to reproduce:
1. Install BRLTTY for Windows you do not need to have any actual braille display connected.
2. Execute scons launcher from the root of the NVDA repo.
3. Start newly created launcher.
### Actual behavior:
BrlAPI dll is missing. It is therefore not possible to switch to BRLTTY.
### Expected behavior:
BrlAPI should be working regardless of what is installed on the system.
### System configuration
#### NVDA installed/portable/running from source:
Source
#### NVDA version:
Any after migration to BrlAPI 07 and Python 3.
#### Windows version:
Windows 7 x64
#### Name and version of other software in use when reproducing the issue:
Python, BRLTTY for Windows
#### Other information about your system:

### Other questions
#### Does the issue still occur after restarting your PC?
Yes
#### Have you tried any other versions of NVDA? If so, please report their behaviors.
This is new after Python 3 migration.
#### Additional info:
WHen BRLTTY is installed it places brlapi-0.7.dll in the syswow64 directory. When this dll is removed either manually or by uninstall of BRLTTY BrlAPI is bundled correctly.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `source/setup.py`
Content:
```
1 # -*- coding: UTF-8 -*-
2 #setup.py
3 #A part of NonVisual Desktop Access (NVDA)
4 #Copyright (C) 2006-2018 NV Access Limited, Peter Vágner, Joseph Lee
5 #This file is covered by the GNU General Public License.
6 #See the file COPYING for more details.
7 
8 import os
9 import copy
10 import gettext
11 gettext.install("nvda")
12 from setuptools import setup
13 import py2exe as py2exeModule
14 from glob import glob
15 import fnmatch
16 from versionInfo import *
17 from py2exe import distutils_buildexe
18 from py2exe.dllfinder import DllFinder
19 import wx
20 import importlib.machinery
21 
22 RT_MANIFEST = 24
23 manifest_template = """\
24 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
25 <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
26 	<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
27 		<security>
28 			<requestedPrivileges>
29 				<requestedExecutionLevel
30 					level="asInvoker"
31 					uiAccess="%(uiAccess)s"
32 				/>
33 			</requestedPrivileges>
34 		</security>
35 	</trustInfo>
36 	<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
37 		<application>
38 			<!-- Windows 7 -->
39 			<supportedOS
40 				Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"
41 			/>
42 			<!-- Windows 8 -->
43 			<supportedOS
44 				Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"
45 			/>
46 			<!-- Windows 8.1 -->
47 			<supportedOS
48 				Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"
49 			/>
50 			<!-- Windows 10 -->
51 			<supportedOS
52 				Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"
53 			/>
54 		</application> 
55 	</compatibility>
56 </assembly>
57 """
58 
59 # py2exe's idea of whether a dll is a system dll appears to be wrong sometimes, so monkey patch it.
60 orig_determine_dll_type = DllFinder.determine_dll_type
61 def determine_dll_type(self, imagename):
62 	dll = os.path.basename(imagename).lower()
63 	if dll.startswith("api-ms-win-") or dll in ("powrprof.dll", "mpr.dll", "crypt32.dll"):
64 		# These are definitely system dlls available on all systems and must be excluded.
65 		# Including them can cause serious problems when a binary build is run on a different version of Windows.
66 		return None
67 	return orig_determine_dll_type(self, imagename)
68 DllFinder.determine_dll_type = determine_dll_type
69 
70 class py2exe(distutils_buildexe.py2exe):
71 	"""Overridden py2exe command to:
72 		* Add a command line option --enable-uiAccess to enable uiAccess for the main executable and EOA proxy
73 		* Add a manifest to the executables
74 	"""
75 
76 	user_options = distutils_buildexe.py2exe.user_options + [
77 		("enable-uiAccess", "u", "enable uiAccess for the main executable"),
78 	]
79 
80 	def initialize_options(self):
81 		super(py2exe, self).initialize_options()
82 		self.enable_uiAccess = False
83 
84 	def run(self):
85 		dist = self.distribution
86 		if self.enable_uiAccess:
87 			# Add a target for nvda_uiAccess, using nvda_noUIAccess as a base.
88 			target = copy.deepcopy(dist.windows[0])
89 			target["dest_base"] = "nvda_uiAccess"
90 			target['uiAccess'] = True
91 			dist.windows.insert(1, target)
92 			# nvda_eoaProxy should have uiAccess.
93 			target = dist.windows[3]
94 			target['uiAccess'] = True
95 		# Add a manifest resource to every target at runtime.
96 		for target in dist.windows:
97 			target["other_resources"] = [
98 				(
99 					RT_MANIFEST,
100 					1,
101 					(manifest_template % dict(uiAccess=target['uiAccess'])).encode("utf-8")
102 				),
103 			]
104 		super(py2exe, self).run()
105 
106 def getLocaleDataFiles():
107 	wxDir=wx.__path__[0]
108 	localeMoFiles=set()
109 	for f in glob("locale/*/LC_MESSAGES"):
110 		localeMoFiles.add((f, (os.path.join(f,"nvda.mo"),)))
111 		wxMoFile=os.path.join(wxDir,f,"wxstd.mo")
112 		if os.path.isfile(wxMoFile):
113 			localeMoFiles.add((f,(wxMoFile,))) 
114 		lang=os.path.split(os.path.split(f)[0])[1]
115 		if '_' in lang:
116 				lang=lang.split('_')[0]
117 				f=os.path.join('locale',lang,'lc_messages')
118 				wxMoFile=os.path.join(wxDir,f,"wxstd.mo")
119 				if os.path.isfile(wxMoFile):
120 					localeMoFiles.add((f,(wxMoFile,))) 
121 	localeDicFiles=[(os.path.dirname(f), (f,)) for f in glob("locale/*/*.dic")]
122 	NVDALocaleGestureMaps=[(os.path.dirname(f), (f,)) for f in glob("locale/*/gestures.ini")]
123 	return list(localeMoFiles)+localeDicFiles+NVDALocaleGestureMaps
124 
125 def getRecursiveDataFiles(dest,source,excludes=()):
126 	rulesList=[]
127 	rulesList.append((dest,
128 		[f for f in glob("%s/*"%source) if not any(fnmatch.fnmatch(f,exclude) for exclude in excludes) and os.path.isfile(f)]))
129 	[rulesList.extend(getRecursiveDataFiles(os.path.join(dest,dirName),os.path.join(source,dirName),excludes=excludes)) for dirName in os.listdir(source) if os.path.isdir(os.path.join(source,dirName)) and not dirName.startswith('.')]
130 	return rulesList
131 
132 setup(
133 	name = name,
134 	version=version,
135 	description=description,
136 	url=url,
137 	classifiers=[
138 'Development Status :: 3 - Alpha',
139 'Environment :: Win32 (MS Windows)',
140 'Topic :: Adaptive Technologies'
141 'Intended Audience :: Developers',
142 'Intended Audience :: End Users/Desktop',
143 'License :: OSI Approved :: GNU General Public License (GPL)',
144 'Natural Language :: English',
145 'Programming Language :: Python',
146 'Operating System :: Microsoft :: Windows',
147 ],
148 	cmdclass={"py2exe": py2exe},
149 	windows=[
150 		{
151 			"script":"nvda.pyw",
152 			"dest_base":"nvda_noUIAccess",
153 			"uiAccess": False,
154 			"icon_resources":[(1,"images/nvda.ico")],
155 			"other_resources": [], # Populated at run time
156 			"version":formatBuildVersionString(),
157 			"description":"NVDA application",
158 			"product_name":name,
159 			"product_version":version,
160 			"copyright":copyright,
161 			"company_name":publisher,
162 		},
163 		# The nvda_uiAccess target will be added at runtime if required.
164 		{
165 			"script": "nvda_slave.pyw",
166 			"uiAccess": False,
167 			"icon_resources": [(1,"images/nvda.ico")],
168 			"other_resources": [], # Populated at run time
169 			"version":formatBuildVersionString(),
170 			"description": name,
171 			"product_name":name,
172 			"product_version": version,
173 			"copyright": copyright,
174 			"company_name": publisher,
175 		},
176 		{
177 			"script": "nvda_eoaProxy.pyw",
178 			# uiAccess will be enabled at runtime if appropriate.
179 			"uiAccess": False,
180 			"icon_resources": [(1,"images/nvda.ico")],
181 			"other_resources": [], # Populated at run time
182 			"version":formatBuildVersionString(),
183 			"description": "NVDA Ease of Access proxy",
184 			"product_name":name,
185 			"product_version": version,
186 			"copyright": copyright,
187 			"company_name": publisher,
188 		},
189 	],
190 	options = {"py2exe": {
191 		"bundle_files": 3,
192 		"excludes": ["tkinter",
193 			"serial.loopback_connection", 
194 			"serial.rfc2217", 
195 			"serial.serialcli", 
196 			"serial.serialjava", 
197 			"serial.serialposix", 
198 			"serial.socket_connection",
199 			# netbios (from pywin32) is optionally used by Python3's uuid module.
200 			# This is not needed.
201 			# We also need to exclude win32wnet explicitly.
202 			"netbios",
203 			"win32wnet",
204 			# winxptheme is optionally used by wx.lib.agw.aui.
205 			# We don't need this.
206 			"winxptheme",
207 		],
208 		"packages": [
209 			"NVDAObjects",
210 			"virtualBuffers",
211 			"appModules",
212 			"comInterfaces",
213 			"brailleDisplayDrivers",
214 			"synthDrivers",
215 			"visionEnhancementProviders",
216 		],
217 		"includes": [
218 			"nvdaBuiltin",
219 			# #3368: bisect was implicitly included with Python 2.7.3, but isn't with 2.7.5.
220 			"bisect",
221 		],
222 	}},
223 	data_files=[
224 		(".",glob("*.dll")+glob("*.manifest")+["builtin.dic"]),
225 		("documentation", ['../copying.txt', '../contributors.txt']),
226 		("lib/%s"%version, glob("lib/*.dll")),
227 		("lib64/%s"%version, glob("lib64/*.dll") + glob("lib64/*.exe")),
228 		("libArm64/%s"%version, glob("libArm64/*.dll") + glob("libArm64/*.exe")),
229 		("waves", glob("waves/*.wav")),
230 		("images", glob("images/*.ico")),
231 		("louis/tables",glob("louis/tables/*")),
232 		("COMRegistrationFixes", glob("COMRegistrationFixes/*.reg")),
233 		(".", ['message.html' ])
234 	] + (
235 		getLocaleDataFiles()
236 		+ getRecursiveDataFiles("synthDrivers", "synthDrivers",
237 			excludes=tuple(
238 				"*%s" % ext
239 				for ext in importlib.machinery.SOURCE_SUFFIXES + importlib.machinery.BYTECODE_SUFFIXES
240 			) + (
241 				"*.exp",
242 				"*.lib",
243 				"*.pdb",
244 				"__pycache__"
245 		))
246 		+ getRecursiveDataFiles("brailleDisplayDrivers", "brailleDisplayDrivers",
247 			excludes=tuple(
248 				"*%s" % ext
249 				for ext in importlib.machinery.SOURCE_SUFFIXES + importlib.machinery.BYTECODE_SUFFIXES
250 			) + (
251 				"__pycache__",
252 		))
253 		+ getRecursiveDataFiles('documentation', '../user_docs', excludes=('*.t2t', '*.t2tconf', '*/developerGuide.*'))
254 	),
255 )
256
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/source/setup.py b/source/setup.py
--- a/source/setup.py
+++ b/source/setup.py
@@ -230,6 +230,7 @@
 		("images", glob("images/*.ico")),
 		("louis/tables",glob("louis/tables/*")),
 		("COMRegistrationFixes", glob("COMRegistrationFixes/*.reg")),
+		(".", glob("../miscDeps/python/*.dll")),
 		(".", ['message.html' ])
 	] + (
 		getLocaleDataFiles()

{"golden_diff": "diff --git a/source/setup.py b/source/setup.py\n--- a/source/setup.py\n+++ b/source/setup.py\n@@ -230,6 +230,7 @@\n \t\t(\"images\", glob(\"images/*.ico\")),\r\n \t\t(\"louis/tables\",glob(\"louis/tables/*\")),\r\n \t\t(\"COMRegistrationFixes\", glob(\"COMRegistrationFixes/*.reg\")),\r\n+\t\t(\".\", glob(\"../miscDeps/python/*.dll\")),\r\n \t\t(\".\", ['message.html' ])\r\n \t] + (\r\n \t\tgetLocaleDataFiles()\n", "issue": "When BRLTTY for Windows is installed scons fails to bundle BrlAPI\nDiscovered while debugging #10228\r\n### Steps to reproduce:\r\n1. Install BRLTTY for Windows you do not need to have any actual braille display connected.\r\n2. Execute scons launcher from the root of the NVDA repo.\r\n3. Start newly created launcher.\r\n### Actual behavior:\r\nBrlAPI dll is missing. It is therefore not possible to switch to BRLTTY.\r\n### Expected behavior:\r\nBrlAPI should be working regardless of what is installed on the system.\r\n### System configuration\r\n#### NVDA installed/portable/running from source:\r\nSource\r\n#### NVDA version:\r\nAny after migration to BrlAPI 07 and Python 3.\r\n#### Windows version:\r\nWindows 7 x64\r\n#### Name and version of other software in use when reproducing the issue:\r\nPython, BRLTTY for Windows\r\n#### Other information about your system:\r\n\r\n### Other questions\r\n#### Does the issue still occur after restarting your PC?\r\nYes\r\n#### Have you tried any other versions of NVDA? If so, please report their behaviors.\r\nThis is new after Python 3 migration.\r\n#### Additional info:\r\nWHen BRLTTY is installed it places brlapi-0.7.dll in the syswow64 directory. When this dll is removed either manually or by uninstall of BRLTTY BrlAPI is bundled correctly.\n", "before_files": [{"content": "# -*- coding: UTF-8 -*-\r\n#setup.py\r\n#A part of NonVisual Desktop Access (NVDA)\r\n#Copyright (C) 2006-2018 NV Access Limited, Peter V\u00e1gner, Joseph Lee\r\n#This file is covered by the GNU General Public License.\r\n#See the file COPYING for more details.\r\n\r\nimport os\r\nimport copy\r\nimport gettext\r\ngettext.install(\"nvda\")\r\nfrom setuptools import setup\r\nimport py2exe as py2exeModule\r\nfrom glob import glob\r\nimport fnmatch\r\nfrom versionInfo import *\r\nfrom py2exe import distutils_buildexe\r\nfrom py2exe.dllfinder import DllFinder\r\nimport wx\r\nimport importlib.machinery\r\n\r\nRT_MANIFEST = 24\r\nmanifest_template = \"\"\"\\\r\n<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">\r\n\t<trustInfo xmlns=\"urn:schemas-microsoft-com:asm.v3\">\r\n\t\t<security>\r\n\t\t\t<requestedPrivileges>\r\n\t\t\t\t<requestedExecutionLevel\r\n\t\t\t\t\tlevel=\"asInvoker\"\r\n\t\t\t\t\tuiAccess=\"%(uiAccess)s\"\r\n\t\t\t\t/>\r\n\t\t\t</requestedPrivileges>\r\n\t\t</security>\r\n\t</trustInfo>\r\n\t<compatibility xmlns=\"urn:schemas-microsoft-com:compatibility.v1\">\r\n\t\t<application>\r\n\t\t\t<!-- Windows 7 -->\r\n\t\t\t<supportedOS\r\n\t\t\t\tId=\"{35138b9a-5d96-4fbd-8e2d-a2440225f93a}\"\r\n\t\t\t/>\r\n\t\t\t<!-- Windows 8 -->\r\n\t\t\t<supportedOS\r\n\t\t\t\tId=\"{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}\"\r\n\t\t\t/>\r\n\t\t\t<!-- Windows 8.1 -->\r\n\t\t\t<supportedOS\r\n\t\t\t\tId=\"{1f676c76-80e1-4239-95bb-83d0f6d0da78}\"\r\n\t\t\t/>\r\n\t\t\t<!-- Windows 10 -->\r\n\t\t\t<supportedOS\r\n\t\t\t\tId=\"{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}\"\r\n\t\t\t/>\r\n\t\t</application> \r\n\t</compatibility>\r\n</assembly>\r\n\"\"\"\r\n\r\n# py2exe's idea of whether a dll is a system dll appears to be wrong sometimes, so monkey patch it.\r\norig_determine_dll_type = DllFinder.determine_dll_type\r\ndef determine_dll_type(self, imagename):\r\n\tdll = os.path.basename(imagename).lower()\r\n\tif dll.startswith(\"api-ms-win-\") or dll in (\"powrprof.dll\", \"mpr.dll\", \"crypt32.dll\"):\r\n\t\t# These are definitely system dlls available on all systems and must be excluded.\r\n\t\t# Including them can cause serious problems when a binary build is run on a different version of Windows.\r\n\t\treturn None\r\n\treturn orig_determine_dll_type(self, imagename)\r\nDllFinder.determine_dll_type = determine_dll_type\r\n\r\nclass py2exe(distutils_buildexe.py2exe):\r\n\t\"\"\"Overridden py2exe command to:\r\n\t\t* Add a command line option --enable-uiAccess to enable uiAccess for the main executable and EOA proxy\r\n\t\t* Add a manifest to the executables\r\n\t\"\"\"\r\n\r\n\tuser_options = distutils_buildexe.py2exe.user_options + [\r\n\t\t(\"enable-uiAccess\", \"u\", \"enable uiAccess for the main executable\"),\r\n\t]\r\n\r\n\tdef initialize_options(self):\r\n\t\tsuper(py2exe, self).initialize_options()\r\n\t\tself.enable_uiAccess = False\r\n\r\n\tdef run(self):\r\n\t\tdist = self.distribution\r\n\t\tif self.enable_uiAccess:\r\n\t\t\t# Add a target for nvda_uiAccess, using nvda_noUIAccess as a base.\r\n\t\t\ttarget = copy.deepcopy(dist.windows[0])\r\n\t\t\ttarget[\"dest_base\"] = \"nvda_uiAccess\"\r\n\t\t\ttarget['uiAccess'] = True\r\n\t\t\tdist.windows.insert(1, target)\r\n\t\t\t# nvda_eoaProxy should have uiAccess.\r\n\t\t\ttarget = dist.windows[3]\r\n\t\t\ttarget['uiAccess'] = True\r\n\t\t# Add a manifest resource to every target at runtime.\r\n\t\tfor target in dist.windows:\r\n\t\t\ttarget[\"other_resources\"] = [\r\n\t\t\t\t(\r\n\t\t\t\t\tRT_MANIFEST,\r\n\t\t\t\t\t1,\r\n\t\t\t\t\t(manifest_template % dict(uiAccess=target['uiAccess'])).encode(\"utf-8\")\r\n\t\t\t\t),\r\n\t\t\t]\r\n\t\tsuper(py2exe, self).run()\r\n\r\ndef getLocaleDataFiles():\r\n\twxDir=wx.__path__[0]\r\n\tlocaleMoFiles=set()\r\n\tfor f in glob(\"locale/*/LC_MESSAGES\"):\r\n\t\tlocaleMoFiles.add((f, (os.path.join(f,\"nvda.mo\"),)))\r\n\t\twxMoFile=os.path.join(wxDir,f,\"wxstd.mo\")\r\n\t\tif os.path.isfile(wxMoFile):\r\n\t\t\tlocaleMoFiles.add((f,(wxMoFile,))) \r\n\t\tlang=os.path.split(os.path.split(f)[0])[1]\r\n\t\tif '_' in lang:\r\n\t\t\t\tlang=lang.split('_')[0]\r\n\t\t\t\tf=os.path.join('locale',lang,'lc_messages')\r\n\t\t\t\twxMoFile=os.path.join(wxDir,f,\"wxstd.mo\")\r\n\t\t\t\tif os.path.isfile(wxMoFile):\r\n\t\t\t\t\tlocaleMoFiles.add((f,(wxMoFile,))) \r\n\tlocaleDicFiles=[(os.path.dirname(f), (f,)) for f in glob(\"locale/*/*.dic\")]\r\n\tNVDALocaleGestureMaps=[(os.path.dirname(f), (f,)) for f in glob(\"locale/*/gestures.ini\")]\r\n\treturn list(localeMoFiles)+localeDicFiles+NVDALocaleGestureMaps\r\n\r\ndef getRecursiveDataFiles(dest,source,excludes=()):\r\n\trulesList=[]\r\n\trulesList.append((dest,\r\n\t\t[f for f in glob(\"%s/*\"%source) if not any(fnmatch.fnmatch(f,exclude) for exclude in excludes) and os.path.isfile(f)]))\r\n\t[rulesList.extend(getRecursiveDataFiles(os.path.join(dest,dirName),os.path.join(source,dirName),excludes=excludes)) for dirName in os.listdir(source) if os.path.isdir(os.path.join(source,dirName)) and not dirName.startswith('.')]\r\n\treturn rulesList\r\n\r\nsetup(\r\n\tname = name,\r\n\tversion=version,\r\n\tdescription=description,\r\n\turl=url,\r\n\tclassifiers=[\r\n'Development Status :: 3 - Alpha',\r\n'Environment :: Win32 (MS Windows)',\r\n'Topic :: Adaptive Technologies'\r\n'Intended Audience :: Developers',\r\n'Intended Audience :: End Users/Desktop',\r\n'License :: OSI Approved :: GNU General Public License (GPL)',\r\n'Natural Language :: English',\r\n'Programming Language :: Python',\r\n'Operating System :: Microsoft :: Windows',\r\n],\r\n\tcmdclass={\"py2exe\": py2exe},\r\n\twindows=[\r\n\t\t{\r\n\t\t\t\"script\":\"nvda.pyw\",\r\n\t\t\t\"dest_base\":\"nvda_noUIAccess\",\r\n\t\t\t\"uiAccess\": False,\r\n\t\t\t\"icon_resources\":[(1,\"images/nvda.ico\")],\r\n\t\t\t\"other_resources\": [], # Populated at run time\r\n\t\t\t\"version\":formatBuildVersionString(),\r\n\t\t\t\"description\":\"NVDA application\",\r\n\t\t\t\"product_name\":name,\r\n\t\t\t\"product_version\":version,\r\n\t\t\t\"copyright\":copyright,\r\n\t\t\t\"company_name\":publisher,\r\n\t\t},\r\n\t\t# The nvda_uiAccess target will be added at runtime if required.\r\n\t\t{\r\n\t\t\t\"script\": \"nvda_slave.pyw\",\r\n\t\t\t\"uiAccess\": False,\r\n\t\t\t\"icon_resources\": [(1,\"images/nvda.ico\")],\r\n\t\t\t\"other_resources\": [], # Populated at run time\r\n\t\t\t\"version\":formatBuildVersionString(),\r\n\t\t\t\"description\": name,\r\n\t\t\t\"product_name\":name,\r\n\t\t\t\"product_version\": version,\r\n\t\t\t\"copyright\": copyright,\r\n\t\t\t\"company_name\": publisher,\r\n\t\t},\r\n\t\t{\r\n\t\t\t\"script\": \"nvda_eoaProxy.pyw\",\r\n\t\t\t# uiAccess will be enabled at runtime if appropriate.\r\n\t\t\t\"uiAccess\": False,\r\n\t\t\t\"icon_resources\": [(1,\"images/nvda.ico\")],\r\n\t\t\t\"other_resources\": [], # Populated at run time\r\n\t\t\t\"version\":formatBuildVersionString(),\r\n\t\t\t\"description\": \"NVDA Ease of Access proxy\",\r\n\t\t\t\"product_name\":name,\r\n\t\t\t\"product_version\": version,\r\n\t\t\t\"copyright\": copyright,\r\n\t\t\t\"company_name\": publisher,\r\n\t\t},\r\n\t],\r\n\toptions = {\"py2exe\": {\r\n\t\t\"bundle_files\": 3,\r\n\t\t\"excludes\": [\"tkinter\",\r\n\t\t\t\"serial.loopback_connection\", \r\n\t\t\t\"serial.rfc2217\", \r\n\t\t\t\"serial.serialcli\", \r\n\t\t\t\"serial.serialjava\", \r\n\t\t\t\"serial.serialposix\", \r\n\t\t\t\"serial.socket_connection\",\r\n\t\t\t# netbios (from pywin32) is optionally used by Python3's uuid module.\r\n\t\t\t# This is not needed.\r\n\t\t\t# We also need to exclude win32wnet explicitly.\r\n\t\t\t\"netbios\",\r\n\t\t\t\"win32wnet\",\r\n\t\t\t# winxptheme is optionally used by wx.lib.agw.aui.\r\n\t\t\t# We don't need this.\r\n\t\t\t\"winxptheme\",\r\n\t\t],\r\n\t\t\"packages\": [\r\n\t\t\t\"NVDAObjects\",\r\n\t\t\t\"virtualBuffers\",\r\n\t\t\t\"appModules\",\r\n\t\t\t\"comInterfaces\",\r\n\t\t\t\"brailleDisplayDrivers\",\r\n\t\t\t\"synthDrivers\",\r\n\t\t\t\"visionEnhancementProviders\",\r\n\t\t],\r\n\t\t\"includes\": [\r\n\t\t\t\"nvdaBuiltin\",\r\n\t\t\t# #3368: bisect was implicitly included with Python 2.7.3, but isn't with 2.7.5.\r\n\t\t\t\"bisect\",\r\n\t\t],\r\n\t}},\r\n\tdata_files=[\r\n\t\t(\".\",glob(\"*.dll\")+glob(\"*.manifest\")+[\"builtin.dic\"]),\r\n\t\t(\"documentation\", ['../copying.txt', '../contributors.txt']),\r\n\t\t(\"lib/%s\"%version, glob(\"lib/*.dll\")),\r\n\t\t(\"lib64/%s\"%version, glob(\"lib64/*.dll\") + glob(\"lib64/*.exe\")),\r\n\t\t(\"libArm64/%s\"%version, glob(\"libArm64/*.dll\") + glob(\"libArm64/*.exe\")),\r\n\t\t(\"waves\", glob(\"waves/*.wav\")),\r\n\t\t(\"images\", glob(\"images/*.ico\")),\r\n\t\t(\"louis/tables\",glob(\"louis/tables/*\")),\r\n\t\t(\"COMRegistrationFixes\", glob(\"COMRegistrationFixes/*.reg\")),\r\n\t\t(\".\", ['message.html' ])\r\n\t] + (\r\n\t\tgetLocaleDataFiles()\r\n\t\t+ getRecursiveDataFiles(\"synthDrivers\", \"synthDrivers\",\r\n\t\t\texcludes=tuple(\r\n\t\t\t\t\"*%s\" % ext\r\n\t\t\t\tfor ext in importlib.machinery.SOURCE_SUFFIXES + importlib.machinery.BYTECODE_SUFFIXES\r\n\t\t\t) + (\r\n\t\t\t\t\"*.exp\",\r\n\t\t\t\t\"*.lib\",\r\n\t\t\t\t\"*.pdb\",\r\n\t\t\t\t\"__pycache__\"\r\n\t\t))\r\n\t\t+ getRecursiveDataFiles(\"brailleDisplayDrivers\", \"brailleDisplayDrivers\",\r\n\t\t\texcludes=tuple(\r\n\t\t\t\t\"*%s\" % ext\r\n\t\t\t\tfor ext in importlib.machinery.SOURCE_SUFFIXES + importlib.machinery.BYTECODE_SUFFIXES\r\n\t\t\t) + (\r\n\t\t\t\t\"__pycache__\",\r\n\t\t))\r\n\t\t+ getRecursiveDataFiles('documentation', '../user_docs', excludes=('*.t2t', '*.t2tconf', '*/developerGuide.*'))\r\n\t),\r\n)\r\n", "path": "source/setup.py"}], "after_files": [{"content": "# -*- coding: UTF-8 -*-\r\n#setup.py\r\n#A part of NonVisual Desktop Access (NVDA)\r\n#Copyright (C) 2006-2018 NV Access Limited, Peter V\u00e1gner, Joseph Lee\r\n#This file is covered by the GNU General Public License.\r\n#See the file COPYING for more details.\r\n\r\nimport os\r\nimport copy\r\nimport gettext\r\ngettext.install(\"nvda\")\r\nfrom setuptools import setup\r\nimport py2exe as py2exeModule\r\nfrom glob import glob\r\nimport fnmatch\r\nfrom versionInfo import *\r\nfrom py2exe import distutils_buildexe\r\nfrom py2exe.dllfinder import DllFinder\r\nimport wx\r\nimport importlib.machinery\r\n\r\nRT_MANIFEST = 24\r\nmanifest_template = \"\"\"\\\r\n<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">\r\n\t<trustInfo xmlns=\"urn:schemas-microsoft-com:asm.v3\">\r\n\t\t<security>\r\n\t\t\t<requestedPrivileges>\r\n\t\t\t\t<requestedExecutionLevel\r\n\t\t\t\t\tlevel=\"asInvoker\"\r\n\t\t\t\t\tuiAccess=\"%(uiAccess)s\"\r\n\t\t\t\t/>\r\n\t\t\t</requestedPrivileges>\r\n\t\t</security>\r\n\t</trustInfo>\r\n\t<compatibility xmlns=\"urn:schemas-microsoft-com:compatibility.v1\">\r\n\t\t<application>\r\n\t\t\t<!-- Windows 7 -->\r\n\t\t\t<supportedOS\r\n\t\t\t\tId=\"{35138b9a-5d96-4fbd-8e2d-a2440225f93a}\"\r\n\t\t\t/>\r\n\t\t\t<!-- Windows 8 -->\r\n\t\t\t<supportedOS\r\n\t\t\t\tId=\"{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}\"\r\n\t\t\t/>\r\n\t\t\t<!-- Windows 8.1 -->\r\n\t\t\t<supportedOS\r\n\t\t\t\tId=\"{1f676c76-80e1-4239-95bb-83d0f6d0da78}\"\r\n\t\t\t/>\r\n\t\t\t<!-- Windows 10 -->\r\n\t\t\t<supportedOS\r\n\t\t\t\tId=\"{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}\"\r\n\t\t\t/>\r\n\t\t</application> \r\n\t</compatibility>\r\n</assembly>\r\n\"\"\"\r\n\r\n# py2exe's idea of whether a dll is a system dll appears to be wrong sometimes, so monkey patch it.\r\norig_determine_dll_type = DllFinder.determine_dll_type\r\ndef determine_dll_type(self, imagename):\r\n\tdll = os.path.basename(imagename).lower()\r\n\tif dll.startswith(\"api-ms-win-\") or dll in (\"powrprof.dll\", \"mpr.dll\", \"crypt32.dll\"):\r\n\t\t# These are definitely system dlls available on all systems and must be excluded.\r\n\t\t# Including them can cause serious problems when a binary build is run on a different version of Windows.\r\n\t\treturn None\r\n\treturn orig_determine_dll_type(self, imagename)\r\nDllFinder.determine_dll_type = determine_dll_type\r\n\r\nclass py2exe(distutils_buildexe.py2exe):\r\n\t\"\"\"Overridden py2exe command to:\r\n\t\t* Add a command line option --enable-uiAccess to enable uiAccess for the main executable and EOA proxy\r\n\t\t* Add a manifest to the executables\r\n\t\"\"\"\r\n\r\n\tuser_options = distutils_buildexe.py2exe.user_options + [\r\n\t\t(\"enable-uiAccess\", \"u\", \"enable uiAccess for the main executable\"),\r\n\t]\r\n\r\n\tdef initialize_options(self):\r\n\t\tsuper(py2exe, self).initialize_options()\r\n\t\tself.enable_uiAccess = False\r\n\r\n\tdef run(self):\r\n\t\tdist = self.distribution\r\n\t\tif self.enable_uiAccess:\r\n\t\t\t# Add a target for nvda_uiAccess, using nvda_noUIAccess as a base.\r\n\t\t\ttarget = copy.deepcopy(dist.windows[0])\r\n\t\t\ttarget[\"dest_base\"] = \"nvda_uiAccess\"\r\n\t\t\ttarget['uiAccess'] = True\r\n\t\t\tdist.windows.insert(1, target)\r\n\t\t\t# nvda_eoaProxy should have uiAccess.\r\n\t\t\ttarget = dist.windows[3]\r\n\t\t\ttarget['uiAccess'] = True\r\n\t\t# Add a manifest resource to every target at runtime.\r\n\t\tfor target in dist.windows:\r\n\t\t\ttarget[\"other_resources\"] = [\r\n\t\t\t\t(\r\n\t\t\t\t\tRT_MANIFEST,\r\n\t\t\t\t\t1,\r\n\t\t\t\t\t(manifest_template % dict(uiAccess=target['uiAccess'])).encode(\"utf-8\")\r\n\t\t\t\t),\r\n\t\t\t]\r\n\t\tsuper(py2exe, self).run()\r\n\r\ndef getLocaleDataFiles():\r\n\twxDir=wx.__path__[0]\r\n\tlocaleMoFiles=set()\r\n\tfor f in glob(\"locale/*/LC_MESSAGES\"):\r\n\t\tlocaleMoFiles.add((f, (os.path.join(f,\"nvda.mo\"),)))\r\n\t\twxMoFile=os.path.join(wxDir,f,\"wxstd.mo\")\r\n\t\tif os.path.isfile(wxMoFile):\r\n\t\t\tlocaleMoFiles.add((f,(wxMoFile,))) \r\n\t\tlang=os.path.split(os.path.split(f)[0])[1]\r\n\t\tif '_' in lang:\r\n\t\t\t\tlang=lang.split('_')[0]\r\n\t\t\t\tf=os.path.join('locale',lang,'lc_messages')\r\n\t\t\t\twxMoFile=os.path.join(wxDir,f,\"wxstd.mo\")\r\n\t\t\t\tif os.path.isfile(wxMoFile):\r\n\t\t\t\t\tlocaleMoFiles.add((f,(wxMoFile,))) \r\n\tlocaleDicFiles=[(os.path.dirname(f), (f,)) for f in glob(\"locale/*/*.dic\")]\r\n\tNVDALocaleGestureMaps=[(os.path.dirname(f), (f,)) for f in glob(\"locale/*/gestures.ini\")]\r\n\treturn list(localeMoFiles)+localeDicFiles+NVDALocaleGestureMaps\r\n\r\ndef getRecursiveDataFiles(dest,source,excludes=()):\r\n\trulesList=[]\r\n\trulesList.append((dest,\r\n\t\t[f for f in glob(\"%s/*\"%source) if not any(fnmatch.fnmatch(f,exclude) for exclude in excludes) and os.path.isfile(f)]))\r\n\t[rulesList.extend(getRecursiveDataFiles(os.path.join(dest,dirName),os.path.join(source,dirName),excludes=excludes)) for dirName in os.listdir(source) if os.path.isdir(os.path.join(source,dirName)) and not dirName.startswith('.')]\r\n\treturn rulesList\r\n\r\nsetup(\r\n\tname = name,\r\n\tversion=version,\r\n\tdescription=description,\r\n\turl=url,\r\n\tclassifiers=[\r\n'Development Status :: 3 - Alpha',\r\n'Environment :: Win32 (MS Windows)',\r\n'Topic :: Adaptive Technologies'\r\n'Intended Audience :: Developers',\r\n'Intended Audience :: End Users/Desktop',\r\n'License :: OSI Approved :: GNU General Public License (GPL)',\r\n'Natural Language :: English',\r\n'Programming Language :: Python',\r\n'Operating System :: Microsoft :: Windows',\r\n],\r\n\tcmdclass={\"py2exe\": py2exe},\r\n\twindows=[\r\n\t\t{\r\n\t\t\t\"script\":\"nvda.pyw\",\r\n\t\t\t\"dest_base\":\"nvda_noUIAccess\",\r\n\t\t\t\"uiAccess\": False,\r\n\t\t\t\"icon_resources\":[(1,\"images/nvda.ico\")],\r\n\t\t\t\"other_resources\": [], # Populated at run time\r\n\t\t\t\"version\":formatBuildVersionString(),\r\n\t\t\t\"description\":\"NVDA application\",\r\n\t\t\t\"product_name\":name,\r\n\t\t\t\"product_version\":version,\r\n\t\t\t\"copyright\":copyright,\r\n\t\t\t\"company_name\":publisher,\r\n\t\t},\r\n\t\t# The nvda_uiAccess target will be added at runtime if required.\r\n\t\t{\r\n\t\t\t\"script\": \"nvda_slave.pyw\",\r\n\t\t\t\"uiAccess\": False,\r\n\t\t\t\"icon_resources\": [(1,\"images/nvda.ico\")],\r\n\t\t\t\"other_resources\": [], # Populated at run time\r\n\t\t\t\"version\":formatBuildVersionString(),\r\n\t\t\t\"description\": name,\r\n\t\t\t\"product_name\":name,\r\n\t\t\t\"product_version\": version,\r\n\t\t\t\"copyright\": copyright,\r\n\t\t\t\"company_name\": publisher,\r\n\t\t},\r\n\t\t{\r\n\t\t\t\"script\": \"nvda_eoaProxy.pyw\",\r\n\t\t\t# uiAccess will be enabled at runtime if appropriate.\r\n\t\t\t\"uiAccess\": False,\r\n\t\t\t\"icon_resources\": [(1,\"images/nvda.ico\")],\r\n\t\t\t\"other_resources\": [], # Populated at run time\r\n\t\t\t\"version\":formatBuildVersionString(),\r\n\t\t\t\"description\": \"NVDA Ease of Access proxy\",\r\n\t\t\t\"product_name\":name,\r\n\t\t\t\"product_version\": version,\r\n\t\t\t\"copyright\": copyright,\r\n\t\t\t\"company_name\": publisher,\r\n\t\t},\r\n\t],\r\n\toptions = {\"py2exe\": {\r\n\t\t\"bundle_files\": 3,\r\n\t\t\"excludes\": [\"tkinter\",\r\n\t\t\t\"serial.loopback_connection\", \r\n\t\t\t\"serial.rfc2217\", \r\n\t\t\t\"serial.serialcli\", \r\n\t\t\t\"serial.serialjava\", \r\n\t\t\t\"serial.serialposix\", \r\n\t\t\t\"serial.socket_connection\",\r\n\t\t\t# netbios (from pywin32) is optionally used by Python3's uuid module.\r\n\t\t\t# This is not needed.\r\n\t\t\t# We also need to exclude win32wnet explicitly.\r\n\t\t\t\"netbios\",\r\n\t\t\t\"win32wnet\",\r\n\t\t\t# winxptheme is optionally used by wx.lib.agw.aui.\r\n\t\t\t# We don't need this.\r\n\t\t\t\"winxptheme\",\r\n\t\t],\r\n\t\t\"packages\": [\r\n\t\t\t\"NVDAObjects\",\r\n\t\t\t\"virtualBuffers\",\r\n\t\t\t\"appModules\",\r\n\t\t\t\"comInterfaces\",\r\n\t\t\t\"brailleDisplayDrivers\",\r\n\t\t\t\"synthDrivers\",\r\n\t\t\t\"visionEnhancementProviders\",\r\n\t\t],\r\n\t\t\"includes\": [\r\n\t\t\t\"nvdaBuiltin\",\r\n\t\t\t# #3368: bisect was implicitly included with Python 2.7.3, but isn't with 2.7.5.\r\n\t\t\t\"bisect\",\r\n\t\t],\r\n\t}},\r\n\tdata_files=[\r\n\t\t(\".\",glob(\"*.dll\")+glob(\"*.manifest\")+[\"builtin.dic\"]),\r\n\t\t(\"documentation\", ['../copying.txt', '../contributors.txt']),\r\n\t\t(\"lib/%s\"%version, glob(\"lib/*.dll\")),\r\n\t\t(\"lib64/%s\"%version, glob(\"lib64/*.dll\") + glob(\"lib64/*.exe\")),\r\n\t\t(\"libArm64/%s\"%version, glob(\"libArm64/*.dll\") + glob(\"libArm64/*.exe\")),\r\n\t\t(\"waves\", glob(\"waves/*.wav\")),\r\n\t\t(\"images\", glob(\"images/*.ico\")),\r\n\t\t(\"louis/tables\",glob(\"louis/tables/*\")),\r\n\t\t(\"COMRegistrationFixes\", glob(\"COMRegistrationFixes/*.reg\")),\r\n\t\t(\".\", glob(\"../miscDeps/python/*.dll\")),\r\n\t\t(\".\", ['message.html' ])\r\n\t] + (\r\n\t\tgetLocaleDataFiles()\r\n\t\t+ getRecursiveDataFiles(\"synthDrivers\", \"synthDrivers\",\r\n\t\t\texcludes=tuple(\r\n\t\t\t\t\"*%s\" % ext\r\n\t\t\t\tfor ext in importlib.machinery.SOURCE_SUFFIXES + importlib.machinery.BYTECODE_SUFFIXES\r\n\t\t\t) + (\r\n\t\t\t\t\"*.exp\",\r\n\t\t\t\t\"*.lib\",\r\n\t\t\t\t\"*.pdb\",\r\n\t\t\t\t\"__pycache__\"\r\n\t\t))\r\n\t\t+ getRecursiveDataFiles(\"brailleDisplayDrivers\", \"brailleDisplayDrivers\",\r\n\t\t\texcludes=tuple(\r\n\t\t\t\t\"*%s\" % ext\r\n\t\t\t\tfor ext in importlib.machinery.SOURCE_SUFFIXES + importlib.machinery.BYTECODE_SUFFIXES\r\n\t\t\t) + (\r\n\t\t\t\t\"__pycache__\",\r\n\t\t))\r\n\t\t+ getRecursiveDataFiles('documentation', '../user_docs', excludes=('*.t2t', '*.t2tconf', '*/developerGuide.*'))\r\n\t),\r\n)\r\n", "path": "source/setup.py"}]}