diff options
Diffstat (limited to 'misc/nsis/install.nsh')
-rwxr-xr-x | misc/nsis/install.nsh | 50 |
1 files changed, 33 insertions, 17 deletions
diff --git a/misc/nsis/install.nsh b/misc/nsis/install.nsh index 8233ab5f0..282a254eb 100755 --- a/misc/nsis/install.nsh +++ b/misc/nsis/install.nsh @@ -1,19 +1,6 @@ -# Copyright 2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org> +# SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org> # -# This file is part of qutebrowser. -# -# qutebrowser is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# qutebrowser is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with qutebrowser. If not, see <https://www.gnu.org/licenses/>. +# SPDX-License-Identifier: GPL-3.0-or-later # NSIS installer header. Uses NsisMultiUser plugin and contains portions of # its demo code, copyright 2017 Richard Drizin, Alex Mitev. @@ -443,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}" |