FunctionEnd
Var OLD_UNINSTALLER
+Var OLD_INSTDIR
Var OLD_DISPLAYNAME
+Var TMP_UNINSTALLER
Function .onInit
; Copied from http://nsis.sourceforge.net/Auto-uninstall_old_before_installing_new
ReadRegStr $OLD_UNINSTALLER HKLM \
- "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" \
- "UninstallString"
+ "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" \
+ "UninstallString"
StrCmp $OLD_UNINSTALLER "" done
+ ReadRegStr $OLD_INSTDIR HKLM \
+ "Software\Microsoft\Windows\CurrentVersion\App Paths\wireshark.exe" \
+ "Path"
+ StrCmp $OLD_INSTDIR "" done
+
ReadRegStr $OLD_DISPLAYNAME HKLM \
- "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" \
- "DisplayName"
+ "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" \
+ "DisplayName"
StrCmp $OLD_DISPLAYNAME "" done
- MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \
- "$OLD_DISPLAYNAME is already installed. $\n$\nClick `OK` to remove it \
- or `Cancel` to cancel this upgrade." \
- IDOK uninst
+ MessageBox MB_YESNOCANCEL|MB_ICONQUESTION \
+ "$OLD_DISPLAYNAME is already installed.\
+ $\n$\nWould you like to uninstall it first?" \
+ IDYES uninst \
+ IDNO done
Abort
-;Run the uninstaller
+; Copy the uninstaller to $TEMP and run it.
+; The uninstaller normally does this by itself, but doesn't wait around
+; for the executable to finish, which means ExecWait won't work correctly.
uninst:
ClearErrors
- ExecWait $OLD_UNINSTALLER
+ StrCpy $TMP_UNINSTALLER "$TEMP\wireshark_uninstaller.exe"
+ ; ...because we surround UninstallString in quotes.
+ StrCpy $0 $OLD_UNINSTALLER -1 1
+ StrCpy $1 "$TEMP\wireshark_uninstaller.exe"
+ StrCpy $2 1
+ System::Call 'kernel32::CopyFile(t r0, t r1, b r2) 1'
+ ExecWait "$TMP_UNINSTALLER _?=$OLD_INSTDIR"
+ Delete "$TMP_UNINSTALLER"
done:
;Extract InstallOptions INI files
!ifdef SMI_DIR
File "${SMI_DIR}\lib\smi.dll"
!endif
-File "..\..\FAQ"
File "..\..\README"
File "..\..\README.win32"
File "..\..\AUTHORS-SHORT"
;IfFileExists dfilters dont_overwrite_dfilters
File "..\..\dfilters"
;dont_overwrite_dfilters:
-;IfFileExists dfilters dont_overwrite_smi_modules
+;IfFileExists smi_modules dont_overwrite_smi_modules
File "..\..\smi_modules"
;dont_overwrite_smi_modules:
File "..\..\radius\dictionary.altiga"
File "..\..\radius\dictionary.aptis"
File "..\..\radius\dictionary.ascend"
+File "..\..\radius\dictionary.aruba"
File "..\..\radius\dictionary.bay"
File "..\..\radius\dictionary.bintec"
File "..\..\radius\dictionary.bristol"
ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 2" "State"
StrCmp $0 "0" SecRequired_skip_StartMenu
SetOutPath $PROFILE
-CreateDirectory "$SMPROGRAMS\Wireshark"
+;CreateDirectory "$SMPROGRAMS\Wireshark"
; To qoute "http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwue/html/ch11d.asp":
; "Do not include Readme, Help, or Uninstall entries on the Programs menu."
Delete "$SMPROGRAMS\Wireshark\Wireshark Web Site.lnk"
;WriteINIStr "$SMPROGRAMS\Wireshark\Wireshark Web Site.url" "InternetShortcut" "URL" "http://www.wireshark.org/"
-CreateShortCut "$SMPROGRAMS\Wireshark\Wireshark.lnk" "$INSTDIR\wireshark.exe" "" "$INSTDIR\wireshark.exe" 0 "" "" "The Wireshark Network Protocol Analyzer"
+CreateShortCut "$SMPROGRAMS\Wireshark.lnk" "$INSTDIR\wireshark.exe" "" "$INSTDIR\wireshark.exe" 0 "" "" "The Wireshark Network Protocol Analyzer"
;CreateShortCut "$SMPROGRAMS\Wireshark\Wireshark Manual.lnk" "$INSTDIR\wireshark.html"
;CreateShortCut "$SMPROGRAMS\Wireshark\Display Filters Manual.lnk" "$INSTDIR\wireshark-filter.html"
-CreateShortCut "$SMPROGRAMS\Wireshark\Wireshark Program Directory.lnk" \
- "$INSTDIR"
+;CreateShortCut "$SMPROGRAMS\Wireshark\Wireshark Program Directory.lnk" "$INSTDIR"
;CreateShortCut "$SMPROGRAMS\Wireshark\Uninstall Wireshark.lnk" "$INSTDIR\uninstall.exe"
SecRequired_skip_StartMenu:
File "${GTK_DIR}\etc\gtk-2.0\*.*"
SetOutPath $INSTDIR\etc\pango
File "${GTK_DIR}\etc\pango\pango.*"
+SetOutPath $INSTDIR\lib\gtk-2.0\${GTK_LIB_DIR}\loaders
+File "${GTK_DIR}\lib\gtk-2.0\${GTK_LIB_DIR}\loaders\libpixbufloader-*.dll"
SetOutPath $INSTDIR\lib\gtk-2.0\${GTK_LIB_DIR}\engines
File "${GTK_DIR}\lib\gtk-2.0\${GTK_LIB_DIR}\engines\libpixmap.dll"
SetOutPath $INSTDIR\lib\gtk-2.0\modules
; previous versions installed this file
Delete "$INSTDIR\AUTHORS-SHORT-FORMAT"
Delete "$INSTDIR\README*"
-Delete "$INSTDIR\FAQ"
Delete "$INSTDIR\NEWS.txt"
Delete "$INSTDIR\manuf"
Delete "$INSTDIR\services"
Delete "$INSTDIR\radius\*.*"
Delete "$INSTDIR\dtds\*.*"
Delete "$SMPROGRAMS\Wireshark\*.*"
+Delete "$SMPROGRAMS\Wireshark.lnk"
Delete "$DESKTOP\Wireshark.lnk"
Delete "$QUICKLAUNCH\Wireshark.lnk"
; (we use the "all users" start menu, so select it first)
SetShellVarContext all
IfFileExists "$SMPROGRAMS\Wireshark\Wireshark.lnk" lbl_have_startmenu
+ IfFileExists "$SMPROGRAMS\Wireshark.lnk" lbl_have_startmenu
WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 2" "State" "0"
lbl_have_startmenu: