2012-06-13 19:06:27 +00:00
; ============================================================================
; Name and version information
; ============================================================================
2015-01-06 23:07:50 +00:00
!ifdef NSIS_INCLUDE_DIR
!addincludedir ${NSIS_INCLUDE_DIR}
!endif
2015-01-05 20:53:46 +00:00
!include "config.nsh"
2012-06-13 19:06:27 +00:00
!if ${WIRESHARK_TARGET_PLATFORM} == "win32"
!define BITS 32
!else
!define BITS 64
!endif
2016-09-08 18:24:34 +00:00
!define DISPLAY_NAME "${PROGRAM_NAME} ${VERSION} ${BITS}-bit"
2012-06-13 19:06:27 +00:00
Name "${DISPLAY_NAME}"
2018-05-10 00:35:26 +00:00
!define PROGRAM_FULL_NAME "The ${PROGRAM_NAME} Network Protocol Analyzer"
!define PROGRAM_NAME_PATH "${PROGRAM_NAME}.exe"
2014-01-05 17:16:03 +00:00
2012-06-14 18:53:55 +00:00
!define UNINSTALLER_NAME "uninstall.exe"
2012-06-13 19:06:27 +00:00
VIAddVersionKey "ProductName" "${PROGRAM_NAME}"
VIAddVersionKey "Comments" "It's a great product with a great story to tell. I'm pumped!"
VIAddVersionKey "CompanyName" "${PROGRAM_NAME} development team"
2018-03-16 21:19:59 +00:00
; NSIS handles U+00a9 but not a UTF-8 encoded copyright symbol.
VIAddVersionKey "LegalCopyright" "${U+00a9} Gerald Combs and many others"
2012-06-13 19:06:27 +00:00
VIAddVersionKey "LegalTrademarks" "Wireshark and the 'fin' logo are registered trademarks of the Wireshark Foundation"
VIAddVersionKey "FileDescription" "${PROGRAM_NAME} installer for ${BITS}-bit Windows"
VIAddVersionKey "Language" "English"
VIAddVersionKey "ProductVersion" "${PRODUCT_VERSION}"
VIAddVersionKey "FileVersion" "${PRODUCT_VERSION}"
VIProductVersion "${PRODUCT_VERSION}"
XPStyle on
; ============================================================================
; Functions and macros
; ============================================================================
; Used to refresh the display of file association
!define SHCNE_ASSOCCHANGED 0x08000000
!define SHCNF_IDLIST 0
!macro UpdateIcons
2013-02-20 23:59:49 +00:00
Push $R0
Push $R1
Push $R2
2014-08-28 23:48:53 +00:00
2013-02-20 23:59:49 +00:00
!define UPDATEICONS_UNIQUE ${__LINE__}
2014-08-28 23:48:53 +00:00
2013-02-20 23:59:49 +00:00
IfFileExists "$SYSDIR\shell32.dll" UpdateIcons.ok_shell32_${UPDATEICONS_UNIQUE} UpdateIcons.error_shell32_${UPDATEICONS_UNIQUE}
2012-06-13 19:06:27 +00:00
UpdateIcons.ok_shell32_${UPDATEICONS_UNIQUE}:
2013-02-20 23:59:49 +00:00
System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (${SHCNE_ASSOCCHANGED}, ${SHCNF_IDLIST}, 0, 0)'
Goto UpdateIcons.quit_${UPDATEICONS_UNIQUE}
2012-06-13 19:06:27 +00:00
UpdateIcons.error_shell32_${UPDATEICONS_UNIQUE}:
2013-02-20 23:59:49 +00:00
MessageBox MB_OK|MB_ICONSTOP \
"Can't find 'shell32.dll' library. Impossible to update icons" \
/SD IDOK
Goto UpdateIcons.quit_${UPDATEICONS_UNIQUE}
2012-06-13 19:06:27 +00:00
UpdateIcons.quit_${UPDATEICONS_UNIQUE}:
2013-02-20 23:59:49 +00:00
!undef UPDATEICONS_UNIQUE
Pop $R2
Pop $R1
Pop $R0
2012-06-13 19:06:27 +00:00
2013-06-06 18:46:37 +00:00
; Force the icon cache to refresh
2019-07-27 07:54:44 +00:00
; https://superuser.com/questions/499078/refresh-icon-cache-without-rebooting
2013-06-06 18:46:37 +00:00
IfFileExists "$SYSDIR\ie4uinit.exe" 0 +2
Exec '"$SYSDIR\ie4uinit.exe" -ClearIconCache'
2012-06-13 19:06:27 +00:00
!macroend
; ============================================================================
; Push our known file extensions onto the stack, prepended with a marker
; Note that this is a subset of dump_open_table in wiretap/file_access.c. We
; probably don't want to grab JPEG or MP3 files.
; ============================================================================
; Used to add associations between file extensions and Wireshark
!define WIRESHARK_ASSOC "wireshark-capture-file"
!define FILE_EXTENSION_MARKER "FILE_EXTENSION_MARKER"
!macro PushFileExtensions
2013-02-20 23:59:49 +00:00
Push "${FILE_EXTENSION_MARKER}"
Push ".wpz"
Push ".wpc"
Push ".vwr"
Push ".trc"
Push ".trace"
Push ".tr1"
Push ".tpc"
Push ".syc"
Push ".snoop"
Push ".rf5"
Push ".pkt"
2016-05-31 01:45:18 +00:00
Push ".pklg"
2013-02-20 23:59:49 +00:00
Push ".pcapng"
Push ".pcap"
Push ".out"
Push ".ntar"
2016-05-31 01:45:18 +00:00
Push ".mplog"
2017-09-22 12:50:38 +00:00
Push ".lcap"
2016-05-31 01:45:18 +00:00
Push ".ipfix"
2013-02-20 23:59:49 +00:00
Push ".fdc"
Push ".erf"
Push ".enc"
Push ".cap"
Push ".bfr"
Push ".atc"
Push ".apc"
Push ".acp"
Push ".5vw"
!macroend
!macro IsWiresharkRunning
; See if Wireshark is running
2019-07-27 07:54:44 +00:00
; https://nsis.sourceforge.io/Check_whether_your_application_is_running
2013-02-20 23:59:49 +00:00
${Do}
System::Call 'kernel32::OpenMutex(i 0x100000, b 0, t "Global\${PROGRAM_NAME}-is-running-{9CA78EEA-EA4D-4490-9240-FC01FCEF464B}") i .R0'
IntCmp $R0 0 checkRunningSession
System::Call 'kernel32::CloseHandle(i $R0)'
Goto isRunning
checkRunningSession:
System::Call 'kernel32::OpenMutex(i 0x100000, b 0, t "${PROGRAM_NAME}-is-running-{9CA78EEA-EA4D-4490-9240-FC01FCEF464B}") i .R0'
IntCmp $R0 0 notRunning
System::Call 'kernel32::CloseHandle(i $R0)'
isRunning:
; You'd better go catch it.
2013-11-02 16:17:23 +00:00
MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION "${PROGRAM_NAME} or one of its associated programs is running.$\r$\nPlease close it first." /SD IDCANCEL IDRETRY continueChecking
2013-02-20 23:59:49 +00:00
Quit
notRunning:
${ExitDo}
continueChecking:
${Loop}
!macroend
;
2019-07-26 18:43:17 +00:00
; Editor modelines - https://www.wireshark.org/tools/modelines.html
2013-02-20 23:59:49 +00:00
;
; Local variables:
; c-basic-offset: 4
; tab-width: 8
; indent-tabs-mode: nil
; End:
;
; vi: set shiftwidth=4 tabstop=8 expandtab:
; :indentSize=4:tabSize=8:noTabs=true:
;