I suspect "ie4uinit" got its name because "mysterious useful undocumented
authorGerald Combs <gerald@wireshark.org>
Thu, 6 Jun 2013 18:46:37 +0000 (18:46 -0000)
committerGerald Combs <gerald@wireshark.org>
Thu, 6 Jun 2013 18:46:37 +0000 (18:46 -0000)
system utility" would have been too obvious. Have UpdateIcons call
"ie4uinit -ClearIconCache" and move UpdateIcons to the "-{,Un.}Finally"
sections in the installer and uninstaller.

svn path=/trunk/; revision=49811

packaging/nsis/common.nsh
packaging/nsis/uninstall.nsi
packaging/nsis/wireshark.nsi

index b05449aea25f03377621507a798b4d35672f4eef..ee2f373c02add8a614fbc650b02069605cc98663 100755 (executable)
@@ -61,6 +61,11 @@ UpdateIcons.quit_${UPDATEICONS_UNIQUE}:
     Pop $R1
     Pop $R0
 
+; Force the icon cache to refresh
+; http://superuser.com/questions/499078/refresh-icon-cache-without-rebooting
+IfFileExists "$SYSDIR\ie4uinit.exe" 0 +2
+Exec '"$SYSDIR\ie4uinit.exe" -ClearIconCache'
+
 !macroend
 
 ; ============================================================================
index 2de9e610b3a21d0d3f28d62cdecf955d54fdc903..22ae242d791d6ad7d8d16e0810759da48be21ee8 100755 (executable)
@@ -133,7 +133,6 @@ Call un.Disassociate
 DeleteRegKey HKCR ${WIRESHARK_ASSOC}
 DeleteRegKey HKCR "${WIRESHARK_ASSOC}\Shell\open\command"
 DeleteRegKey HKCR "${WIRESHARK_ASSOC}\DefaultIcon"
-!insertmacro UpdateIcons
 
 Delete "$INSTDIR\etc\gtk-2.0\*.*"
 Delete "$INSTDIR\etc\gtk-3.0\*.*"
@@ -285,6 +284,9 @@ SectionEnd
 Section "-Un.Finally"
 ;-------------------------------------------
 SectionIn 1 2
+
+!insertmacro UpdateIcons
+
 ; this test must be done after all other things uninstalled (e.g. Global Settings)
 IfFileExists "$INSTDIR" 0 NoFinalErrorMsg
     MessageBox MB_OK "Unable to remove $INSTDIR." /SD IDOK IDOK 0 ; skipped if dir doesn't exist
index 1c537c54df0068b328d4a18d55b0dce8236f9014..9d6c5591344b9155d26cad2eb30c284ce23448ee 100644 (file)
@@ -717,11 +717,10 @@ WriteRegStr HKCR ${WIRESHARK_ASSOC} "" "Wireshark capture file"
 WriteRegStr HKCR "${WIRESHARK_ASSOC}\Shell\open\command" "" '"$INSTDIR\${PROGRAM_NAME}.exe" "%1"'
 WriteRegStr HKCR "${WIRESHARK_ASSOC}\DefaultIcon" "" '"$INSTDIR\${PROGRAM_NAME}.exe",1'
 
-
+; We refresh the icon cache down in -Finally.
 Call Associate
 ; if somethings added here, add it also to the uninstall section and the AdditionalTask page
 
-!insertmacro UpdateIcons
 SecRequired_skip_FileExtensions:
 
 ; if running as a silent installer, don't try to install winpcap
@@ -968,6 +967,8 @@ SectionEnd
 
 Section "-Finally"
 
+!insertmacro UpdateIcons
+
 ; Compute and write the installation directory size
 ${GetSize} "$INSTDIR" "/S=0K" $0 $1 $2
 IntFmt $0 "0x%08X" $0