mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-20 00:35:44 +00:00
Bug 1567229
- Attempt creating a taskbar pin a second time on Windows 10. r=agashlin
At least for now, this behavior is behind a hidden pref. The intent is to experiment with the feature and determine that way whether enabling it permanently is a good idea, and if so the pref gate will be removed in a separate bug. This patch depends on bug 1567247 and will fail to build without it. Differential Revision: https://phabricator.services.mozilla.com/D41100 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
6f1b6a839a
commit
ea12a48529
@ -30,7 +30,7 @@ const INSTALLER_PREFS_BRANCH = "installer.";
|
||||
// current use (e.g., currently active experiments).
|
||||
// Only add prefs to this list which are in INSTALLER_PREFS_BRANCH;
|
||||
// any others will be ignored.
|
||||
const INSTALLER_PREFS_LIST = [];
|
||||
const INSTALLER_PREFS_LIST = ["installer.taskbarpin.win10.enabled"];
|
||||
|
||||
const { AppConstants } = ChromeUtils.import(
|
||||
"resource://gre/modules/AppConstants.jsm"
|
||||
|
@ -121,6 +121,11 @@ VIAddVersionKey "OriginalFilename" "setup.exe"
|
||||
!insertmacro WriteRegStr2
|
||||
!insertmacro WriteRegDWORD2
|
||||
|
||||
; This needs to be inserted after InitHashAppModelId because it uses
|
||||
; $AppUserModelID and the compiler can't handle using variables lexically before
|
||||
; they've been declared.
|
||||
!insertmacro GetInstallerRegistryPref
|
||||
|
||||
!include shared.nsh
|
||||
|
||||
; Helper macros for ui callbacks. Insert these after shared.nsh
|
||||
|
@ -1099,6 +1099,7 @@
|
||||
${If} ${Errors}
|
||||
ClearErrors
|
||||
WriteIniStr "$0" "TASKBAR" "Migrated" "true"
|
||||
WriteINIStr "$0" "TASKBAR" "Pinned" "true"
|
||||
${If} ${AtLeastWin7}
|
||||
; If we didn't run the stub installer, AddTaskbarSC will be empty.
|
||||
; We determine whether to pin based on whether we're the default
|
||||
@ -1121,6 +1122,24 @@
|
||||
${PinToTaskBar}
|
||||
${EndIf}
|
||||
${EndIf}
|
||||
${ElseIf} ${AtLeastWin10}
|
||||
${GetInstallerRegistryPref} "Software\Mozilla\${AppName}" \
|
||||
"installer.taskbarpin.win10.enabled" $2
|
||||
${If} $2 == "true"
|
||||
; On Windows 10, we may have previously tried to make a taskbar pin
|
||||
; and failed because the API we tried to use was blocked by the OS.
|
||||
; We have an option that works in more cases now, so we're going to try
|
||||
; again, but also record that we've done so by writing "Pinned" into the
|
||||
; shortcuts log, so that we don't continue to do this repeatedly.
|
||||
ClearErrors
|
||||
ReadINIStr $1 "$0" "TASKBAR" "Pinned"
|
||||
${If} ${Errors}
|
||||
WriteINIStr "$0" "TASKBAR" "Pinned" "true"
|
||||
${If} $AddTaskbarSC != "0"
|
||||
${PinToTaskBar}
|
||||
${EndIf}
|
||||
${EndIf}
|
||||
${EndIf}
|
||||
${EndIf}
|
||||
${EndIf}
|
||||
!macroend
|
||||
|
@ -93,6 +93,11 @@ VIAddVersionKey "OriginalFilename" "helper.exe"
|
||||
!insertmacro WriteRegDWORD2
|
||||
!insertmacro WriteRegStr2
|
||||
|
||||
; This needs to be inserted after InitHashAppModelId because it uses
|
||||
; $AppUserModelID and the compiler can't handle using variables lexically before
|
||||
; they've been declared.
|
||||
!insertmacro GetInstallerRegistryPref
|
||||
|
||||
!insertmacro un.ChangeMUIHeaderImage
|
||||
!insertmacro un.CheckForFilesInUse
|
||||
!insertmacro un.CleanUpdateDirectories
|
||||
|
Loading…
Reference in New Issue
Block a user