summaryrefslogtreecommitdiffstats
path: root/Tools/msi/bundle/bootstrap
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@python.org>2020-07-28 15:35:46 (GMT)
committerGitHub <noreply@github.com>2020-07-28 15:35:46 (GMT)
commit37a06cbe5c17c2aa6ad938339fd42531a8a0bea0 (patch)
tree31cce5032c872a64a8904b7c48952fd0235ec548 /Tools/msi/bundle/bootstrap
parent5e3826785dcc64f8e1a8a7bde11b88fbb40943be (diff)
downloadcpython-37a06cbe5c17c2aa6ad938339fd42531a8a0bea0.zip
cpython-37a06cbe5c17c2aa6ad938339fd42531a8a0bea0.tar.gz
cpython-37a06cbe5c17c2aa6ad938339fd42531a8a0bea0.tar.bz2
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
Diffstat (limited to 'Tools/msi/bundle/bootstrap')
-rw-r--r--Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp56
1 files changed, 13 insertions, 43 deletions
diff --git a/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp b/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp
index fbdf7b6..3c54e40 100644
--- a/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp
+++ b/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp
@@ -3011,65 +3011,35 @@ private:
BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Target OS is Windows Server 2012 or later");
return;
} else if (IsWindowsVersionOrGreater(6, 1, 1)) {
- 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;
- }
+ BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Detected Windows Server 2008 R2");
} 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, 2)) {
- BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Target OS is Windows Server 2008 SP2 or later");
- return;
} else if (IsWindowsVersionOrGreater(6, 0, 0)) {
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows Server 2008");
- BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Service Pack 2 is required to continue installation");
- LocGetString(_wixLoc, L"#(loc.FailureWS2K8MissingSP2)", &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.FailureWS2K3OrEarlier)", &pLocString);
}
+ BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Windows Server 2012 or later is required to continue installation");
} else {
- if (IsWindows8OrGreater()) {
- BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Target OS is Windows 8 or later");
+ if (IsWindows10OrGreater()) {
+ BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Target OS is Windows 10 or later");
return;
- } 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 RTM");
- BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Service Pack 1 is required to continue installation");
- LocGetString(_wixLoc, L"#(loc.FailureWin7MissingSP1)", &pLocString);
- } else if (IsWindowsVistaSP2OrGreater()) {
- BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Target OS is Windows Vista SP2");
+ } else if (IsWindows8Point1OrGreater()) {
+ BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Target OS is Windows 8.1");
return;
+ } else if (IsWindows8OrGreater()) {
+ BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows 8");
+ } else if (IsWindows7OrGreater()) {
+ BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows 7");
} else if (IsWindowsVistaOrGreater()) {
- BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows Vista RTM or SP1");
- BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Service Pack 2 is required to continue installation");
- LocGetString(_wixLoc, L"#(loc.FailureVistaMissingSP2)", &pLocString);
+ BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows Vista");
} else {
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows XP or earlier");
- BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Windows Vista SP2 or later is required to continue installation");
- LocGetString(_wixLoc, L"#(loc.FailureXPOrEarlier)", &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);
}