Bug 1493597 - Funnelcake 138 / 139 Pinning to Win10 taskbar A/B testing, installer patch, r=agashlin a=release FUNNELCAKE_138_139_BRANCH
authorNick Thomas <nthomas@mozilla.com>
Fri, 09 Nov 2018 16:30:18 +1300
branchFUNNELCAKE_138_139_BRANCH
changeset 492980 b054ab8cb4da
parent 492979 7c2b7d3a4665
push id1848
push usernthomas@mozilla.com
push dateFri, 09 Nov 2018 03:32:34 +0000
treeherdermozilla-release@b054ab8cb4da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersagashlin, release
bugs1493597
milestone63.0.3
Bug 1493597 - Funnelcake 138 / 139 Pinning to Win10 taskbar A/B testing, installer patch, r=agashlin a=release
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
@@ -1172,19 +1172,39 @@
             ; 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.
+              ; !!! For now we're gating this code on an INI option for testing.
+              ; This will be removed for final landing.
+              ClearErrors
+              ReadINIStr $R9 "$EXEDIR\core\distribution\setup.ini" \
+                "Testing" "Win10TaskbarPin"
+              ${IfNot} ${Errors}
+                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}
+            ${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`W0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