From 5f57286cdb17371098d3c0034a9bfa5ca17b9497 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Fri, 7 Mar 2025 11:09:32 +0100 Subject: [PATCH] Fix Windows detection to use correct system version it was build for (eg. Win10 or Win7) --- .../Platform/Windows/WindowsPlatform.cpp | 26 ++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/Source/Engine/Platform/Windows/WindowsPlatform.cpp b/Source/Engine/Platform/Windows/WindowsPlatform.cpp index 20e17e800..1ac886afe 100644 --- a/Source/Engine/Platform/Windows/WindowsPlatform.cpp +++ b/Source/Engine/Platform/Windows/WindowsPlatform.cpp @@ -637,12 +637,32 @@ bool WindowsPlatform::Init() } } - // Check if can run Engine on current platform (requires Windows Vista SP1 or above) - if (!IsWindowsVistaSP1OrGreater() && !IsWindowsServer()) + // Check if can run Engine on current platform +#if WINVER >= 0x0A00 + if (!IsWindows10OrGreater() && !IsWindowsServer()) { - Platform::Fatal(TEXT("Flax Engine requires Windows Vista SP1 or higher.")); + Platform::Fatal(TEXT("Flax Engine requires Windows 10 or higher.")); return true; } +#elif WINVER >= 0x0603 + if (!IsWindows8Point1OrGreater() && !IsWindowsServer()) + { + Platform::Fatal(TEXT("Flax Engine requires Windows 8.1 or higher.")); + return true; + } +#elif WINVER >= 0x0602 + if (!IsWindows8OrGreater() && !IsWindowsServer()) + { + Platform::Fatal(TEXT("Flax Engine requires Windows 8 or higher.")); + return true; + } +#else + if (!IsWindows7OrGreater() && !IsWindowsServer()) + { + Platform::Fatal(TEXT("Flax Engine requires Windows 7 or higher.")); + return true; + } +#endif // Set the lowest possible timer resolution const HMODULE ntdll = LoadLibraryW(L"ntdll.dll");