From 47b8c58d47bae45d723ef22665e8f13ecc66725f Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Sun, 18 Feb 2018 13:12:13 +0100 Subject: Prevent installing stand-alone installers on unsupported environments. - Prevent installers from installing on XP/Vista. - Prevent x64 installers from installing on x86. --- browser/installer/windows/nsis/installer.nsi | 61 +++++++--------------------- 1 file changed, 14 insertions(+), 47 deletions(-) (limited to 'browser/installer/windows/nsis/installer.nsi') diff --git a/browser/installer/windows/nsis/installer.nsi b/browser/installer/windows/nsis/installer.nsi index aed5808cd..994c09279 100755 --- a/browser/installer/windows/nsis/installer.nsi +++ b/browser/installer/windows/nsis/installer.nsi @@ -1139,13 +1139,11 @@ Function .onInit ; Don't install on systems that don't support SSE2. The parameter value of ; 10 is for PF_XMMI64_INSTRUCTIONS_AVAILABLE which will check whether the - ; SSE2 instruction set is available. + ; SSE2 instruction set is available. Result returned in $R7. System::Call "kernel32::IsProcessorFeaturePresent(i 10)i .R7" -!ifdef HAVE_64BIT_BUILD - ; Restrict x64 builds from being installed on x86 and pre Win7 - ${Unless} ${RunningX64} - ${OrUnless} ${AtLeastWin7} + ; Windows NT 6.0 and lower are not supported on any architecture. + ${Unless} ${AtLeastWin7} ${If} "$R7" == "0" strCpy $R7 "$(WARN_MIN_SUPPORTED_OSVER_CPU_MSG)" ${Else} @@ -1156,59 +1154,28 @@ Function .onInit Quit ${EndUnless} - SetRegView 64 -!else - StrCpy $R8 "0" - ${If} ${AtMostWin2000} - StrCpy $R8 "1" - ${EndIf} - - ${If} ${IsWinXP} - ${AndIf} ${AtMostServicePack} 1 - StrCpy $R8 "1" - ${EndIf} - - ${If} $R8 == "1" - ; XXX-rstrong - some systems failed the AtLeastWin2000 test that we - ; used to use for an unknown reason and likely fail the AtMostWin2000 - ; and possibly the IsWinXP test as well. To work around this also - ; check if the Windows NT registry Key exists and if it does if the - ; first char in CurrentVersion is equal to 3 (Windows NT 3.5 and - ; 3.5.1), 4 (Windows NT 4), or 5 (Windows 2000 and Windows XP). - StrCpy $R8 "" - ClearErrors - ReadRegStr $R8 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" "CurrentVersion" - StrCpy $R8 "$R8" 1 - ${If} ${Errors} - ${OrIf} "$R8" == "3" - ${OrIf} "$R8" == "4" - ${OrIf} "$R8" == "5" - ${If} "$R7" == "0" - strCpy $R7 "$(WARN_MIN_SUPPORTED_OSVER_CPU_MSG)" - ${Else} - strCpy $R7 "$(WARN_MIN_SUPPORTED_OSVER_MSG)" - ${EndIf} - MessageBox MB_OKCANCEL|MB_ICONSTOP "$R7" IDCANCEL +2 - ExecShell "open" "${URLSystemRequirements}" - Quit - ${EndIf} - ${EndUnless} -!endif - + ; SSE2 support ${If} "$R7" == "0" MessageBox MB_OKCANCEL|MB_ICONSTOP "$(WARN_MIN_SUPPORTED_CPU_MSG)" IDCANCEL +2 ExecShell "open" "${URLSystemRequirements}" Quit ${EndIf} +!ifdef HAVE_64BIT_BUILD + ${Unless} ${RunningX64} + MessageBox MB_OKCANCEL|MB_ICONSTOP "$(WARN_MIN_SUPPORTED_OSVER_MSG)" IDCANCEL +2 + ExecShell "open" "${URLSystemRequirements}" + Quit + ${EndUnless} + SetRegView 64 +!endif + ${InstallOnInitCommon} "$(WARN_MIN_SUPPORTED_OSVER_CPU_MSG)" ; The commands inside this ifndef are needed prior to NSIS 3.0a2 and can be ; removed after we require NSIS 3.0a2 or greater. !ifndef NSIS_PACKEDVERSION - ${If} ${AtLeastWinVista} - System::Call 'user32::SetProcessDPIAware()' - ${EndIf} + System::Call 'user32::SetProcessDPIAware()' !endif !insertmacro InitInstallOptionsFile "options.ini" -- cgit v1.2.3