Bug 1271759 - Don't install on systems that have a CPU that doesn't support SSE2. r=mhowell

This commit is contained in:
Robert Strong 2016-05-27 09:15:16 -07:00
parent e9ee2349cc
commit 2e59bf1b5d
10 changed files with 114 additions and 7 deletions

View File

@ -16,6 +16,7 @@
!define URLStubDownload "http://download.mozilla.org/?os=win&lang=${AB_CD}&product=firefox-aurora-latest"
!define URLManualDownload "https://www.mozilla.org/${AB_CD}/firefox/installer-help/?channel=aurora&installer_lang=${AB_CD}"
!define URLSystemRequirements "https://www.mozilla.org/firefox/system-requirements/"
!define Channel "aurora"
# The installer's certificate name and issuer expected by the stub installer

View File

@ -15,6 +15,7 @@
!define URLStubDownload "http://download.mozilla.org/?os=win&lang=${AB_CD}&product=firefox-nightly-latest"
!define URLManualDownload "https://www.mozilla.org/${AB_CD}/firefox/installer-help/?channel=nightly&installer_lang=${AB_CD}"
!define URLSystemRequirements "https://www.mozilla.org/firefox/system-requirements/"
!define Channel "nightly"
# The installer's certificate name and issuer expected by the stub installer

View File

@ -20,6 +20,7 @@
!define OFFICIAL
!define URLStubDownload "http://download.mozilla.org/?os=win&lang=${AB_CD}&product=firefox-latest"
!define URLManualDownload "https://www.mozilla.org/${AB_CD}/firefox/installer-help/?channel=release&installer_lang=${AB_CD}"
!define URLSystemRequirements "https://www.mozilla.org/firefox/system-requirements/"
!define Channel "release"
# The installer's certificate name and issuer expected by the stub installer

View File

@ -15,6 +15,7 @@
!define URLStubDownload "http://download.mozilla.org/?os=win&lang=${AB_CD}&product=firefox-latest"
!define URLManualDownload "https://www.mozilla.org/${AB_CD}/firefox/installer-help/?channel=release&installer_lang=${AB_CD}"
!define URLSystemRequirements "https://www.mozilla.org/firefox/system-requirements/"
!define Channel "unofficial"
# The installer's certificate name and issuer expected by the stub installer

View File

@ -74,6 +74,8 @@
!define MinSupportedVer "Microsoft Windows XP SP2"
#endif
!define MinSupportedCPU "SSE2"
#ifdef MOZ_MAINTENANCE_SERVICE
!define MOZ_MAINTENANCE_SERVICE
#endif

View File

