Bug 1592968 Followup - Write the pinned to taskbar flag in a place the unelevated helper can write to. r=agashlin

The previous patch didn't work because the helper running as the unelevated
user is the only one that can read the pref out of its user registry hive,
which is where Firefox has to write it, but then since it's limited it can't
write to either the shortcut log or to HKLM. So everything has to happen in
HKCU so that the unelevated helper can both read and write where it needs to
read and write to.

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Molly Howell 2019-11-15 00:31:07 +00:00
parent 58f75fdd03
commit d69dc58f66

View File

@ -1095,16 +1095,6 @@
; installation time, then we don't get the opportunity to run this code at ; installation time, then we don't get the opportunity to run this code at
; that time. ; that time.
!macro MigrateTaskBarShortcut !macro MigrateTaskBarShortcut
; Find out if this is an ESR build or not, because it affects what we've
; named some of our application registry keys.
ClearErrors
${WordFind} "${UpdateChannel}" "esr" "E#" $3
${If} ${Errors}
StrCpy $3 ""
${Else}
StrCpy $3 " ESR"
${EndIf}
${GetShortcutsLogPath} $0 ${GetShortcutsLogPath} $0
${If} ${FileExists} "$0" ${If} ${FileExists} "$0"
ClearErrors ClearErrors
@ -1112,8 +1102,8 @@
${If} ${Errors} ${If} ${Errors}
ClearErrors ClearErrors
WriteIniStr "$0" "TASKBAR" "Migrated" "true" WriteIniStr "$0" "TASKBAR" "Migrated" "true"
WriteRegDWORD SHCTX \ WriteRegDWORD HKCU \
"Software\Mozilla\${BrandFullNameInternal}\${AppVersion}$3 (${ARCH} ${AB_CD})\Main" \ "Software\Mozilla\${AppName}\Installer\$AppUserModelID" \
"WasPinnedToTaskbar" 1 "WasPinnedToTaskbar" 1
${If} ${AtLeastWin7} ${If} ${AtLeastWin7}
; If we didn't run the stub installer, AddTaskbarSC will be empty. ; If we didn't run the stub installer, AddTaskbarSC will be empty.
@ -1147,12 +1137,12 @@
; again, but also record that we've done so by writing a particular ; again, but also record that we've done so by writing a particular
; registry value, so that we don't continue to do this repeatedly. ; registry value, so that we don't continue to do this repeatedly.
ClearErrors ClearErrors
ReadRegDWORD $2 SHCTX \ ReadRegDWORD $2 HKCU \
"Software\Mozilla\${BrandFullNameInternal}\${AppVersion}$3 (${ARCH} ${AB_CD})\Main" \ "Software\Mozilla\${AppName}\Installer\$AppUserModelID" \
"WasPinnedToTaskbar" "WasPinnedToTaskbar"
${If} ${Errors} ${If} ${Errors}
WriteRegDWORD SHCTX \ WriteRegDWORD HKCU \
"Software\Mozilla\${BrandFullNameInternal}\${AppVersion}$3 (${ARCH} ${AB_CD})\Main" \ "Software\Mozilla\${AppName}\Installer\$AppUserModelID" \
"WasPinnedToTaskbar" 1 "WasPinnedToTaskbar" 1
${If} $AddTaskbarSC != "0" ${If} $AddTaskbarSC != "0"
${PinToTaskBar} ${PinToTaskBar}