From f903ae4985c435905110de7a794087cb533a957b Mon Sep 17 00:00:00 2001 From: bitraid Date: Sat, 12 Aug 2023 14:08:01 +1200 Subject: nsis: minimum OS version check for Qt6 The Qt docs for 6.5 say that the minimum supported version is Windows 10 1809. Experimentally it seems qutebrowser and it's dependencies work fine on a version as early 1607. There should be no change in OS version requirements for the Qt5 build, although we've dropped 32 bit support already and in a future version of the installer we may bring the minimum OS version support in line with the Qt6 requirements for simplicity too. Added a new QT5 version into the NSIS scripts so we can do the different version check per installer build. It just uses the python bool serialization format so should always be "True" or "False", but I've added a fallback anyway for consistency. --- misc/nsis/install.nsh | 25 +++++++++++++++++++++++-- misc/nsis/qutebrowser.nsi | 3 +++ scripts/dev/build_release.py | 1 + 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/misc/nsis/install.nsh b/misc/nsis/install.nsh index e7d8b4956..df830cb63 100755 --- a/misc/nsis/install.nsh +++ b/misc/nsis/install.nsh @@ -430,8 +430,29 @@ SectionEnd ; Callbacks Function .onInit StrCpy $KeepReg 1 - !insertmacro CheckPlatform ${PLATFORM} - !insertmacro CheckMinWinVer ${MIN_WIN_VER} + +; OS version check + ${If} ${QT5} == "True" + !insertmacro CheckPlatform ${PLATFORM} + !insertmacro CheckMinWinVer ${MIN_WIN_VER} + Goto _os_check_pass + ${ElseIf} ${RunningX64} + GetWinVer $R0 Major + IntCmpU $R0 10 0 _os_check_fail _os_check_pass + GetWinVer $R1 Build + ${If} $R1 >= 22000 ; Windows 11 21H2 + Goto _os_check_pass + ${ElseIf} $R1 >= 17763 ; Windows 10 1809 + ${AndIf} ${IsNativeAMD64} ; Windows 10 has no x86_64 emulation on arm64 + Goto _os_check_pass + ${EndIf} + ${EndIf} + _os_check_fail: + MessageBox MB_OK|MB_ICONSTOP "This version of ${PRODUCT_NAME} requires a 64-bit$\r$\n\ + version of Windows 10 1809 or later." + Abort + _os_check_pass: + ${ifnot} ${UAC_IsInnerInstance} !insertmacro CheckSingleInstance "Setup" "Global" "${SETUP_MUTEX}" !insertmacro CheckSingleInstance "Application" "Local" "${APP_MUTEX}" diff --git a/misc/nsis/qutebrowser.nsi b/misc/nsis/qutebrowser.nsi index 60b174bdd..a6863ba34 100755 --- a/misc/nsis/qutebrowser.nsi +++ b/misc/nsis/qutebrowser.nsi @@ -131,6 +131,9 @@ ShowUninstDetails hide !define /ifndef DIST_DIR ".\..\..\dist\${PRODUCT_NAME}-${VERSION}-${ARCH}" !endif +; If not defined, assume Qt6 (requires a more recent windows version) +!define /ifndef QT5 "False" + ; Pack the exe header with upx if UPX is defined. !ifdef UPX !packhdr "$%TEMP%\exehead.tmp" '"upx" "--ultra-brute" "$%TEMP%\exehead.tmp"' diff --git a/scripts/dev/build_release.py b/scripts/dev/build_release.py index 4c443136f..a638508de 100755 --- a/scripts/dev/build_release.py +++ b/scripts/dev/build_release.py @@ -423,6 +423,7 @@ def _package_windows_single( utils.print_subtitle("Building installer...") subprocess.run(['makensis.exe', f'/DVERSION={qutebrowser.__version__}', + f'/DQT5={qt5}', 'misc/nsis/qutebrowser.nsi'], check=True) name_parts = [ -- cgit v1.2.3-54-g00ecf