Bug 1623676 - Port bug 1466357: Use RefreshShellIcons instead of manually reimplementing it for Windows installer. r=rjl
authorRichard Marti <richard.marti@gmail.com>
Sun, 22 Mar 2020 12:39:06 +0200
changeset 38548 ca55126db32af5036a9242ce93b6e2082bfa9db6
parent 38547 c8aea2febde1ce9fb9ddf30a5fc2fd540d9fa02e
child 38549 c645484f94d2321c325dd8aa3977561ace23b6e0
push id400
push userclokep@gmail.com
push dateMon, 04 May 2020 18:56:09 +0000
reviewersrjl
bugs1623676, 1466357
Bug 1623676 - Port bug 1466357: Use RefreshShellIcons instead of manually reimplementing it for Windows installer. r=rjl
mail/installer/windows/nsis/installer.nsi
mail/installer/windows/nsis/uninstaller.nsi
--- a/mail/installer/windows/nsis/installer.nsi
+++ b/mail/installer/windows/nsis/installer.nsi
@@ -608,31 +608,31 @@ Section "-InstallEndCleanup"
       ${EndIf}
     ${EndIf}
   ${EndUnless}
 
   ; Adds a pinned Task Bar shortcut (see MigrateTaskBarShortcut for details).
   ${MigrateTaskBarShortcut}
 
   ; Refresh desktop icons
-  System::Call "shell32::SHChangeNotify(i 0x08000000, i 0, i 0, i 0)"
+  ${RefreshShellIcons}
 
   ${InstallEndCleanupCommon}
 
   ${If} $PreventRebootRequired == "true"
     SetRebootFlag false
   ${EndIf}
 
   ${If} ${RebootFlag}
     ; Admin is required to delete files on reboot so only add the moz-delete if
     ; the user is an admin. After calling UAC::IsAdmin $0 will equal 1 if the
     ; user is an admin.
     UAC::IsAdmin
     ${If} "$0" == "1"
-      ; When a reboot is required give SHChangeNotify time to finish the
+      ; When a reboot is required give RefreshShellIcons time to finish the
       ; refreshing the icons so the OS doesn't display the icons from helper.exe
       Sleep 10000
       ${LogHeader} "Reboot Required To Finish Installation"
       ; ${FileMainEXE}.moz-upgrade should never exist but just in case...
       ${Unless} ${FileExists} "$INSTDIR\${FileMainEXE}.moz-upgrade"
         Rename "$INSTDIR\${FileMainEXE}" "$INSTDIR\${FileMainEXE}.moz-upgrade"
       ${EndUnless}
 
--- a/mail/installer/windows/nsis/uninstaller.nsi
+++ b/mail/installer/windows/nsis/uninstaller.nsi
@@ -419,17 +419,17 @@ Section "Uninstall"
         FileClose $0
       ${EndUnless}
     ${EndIf}
   ${EndIf}
 
   ; Refresh desktop icons otherwise the start menu internet item won't be
   ; removed and other ugly things will happen like recreation of the app's
   ; clients registry key by the OS under some conditions.
-  System::Call "shell32::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)"
+  ${RefreshShellIcons}
 
 !ifdef MOZ_MAINTENANCE_SERVICE
   ; Get the path the allowed cert is at and remove it
   ; Keep this block of code last since it modifies the reg view
   ServicesHelper::PathToUniqueRegistryPath "$INSTDIR"
   Pop $MaintCertKey
   ${If} $MaintCertKey != ""
     ; Always use the 64bit registry for certs on 64bit systems.