Skip to content

Commit

Permalink
pythongh-124487: Require at least Windows 10 SDK and for install
Browse files Browse the repository at this point in the history
  • Loading branch information
zooba committed Sep 27, 2024
1 parent 365dffb commit 02fdba6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Increases Windows required OS and API level to Windows 10.
4 changes: 2 additions & 2 deletions PC/pyconfig.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ WIN32 is still required for the locale module.

/* set the version macros for the windows headers */
/* Python 3.9+ requires Windows 8 or greater */
#define Py_WINVER 0x0602 /* _WIN32_WINNT_WIN8 */
#define Py_NTDDI NTDDI_WIN8
#define Py_WINVER 0x0A00 /* _WIN32_WINNT_WIN10 */
#define Py_NTDDI NTDDI_WIN10

/* We only set these values when building Python - we don't want to force
these values on extensions, as that will affect the prototypes and
Expand Down
11 changes: 6 additions & 5 deletions Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3086,11 +3086,13 @@ class PythonBootstrapperApplication : public CBalBaseBootstrapperApplication {
LOC_STRING *pLocString = nullptr;

if (IsWindowsServer()) {
if (IsWindowsVersionOrGreater(6, 2, 0)) {
BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Target OS is Windows Server 2012 or later");
if (IsWindowsVersionOrGreater(10, 0, 0)) {
BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Target OS is Windows Server 2016 or later");
return;
if (IsWindowsVersionOrGreater(6, 2, 0)) {
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows Server 2012");
} else if (IsWindowsVersionOrGreater(6, 1, 1)) {
BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Detected Windows Server 2008 R2");
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows Server 2008 R2");
} else if (IsWindowsVersionOrGreater(6, 1, 0)) {
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows Server 2008 R2");
} else if (IsWindowsVersionOrGreater(6, 0, 0)) {
Expand All @@ -3104,8 +3106,7 @@ class PythonBootstrapperApplication : public CBalBaseBootstrapperApplication {
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");
return;
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows 8.1");
} else if (IsWindows8OrGreater()) {
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows 8");
} else if (IsWindows7OrGreater()) {
Expand Down

0 comments on commit 02fdba6

Please sign in to comment.