Bug 1319469 - Prevent non-esr stand alone installers from installing on XP/Vista. r=jorgk

This commit is contained in:
Richard Marti 2016-11-22 18:49:20 +01:00
Родитель a6cf994e8f
Коммит 76492d1d0f
3 изменённых файлов: 21 добавлений и 55 удалений

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

@ -44,10 +44,10 @@
#ifdef HAVE_64BIT_BUILD
!define HAVE_64BIT_BUILD
!define ARCH "x64"
!define MinSupportedVer "Microsoft Windows Vista x64"
!define MinSupportedVer "Microsoft Windows 7 x64"
#else
!define MinSupportedVer "Microsoft Windows 7"
!define ARCH "x86"
!define MinSupportedVer "Microsoft Windows XP SP2"
#endif
!define MinSupportedCPU "SSE2"

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

@ -1002,13 +1002,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}
@ -1019,51 +1017,22 @@ 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
${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)"
!insertmacro InitInstallOptionsFile "options.ini"

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

@ -42,7 +42,7 @@ Var BrandFullName
!insertmacro GetSize
; The test slaves use this fallback key to run tests.
; And anyone that wants to run tests themselves should already have
; And anyone that wants to run tests themselves should already have
; this installed.
!define FallbackKey \
"SOFTWARE\Mozilla\MaintenanceService\3932ecacee736d366d6436db0f55bce4"
@ -52,7 +52,7 @@ Var BrandFullName
; The following includes are custom.
!include defines.nsi
; We keep defines.nsi defined so that we get other things like
; We keep defines.nsi defined so that we get other things like
; the version number, but we redefine BrandFullName
!define MaintFullName "Mozilla Maintenance Service"
!undef BrandFullName
@ -127,10 +127,7 @@ Function .onInit
Abort
!endif
; 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
@ -161,7 +158,7 @@ Section "MaintenanceService"
StrCpy $TempMaintServiceName "maintenanceservice_tmp.exe"
skipAlreadyExists:
; We always write out a copy and then decide whether to install it or
; We always write out a copy and then decide whether to install it or
; not via calling its 'install' cmdline which works by version comparison.
CopyFiles "$EXEDIR\maintenanceservice.exe" "$INSTDIR\$TempMaintServiceName"
@ -215,7 +212,7 @@ Section "MaintenanceService"
WriteRegDWORD HKLM "Software\Mozilla\MaintenanceService" "Attempted" 1
WriteRegDWORD HKLM "Software\Mozilla\MaintenanceService" "Installed" 1
; Included here for debug purposes only.
; Included here for debug purposes only.
; These keys are used to bypass the installation dir is a valid installation
; check from the service so that tests can be run.
; WriteRegStr HKLM "${FallbackKey}\0" "name" "Mozilla Corporation"
@ -237,7 +234,7 @@ Function un.RenameDelete
Rename "$9" "$9.moz-delete"
${If} ${Errors}
Delete /REBOOTOK "$9"
${Else}
${Else}
Delete /REBOOTOK "$9.moz-delete"
${EndIf}
ClearErrors