Skip to content

Commit

Permalink
Backed out 2 changesets (bug 1771951) for causing bug 1776170. CLOSED…
Browse files Browse the repository at this point in the history
… TREE

Backed out changeset 3a789d06604f (bug 1771951)
Backed out changeset 59eac90984cb (bug 1771951)
  • Loading branch information
smolnar committed Jun 23, 2022
1 parent ad0291c commit 45ecfdf
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 386 deletions.
31 changes: 22 additions & 9 deletions browser/installer/windows/nsis/installer.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -1446,7 +1446,11 @@ Function leaveShortcuts
${EndIf}
${MUI_INSTALLOPTIONS_READ} $AddDesktopSC "shortcuts.ini" "Field 2" "State"
${MUI_INSTALLOPTIONS_READ} $AddStartMenuSC "shortcuts.ini" "Field 3" "State"
${MUI_INSTALLOPTIONS_READ} $AddTaskbarSC "shortcuts.ini" "Field 4" "State"

; Don't install the quick launch shortcut on Windows 7
${Unless} ${AtLeastWin7}
${MUI_INSTALLOPTIONS_READ} $AddQuickLaunchSC "shortcuts.ini" "Field 4" "State"
${EndUnless}

${If} $InstallType == ${INSTALLTYPE_CUSTOM}
Call CheckExistingInstall
Expand Down Expand Up @@ -1894,7 +1898,13 @@ Function .onInit
WriteINIStr "$PLUGINSDIR\options.ini" "Field 5" Top "67"
WriteINIStr "$PLUGINSDIR\options.ini" "Field 5" Bottom "87"

WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Settings" NumFields "4"
; Setup the shortcuts.ini file for the Custom Shortcuts Page
; Don't offer to install the quick launch shortcut on Windows 7
${If} ${AtLeastWin7}
WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Settings" NumFields "3"
${Else}
WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Settings" NumFields "4"
${EndIf}

WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 1" Type "label"
WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 1" Text "$(CREATE_ICONS_DESC)"
Expand All @@ -1920,13 +1930,16 @@ Function .onInit
WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 3" Bottom "50"
WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 3" State "1"

WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 4" Type "checkbox"
WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 4" Text "$(ICONS_TASKBAR)"
WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 4" Left "0"
WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 4" Right "-1"
WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 4" Top "60"
WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 4" Bottom "70"
WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 4" State "1"
; Don't offer to install the quick launch shortcut on Windows 7
${Unless} ${AtLeastWin7}
WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 4" Type "checkbox"
WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 4" Text "$(ICONS_QUICKLAUNCH)"
WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 4" Left "0"
WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 4" Right "-1"
WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 4" Top "60"
WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 4" Bottom "70"
WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 4" State "1"
${EndUnless}

; Setup the components.ini file for the Components Page
WriteINIStr "$PLUGINSDIR\components.ini" "Settings" NumFields "2"
Expand Down
42 changes: 25 additions & 17 deletions browser/installer/windows/nsis/shared.nsh
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,7 @@
${EndIf}

; Adds a pinned Task Bar shortcut (see MigrateTaskBarShortcut for details).
; When we enabled this feature for Windows 10 & 11 we decided _not_ to pin
; during an update (even once) because we already offered to do when the
; the user originally installed, and we don't want to go against their
; explicit wishes.
; For Windows 7 and 8, we've been doing this ~forever, and those users may
; not have experienced the onboarding offer to pin to taskbar, so we're
; leaving it enabled there.
${If} ${AtMostWin2012R2}
${MigrateTaskBarShortcut}
${EndIf}
${MigrateTaskBarShortcut}

; Update the name/icon/AppModelID of our shortcuts as needed, then update the
; lastwritetime of the Start Menu shortcut to clear the tile icon cache.
Expand Down Expand Up @@ -1290,6 +1281,28 @@ ${RemoveDefaultBrowserAgentShortcut}
${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 a particular
; registry value, so that we don't continue to do this repeatedly.
ClearErrors
ReadRegDWORD $2 HKCU \
"Software\Mozilla\${AppName}\Installer\$AppUserModelID" \
"WasPinnedToTaskbar"
${If} ${Errors}
WriteRegDWORD HKCU \
"Software\Mozilla\${AppName}\Installer\$AppUserModelID" \
"WasPinnedToTaskbar" 1
${If} $AddTaskbarSC != "0"
${PinToTaskBar}
${EndIf}
${EndIf}
${EndIf}
${EndIf}
${EndIf}
!macroend
Expand Down Expand Up @@ -1356,22 +1369,17 @@ ${RemoveDefaultBrowserAgentShortcut}
; Pin the shortcut to the TaskBar. 5386 is the shell32.dll
; resource id for the "Pin to Taskbar" string.
InvokeShellVerb::DoIt "$SMPROGRAMS" "$1" "5386"
${ElseIf} ${AtMostWaaS} 1809
${Else}
; In Windows 10 the "Pin to Taskbar" resource was removed, so we
; can't access the verb that way anymore. We have a create a
; command key using the GUID that's assigned to this action and
; then invoke that as a verb. This works up until build 1809
; then invoke that as a verb.
ReadRegStr $R9 HKLM \
"Software\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\Windows.taskbarpin" \
"ExplorerCommandHandler"
WriteRegStr HKCU "Software\Classes\*\shell\${AppRegName}-$AppUserModelID" "ExplorerCommandHandler" $R9
InvokeShellVerb::DoIt "$SMPROGRAMS" "$1" "${AppRegName}-$AppUserModelID"
DeleteRegKey HKCU "Software\Classes\*\shell\${AppRegName}-$AppUserModelID"
${Else}
; In the Windows 10 1903 and up (and Windows 11) the above no
; longer works. We have yet another method for these versions
; which is detailed in the PinToTaskbar plugin code.
PinToTaskbar::Pin "$SMPROGRAMS\$1"
${EndIf}

; Delete the shortcut if it was created
Expand Down
6 changes: 3 additions & 3 deletions browser/locales/en-US/installer/custom.properties
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ SUMMARY_UPGRADE_CLICK=Click Upgrade to continue.
SURVEY_TEXT=&Tell us what you thought of $BrandShortName
LAUNCH_TEXT=&Launch $BrandShortName now
CREATE_ICONS_DESC=Create icons for $BrandShortName:
ICONS_DESKTOP=On my &desktop
ICONS_STARTMENU=In my &Start menu Programs folder
ICONS_TASKBAR=On my &taskbar
ICONS_DESKTOP=On my &Desktop
ICONS_STARTMENU=In my &Start Menu Programs folder
ICONS_QUICKLAUNCH=In my &Quick Launch bar
WARN_MANUALLY_CLOSE_APP_INSTALL=$BrandShortName must be closed to proceed with the installation.\n\nPlease close $BrandShortName to continue.
WARN_MANUALLY_CLOSE_APP_UNINSTALL=$BrandShortName must be closed to proceed with the uninstall.\n\nPlease close $BrandShortName to continue.
WARN_MANUALLY_CLOSE_APP_REFRESH=$BrandShortName must be closed to proceed with the refresh.\n\nPlease close $BrandShortName to continue.
Expand Down
150 changes: 0 additions & 150 deletions other-licenses/nsis/Contrib/PinToTaskbar/PinToTaskbar.cpp

This file was deleted.

31 changes: 0 additions & 31 deletions other-licenses/nsis/Contrib/PinToTaskbar/PinToTaskbar.sln

This file was deleted.

Loading

0 comments on commit 45ecfdf

Please sign in to comment.