summaryrefslogtreecommitdiffstats
path: root/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@python.org>2020-01-30 06:07:17 (GMT)
committerGitHub <noreply@github.com>2020-01-30 06:07:17 (GMT)
commit561c59777c8426fde0ef48b57cf02eddaeb2a5b8 (patch)
treecff29a7de5b484e4c142999e8b8d199b29bfd973 /Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp
parent194c7aeb6f3d6c2b0015457d22b38253652f4f38 (diff)
downloadcpython-561c59777c8426fde0ef48b57cf02eddaeb2a5b8.zip
cpython-561c59777c8426fde0ef48b57cf02eddaeb2a5b8.tar.gz
cpython-561c59777c8426fde0ef48b57cf02eddaeb2a5b8.tar.bz2
[3.7] bpo-39401: Avoid unsafe DLL load on Windows 7 and earlier (GH-18231) (GH-18232)
https://bugs.python.org/issue39401 Automerge-Triggered-By: @zooba
Diffstat (limited to 'Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp')
-rw-r--r--Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp b/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp
index cd4a1f8..af6cf0c 100644
--- a/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp
+++ b/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp
@@ -3028,8 +3028,16 @@ private:
}
} else {
if (IsWindows7SP1OrGreater()) {
- BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Target OS is Windows 7 SP1 or later");
- return;
+ 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");