Main patch for Bug 1305453 - Prevent non-esr stand alone installers from installing on XP/Vista. r=rstrong

This commit is contained in:
Jim Mathies 2016-11-21 12:11:44 -08:00
Родитель 0a46071cca
Коммит ff3ad8815a
6 изменённых файлов: 26 добавлений и 135 удалений

Просмотреть файл

@ -68,12 +68,12 @@
#ifdef HAVE_64BIT_BUILD
!define HAVE_64BIT_BUILD
!define ARCH "x64"
!define MinSupportedVer "Microsoft Windows 7 x64"
#else
!define ARCH "x86"
!define MinSupportedVer "Microsoft Windows XP SP2"
#endif
!define MinSupportedVer "Microsoft Windows 7"
!define MinSupportedCPU "SSE2"
#ifdef MOZ_MAINTENANCE_SERVICE

Просмотреть файл

@ -1138,13 +1138,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 (Vista/Server 2008) and lower are not supported.
${Unless} ${AtLeastWin7}
${If} "$R7" == "0"
strCpy $R7 "$(WARN_MIN_SUPPORTED_OSVER_CPU_MSG)"
${Else}
@ -1155,51 +1153,17 @@ 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 CPU 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
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

Просмотреть файл

@ -120,10 +120,7 @@ Function .onInit
SetSilent silent
; On Windows 2000 we do not install the maintenance service.
; We won't run this installer from the parent installer, but just in case
; someone tries to execute it on Windows 2000...
${Unless} ${AtLeastWinXP}
${Unless} ${AtLeastWin7}
Abort
${EndUnless}
FunctionEnd

Просмотреть файл

@ -321,10 +321,8 @@ Function .onInit
; 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}
; Windows NT 6.0 (Vista/Server 2008) and lower are not supported.
${Unless} ${AtLeastWin7}
${If} "$R7" == "0"
strCpy $R7 "$(WARN_MIN_SUPPORTED_OSVER_CPU_MSG)"
${Else}
@ -335,51 +333,17 @@ 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 CPU 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
SetRegView 64
!endif
; Require elevation if the user can elevate
${ElevateUAC}

Просмотреть файл

@ -117,10 +117,7 @@ Function .onInit
System::Call 'kernel32::SetDllDirectoryW(w "")'
SetSilent silent
; On Windows 2000 we do not install the maintenance service.
; We won't run this installer from the parent installer, but just in case
; someone tries to execute it on Windows 2000...
${Unless} ${AtLeastWinXP}
${Unless} ${AtLeastWin7}
Abort
${EndUnless}
FunctionEnd

Просмотреть файл

@ -5107,46 +5107,15 @@
Quit
${EndIf}
; Windows NT 6.0 (Vista/Server 2008) and lower are not supported.
${Unless} ${AtLeastWin7}
MessageBox MB_OK|MB_ICONSTOP "$R9"
; Nothing initialized so no need to call OnEndCommon
Quit
${EndUnless}
!ifdef HAVE_64BIT_BUILD
${Unless} ${RunningX64}
${OrUnless} ${AtLeastWin7}
MessageBox MB_OK|MB_ICONSTOP "$R9"
; Nothing initialized so no need to call OnEndCommon
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), to 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"
MessageBox MB_OK|MB_ICONSTOP "$R9"
; Nothing initialized so no need to call OnEndCommon
Quit
${EndIf}
${EndUnless}
!endif
${GetParameters} $R8