From 02fdba6ff0fc2a35afcfe3fff7ee5592b4cfb4f3 Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Fri, 27 Sep 2024 15:08:18 +0100 Subject: [PATCH 1/4] gh-124487: Require at least Windows 10 SDK and for install --- .../2024-09-27-15-07-30.gh-issue-124487.7LrwHC.rst | 1 + PC/pyconfig.h.in | 4 ++-- .../bootstrap/PythonBootstrapperApplication.cpp | 11 ++++++----- 3 files changed, 9 insertions(+), 7 deletions(-) create mode 100644 Misc/NEWS.d/next/Windows/2024-09-27-15-07-30.gh-issue-124487.7LrwHC.rst diff --git a/Misc/NEWS.d/next/Windows/2024-09-27-15-07-30.gh-issue-124487.7LrwHC.rst b/Misc/NEWS.d/next/Windows/2024-09-27-15-07-30.gh-issue-124487.7LrwHC.rst new file mode 100644 index 00000000000000..93fb68d28c702e --- /dev/null +++ b/Misc/NEWS.d/next/Windows/2024-09-27-15-07-30.gh-issue-124487.7LrwHC.rst @@ -0,0 +1 @@ +Increases Windows required OS and API level to Windows 10. diff --git a/PC/pyconfig.h.in b/PC/pyconfig.h.in index 503f3193e2803e..c40c5324cd85db 100644 --- a/PC/pyconfig.h.in +++ b/PC/pyconfig.h.in @@ -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 diff --git a/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp b/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp index 094ddba4f1ad8f..c6b1262542dd1f 100644 --- a/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp +++ b/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp @@ -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)) { @@ -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()) { From dff541b40fa4261a448a56a23da4c6899d39fbdc Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Fri, 27 Sep 2024 15:13:39 +0100 Subject: [PATCH 2/4] Correct syntax --- Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp b/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp index c6b1262542dd1f..6f50200dc7b251 100644 --- a/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp +++ b/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp @@ -3089,7 +3089,7 @@ class PythonBootstrapperApplication : public CBalBaseBootstrapperApplication { if (IsWindowsVersionOrGreater(10, 0, 0)) { BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Target OS is Windows Server 2016 or later"); return; - if (IsWindowsVersionOrGreater(6, 2, 0)) { + } else if (IsWindowsVersionOrGreater(6, 2, 0)) { BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows Server 2012"); } else if (IsWindowsVersionOrGreater(6, 1, 1)) { BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows Server 2008 R2"); From 2a28de26cfef0c7de006e93eabc65b01d089486d Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Mon, 30 Sep 2024 16:46:55 +0100 Subject: [PATCH 3/4] Update PC/pyconfig.h.in Co-authored-by: Wulian <1055917385@qq.com> --- PC/pyconfig.h.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PC/pyconfig.h.in b/PC/pyconfig.h.in index c40c5324cd85db..010f5fe5646630 100644 --- a/PC/pyconfig.h.in +++ b/PC/pyconfig.h.in @@ -169,7 +169,7 @@ WIN32 is still required for the locale module. #endif /* MS_WIN64 */ /* set the version macros for the windows headers */ -/* Python 3.9+ requires Windows 8 or greater */ +/* Python 3.13+ requires Windows 10 or greater */ #define Py_WINVER 0x0A00 /* _WIN32_WINNT_WIN10 */ #define Py_NTDDI NTDDI_WIN10 From adc98500abc633ace40c306e16ee9477c65f2a64 Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Mon, 30 Sep 2024 16:47:46 +0100 Subject: [PATCH 4/4] Update installer string --- Tools/msi/bundle/Default.wxl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tools/msi/bundle/Default.wxl b/Tools/msi/bundle/Default.wxl index 0014204e89d1bb..49f681d3e11d2e 100644 --- a/Tools/msi/bundle/Default.wxl +++ b/Tools/msi/bundle/Default.wxl @@ -123,7 +123,7 @@ Feel free to post at <a href="https://discuss.python.org/c/users/7">discus You must restart your computer to complete the rollback of the software. &Restart Unable to install [WixBundleName] due to an existing install. Use Programs and Features to modify, repair or remove [WixBundleName]. - At least Windows 8.1 or Windows Server 2012 are required to install [WixBundleName] + At least Windows 10 or Windows Server 2016 are required to install [WixBundleName] Visit <a href="https://www.python.org/downloads/">python.org</a> to download an earlier version of Python. Disable path length limit