2012-06-13 19:06:27 +00:00
;
2022-06-02 22:07:09 +00:00
; uninstall-wireshark.nsi
2012-06-13 19:06:27 +00:00
;
; Create an installer that only writes an uninstaller.
2019-07-27 07:54:44 +00:00
; https://nsis.sourceforge.io/Signing_an_Uninstaller
2012-06-13 19:06:27 +00:00
2022-06-02 22:07:09 +00:00
!include "wireshark-common.nsh"
2012-06-14 18:53:55 +00:00
!include 'LogicLib.nsh'
2015-10-07 21:27:17 +00:00
!include x64.nsh
!include "StrFunc.nsh"
${UnStrRep}
2012-06-14 18:53:55 +00:00
2012-06-13 19:06:27 +00:00
SetCompress off
2022-06-02 22:07:09 +00:00
OutFile "${STAGING_DIR}\uninstall_wireshark_installer.exe"
2012-06-13 19:06:27 +00:00
2018-11-29 01:08:27 +00:00
InstType "un.Default (keep Personal Settings and Npcap)"
2012-06-13 19:06:27 +00:00
InstType "un.All (remove all)"
; Uninstaller icon
2022-03-09 03:36:20 +00:00
UninstallIcon "..\..\resources\icons\wiresharkinst.ico"
2012-06-13 19:06:27 +00:00
!include "MUI.nsh"
2022-03-09 03:36:20 +00:00
!define MUI_UNICON "..\..\resources\icons\wiresharkinst.ico"
2012-06-14 18:53:55 +00:00
; Uninstall stuff (NSIS 2.08: "\r\n" don't work here)
2012-10-16 14:03:42 +00:00
!define MUI_UNCONFIRMPAGE_TEXT_TOP "The following ${PROGRAM_NAME} installation will be removed. Click 'Next' to continue."
2012-06-14 18:53:55 +00:00
; Uninstall stuff (this text isn't used with the MODERN_UI!)
2012-10-16 14:03:42 +00:00
;UninstallText "This will uninstall ${PROGRAM_NAME}.\r\nBefore starting the uninstallation, make sure ${PROGRAM_NAME} is not running.\r\nClick 'Next' to continue."
2012-06-14 18:53:55 +00:00
!define MUI_UNFINISHPAGE_NOAUTOCLOSE
2021-09-03 20:59:34 +00:00
!define MUI_WELCOMEPAGE_TITLE_3LINES
!define MUI_FINISHPAGE_TITLE_3LINES
2012-06-14 18:53:55 +00:00
2012-06-13 19:06:27 +00:00
!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_COMPONENTS
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH
!insertmacro MUI_LANGUAGE "English"
; ============================================================================
; Section macros
; ============================================================================
!include "Sections.nsh"
; ============================================================================
; Uninstall page configuration
; ============================================================================
ShowUninstDetails show
; ============================================================================
; Functions and macros
; ============================================================================
Function .onInit
2012-06-14 19:49:57 +00:00
; MUST be the absolute path to our staging directory.
2015-01-06 23:07:50 +00:00
WriteUninstaller "${STAGING_DIR}\${UNINSTALLER_NAME}"
2012-06-13 19:06:27 +00:00
SetErrorLevel 0
Quit
FunctionEnd
Var EXTENSION
Function un.Disassociate
2022-06-03 17:09:40 +00:00
Push $R0
2012-06-13 19:06:27 +00:00
!insertmacro PushFileExtensions
2022-06-03 17:09:40 +00:00
Pop $EXTENSION
${DoUntil} $EXTENSION == ${FILE_EXTENSION_MARKER}
ReadRegStr $R0 HKCR $EXTENSION ""
StrCmp $R0 ${WIRESHARK_ASSOC} un.Disassociate.doDeregister
Goto un.Disassociate.end
2012-06-13 19:06:27 +00:00
un.Disassociate.doDeregister:
2022-06-03 17:09:40 +00:00
; The extension is associated with Wireshark so, we must destroy this!
DeleteRegKey HKCR $EXTENSION
DetailPrint "Deregistered file type: $EXTENSION"
2012-06-13 19:06:27 +00:00
un.Disassociate.end:
2022-06-03 17:09:40 +00:00
Pop $EXTENSION
${Loop}
2012-06-13 19:06:27 +00:00
2022-06-03 17:09:40 +00:00
Pop $R0
2012-06-13 19:06:27 +00:00
FunctionEnd
Section "-Required"
SectionEnd
2013-02-20 23:59:49 +00:00
!define EXECUTABLE_MARKER "EXECUTABLE_MARKER"
Var EXECUTABLE
2015-10-07 21:27:17 +00:00
Section /o "Un.USBPcap" un.SecUSBPcap
;-------------------------------------------
SectionIn 2
${If} ${RunningX64}
${DisableX64FSRedirection}
SetRegView 64
${EndIf}
ReadRegStr $1 HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\USBPcap" "UninstallString"
${If} ${RunningX64}
${EnableX64FSRedirection}
SetRegView 32
${EndIf}
${If} $1 != ""
${UnStrRep} $2 '$1' '\Uninstall.exe' ''
${UnStrRep} $3 '$2' '"' ''
ExecWait '$1 _?=$3' $0
DetailPrint "USBPcap uninstaller returned $0"
${If} $0 == "0"
Delete "$3\Uninstall.exe"
Delete "$INSTDIR\extcap\USBPcapCMD.exe"
${EndIf}
${EndIf}
ClearErrors
SectionEnd
2012-06-13 19:06:27 +00:00
Section "Uninstall" un.SecUinstall
;-------------------------------------------
;
; UnInstall for every user
;
SectionIn 1 2
SetShellVarContext all
2013-02-20 23:59:49 +00:00
!insertmacro IsWiresharkRunning
Push "${EXECUTABLE_MARKER}"
2018-02-09 01:20:26 +00:00
Push "${PROGRAM_NAME}"
Push "capinfos"
2021-10-13 17:32:26 +00:00
Push "captype"
2018-02-09 01:20:26 +00:00
Push "dftest"
2013-02-20 23:59:49 +00:00
Push "dumpcap"
Push "editcap"
Push "mergecap"
2019-01-11 21:13:48 +00:00
Push "randpkt"
2013-02-20 23:59:49 +00:00
Push "rawshark"
2018-02-09 01:20:26 +00:00
Push "reordercap"
Push "text2pcap"
Push "tshark"
2013-02-20 23:59:49 +00:00
2018-03-06 23:29:34 +00:00
!ifdef MMDBRESOLVE_EXE
Push "mmdbresolve"
!endif
2013-02-20 23:59:49 +00:00
Pop $EXECUTABLE
${DoUntil} $EXECUTABLE == ${EXECUTABLE_MARKER}
2022-06-03 17:09:40 +00:00
; IsWiresharkRunning should make sure everything is closed down so we *shouldn't* run
; into any problems here.
Delete "$INSTDIR\$EXECUTABLE.exe"
IfErrors 0 deletionSuccess
MessageBox MB_OK "$EXECUTABLE.exe could not be removed. Is it in use?" /SD IDOK IDOK 0
Abort "$EXECUTABLE.exe could not be removed. Aborting the uninstall process."
2013-02-20 23:59:49 +00:00
deletionSuccess:
2022-06-03 17:09:40 +00:00
Pop $EXECUTABLE
2013-02-20 23:59:49 +00:00
${Loop}
2012-06-13 19:06:27 +00:00
2012-10-16 14:03:42 +00:00
DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}"
DeleteRegKey HKEY_LOCAL_MACHINE "Software\${PROGRAM_NAME}"
DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\${PROGRAM_NAME}.exe"
2012-06-13 19:06:27 +00:00
Call un.Disassociate
DeleteRegKey HKCR ${WIRESHARK_ASSOC}
DeleteRegKey HKCR "${WIRESHARK_ASSOC}\Shell\open\command"
DeleteRegKey HKCR "${WIRESHARK_ASSOC}\DefaultIcon"
2014-07-30 16:33:43 +00:00
Delete "$INSTDIR\*.dll"
Delete "$INSTDIR\*.exe"
Delete "$INSTDIR\*.html"
Delete "$INSTDIR\*.qm"
Delete "$INSTDIR\accessible\*.*"
Delete "$INSTDIR\AUTHORS-SHORT"
Delete "$INSTDIR\COPYING*"
2015-10-03 10:04:56 +00:00
Delete "$INSTDIR\audio\*.*"
Delete "$INSTDIR\bearer\*.*"
2014-07-30 16:33:43 +00:00
Delete "$INSTDIR\diameter\*.*"
2015-04-08 14:09:03 +00:00
Delete "$INSTDIR\extcap\androiddump.*"
2022-10-26 16:07:24 +00:00
Delete "$INSTDIR\extcap\ciscodump.*"
Delete "$INSTDIR\extcap\etwdump.*"
2015-11-05 17:31:11 +00:00
Delete "$INSTDIR\extcap\randpktdump.*"
2015-11-24 22:03:13 +00:00
Delete "$INSTDIR\extcap\sshdump.*"
2016-09-16 18:59:06 +00:00
Delete "$INSTDIR\extcap\udpdump.*"
2022-03-08 21:38:13 +00:00
Delete "$INSTDIR\extcap\wifidump.*"
2022-07-27 19:47:13 +00:00
Delete "$INSTDIR\gpl-2.0-standalone.html"
2022-07-27 12:05:08 +00:00
Delete "$INSTDIR\Acknowledgements.md"
2014-07-30 16:33:43 +00:00
Delete "$INSTDIR\help\*.*"
Delete "$INSTDIR\iconengines\*.*"
Delete "$INSTDIR\imageformats\*.*"
2015-10-03 10:04:56 +00:00
Delete "$INSTDIR\mediaservice\*.*"
2022-09-07 22:14:45 +00:00
Delete "$INSTDIR\networkinformation\*.*"
2014-07-30 16:33:43 +00:00
Delete "$INSTDIR\platforms\*.*"
2015-10-03 10:04:56 +00:00
Delete "$INSTDIR\playlistformats\*.*"
2014-07-30 16:33:43 +00:00
Delete "$INSTDIR\printsupport\*.*"
2012-10-14 18:42:02 +00:00
Delete "$INSTDIR\share\glib-2.0\schemas\*.*"
2012-06-13 19:06:27 +00:00
Delete "$INSTDIR\snmp\*.*"
2014-07-30 16:33:43 +00:00
Delete "$INSTDIR\snmp\mibs\*.*"
2020-06-04 18:50:27 +00:00
Delete "$INSTDIR\styles\translations\*.*"
2020-06-10 21:27:45 +00:00
Delete "$INSTDIR\styles\*.*"
2021-04-10 18:15:34 +00:00
Delete "$INSTDIR\protobuf\*.*"
2022-09-07 22:14:45 +00:00
Delete "$INSTDIR\tls\*.*"
2012-06-13 19:06:27 +00:00
Delete "$INSTDIR\tpncp\*.*"
2015-07-15 19:32:44 +00:00
Delete "$INSTDIR\translations\*.*"
2012-06-13 19:06:27 +00:00
Delete "$INSTDIR\ui\*.*"
Delete "$INSTDIR\wimaxasncp\*.*"
Delete "$INSTDIR\ws.css"
; previous versions installed these files
Delete "$INSTDIR\*.manifest"
; previous versions installed this file
Delete "$INSTDIR\AUTHORS-SHORT-FORMAT"
Delete "$INSTDIR\README*"
Delete "$INSTDIR\NEWS.txt"
Delete "$INSTDIR\manuf"
2017-07-20 01:32:40 +00:00
Delete "$INSTDIR\wka"
2012-06-13 19:06:27 +00:00
Delete "$INSTDIR\services"
Delete "$INSTDIR\pdml2html.xsl"
Delete "$INSTDIR\pcrepattern.3.txt"
Delete "$INSTDIR\user-guide.chm"
Delete "$INSTDIR\example_snmp_users_file"
Re-implement "Map" feature for Endpoints
This feature was removed in v2.5.1rc0-427-gf529ab5d0a, anticipating that
MaxMind would remove support for it in 2019. They have however changed
their mind and maintained latitude and longitude information.
They recommend displaying an accuracy radius, but the reported values
are 50, 100, 200 and 1000km. When implemented literally, a marker in
Ireland would cover the whole island plus mainland, so I have instead
opted to use a fixed radius of 1km at deeper zoom levels.
The old ipmap.html file was outdated and had broken tiles, I rewrote a
new one from scratch using the light-weight Leaflet library combined
with tiles from OpenStreetMap. This is more mobile-friendly and secure
(https, SRI). To improve handling of nearby or overlapping nodes,
clustering is used (individual nodes can still be inspected).
Browser compatibility results: IE8 is unusable, IE9 partially works
(tooltips sometimes disappear and the cluster radius control is gone),
IE11 works. Of course Firefox 65 and Chromium 72 have no issues.
The map popup description in the generated GeoJSON structure is now
split in several properties, allowing presentation to be handled by the
HTML page instead of the C code.
Bug: 14693
Change-Id: If2ec9c518f7723ac0ab27b6272463356875a0ff2
Reviewed-on: https://code.wireshark.org/review/31952
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-02-09 23:19:54 +00:00
Delete "$INSTDIR\ipmap.html"
2012-06-13 19:06:27 +00:00
Delete "$INSTDIR\radius\*.*"
Delete "$INSTDIR\dtds\*.*"
2018-05-11 18:00:27 +00:00
2015-03-24 21:44:13 +00:00
RMDir "$INSTDIR\accessible"
2015-10-03 10:04:56 +00:00
RMDir "$INSTDIR\audio"
RMDir "$INSTDIR\bearer"
2015-04-08 14:09:03 +00:00
RMDir "$INSTDIR\extcap"
2015-03-24 21:44:13 +00:00
RMDir "$INSTDIR\iconengines"
RMDir "$INSTDIR\imageformats"
2015-10-03 10:04:56 +00:00
RMDir "$INSTDIR\mediaservice"
2022-09-07 22:14:45 +00:00
RMDir "$INSTDIR\networkinformation"
2015-03-24 21:44:13 +00:00
RMDir "$INSTDIR\platforms"
2015-10-03 10:04:56 +00:00
RMDir "$INSTDIR\playlistformats"
2015-03-24 21:44:13 +00:00
RMDir "$INSTDIR\printsupport"
2020-06-10 21:27:45 +00:00
RMDir "$INSTDIR\styles\translations"
2018-08-06 14:25:05 +00:00
RMDir "$INSTDIR\styles"
2012-10-16 14:03:42 +00:00
RMDir "$SMPROGRAMS\${PROGRAM_NAME}"
2012-06-13 19:06:27 +00:00
RMDir "$INSTDIR\help"
2022-01-24 03:13:32 +00:00
RMDir /r "$INSTDIR\Wireshark User's Guide"
2012-06-13 19:06:27 +00:00
RMDir "$INSTDIR\diameter"
RMDir "$INSTDIR\snmp\mibs"
RMDir "$INSTDIR\snmp"
RMDir "$INSTDIR\radius"
RMDir "$INSTDIR\dtds"
2021-04-10 18:15:34 +00:00
RMDir "$INSTDIR\protobuf"
2022-09-07 22:14:45 +00:00
RMDir "$INSTDIR\tls"
2012-06-13 19:06:27 +00:00
RMDir "$INSTDIR\tpncp"
2015-07-15 19:32:44 +00:00
RMDir "$INSTDIR\translations"
2012-06-13 19:06:27 +00:00
RMDir "$INSTDIR\ui"
RMDir "$INSTDIR\wimaxasncp"
RMDir "$INSTDIR"
SectionEnd ; "Uinstall"
Section "Un.Plugins" un.SecPlugins
;-------------------------------------------
SectionIn 1 2
;Delete "$INSTDIR\plugins\${VERSION}\*.*"
;Delete "$INSTDIR\plugins\*.*"
;RMDir "$INSTDIR\plugins\${VERSION}"
;RMDir "$INSTDIR\plugins"
RMDir /r "$INSTDIR\plugins"
SectionEnd
2013-05-01 22:22:10 +00:00
Section "Un.Global Profiles" un.SecProfiles
2013-05-01 22:06:49 +00:00
;-------------------------------------------
SectionIn 1 2
RMDir /r "$INSTDIR\profiles"
SectionEnd
2012-06-13 19:06:27 +00:00
Section "Un.Global Settings" un.SecGlobalSettings
;-------------------------------------------
SectionIn 1 2
Delete "$INSTDIR\cfilters"
Delete "$INSTDIR\colorfilters"
Delete "$INSTDIR\dfilters"
2017-07-13 20:03:13 +00:00
Delete "$INSTDIR\enterprises.tsv"
2012-06-13 19:06:27 +00:00
Delete "$INSTDIR\init.lua"
Delete "$INSTDIR\console.lua"
Delete "$INSTDIR\dtd_gen.lua"
Delete "$INSTDIR\smi_modules"
RMDir "$INSTDIR"
SectionEnd
Section /o "Un.Personal Settings" un.SecPersonalSettings
;-------------------------------------------
SectionIn 2
SetShellVarContext current
2012-10-16 14:03:42 +00:00
Delete "$APPDATA\${PROGRAM_NAME}\*.*"
RMDir "$APPDATA\${PROGRAM_NAME}"
2013-03-05 18:46:50 +00:00
DeleteRegKey HKCU "Software\${PROGRAM_NAME}"
2012-06-13 19:06:27 +00:00
SectionEnd
2018-11-29 01:08:27 +00:00
;VAR un.NPCAP_UNINSTALL
2012-06-13 19:06:27 +00:00
2018-11-29 01:08:27 +00:00
Section /o "Un.Npcap" un.SecNpcap
2012-06-13 19:06:27 +00:00
;-------------------------------------------
SectionIn 2
2018-11-29 01:08:27 +00:00
ReadRegStr $1 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\NpcapInst" "UninstallString"
;IfErrors un.lbl_npcap_notinstalled ;if RegKey is unavailable, Npcap is not installed
2015-08-22 18:08:31 +00:00
${If} $1 != ""
2022-06-03 17:09:40 +00:00
;MessageBox MB_OK "Npcap $1" /SD IDOK
ExecWait '$1' $0
DetailPrint "Npcap uninstaller returned $0"
;SetRebootFlag true
2015-08-22 18:08:31 +00:00
${EndIf}
2018-11-29 01:08:27 +00:00
;un.lbl_npcap_notinstalled:
2012-06-13 19:06:27 +00:00
SectionEnd
Section "-Un.Finally"
;-------------------------------------------
SectionIn 1 2
2013-06-06 18:46:37 +00:00
!insertmacro UpdateIcons
2012-06-13 19:06:27 +00:00
; this test must be done after all other things uninstalled (e.g. Global Settings)
IfFileExists "$INSTDIR" 0 NoFinalErrorMsg
2013-03-08 18:23:58 +00:00
MessageBox MB_OK "Unable to remove $INSTDIR." /SD IDOK IDOK 0 ; skipped if dir doesn't exist
2012-06-13 19:06:27 +00:00
NoFinalErrorMsg:
SectionEnd
!insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
2022-06-03 17:09:40 +00:00
!insertmacro MUI_DESCRIPTION_TEXT ${un.SecUinstall} "Uninstall all ${PROGRAM_NAME} components."
!insertmacro MUI_DESCRIPTION_TEXT ${un.SecPlugins} "Uninstall all Plugins (even from previous ${PROGRAM_NAME} versions)."
!insertmacro MUI_DESCRIPTION_TEXT ${un.SecProfiles} "Uninstall all global configuration profiles."
!insertmacro MUI_DESCRIPTION_TEXT ${un.SecGlobalSettings} "Uninstall global settings like: $INSTDIR\cfilters"
!insertmacro MUI_DESCRIPTION_TEXT ${un.SecPersonalSettings} "Uninstall personal settings like your preferences file from your profile: $PROFILE."
!insertmacro MUI_DESCRIPTION_TEXT ${un.SecNpcap} "Call Npcap's uninstall program."
!insertmacro MUI_DESCRIPTION_TEXT ${un.SecUSBPcap} "Call USBPcap's uninstall program."
2012-06-13 19:06:27 +00:00
!insertmacro MUI_UNFUNCTION_DESCRIPTION_END