Browse Source

Installer enhancement: prevent arm64 installer from installing on non ARM64 system

Fix #12320, close #12331
pull/12343/head
xomx 2 years ago committed by Don Ho
parent
commit
1be0044663
  1. 2
      PowerEditor/installer/nppSetup.nsi
  2. 30
      PowerEditor/installer/nsisInclude/tools.nsh

2
PowerEditor/installer/nppSetup.nsi

@ -172,7 +172,7 @@ updaterDone:
Call SetRoughEstimation ; This is rough estimation of files present in function copyCommonFiles
InitPluginsDir ; Initializes the plug-ins dir ($PLUGINSDIR) if not already initialized.
Call preventInstallInWin9x
Call checkCompatibility ; check unsupported OSes and CPUs
; look for previously selected language
ClearErrors

30
PowerEditor/installer/nsisInclude/tools.nsh

@ -124,28 +124,28 @@ Function ExtraOptions
nsDialogs::Show
FunctionEnd
Function preventInstallInWin9x
;Test if window9x
Function checkCompatibility
${GetWindowsVersion} $WinVer
StrCmp $WinVer "95" 0 +3
MessageBox MB_OK "Notepad++ does not support your OS. The installation will be aborted."
MessageBox MB_OK|MB_ICONSTOP "Notepad++ does not support your OS. The installation will be aborted."
Abort
StrCmp $WinVer "98" 0 +3
MessageBox MB_OK "Notepad++ does not support your OS. The installation will be aborted."
MessageBox MB_OK|MB_ICONSTOP "Notepad++ does not support your OS. The installation will be aborted."
Abort
StrCmp $WinVer "ME" 0 +3
MessageBox MB_OK "Notepad++ does not support your OS. The installation will be aborted."
MessageBox MB_OK|MB_ICONSTOP "Notepad++ does not support your OS. The installation will be aborted."
Abort
StrCmp $WinVer "2000" 0 +3 ; Windows 2000
MessageBox MB_OK "Notepad++ does not support your OS. The installation will be aborted."
MessageBox MB_OK|MB_ICONSTOP "Notepad++ does not support your OS. The installation will be aborted."
Abort
StrCmp $WinVer "XP" 0 xp_endTest ; XP
MessageBox MB_YESNO "This version of Notepad++ doesn't support Windows XP. The installation will be aborted.$\nDo you want to go to Notepad++ download page for downloading the last version which supports XP (v7.9.2)?" IDYES xp_openDlPage IDNO xp_goQuit
MessageBox MB_YESNO|MB_ICONSTOP "This version of Notepad++ doesn't support Windows XP. The installation will be aborted.$\n$\nDo you want to go to Notepad++ download page for downloading the last version which supports XP (v7.9.2)?" IDYES xp_openDlPage IDNO xp_goQuit
xp_openDlPage:
ExecShell "open" "https://notepad-plus-plus.org/downloads/v7.9.2/"
xp_goQuit:
@ -153,12 +153,26 @@ xp_goQuit:
xp_endTest:
StrCmp $WinVer "2003" 0 ws2003_endTest ; Windows Server 2003
MessageBox MB_YESNO "This version of Notepad++ doesn't support Windows Server 2003. The installation will be aborted.$\nDo you want to go to Notepad++ download page for downloading the last version which supports this OS?" IDYES ws2003_openDlPage IDNO ws2003_goQuit
MessageBox MB_YESNO|MB_ICONSTOP "This version of Notepad++ doesn't support Windows Server 2003. The installation will be aborted.$\n$\nDo you want to go to Notepad++ download page for downloading the last version which supports this OS?" IDYES ws2003_openDlPage IDNO ws2003_goQuit
ws2003_openDlPage:
ExecShell "open" "https://notepad-plus-plus.org/downloads/v7.9.2/"
ws2003_goQuit:
Abort
ws2003_endTest:
!ifdef ARCHARM64
${If} ${IsNativeARM64}
; OK
${Else}
; we cannot run ARM64 binaries on a x86/x64 CPU (the other way around is possible - x86 on ARM64 CPU)
MessageBox MB_YESNO|MB_ICONSTOP "This installer contains ARM64 version of Notepad++ incompatible with your computer processor running, so the installation will be aborted.$\n$\nDo you want to go to the Notepad++ site to download a compatible (x86/x64) installer instead?" IDYES arm64_openDlPage IDNO arm64_goQuit
arm64_openDlPage:
ExecShell "open" "https://notepad-plus-plus.org/downloads/"
arm64_goQuit:
Abort
${EndIf}
!endif
FunctionEnd

Loading…
Cancel
Save