summaryrefslogtreecommitdiff
path: root/misc/nsis/install.nsh
diff options
context:
space:
mode:
Diffstat (limited to 'misc/nsis/install.nsh')
-rwxr-xr-xmisc/nsis/install.nsh33
1 files changed, 31 insertions, 2 deletions
diff --git a/misc/nsis/install.nsh b/misc/nsis/install.nsh
index e7d8b4956..282a254eb 100755
--- a/misc/nsis/install.nsh
+++ b/misc/nsis/install.nsh
@@ -430,8 +430,37 @@ SectionEnd
; Callbacks
Function .onInit
StrCpy $KeepReg 1
- !insertmacro CheckPlatform ${PLATFORM}
- !insertmacro CheckMinWinVer ${MIN_WIN_VER}
+
+; OS version check
+ ${If} ${RunningX64}
+ ; https://learn.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-osversioninfoa#remarks
+ GetWinVer $R0 Major
+ !if "${QT5}" == "True"
+ IntCmpU $R0 6 0 _os_check_fail _os_check_pass
+ GetWinVer $R1 Minor
+ IntCmpU $R1 2 _os_check_pass _os_check_fail _os_check_pass
+ !else
+ 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 >= 14393 ; Windows 10 1607
+ ${AndIf} ${IsNativeAMD64} ; Windows 10 has no x86_64 emulation on arm64
+ Goto _os_check_pass
+ ${EndIf}
+ !endif
+ ${EndIf}
+ _os_check_fail:
+ !if "${QT5}" == "True"
+ MessageBox MB_OK|MB_ICONSTOP "This version of ${PRODUCT_NAME} requires a 64-bit$\r$\n\
+ version of Windows 8 or later."
+ !else
+ MessageBox MB_OK|MB_ICONSTOP "This version of ${PRODUCT_NAME} requires a 64-bit$\r$\n\
+ version of Windows 10 1607 or later."
+ !endif
+ Abort
+ _os_check_pass:
+
${ifnot} ${UAC_IsInnerInstance}
!insertmacro CheckSingleInstance "Setup" "Global" "${SETUP_MUTEX}"
!insertmacro CheckSingleInstance "Application" "Local" "${APP_MUTEX}"