-
Notifications
You must be signed in to change notification settings - Fork 84
/
Copy pathenable-win7-install-9.patch
227 lines (220 loc) · 13.9 KB
/
enable-win7-install-9.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
diff --git a/Tools/msi/buildrelease.bat b/Tools/msi/buildrelease.bat
index 77fb477..82c7c01 100644
--- a/Tools/msi/buildrelease.bat
+++ b/Tools/msi/buildrelease.bat
@@ -177,6 +177,18 @@ if not "%SKIPBUILD%" EQU "1" (
@if errorlevel 1 exit /B %ERRORLEVEL%
@rem build.bat turns echo back on, so we disable it again
@echo off
+
+ @echo call "%PCBUILD%build.bat" -e -p %BUILD_PLAT% -t Build %PGOOPTS% %CERTOPTS% --disable-gil
+ @call "%PCBUILD%build.bat" -e -p %BUILD_PLAT% -t Build %PGOOPTS% %CERTOPTS% --disable-gil
+ @if errorlevel 1 exit /B %ERRORLEVEL%
+ @rem build.bat turns echo back on, so we disable it again
+ @echo off
+
+ @echo call "%PCBUILD%build.bat" -d -e -p %BUILD_PLAT% -t Build --disable-gil
+ @call "%PCBUILD%build.bat" -d -e -p %BUILD_PLAT% -t Build --disable-gil
+ @if errorlevel 1 exit /B %ERRORLEVEL%
+ @rem build.bat turns echo back on, so we disable it again
+ @echo off
)
if "%OUTDIR_PLAT%" EQU "win32" (
@@ -187,9 +199,9 @@ if "%OUTDIR_PLAT%" EQU "win32" (
if errorlevel 1 exit /B %ERRORLEVEL%
)
-set BUILDOPTS=/p:Platform=%1 /p:BuildForRelease=true /p:DownloadUrl=%DOWNLOAD_URL% /p:DownloadUrlBase=%DOWNLOAD_URL_BASE% /p:ReleaseUri=%RELEASE_URI%
+set BUILDOPTS=/p:Platform=%1 /p:BuildForRelease=true /p:DownloadUrl=%DOWNLOAD_URL% /p:DownloadUrlBase=%DOWNLOAD_URL_BASE% /p:ReleaseUri=%RELEASE_URI% /p:IncludeFreethreaded=true
if defined BUILDMSI (
- %MSBUILD% "%D%bundle\releaselocal.wixproj" /t:Rebuild %BUILDOPTS% %CERTOPTS% /p:RebuildAll=true
+ %MSBUILD% "%D%bundle\full.wixproj" /t:Rebuild %BUILDOPTS% %CERTOPTS% /p:RebuildAll=true
if errorlevel 1 exit /B %ERRORLEVEL%
)
diff --git a/Tools/msi/bundle/Default.wxl b/Tools/msi/bundle/Default.wxl
index 0014204..468d27e 100644
--- a/Tools/msi/bundle/Default.wxl
+++ b/Tools/msi/bundle/Default.wxl
@@ -90,9 +90,9 @@ Select Customize to review current options.</String>
<String Id="ShortInstallLauncherAllUsersLabel">Use admin privi&leges when installing py.exe</String>
<String Id="ShortInstallLauncherBlockedLabel">Python Launcher is already installed</String>
<String Id="PrecompileLabel">&Precompile standard library</String>
- <String Id="Include_symbolsLabel">Download debugging &symbols</String>
- <String Id="Include_debugLabel">Download debu&g binaries (requires VS 2017 or later)</String>
- <String Id="Include_freethreadedLabel">Download &free-threaded binaries (experimental)</String>
+ <String Id="Include_symbolsLabel">Install debugging &symbols</String>
+ <String Id="Include_debugLabel">Install debu&g binaries (requires VS 2017 or later)</String>
+ <String Id="Include_freethreadedLabel">Install &free-threaded binaries (experimental)</String>
<String Id="ProgressHeader">[ActionLikeInstallation] Progress</String>
<String Id="ProgressLabel">[ActionLikeInstalling]:</String>
@@ -123,9 +123,17 @@ Feel free to post at <a href="https://discuss.python.org/c/users/7">discus
<String Id="FailureRestartText">You must restart your computer to complete the rollback of the software.</String>
<String Id="FailureRestartButton">&Restart</String>
<String Id="FailureExistingInstall">Unable to install [WixBundleName] due to an existing install. Use Programs and Features to modify, repair or remove [WixBundleName].</String>
- <String Id="FailureOldOS">At least Windows 8.1 or Windows Server 2012 are required to install [WixBundleName]
+ <String Id="FailureWin7MissingSP1">Windows 7 Service Pack 1 and all applicable updates are required to install [WixBundleName].
+
+Please <a href="https://www.bing.com/search?q=how%20to%20install%20windows%207%20service%20pack%201">update your machine</a> and then restart the installation.</String>
+ <String Id="FailureVistaOrEarlier">Windows 7 SP1 or later is required to install and use [WixBundleName].
+
+Visit <a href="https://www.python.org/">python.org</a> to download Python 3.8.</String>
+
+ <String Id="FailureWS2K8R2MissingSP1">Windows Server 2008 R2 Service Pack 1 and all applicable updates are required to install [WixBundleName].
+
+Please <a href="https://www.bing.com/search?q=how%20to%20install%20windows%20server%202008%20r2%20service%20pack%201">update your machine</a> and then restart the installation.</String>
-Visit <a href="https://www.python.org/downloads/">python.org</a> to download an earlier version of Python.</String>
<String Id="SuccessMaxPathButton">Disable path length limit</String>
<String Id="SuccessMaxPathButtonNote">Changes your machine configuration to allow programs, including Python, to bypass the 260 character "MAX_PATH" limitation.</String>
</WixLocalization>
diff --git a/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp b/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp
index 094ddba..3fe5c03 100644
--- a/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp
+++ b/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp
@@ -3090,35 +3090,55 @@ private:
BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Target OS is Windows Server 2012 or later");
return;
} else if (IsWindowsVersionOrGreater(6, 1, 1)) {
- BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Detected Windows Server 2008 R2");
+ HMODULE hKernel32 = GetModuleHandleW(L"kernel32");
+ if (hKernel32 && !GetProcAddress(hKernel32, "AddDllDirectory")) {
+ BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows Server 2008 R2 without KB2533623");
+ BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "KB2533623 update is required to continue.");
+ /* The "MissingSP1" error also specifies updates are required */
+ LocGetString(_wixLoc, L"#(loc.FailureWS2K8R2MissingSP1)", &pLocString);
+ } else {
+ BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Target OS is Windows Server 2008 R2 or later");
+ return;
+ }
} else if (IsWindowsVersionOrGreater(6, 1, 0)) {
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows Server 2008 R2");
+ BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Service Pack 1 is required to continue installation");
+ LocGetString(_wixLoc, L"#(loc.FailureWS2K8R2MissingSP1)", &pLocString);
} else if (IsWindowsVersionOrGreater(6, 0, 0)) {
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows Server 2008");
+ BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Windows Server 2008 SP2 or later is required to continue installation");
+ LocGetString(_wixLoc, L"#(loc.FailureWS2K8R2MissingSP1)", &pLocString);
} else {
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows Server 2003 or earlier");
+ BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Windows Server 2008 SP2 or later is required to continue installation");
+ LocGetString(_wixLoc, L"#(loc.FailureWS2K8R2MissingSP1)", &pLocString);
}
- BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Windows Server 2012 or later is required to continue installation");
} else {
- if (IsWindows10OrGreater()) {
- BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Target OS is Windows 10 or later");
- return;
- } else if (IsWindows8Point1OrGreater()) {
- BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Target OS is Windows 8.1");
+ if (IsWindows8OrGreater()) {
+ BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Target OS is Windows 8 or later");
return;
- } else if (IsWindows8OrGreater()) {
- BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows 8");
+ } else if (IsWindows7SP1OrGreater()) {
+ HMODULE hKernel32 = GetModuleHandleW(L"kernel32");
+ if (hKernel32 && !GetProcAddress(hKernel32, "AddDllDirectory")) {
+ BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows 7 SP1 without KB2533623");
+ BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "KB2533623 update is required to continue.");
+ /* The "MissingSP1" error also specifies updates are required */
+ LocGetString(_wixLoc, L"#(loc.FailureWin7MissingSP1)", &pLocString);
+ } else {
+ BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Target OS is Windows 7 SP1 or later");
+ return;
+ }
} else if (IsWindows7OrGreater()) {
- BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows 7");
- } else if (IsWindowsVistaOrGreater()) {
- BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows Vista");
+ BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows 7 RTM");
+ BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Service Pack 1 is required to continue installation");
+ LocGetString(_wixLoc, L"#(loc.FailureWin7MissingSP1)", &pLocString);
} else {
- BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows XP or earlier");
+ BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Vista or earlier");
+ BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Windows 7 SP1 or later is required to continue installation");
+ LocGetString(_wixLoc, L"#(loc.FailureVistaOrEarlier)", &pLocString);
}
- BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Windows 8.1 or later is required to continue installation");
}
- LocGetString(_wixLoc, L"#(loc.FailureOldOS)", &pLocString);
if (pLocString && pLocString->wzText) {
BalFormatString(pLocString->wzText, &_failedMessage);
}
diff --git a/Tools/msi/bundle/packagegroups/crt.wxs b/Tools/msi/bundle/packagegroups/crt.wxs
index f931da1..bcb81ea 100644
--- a/Tools/msi/bundle/packagegroups/crt.wxs
+++ b/Tools/msi/bundle/packagegroups/crt.wxs
@@ -4,7 +4,7 @@
<PackageGroup Id="crt">
<MsiPackage Id="ucrt_AllUsers"
SourceFile="ucrt.msi"
- Compressed="no"
+ Compressed="yes"
DownloadUrl="$(var.DownloadUrl)"
ForcePerMachine="yes"
InstallCondition="InstallAllUsers and not CRTInstalled and (Include_core or Include_exe or Include_pip) and not LauncherOnly">
@@ -12,7 +12,7 @@
</MsiPackage>
<MsiPackage Id="ucrt_JustForMe"
SourceFile="ucrt.msi"
- Compressed="no"
+ Compressed="yes"
DownloadUrl="$(var.DownloadUrl)"
ForcePerMachine="no"
InstallCondition="not InstallAllUsers and not CRTInstalled and (Include_core or Include_exe or Include_pip) and not LauncherOnly">
diff --git a/Tools/msi/bundle/packagegroups/freethreaded.wxs b/Tools/msi/bundle/packagegroups/freethreaded.wxs
index 121ca34..47121d0 100644
--- a/Tools/msi/bundle/packagegroups/freethreaded.wxs
+++ b/Tools/msi/bundle/packagegroups/freethreaded.wxs
@@ -4,7 +4,7 @@
<PackageGroup Id="freethreaded">
<MsiPackage Id="freethreaded_AllUsers"
SourceFile="freethreaded.msi"
- Compressed="no"
+ Compressed="$(var.CompressMSI)"
DownloadUrl="$(var.DownloadUrl)"
ForcePerMachine="yes"
InstallCondition="InstallAllUsers and (Include_freethreaded) and not LauncherOnly">
@@ -13,7 +13,7 @@
</MsiPackage>
<MsiPackage Id="freethreaded_AllUsers_pdb"
SourceFile="freethreaded_pdb.msi"
- Compressed="no"
+ Compressed="$(var.CompressPDB)"
DownloadUrl="$(var.DownloadUrl)"
ForcePerMachine="yes"
InstallCondition="InstallAllUsers and (Include_freethreaded) and Include_symbols and not LauncherOnly">
@@ -22,7 +22,7 @@
</MsiPackage>
<MsiPackage Id="freethreaded_AllUsers_d"
SourceFile="freethreaded_d.msi"
- Compressed="no"
+ Compressed="$(var.CompressMSI_D)"
DownloadUrl="$(var.DownloadUrl)"
ForcePerMachine="yes"
InstallCondition="InstallAllUsers and (Include_freethreaded) and Include_debug and not LauncherOnly">
@@ -32,7 +32,7 @@
<MsiPackage Id="freethreaded_JustForMe"
SourceFile="freethreaded.msi"
- Compressed="no"
+ Compressed="$(var.CompressMSI)"
DownloadUrl="$(var.DownloadUrl)"
ForcePerMachine="no"
InstallCondition="not InstallAllUsers and (Include_freethreaded) and not LauncherOnly">
@@ -41,7 +41,7 @@
</MsiPackage>
<MsiPackage Id="freethreaded_JustForMe_pdb"
SourceFile="freethreaded_pdb.msi"
- Compressed="no"
+ Compressed="$(var.CompressPDB)"
DownloadUrl="$(var.DownloadUrl)"
ForcePerMachine="no"
InstallCondition="not InstallAllUsers and (Include_freethreaded) and Include_symbols and not LauncherOnly">
@@ -50,7 +50,7 @@
</MsiPackage>
<MsiPackage Id="freethreaded_JustForMe_d"
SourceFile="freethreaded_d.msi"
- Compressed="no"
+ Compressed="$(var.CompressMSI_D)"
DownloadUrl="$(var.DownloadUrl)"
ForcePerMachine="no"
InstallCondition="not InstallAllUsers and (Include_freethreaded) and Include_debug and not LauncherOnly">