Bug 1543807 - Part 2: Update the installer to reflect new launcher process registry settings; r=mhowell
authorAaron Klotz <aklotz@mozilla.com>
Wed, 01 May 2019 21:08:49 +0000
changeset 531138 26c271a86fddbef6275e2c62140db382266ba392
parent 531137 07eb003e6efebe215d19ce3d376a04843c310e5e
child 531139 b94f9b2fbe2c695e26fa9473464b39439f2307c1
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmhowell
bugs1543807
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1543807 - Part 2: Update the installer to reflect new launcher process registry settings; r=mhowell * New installs should always have launcher process telemetry enabled by default (since it is opt-out telemetry). * Upgrades do a reset of the force-disabled launcher state, as that state might have been set by SHIELD but is no longer desired in 68. * We add the `|Telemetry` registry value to the list of values to be removed at uninstall. Differential Revision: https://phabricator.services.mozilla.com/D29544
browser/installer/windows/nsis/installer.nsi
browser/installer/windows/nsis/shared.nsh
browser/installer/windows/nsis/uninstaller.nsi
--- a/browser/installer/windows/nsis/installer.nsi
+++ b/browser/installer/windows/nsis/installer.nsi
@@ -485,17 +485,23 @@ Section "-Application" APP_IDX
   ${CreateRegKey} "$TmpVal" "$0" 0
 
   ${If} $TmpVal == "HKLM"
     ; Set the permitted LSP Categories
     ${SetAppLSPCategories} ${LSP_CATEGORIES}
   ${EndIf}
 
 !ifdef MOZ_LAUNCHER_PROCESS
-  ${DisableLauncherProcessByDefault}
+  ; Launcher telemetry is opt-out, so we always enable it by default in new
+  ; installs. We always use HKCU because this value is a reflection of a pref
+  ; from the user profile. While this is not a perfect abstraction (given the
+  ; possibility of multiple Firefox profiles owned by the same Windows user), it
+  ; is more accurate than a machine-wide setting, and should be accurate in the
+  ; majority of cases.
+  WriteRegDWORD HKCU ${MOZ_LAUNCHER_SUBKEY} "$INSTDIR\${FileMainEXE}|Telemetry" 1
 !endif
 
   ; Create shortcuts
   ${LogHeader} "Adding Shortcuts"
 
   ; Remove the start menu shortcuts and directory if the SMPROGRAMS section
   ; exists in the shortcuts_log.ini and the SMPROGRAMS. The installer's shortcut
   ; creation code will create the shortcut in the root of the Start Menu
--- a/browser/installer/windows/nsis/shared.nsh
+++ b/browser/installer/windows/nsis/shared.nsh
@@ -166,17 +166,17 @@
       ; IsAdmin check and the permissions check, the maintenance service
       ; will just fail to be attempted to be installed.
       nsExec::Exec "$\"$INSTDIR\maintenanceservice_installer.exe$\""
     ${EndIf}
   ${EndIf}
 !endif
 
 !ifdef MOZ_LAUNCHER_PROCESS
-  ${DisableLauncherProcessByDefault}
+  ${ResetLauncherProcessDefaults}
 !endif
 
 !macroend
 !define PostUpdate "!insertmacro PostUpdate"
 
 ; Update the last modified time on the Start Menu shortcut, so that its icon
 ; gets refreshed. Should be called on Win8+ after UpdateShortcutBranding.
 !macro TouchStartMenuShortcut
@@ -1577,27 +1577,18 @@ Function SetAsDefaultAppUser
     UAC::ExecCodeSegment $0
   ${EndIf}
 FunctionEnd
 !define SetAsDefaultAppUser "Call SetAsDefaultAppUser"
 
 !endif ; NO_LOG
 
 !ifdef MOZ_LAUNCHER_PROCESS
-!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
-      ReadRegDWORD $0 HKCU ${MOZ_LAUNCHER_SUBKEY} "$INSTDIR\${FileMainEXE}|Image"
-      ${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}
-  ${EndIf}
+!macro ResetLauncherProcessDefaults
+  # By deleting these values, we remove remnants of any force-disable settings
+  # that may have been set during the SHIELD study in 67. Note that this setting
+  # was only intended to distinguish between test and control groups for the
+  # purposes of the study, not as a user preference.
+  DeleteRegValue HKCU ${MOZ_LAUNCHER_SUBKEY} "$INSTDIR\${FileMainEXE}|Launcher"
+  DeleteRegValue HKCU ${MOZ_LAUNCHER_SUBKEY} "$INSTDIR\${FileMainEXE}|Browser"
 !macroend
-!define DisableLauncherProcessByDefault "!insertmacro DisableLauncherProcessByDefault"
+!define ResetLauncherProcessDefaults "!insertmacro ResetLauncherProcessDefaults"
 !endif
--- a/browser/installer/windows/nsis/uninstaller.nsi
+++ b/browser/installer/windows/nsis/uninstaller.nsi
@@ -415,16 +415,17 @@ Section "Uninstall"
   ${If} "$INSTDIR\AccessibleHandler.dll" == "$R1"
     ${UnregisterDLL} "$INSTDIR\AccessibleHandler.dll"
   ${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"
+  DeleteRegValue HKCU ${MOZ_LAUNCHER_SUBKEY} "$INSTDIR\${FileMainEXE}|Telemetry"
 !endif
 
   ${un.RemovePrecompleteEntries} "false"
 
   ${If} ${FileExists} "$INSTDIR\defaults\pref\channel-prefs.js"
     Delete /REBOOTOK "$INSTDIR\defaults\pref\channel-prefs.js"
   ${EndIf}
   ${If} ${FileExists} "$INSTDIR\defaults\pref"