Skip to content

Commit 37a06cb

Browse files
authored
bpo-41412 and bpo-40948: Windows installer updates (GH-21656)
Prevent installation on Windows 8 and earlier. Download UCRT on demand when required (non-updated Windows 8.1 only) Add reference to py launcher to post-install message
1 parent 5e38267 commit 37a06cb

File tree

6 files changed

+25
-69
lines changed

6 files changed

+25
-69
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
The installer will now fail to install on Windows 7 and Windows 8. Further,
2+
the UCRT dependency is now always downloaded on demand.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Improve post-install message to direct people to the "py" command.

Tools/msi/bundle/Default.thm

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
<Text X="185" Y="11" Width="-11" Height="36" FontId="1" DisablePrefix="yes">#(loc.SuccessHeader)</Text>
117117
<Image X="0" Y="0" Width="178" Height="382" ImageFile="SideBar.png"/>
118118

119-
<Hypertext Name="SuccessText" X="205" Y="71" Width="-71" Height="150" FontId="3" DisablePrefix="yes"></Hypertext>
119+
<Hypertext Name="SuccessText" X="205" Y="71" Width="-71" Height="180" FontId="3" DisablePrefix="yes"></Hypertext>
120120

121121
<Button Name="SuccessMaxPathButton" X="185" Y="-70" Width="-11" Height="81" TabStop="yes" FontId="3" HexStyle="0xE" HideWhenDisabled="yes">#(loc.SuccessMaxPathButton)</Button>
122122

Tools/msi/bundle/Default.wxl

+6-23
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Select Customize to review current options.</String>
8989
<String Id="ShortInstallLauncherAllUsersLabel">Install &amp;launcher for all users (recommended)</String>
9090
<String Id="PrecompileLabel">&amp;Precompile standard library</String>
9191
<String Id="Include_symbolsLabel">Download debugging &amp;symbols</String>
92-
<String Id="Include_debugLabel">Download debu&amp;g binaries (requires VS 2015 or later)</String>
92+
<String Id="Include_debugLabel">Download debu&amp;g binaries (requires VS 2017 or later)</String>
9393

9494
<String Id="ProgressHeader">[ActionLikeInstallation] Progress</String>
9595
<String Id="ProgressLabel">[ActionLikeInstalling]:</String>
@@ -105,11 +105,11 @@ Select Customize to review current options.</String>
105105
<String Id="SuccessLaunchButton">&amp;Launch</String>
106106
<String Id="SuccessRestartText">You may need to restart your computer to finish updating files.</String>
107107
<String Id="SuccessRestartButton">&amp;Restart</String>
108-
<String Id="SuccessInstallMessage">Special thanks to Mark Hammond, without whose years of freely shared Windows expertise, Python for Windows would still be Python for DOS.
108+
<String Id="SuccessInstallMessage">New to Python? Start with the &lt;a href="https://docs.python.org/[ShortVersion]/tutorial/index.html"&gt;online tutorial&lt;/a&gt; and &lt;a href="https://docs.python.org/[ShortVersion]/index.html"&gt;documentation&lt;/a&gt;. At your terminal, type "py" to launch Python, or search for Python in your Start menu.
109109

110-
New to Python? Start with the &lt;a href="https://docs.python.org/[ShortVersion]/tutorial/index.html"&gt;online tutorial&lt;/a&gt; and &lt;a href="https://docs.python.org/[ShortVersion]/index.html"&gt;documentation&lt;/a&gt;.
110+
See &lt;a href="https://docs.python.org/[ShortVersion]/whatsnew/[ShortVersion].html"&gt;what's new&lt;/a&gt; in this release, or find more info about &lt;a href="https://docs.python.org/[ShortVersion]/using/windows.html"&gt;using Python on Windows&lt;/a&gt;.
111111

112-
See &lt;a href="https://docs.python.org/[ShortVersion]/whatsnew/[ShortVersion].html"&gt;what's new&lt;/a&gt; in this release.</String>
112+
Special thanks to Mark Hammond, without whose years of freely shared Windows expertise, Python for Windows would still be Python for DOS.</String>
113113
<String Id="SuccessModifyMessage">Thank you for using [WixBundleName].</String>
114114
<String Id="SuccessRepairMessage">Thank you for using [WixBundleName].
115115

