2 ; ============================================================================
3 ; Name and version information
4 ; ============================================================================
6 !if ${WIRESHARK_TARGET_PLATFORM} == "win32"
12 !define DISPLAY_NAME "${PROGRAM_NAME} ${VERSION} (${BITS}-bit)"
13 Name "${DISPLAY_NAME}"
15 !define UNINSTALLER_NAME "uninstall.exe"
17 VIAddVersionKey "ProductName" "${PROGRAM_NAME}"
18 VIAddVersionKey "Comments" "It's a great product with a great story to tell. I'm pumped!"
19 VIAddVersionKey "CompanyName" "${PROGRAM_NAME} development team"
20 ; NSIS handles the copyright symbol correctly using CP-1252 but not UTF-8.
21 VIAddVersionKey "LegalCopyright" "© Gerald Combs and many others"
22 VIAddVersionKey "LegalTrademarks" "Wireshark and the 'fin' logo are registered trademarks of the Wireshark Foundation"
23 VIAddVersionKey "FileDescription" "${PROGRAM_NAME} installer for ${BITS}-bit Windows"
24 VIAddVersionKey "Language" "English"
25 VIAddVersionKey "ProductVersion" "${PRODUCT_VERSION}"
26 VIAddVersionKey "FileVersion" "${PRODUCT_VERSION}"
27 VIProductVersion "${PRODUCT_VERSION}"
32 ; ============================================================================
33 ; Functions and macros
34 ; ============================================================================
36 ; Used to refresh the display of file association
37 !define SHCNE_ASSOCCHANGED 0x08000000
38 !define SHCNF_IDLIST 0
45 !define UPDATEICONS_UNIQUE ${__LINE__}
47 IfFileExists "$SYSDIR\shell32.dll" UpdateIcons.ok_shell32_${UPDATEICONS_UNIQUE} UpdateIcons.error_shell32_${UPDATEICONS_UNIQUE}
48 UpdateIcons.ok_shell32_${UPDATEICONS_UNIQUE}:
49 System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (${SHCNE_ASSOCCHANGED}, ${SHCNF_IDLIST}, 0, 0)'
50 Goto UpdateIcons.quit_${UPDATEICONS_UNIQUE}
52 UpdateIcons.error_shell32_${UPDATEICONS_UNIQUE}:
53 MessageBox MB_OK|MB_ICONSTOP \
54 "Can't find 'shell32.dll' library. Impossible to update icons" \
56 Goto UpdateIcons.quit_${UPDATEICONS_UNIQUE}
58 UpdateIcons.quit_${UPDATEICONS_UNIQUE}:
59 !undef UPDATEICONS_UNIQUE
64 ; Force the icon cache to refresh
65 ; http://superuser.com/questions/499078/refresh-icon-cache-without-rebooting
66 IfFileExists "$SYSDIR\ie4uinit.exe" 0 +2
67 Exec '"$SYSDIR\ie4uinit.exe" -ClearIconCache'
71 ; ============================================================================
72 ; Push our known file extensions onto the stack, prepended with a marker
73 ; Note that this is a subset of dump_open_table in wiretap/file_access.c. We
74 ; probably don't want to grab JPEG or MP3 files.
75 ; ============================================================================
77 ; Used to add associations between file extensions and Wireshark
78 !define WIRESHARK_ASSOC "wireshark-capture-file"
80 !define FILE_EXTENSION_MARKER "FILE_EXTENSION_MARKER"
82 !macro PushFileExtensions
83 Push "${FILE_EXTENSION_MARKER}"
110 !macro IsWiresharkRunning
111 ; See if Wireshark is running
112 ; http://nsis.sourceforge.net/Check_whether_your_application_is_running
115 System::Call 'kernel32::OpenMutex(i 0x100000, b 0, t "Global\${PROGRAM_NAME}-is-running-{9CA78EEA-EA4D-4490-9240-FC01FCEF464B}") i .R0'
116 IntCmp $R0 0 checkRunningSession
117 System::Call 'kernel32::CloseHandle(i $R0)'
121 System::Call 'kernel32::OpenMutex(i 0x100000, b 0, t "${PROGRAM_NAME}-is-running-{9CA78EEA-EA4D-4490-9240-FC01FCEF464B}") i .R0'
122 IntCmp $R0 0 notRunning
123 System::Call 'kernel32::CloseHandle(i $R0)'
126 ; You'd better go catch it.
127 MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION "${PROGRAM_NAME} or one of its associated programs is running.$\r$\nPlease close it first." /SD IDCANCEL IDRETRY continueChecking
138 ; Editor modelines - http://www.wireshark.org/tools/modelines.html
143 ; indent-tabs-mode: nil
146 ; vi: set shiftwidth=4 tabstop=8 expandtab:
147 ; :indentSize=4:tabSize=8:noTabs=true: