-
Notifications
You must be signed in to change notification settings - Fork 84
/
Copy pathadd-dll-2.patch
72 lines (68 loc) · 3.57 KB
/
add-dll-2.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
diff --git a/PC/layout/main.py b/PC/layout/main.py
index 0350ed7..f7c71b0 100644
--- a/PC/layout/main.py
+++ b/PC/layout/main.py
@@ -41,7 +41,7 @@ TCLTK_FILES_ONLY = FileNameSet("turtle.py")
VENV_DIRS_ONLY = FileNameSet("venv", "ensurepip")
-EXCLUDE_FROM_DLLS = FileStemSet("python*", "pyshellext", "vcruntime*")
+EXCLUDE_FROM_DLLS = FileStemSet("python*", "pyshellext", "vcruntime*", "api-ms-*")
EXCLUDE_FROM_LIB = FileNameSet("*.pyc", "__pycache__", "*.pickle")
EXCLUDE_FROM_PACKAGED_LIB = FileNameSet("readme.txt")
EXCLUDE_FROM_COMPILE = FileNameSet("badsyntax_*", "bad_*")
@@ -200,6 +200,12 @@ def get_layout(ns):
if not found_any:
log_error("Failed to locate vcruntime DLL in the build.")
+ for dest, src in rglob(ns.build, "api-ms-win-core-path-l1-1-0.dll"):
+ yield dest, src
+ break
+ else:
+ log_error("Failed to locate api-ms-win-core-path-l1-1-0.dll in the build.")
+
yield "LICENSE.txt", ns.build / "LICENSE.txt"
dest = "" if ns.flat_dlls else "DLLs/"
diff --git a/PC/layout/support/python.props b/PC/layout/support/python.props
index c48ecb2..bf65713 100644
--- a/PC/layout/support/python.props
+++ b/PC/layout/support/python.props
@@ -29,6 +29,7 @@
<ItemGroup>
<_PythonRuntimeExe Include="$(PythonHome)\python*.dll" />
<_PythonRuntimeExe Include="$(PythonHome)\vcruntime140.dll" />
+ <_PythonRuntimeExe Include="$(PythonHome)\api-ms-win-core-path-l1-1-0.dll" />
<_PythonRuntimeExe Include="$(PythonHome)\python*.exe" Condition="$(IncludePythonExe) == 'true'" />
<_PythonRuntimeExe>
<Link>%(Filename)%(Extension)</Link>
diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj
index 7021290..9e6e4a4 100644
--- a/PCbuild/pythoncore.vcxproj
+++ b/PCbuild/pythoncore.vcxproj
@@ -732,6 +732,15 @@
<Warning Text="A copy of vcruntime140.dll is also required" Condition="!$(VCToolsRedistVersion.StartsWith(`14.`))" />
<Copy SourceFiles="%(VCRuntimeDLL.FullPath)" DestinationFolder="$(OutDir)" />
</Target>
+ <Target Name="_CopyWin7Patch_x86" AfterTargets="Build" DependsOnTargets="_CopyVCRuntime" Condition="$(Platform) == 'Win32'">
+ <Copy SourceFiles="$(PATCHDIR)\x86\api-ms-win-core-path-l1-1-0.dll" DestinationFolder="$(OutDir)" />
+ </Target>
+ <Target Name="_CopyWin7Patch_x64" AfterTargets="Build" DependsOnTargets="_CopyVCRuntime" Condition="$(Platform) == 'x64'">
+ <Copy SourceFiles="$(PATCHDIR)\x64\api-ms-win-core-path-l1-1-0.dll" DestinationFolder="$(OutDir)" />
+ </Target>
+ <Target Name="_CleanWin7Patch" AfterTargets="Clean">
+ <Delete Files="$(OutDir)api-ms-win-core-path-l1-1-0.dll" />
+ </Target>
<Target Name="_CleanVCRuntime" AfterTargets="Clean">
<Delete Files="@(VCRuntimeDLL->'$(OutDir)%(Filename)%(Extension)')" />
</Target>
diff --git a/Tools/msi/exe/exe_files.wxs b/Tools/msi/exe/exe_files.wxs
index 15bf6a0..8b920e5 100644
--- a/Tools/msi/exe/exe_files.wxs
+++ b/Tools/msi/exe/exe_files.wxs
@@ -32,6 +32,9 @@
<Component Id="vcruntime140.dll" Directory="InstallDirectory" Guid="*">
<File Name="vcruntime140.dll" Source="vcruntime140.dll" KeyPath="yes" />
</Component>
+ <Component Id="Win7Patch" Directory="InstallDirectory" Guid="*">
+ <File Name="api-ms-win-core-path-l1-1-0.dll" Source="api-ms-win-core-path-l1-1-0.dll" KeyPath="yes" />
+ </Component>
<?ifdef Include_Vcruntime140_1_dll ?>
<Component Id="vcruntime140_1.dll" Directory="InstallDirectory" Guid="*">
<File Name="vcruntime140_1.dll" Source="vcruntime140_1.dll" KeyPath="yes" />