@@ -123,26 +123,9 @@ Feel free to email &lt;a href="mailto:python-list@python.org"&gt;python-list@pyt
123123
<String Id="FailureRestartButton">&amp;Restart</String>
124124
<String Id="FailureExistingInstall">Unable to install [WixBundleName] due to an existing install. Use Programs and Features to modify, repair or remove [WixBundleName].</String>
125125

126-
<String Id="FailureWin7MissingSP1">Windows 7 Service Pack 1 and all applicable updates are required to install [WixBundleName].
127-
128-
Please &lt;a href="https://www.bing.com/search?q=how%20to%20install%20windows%207%20service%20pack%201"&gt;update your machine&lt;/a&gt; and then restart the installation.</String>
129-
<String Id="FailureVistaMissingSP2">Windows Vista Service Pack 2 and all applicable updates are required to install [WixBundleName].
130-
131-
Please &lt;a href="https://www.bing.com/search?q=how%20to%20install%20windows%20vista%20service%20pack%202"&gt;update your machine&lt;/a&gt; and then restart the installation.</String>
132-
<String Id="FailureXPOrEarlier">Windows Vista or later is required to install and use [WixBundleName].
133-
134-
Visit &lt;a href="https://www.python.org/"&gt;python.org&lt;/a&gt; to download Python 3.4.</String>
135-
136-
<String Id="FailureWS2K8R2MissingSP1">Windows Server 2008 R2 Service Pack 1 and all applicable updates are required to install [WixBundleName].
137-
138-
Please &lt;a href="https://www.bing.com/search?q=how%20to%20install%20windows%20server%202008%20r2%20service%20pack%201"&gt;update your machine&lt;/a&gt; and then restart the installation.</String>
139-
<String Id="FailureWS2K8MissingSP2">Windows Server 2008 Service Pack 2 and all applicable updates are required to install [WixBundleName].
140-
141-
Please &lt;a href="https://www.bing.com/search?q=how%20to%20install%20windows%20server%202008%20service%20pack%202"&gt;update your machine&lt;/a&gt; and then restart the installation.</String>
142-
<String Id="FailureWS2K3OrEarlier">Windows Server 2008 SP2 or later is required to install and use [WixBundleName].
143-
144-
Visit &lt;a href="https://www.python.org/"&gt;python.org&lt;/a&gt; to download Python 3.4.</String>
126+
<String Id="FailureOldOS">At least Windows 8.1 or Windows Server 2012 are required to install [WixBundleName]
145127

128+
Visit &lt;a href="https://www.python.org/"&gt;python.org&lt;/a&gt; to download an earlier version of Python.</String>
146129
<String Id="SuccessMaxPathButton">Disable path length limit</String>
147130
<String Id="SuccessMaxPathButtonNote">Changes your machine configuration to allow programs, including Python, to bypass the 260 character "MAX_PATH" limitation.</String>
148131
</WixLocalization>

Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp

