Bug 1517642: Make the installer and updater disable the launcher process by default on beta and release; r=mhowell

Differential Revision: https://phabricator.services.mozilla.com/D15758

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Aaron Klotz 2019-01-16 00:06:39 +00:00
Родитель f11cf08512
Коммит d56e504ec2
5 изменённых файлов: 115 добавлений и 0 удалений

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

@ -79,6 +79,15 @@
!define AccessibleHandlerCLSID "{4A195748-DCA2-45FB-9295-0A139E76A9E7}" !define AccessibleHandlerCLSID "{4A195748-DCA2-45FB-9295-0A139E76A9E7}"
!endif !endif
#ifdef MOZ_LAUNCHER_PROCESS
!define MOZ_LAUNCHER_PROCESS
!define MOZ_LAUNCHER_SUBKEY "Software\Mozilla\${AppName}\Launcher"
#endif
#ifdef RELEASE_OR_BETA
!define RELEASE_OR_BETA
#endif
# Due to official and beta using the same branding this is needed to # Due to official and beta using the same branding this is needed to
# differentiante between the url used by the stub for downloading. # differentiante between the url used by the stub for downloading.
!if "@MOZ_UPDATE_CHANNEL@" == "beta" !if "@MOZ_UPDATE_CHANNEL@" == "beta"

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

@ -489,6 +489,12 @@ Section "-Application" APP_IDX
${SetAppLSPCategories} ${LSP_CATEGORIES} ${SetAppLSPCategories} ${LSP_CATEGORIES}
${EndIf} ${EndIf}
!ifdef MOZ_LAUNCHER_PROCESS
!ifdef RELEASE_OR_BETA
${DisableLauncherProcessByDefault}
!endif
!endif
; Create shortcuts ; Create shortcuts
${LogHeader} "Adding Shortcuts" ${LogHeader} "Adding Shortcuts"

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

@ -162,6 +162,13 @@
${EndIf} ${EndIf}
${EndIf} ${EndIf}
!endif !endif
!ifdef MOZ_LAUNCHER_PROCESS
!ifdef RELEASE_OR_BETA
${DisableLauncherProcessByDefault}
!endif
!endif
!macroend !macroend
!define PostUpdate "!insertmacro PostUpdate" !define PostUpdate "!insertmacro PostUpdate"
@ -1607,3 +1614,22 @@ FunctionEnd
!define SetAsDefaultAppUser "Call SetAsDefaultAppUser" !define SetAsDefaultAppUser "Call SetAsDefaultAppUser"
!endif ; NO_LOG !endif ; NO_LOG
!ifdef MOZ_LAUNCHER_PROCESS
!ifdef RELEASE_OR_BETA
!macro DisableLauncherProcessByDefault
ClearErrors
${ReadRegQWORD} $0 HKCU ${MOZ_LAUNCHER_SUBKEY} "$INSTDIR\${FileMainEXE}|Launcher"
${If} ${Errors}
ClearErrors
${ReadRegQWORD} $0 HKCU ${MOZ_LAUNCHER_SUBKEY} "$INSTDIR\${FileMainEXE}|Browser"
${If} ${Errors}
ClearErrors
; New install that hasn't seen this yet; disable by default
${WriteRegQWORD} HKCU ${MOZ_LAUNCHER_SUBKEY} "$INSTDIR\${FileMainEXE}|Browser" 0
${EndIf}
${EndIf}
!macroend
!define DisableLauncherProcessByDefault "!insertmacro DisableLauncherProcessByDefault"
!endif
!endif

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

@ -411,6 +411,12 @@ Section "Uninstall"
${UnregisterDLL} "$INSTDIR\AccessibleHandler.dll" ${UnregisterDLL} "$INSTDIR\AccessibleHandler.dll"
${EndIf} ${EndIf}
!ifdef MOZ_LAUNCHER_PROCESS
DeleteRegValue HKCU ${MOZ_LAUNCHER_SUBKEY} "$INSTDIR\${FileMainEXE}|Launcher"
DeleteRegValue HKCU ${MOZ_LAUNCHER_SUBKEY} "$INSTDIR\${FileMainEXE}|Browser"
DeleteRegValue HKCU ${MOZ_LAUNCHER_SUBKEY} "$INSTDIR\${FileMainEXE}|Image"
!endif
${un.RemovePrecompleteEntries} "false" ${un.RemovePrecompleteEntries} "false"
${If} ${FileExists} "$INSTDIR\defaults\pref\channel-prefs.js" ${If} ${FileExists} "$INSTDIR\defaults\pref\channel-prefs.js"

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

@ -8402,3 +8402,71 @@ end:
Pop $1 Pop $1
Pop $0 Pop $0
!macroend !macroend
Function WriteRegQWORD
; Stack contents:
; VALUE, VALUE_NAME, SUBKEY, ROOTKEY
Exch $3 ; $3, VALUE_NAME, SUBKEY, ROOTKEY
Exch 1 ; VALUE_NAME, $3, SUBKEY, ROOTKEY
Exch $2 ; $2, $3, SUBKEY, ROOTKEY
Exch 2 ; SUBKEY, $3, $2, ROOTKEY
Exch $1 ; $1, $3, $2, ROOTKEY
Exch 3 ; ROOTKEY, $3, $2, $1
Exch $0 ; $0, $3, $2, $1
System::Call "advapi32::RegSetKeyValueW(p r0, w r1, w r2, i 11, *l r3, i 8) i.r0"
${IfNot} $0 = 0
SetErrors
${EndIf}
Pop $0
Pop $3
Pop $2
Pop $1
FunctionEnd
!macro WriteRegQWORD ROOTKEY SUBKEY VALUE_NAME VALUE
${If} "${ROOTKEY}" == "HKCR"
Push 0x80000000
${ElseIf} "${ROOTKEY}" == "HKCU"
Push 0x80000001
${ElseIf} "${ROOTKEY}" == "HKLM"
Push 0x80000002
${Endif}
Push "${SUBKEY}"
Push "${VALUE_NAME}"
System::Int64Op ${VALUE} + 0 ; The result is pushed on the stack
Call WriteRegQWORD
!macroend
!define WriteRegQWORD "!insertmacro WriteRegQWORD"
Function ReadRegQWORD
; Stack contents:
; VALUE_NAME, SUBKEY, ROOTKEY
Exch $2 ; $2, SUBKEY, ROOTKEY
Exch 1 ; SUBKEY, $2, ROOTKEY
Exch $1 ; $1, $2, ROOTKEY
Exch 2 ; ROOTKEY, $2, $1
Exch $0 ; $0, $2, $1
System::Call "advapi32::RegGetValueW(p r0, w r1, w r2, i 0x48, p 0, *l s, *i 8) i.r0"
${IfNot} $0 = 0
SetErrors
${EndIf}
; VALUE, $0, $2, $1
Exch 3 ; $1, $0, $2, VALUE
Pop $1 ; $0, $2, VALUE
Pop $0 ; $2, VALUE
Pop $2 ; VALUE
FunctionEnd
!macro ReadRegQWORD DEST ROOTKEY SUBKEY VALUE_NAME
${If} "${ROOTKEY}" == "HKCR"
Push 0x80000000
${ElseIf} "${ROOTKEY}" == "HKCU"
Push 0x80000001
${ElseIf} "${ROOTKEY}" == "HKLM"
Push 0x80000002
${Endif}
Push "${SUBKEY}"
Push "${VALUE_NAME}"
Call ReadRegQWORD
Pop ${DEST}
!macroend
!define ReadRegQWORD "!insertmacro ReadRegQWORD"