Bug 1538249 - Support pinning to the taskbar on Windows 10. r=agashlin
authorMatt Howell <mhowell@mozilla.com>
Mon, 15 Oct 2018 08:13:12 -0700
changeset 470283 8c09cf1ee1e5321cb042554c088bef563b328d12
parent 470282 590157f23b85a1cfcd6d3e910fbf4baefec5f3c6
child 470284 0a223da4c1e482cff28ae415e52ef50853b85ff3
push id35892
push userrgurzau@mozilla.com
push dateSat, 20 Apr 2019 09:55:32 +0000
treeherdermozilla-central@a092972b53f0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersagashlin
bugs1538249
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 1538249 - Support pinning to the taskbar on Windows 10. r=agashlin
browser/installer/windows/nsis/shared.nsh
other-licenses/nsis/Plugins/InvokeShellVerb.dll
--- a/browser/installer/windows/nsis/shared.nsh
+++ b/browser/installer/windows/nsis/shared.nsh
@@ -1187,19 +1187,32 @@
             ; assume that unpinning unpinned a side by side installation from
             ; the Start Menu and pin this installation to the Start Menu.
             ${Unless} $R8 == $R9
               ; Pin the shortcut to the Start Menu. 5381 is the shell32.dll
               ; resource id for the "Pin to Start Menu" string.
               InvokeShellVerb::DoIt "$SMPROGRAMS" "$1" "5381"
             ${EndUnless}
 
-            ; Pin the shortcut to the TaskBar. 5386 is the shell32.dll resource
-            ; id for the "Pin to Taskbar" string.
-            InvokeShellVerb::DoIt "$SMPROGRAMS" "$1" "5386"
+            ${If} ${AtMostWin2012R2}
+              ; Pin the shortcut to the TaskBar. 5386 is the shell32.dll
+              ; resource id for the "Pin to Taskbar" string.
+              InvokeShellVerb::DoIt "$SMPROGRAMS" "$1" "5386"
+            ${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.
+              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"
+            ${EndIf}
 
             ; Delete the shortcut if it was created
             ${If} "$8" == "true"
               Delete "$SMPROGRAMS\$1"
             ${EndIf}
           ${EndIf}
 
           ${If} $TmpVal == "HKCU"
index 36aded09f5f181fcc38f679a68060d512e6a1842..e1eab1bbca9ca7dd6213e323fd4778039d52455c
GIT binary patch
literal 4096
zc%1E5e{2(V6o1|7C{VT<TEia%Z)6%wu-<z32Mm+JcEEJVtzEkz6z$rBcHVl+^@<yT
zWHPGM(#1cJe=sC47mb?vBcdQNX+Q-MF>0onKSCtVrE`mxWHAe?p6~m;>(&SXVhH}T
z*L?52@8^BK@B7}n`|fU=pL!We0l<ty(*RC^F12uL8OBk5|HtL<!Td{=r%a8PDx1TR
z7}Kf9yOcl&6AVP7vdXlHj1rGBktkEY#lv*SA<?;L(Sj-?#`v`}C*L{x?Py_4pZaxl
z5VdspB|{$^eVzJ-M$e$$c;GU{Hy-$U^exoxNH9#+{W~{-2WT{zA^q9NwgUDulvge^
zmFdM=bZpsTyx4FsbZVn^iB18S)ga7HN(?IH&S+f;%K@H1-G%YGZq__(aO-XK_&Q;3
zzRszNT`KAiOO1rgP*lWBh-aKiD4+%aj+W>^aZid;taa)%7$N`*dhyolcp0Z6N^%h3
z8v~%c^6Pl(Z(ZP=+)eSOCZ3<L&I3sCR!{#07Hlcr-v0&Fw*IeB`_hU0HBD;~vg8j%
zB2$sLg7-F^n4HoyAv;l`W0xpq{)=G426mcY{7Cx(LHBS!3Q7ND(m#^)Ta*4=(r-`t
zr;>hK_Baxgd_KjG^nPlsIj64Mxq3-_ZTMZ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