+13-43
Original file line numberDiff line numberDiff line change
@@ -3011,65 +3011,35 @@ class PythonBootstrapperApplication : public CBalBaseBootstrapperApplication {
30113011
BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Target OS is Windows Server 2012 or later");
30123012
return;
30133013
} else if (IsWindowsVersionOrGreater(6, 1, 1)) {
3014-
HMODULE hKernel32 = GetModuleHandleW(L"kernel32");
3015-
if (hKernel32 && !GetProcAddress(hKernel32, "AddDllDirectory")) {
3016-
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows Server 2008 R2 without KB2533623");
3017-
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "KB2533623 update is required to continue.");
3018-
/* The "MissingSP1" error also specifies updates are required */
3019-
LocGetString(_wixLoc, L"#(loc.FailureWS2K8R2MissingSP1)", &pLocString);
3020-
} else {
3021-
BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Target OS is Windows Server 2008 R2 or later");
3022-
return;
3023-
}
3014+
BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Detected Windows Server 2008 R2");
30243015
} else if (IsWindowsVersionOrGreater(6, 1, 0)) {
30253016
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows Server 2008 R2");
3026-
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Service Pack 1 is required to continue installation");
3027-
LocGetString(_wixLoc, L"#(loc.FailureWS2K8R2MissingSP1)", &pLocString);
3028-
} else if (IsWindowsVersionOrGreater(6, 0, 2)) {
3029-
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Target OS is Windows Server 2008 SP2 or later");
3030-
return;
30313017
} else if (IsWindowsVersionOrGreater(6, 0, 0)) {
30323018
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows Server 2008");
3033-
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Service Pack 2 is required to continue installation");
3034-
LocGetString(_wixLoc, L"#(loc.FailureWS2K8MissingSP2)", &pLocString);
30353019
} else {
30363020
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows Server 2003 or earlier");
3037-
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Windows Server 2008 SP2 or later is required to continue installation");
3038-
LocGetString(_wixLoc, L"#(loc.FailureWS2K3OrEarlier)", &pLocString);
30393021
}
3022+
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Windows Server 2012 or later is required to continue installation");
30403023
} else {
3041-
if (IsWindows8OrGreater()) {
3042-
BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Target OS is Windows 8 or later");
3024+
if (IsWindows10OrGreater()) {
3025+
BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Target OS is Windows 10 or later");
30433026
return;
3044-
} else if (IsWindows7SP1OrGreater()) {
3045-
HMODULE hKernel32 = GetModuleHandleW(L"kernel32");
3046-
if (hKernel32 && !GetProcAddress(hKernel32, "AddDllDirectory")) {
3047-
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows 7 SP1 without KB2533623");
3048-
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "KB2533623 update is required to continue.");
3049-
/* The "MissingSP1" error also specifies updates are required */
3050-
LocGetString(_wixLoc, L"#(loc.FailureWin7MissingSP1)", &pLocString);
3051-
} else {
3052-
BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Target OS is Windows 7 SP1 or later");
3053-
return;
3054-
}
3055-
} else if (IsWindows7OrGreater()) {
3056-
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows 7 RTM");
3057-
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Service Pack 1 is required to continue installation");
3058-
LocGetString(_wixLoc, L"#(loc.FailureWin7MissingSP1)", &pLocString);
3059-
} else if (IsWindowsVistaSP2OrGreater()) {
3060-
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Target OS is Windows Vista SP2");
3027+
} else if (IsWindows8Point1OrGreater()) {
3028+
BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Target OS is Windows 8.1");
30613029
return;
3030+
} else if (IsWindows8OrGreater()) {
3031+
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows 8");
3032+
} else if (IsWindows7OrGreater()) {
3033+
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows 7");
30623034
} else if (IsWindowsVistaOrGreater()) {
3063-
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows Vista RTM or SP1");
3064-
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Service Pack 2 is required to continue installation");
3065-
LocGetString(_wixLoc, L"#(loc.FailureVistaMissingSP2)", &pLocString);
3035+
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows Vista");
30663036
} else {
30673037
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows XP or earlier");
3068-
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Windows Vista SP2 or later is required to continue installation");
3069-
LocGetString(_wixLoc, L"#(loc.FailureXPOrEarlier)", &pLocString);
30703038
}
3039+
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Windows 8.1 or later is required to continue installation");
30713040
}
30723041

3042+
LocGetString(_wixLoc, L"#(loc.FailureOldOS)", &pLocString);
30733043
if (pLocString && pLocString->wzText) {
30743044
BalFormatString(pLocString->wzText, &_failedMessage);
30753045
}

Tools/msi/bundle/packagegroups/crt.wxs

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
<PackageGroup Id="crt">
55
<MsiPackage Id="ucrt_AllUsers"
66
SourceFile="ucrt.msi"
7-
Compressed="$(var.CompressMSI)"
7+
Compressed="no"
88
DownloadUrl="$(var.DownloadUrl)"
99
ForcePerMachine="yes"
1010
InstallCondition="InstallAllUsers and not CRTInstalled and (Include_core or Include_exe or Include_pip) and not LauncherOnly">
1111
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
1212
</MsiPackage>
1313
<MsiPackage Id="ucrt_JustForMe"
1414
SourceFile="ucrt.msi"
15-
Compressed="$(var.CompressMSI)"
15+
Compressed="no"
1616
DownloadUrl="$(var.DownloadUrl)"
1717
ForcePerMachine="no"
1818
InstallCondition="not InstallAllUsers and not CRTInstalled and (Include_core or Include_exe or Include_pip) and not LauncherOnly">

0 commit comments

Comments
 (0)