@ -1108,7 +1108,71 @@ Function .onInit
StrCpy $LANGUAGE 0
${SetBrandNameVars} "$EXEDIR\core\distribution\setup.ini"
${InstallOnInitCommon} "$(WARN_MIN_SUPPORTED_OS_MSG)"
; 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.
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}
${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
${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
${If} "$R7" == "0"
MessageBox MB_OKCANCEL|MB_ICONSTOP "$(WARN_MIN_SUPPORTED_CPU_MSG)" IDCANCEL +2
ExecShell "open" "${URLSystemRequirements}"
Quit
${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.

View File

@ -316,11 +316,22 @@ Function .onInit
; isn't supported for the stub installer.
${SetBrandNameVars} "$PLUGINSDIR\ignored.ini"
; 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.
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}
MessageBox MB_OK|MB_ICONSTOP "$(WARN_MIN_SUPPORTED_OS_MSG)"
${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
${EndUnless}
@ -351,12 +362,24 @@ Function .onInit
${OrIf} "$R8" == "3"
${OrIf} "$R8" == "4"
${OrIf} "$R8" == "5"
MessageBox MB_OK|MB_ICONSTOP "$(WARN_MIN_SUPPORTED_OS_MSG)"
${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
${If} "$R7" == "0"
MessageBox MB_OKCANCEL|MB_ICONSTOP "$(WARN_MIN_SUPPORTED_CPU_MSG)" IDCANCEL +2
ExecShell "open" "${URLSystemRequirements}"
Quit
${EndIf}
; Require elevation if the user can elevate
${ElevateUAC}

View File

@ -48,7 +48,9 @@ WARN_MANUALLY_CLOSE_APP_UNINSTALL=$BrandShortName must be closed to proceed with
WARN_MANUALLY_CLOSE_APP_LAUNCH=$BrandShortName is already running.\n\nPlease close $BrandShortName prior to launching the version you have just installed.
WARN_WRITE_ACCESS=You don't have access to write to the installation directory.\n\nClick OK to select a different directory.
WARN_DISK_SPACE=You don't have sufficient disk space to install to this location.\n\nClick OK to select a different location.
WARN_MIN_SUPPORTED_OS_MSG=Sorry, $BrandShortName can't be installed. This version of $BrandShortName requires ${MinSupportedVer} or newer.
WARN_MIN_SUPPORTED_OSVER_MSG=Sorry, $BrandShortName can't be installed. This version of $BrandShortName requires ${MinSupportedVer} or newer. Please click the OK button for additional information.
WARN_MIN_SUPPORTED_CPU_MSG=Sorry, $BrandShortName can't be installed. This version of $BrandShortName requires a processor with ${MinSupportedCPU} support. Please click the OK button for additional information.
WARN_MIN_SUPPORTED_OSVER_CPU_MSG=Sorry, $BrandShortName can't be installed. This version of $BrandShortName requires ${MinSupportedVer} or newer and a processor with ${MinSupportedCPU} support. Please click the OK button for additional information.
WARN_RESTART_REQUIRED_UNINSTALL=Your computer must be restarted to complete a previous uninstall of $BrandShortName. Do you want to reboot now?
WARN_RESTART_REQUIRED_UPGRADE=Your computer must be restarted to complete a previous upgrade of $BrandShortName. Do you want to reboot now?
ERROR_CREATE_DIRECTORY_PREFIX=Error creating directory:

View File

@ -25,7 +25,9 @@ INSTALL_BLURB1=You're about to enjoy the very latest in speed, flexibility and s
INSTALL_BLURB2=That's because $BrandShortName is made by a non-profit to make browsing and the Web better for you.
INSTALL_BLURB3=You're also joining a global community of users, contributors and developers working to make the best browser in the world.
WARN_MIN_SUPPORTED_OS_MSG=Sorry, $BrandShortName can't be installed. This version of $BrandShortName requires ${MinSupportedVer} or newer.
WARN_MIN_SUPPORTED_OSVER_MSG=Sorry, $BrandShortName can't be installed. This version of $BrandShortName requires ${MinSupportedVer} or newer. Please click the OK button for additional information.
WARN_MIN_SUPPORTED_CPU_MSG=Sorry, $BrandShortName can't be installed. This version of $BrandShortName requires a processor with ${MinSupportedCPU} support. Please click the OK button for additional information.
WARN_MIN_SUPPORTED_OSVER_CPU_MSG=Sorry, $BrandShortName can't be installed. This version of $BrandShortName requires ${MinSupportedVer} or newer and a processor with ${MinSupportedCPU} support. Please click the OK button for additional information.
WARN_WRITE_ACCESS=You don't have access to write to the installation directory.\n\nClick OK to select a different directory.
WARN_DISK_SPACE=You don't have sufficient disk space to install to this location.\n\nClick OK to select a different location.
WARN_ROOT_INSTALL=Unable to install to the root of your disk.\n\nClick OK to select a different location.

View File

@ -5097,10 +5097,20 @@
Push $R6
Push $R5
; 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.
System::Call "kernel32::IsProcessorFeaturePresent(i 10)i .R8"
${If} "$R8" == "0"
MessageBox MB_OK|MB_ICONSTOP "$R9"
; Nothing initialized so no need to call OnEndCommon
Quit
${EndIf}
!ifdef HAVE_64BIT_BUILD
${Unless} ${RunningX64}
${OrUnless} ${AtLeastWin7}
MessageBox MB_OK|MB_ICONSTOP "$R9" IDOK
MessageBox MB_OK|MB_ICONSTOP "$R9"
; Nothing initialized so no need to call OnEndCommon
Quit
${EndUnless}
@ -5132,7 +5142,7 @@
${OrIf} "$R8" == "3"
${OrIf} "$R8" == "4"
${OrIf} "$R8" == "5"
MessageBox MB_OK|MB_ICONSTOP "$R9" IDOK
MessageBox MB_OK|MB_ICONSTOP "$R9"
; Nothing initialized so no need to call OnEndCommon
Quit
${EndIf}