Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / packaging / nsis / wireshark.nsi
blob33375a1f6bb8ac2da08a03655f8062b1769f9479
2 ; wireshark.nsi
5 ; Set the compression mechanism first.
6 ; As of NSIS 2.07, solid compression which makes installer about 1MB smaller
7 ; is no longer the default, so use the /SOLID switch.
8 ; This unfortunately is unknown to NSIS prior to 2.07 and creates an error.
9 ; So if you get an error here, please update to at least NSIS 2.07!
10 SetCompressor /SOLID lzma
11 SetCompressorDictSize 64 ; MB
13 !include "wireshark-common.nsh"
14 !include 'LogicLib.nsh'
15 !include "StrFunc.nsh"
16 !include "WordFunc.nsh"
18 ${StrRep}
19 ${UnStrRep}
21 ; See https://nsis.sourceforge.io/Check_if_a_file_exists_at_compile_time for documentation
22 !macro !defineifexist _VAR_NAME _FILE_NAME
23 !tempfile _TEMPFILE
24 !ifdef NSIS_WIN32_MAKENSIS
25 ; Windows - cmd.exe
26 !system 'if exist "${_FILE_NAME}" echo !define ${_VAR_NAME} > "${_TEMPFILE}"'
27 !else
28 ; Posix - sh
29 !system 'if [ -e "${_FILE_NAME}" ]; then echo "!define ${_VAR_NAME}" > "${_TEMPFILE}"; fi'
30 !endif
31 !include '${_TEMPFILE}'
32 !delfile '${_TEMPFILE}'
33 !undef _TEMPFILE
34 !macroend
35 !define !defineifexist "!insertmacro !defineifexist"
37 ; ============================================================================
38 ; Header configuration
39 ; ============================================================================
41 ; The file to write
42 OutFile "${OUTFILE_DIR}\${PROGRAM_NAME}-${VERSION}-${WIRESHARK_TARGET_PLATFORM}.exe"
43 ; Installer icon
44 Icon "${TOP_SRC_DIR}\resources\icons\wiresharkinst.ico"
45 ; Uninstaller icon
46 UninstallIcon "${TOP_SRC_DIR}\resources\icons\wiresharkinst.ico"
48 ; ============================================================================
49 ; Modern UI
50 ; ============================================================================
51 ; The modern user interface will look much better than the common one.
52 ; However, as the development of the modern UI is still going on, and the script
53 ; syntax changes, you will need exactly that NSIS version, which this script is
54 ; made for. This is the current (December 2003) latest version: V2.0b4
55 ; If you are using a different version, it's not predictable what will happen.
57 !include "MUI2.nsh"
58 !include "InstallOptions.nsh"
59 ;!addplugindir ".\Plugins"
61 !define MUI_ICON "${TOP_SRC_DIR}\resources\icons\wiresharkinst.ico"
62 !define MUI_UNICON "${TOP_SRC_DIR}\resources\icons\wiresharkinst.ico"
63 BrandingText "Wireshark${U+00ae} Installer"
65 !define MUI_COMPONENTSPAGE_SMALLDESC
66 !define MUI_FINISHPAGE_NOAUTOCLOSE
67 !define MUI_WELCOMEPAGE_TITLE_3LINES
68 !define MUI_WELCOMEPAGE_TEXT "This wizard will guide you through the installation of ${PROGRAM_NAME}.$\r$\n$\r$\nBefore starting the installation, make sure ${PROGRAM_NAME} is not running.$\r$\n$\r$\nClick 'Next' to continue."
69 ;!define MUI_FINISHPAGE_LINK "Install Npcap to be able to capture packets from a network."
70 ;!define MUI_FINISHPAGE_LINK_LOCATION "https://npcap.com/"
72 ; NSIS shows Readme files by opening the Readme file with the default application for
73 ; the file's extension. "README.win32" won't work in most cases, because extension "win32"
74 ; is usually not associated with an appropriate text editor. We should use extension "txt"
75 ; for a text file or "html" for an html README file.
76 !define MUI_FINISHPAGE_TITLE_3LINES
77 !define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\release-notes.html"
78 !define MUI_FINISHPAGE_SHOWREADME_TEXT "Open the release notes"
79 !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
80 ; NSIS runs as Administrator and will run Wireshark as Administrator
81 ; if these are enabled.
82 ;!define MUI_FINISHPAGE_RUN "$INSTDIR\${PROGRAM_NAME_PATH}"
83 ;!define MUI_FINISHPAGE_RUN_NOTCHECKED
85 !define MUI_PAGE_CUSTOMFUNCTION_SHOW myShowCallback
87 ; ============================================================================
88 ; MUI Pages
89 ; ============================================================================
91 !insertmacro MUI_PAGE_WELCOME
93 !define MUI_LICENSEPAGE_TEXT_TOP "Wireshark is distributed under the GNU General Public License."
94 !define MUI_LICENSEPAGE_TEXT_BOTTOM "This is not an end user license agreement (EULA). It is provided here for informational purposes only."
95 !define MUI_LICENSEPAGE_BUTTON "Noted"
96 !insertmacro MUI_PAGE_LICENSE "${STAGING_DIR}\COPYING.txt"
98 Page custom DisplayDonatePage
100 !insertmacro MUI_PAGE_COMPONENTS
101 !ifdef QT_DIR
102 Page custom DisplayAdditionalTasksPage LeaveAdditionalTasksPage
103 !endif
104 !insertmacro MUI_PAGE_DIRECTORY
105 Page custom DisplayNpcapPage
106 Page custom DisplayUSBPcapPage
107 !insertmacro MUI_PAGE_INSTFILES
108 !insertmacro MUI_PAGE_FINISH
110 ; Uninstall stuff (NSIS 2.08: "\r\n" don't work here)
111 !define MUI_UNCONFIRMPAGE_TEXT_TOP "The following ${PROGRAM_NAME} installation will be removed. Click 'Next' to continue."
112 ; Uninstall stuff (this text isn't used with the MODERN_UI!)
113 ;UninstallText "This will uninstall ${PROGRAM_NAME}.\r\nBefore starting the uninstallation, make sure ${PROGRAM_NAME} is not running.\r\nClick 'Next' to continue."
115 !define MUI_UNFINISHPAGE_NOAUTOCLOSE
116 !define MUI_WELCOMEPAGE_TITLE_3LINES
117 !define MUI_FINISHPAGE_TITLE_3LINES
119 !insertmacro MUI_UNPAGE_WELCOME
120 !insertmacro MUI_UNPAGE_CONFIRM
121 !insertmacro MUI_UNPAGE_COMPONENTS
122 !insertmacro MUI_UNPAGE_INSTFILES
123 !insertmacro MUI_UNPAGE_FINISH
125 ; ============================================================================
126 ; MUI Languages
127 ; ============================================================================
129 !insertmacro MUI_LANGUAGE "English"
131 ; ============================================================================
132 ; Reserve Files
133 ; ============================================================================
135 ;Things that need to be extracted on first (keep these lines before any File command!)
136 ;Only useful for BZIP2 compression
138 ; Old Modern 1 UI: https://nsis.sourceforge.io/Docs/Modern%20UI/Readme.html
139 ; To do: Upgrade to the Modern 2 UI:
140 ;ReserveFile "AdditionalTasksPage.ini"
141 ReserveFile "DonatePage.ini"
142 ReserveFile "NpcapPage.ini"
143 ReserveFile "USBPcapPage.ini"
144 ReserveFile /plugin InstallOptions.dll
146 ; Modern UI 2 / nsDialog pages.
147 ; https://nsis.sourceforge.io/Docs/Modern%20UI%202/Readme.html
148 ; https://nsis.sourceforge.io/Docs/nsDialogs/Readme.html
149 !ifdef QT_DIR
150 !include "wireshark-additional-tasks.nsdinc"
151 !endif
153 ; ============================================================================
154 ; Section macros
155 ; ============================================================================
156 !include "Sections.nsh"
158 ; ============================================================================
159 ; Command Line
160 ; ============================================================================
161 !include "FileFunc.nsh"
163 !insertmacro GetParameters
164 !insertmacro GetOptions
166 ; ========= Install extcap binary and help file =========
167 !macro InstallExtcap EXTCAP_NAME
169 SetOutPath $INSTDIR
170 File "${STAGING_DIR}\${EXTCAP_NAME}.html"
171 SetOutPath $INSTDIR\extcap
172 File "${STAGING_DIR}\extcap\wireshark\${EXTCAP_NAME}.exe"
174 !macroend
176 ; ========= Check if silent mode install of /EXTRACOMPONENTS =========
177 !macro CheckExtrasFlag EXTRAS_NAME
178 !define EXTRAS_FLAG ${__LINE__}
179 Section
180 IfSilent +1 skip_${EXTRAS_FLAG}
181 push $R0
182 push $R1
183 push $R2
184 ${GetParameters} $R0
185 ${GetOptions} $R0 "/EXTRACOMPONENTS=" $R1
186 IfErrors popreg_${EXTRAS_FLAG}
187 ${WordFind} $R1 "," "E+1" $R0
189 ; No delimiters found - check for single word match
190 ${If} $R0 = 1
191 StrCmp $R1 ${EXTRAS_NAME} install_${EXTRAS_FLAG} popreg_${EXTRAS_FLAG}
192 ${ENDIF}
194 ; Loop through all delimited words checking for match
195 IntOp $R2 0 + 1
196 ${While} $R0 != 2
197 StrCmp $R0 ${EXTRAS_NAME} install_${EXTRAS_FLAG} 0
198 IntOp $R2 $R2 + 1
199 ${WordFind} $R1 "," "E+$R2" $R0
200 ${EndWhile}
201 Goto popreg_${EXTRAS_FLAG}
203 install_${EXTRAS_FLAG}:
204 !insertmacro InstallExtcap ${EXTRAS_NAME}
205 popreg_${EXTRAS_FLAG}:
206 pop $R2
207 pop $R1
208 pop $R0
209 skip_${EXTRAS_FLAG}:
210 !undef EXTRAS_FLAG
211 SectionEnd
212 !macroend
214 ; ============================================================================
215 ; Component page configuration
216 ; ============================================================================
217 ComponentText "The following components are available for installation."
219 ; ============================================================================
220 ; Directory selection page configuration
221 ; ============================================================================
222 ; The text to prompt the user to enter a directory
223 DirText "Choose a directory in which to install ${PROGRAM_NAME}."
225 ; The default installation directory
226 InstallDir $PROGRAMFILES64\${PROGRAM_NAME}
228 ; See if this is an upgrade; if so, use the old InstallDir as default
229 InstallDirRegKey HKEY_LOCAL_MACHINE SOFTWARE\${PROGRAM_NAME} InstallDir
232 ; ============================================================================
233 ; Install page configuration
234 ; ============================================================================
235 ShowInstDetails show
237 ; ============================================================================
238 ; Functions and macros
239 ; ============================================================================
241 Var EXTENSION
242 ; https://docs.microsoft.com/en-us/windows/win32/shell/fa-file-types
243 Function Associate
244 Push $R0
245 !insertmacro PushFileExtensions
247 Pop $EXTENSION
249 ${DoUntil} $EXTENSION == ${FILE_EXTENSION_MARKER}
250 ReadRegStr $R0 HKCR $EXTENSION ""
251 StrCmp $R0 "" Associate.doRegister
252 Goto Associate.end
254 Associate.doRegister:
255 ;The extension is not associated to any program, we can do the link
256 WriteRegStr HKCR $EXTENSION "" ${WIRESHARK_ASSOC}
257 DetailPrint "Registered file type: $EXTENSION"
259 Associate.end:
260 Pop $EXTENSION
261 ${Loop}
263 Pop $R0
264 FunctionEnd
266 ; Control states
267 Var START_MENU_STATE
268 Var DESKTOP_ICON_STATE
269 Var FILE_ASSOCIATE_STATE
271 ; NSIS
272 Var OLD_UNINSTALLER
273 Var OLD_INSTDIR
274 Var OLD_DISPLAYNAME
275 Var TMP_UNINSTALLER
277 ; WiX
278 Var REGISTRY_BITS
279 Var TMP_PRODUCT_GUID
280 Var WIX_DISPLAYNAME
281 Var WIX_DISPLAYVERSION
282 Var WIX_UNINSTALLSTRING
284 ; ============================================================================
285 ; Platform and OS version checks
286 ; ============================================================================
288 !include x64.nsh
289 !include WinVer.nsh
290 !include WinMessages.nsh
292 Function .onInit
293 ; http://forums.winamp.com/printthread.php?s=16ffcdd04a8c8d52bee90c0cae273ac5&threadid=262873
294 ${IfNot} ${RunningX64}
295 MessageBox MB_OK "Wireshark only runs on 64 bit machines.$\nTry installing a 32 bit version (3.6 or earlier) instead." /SD IDOK
296 Abort
297 ${EndIf}
299 !if ${WIRESHARK_TARGET_PLATFORM} == "x64"
300 ${If} ${IsNativeARM64}
301 MessageBox MB_OK "You're installing the x64 version of Wireshark on an Arm64 system.$\nThe native Arm64 installer might work better." /SD IDOK
302 ${EndIf}
303 !endif
305 !if ${WIRESHARK_TARGET_PLATFORM} == "arm64"
306 ${IfNot} ${IsNativeARM64}
307 MessageBox MB_OK "You're trying to install the Arm64 version of Wireshark on an x64 system.$\nTry the native x64 installer instead." /SD IDOK
308 Abort
309 ${EndIf}
310 !endif
312 ; This should match the following:
313 ; - The NTDDI_VERSION and _WIN32_WINNT parts of cmakeconfig.h.in
314 ; - The <compatibility><application> section in image\wireshark.exe.manifest.in
315 ; - The VersionNT parts of packaging\wix\Prerequisites.wxi
317 ; Uncomment to test.
318 ; MessageBox MB_OK "You're running Windows $R0."
320 ${If} ${AtMostWinME}
321 MessageBox MB_OK \
322 "Windows 95, 98, and ME are no longer supported.$\nPlease install Ethereal 0.99.0 instead." \
323 /SD IDOK
324 Quit
325 ${EndIf}
327 ${If} ${IsWinNT4}
328 MessageBox MB_OK \
329 "Windows NT 4.0 is no longer supported.$\nPlease install Wireshark 0.99.4 instead." \
330 /SD IDOK
331 Quit
332 ${EndIf}
334 ${If} ${IsWin2000}
335 MessageBox MB_OK \
336 "Windows 2000 is no longer supported.$\nPlease install Wireshark 1.2 or 1.0 instead." \
337 /SD IDOK
338 Quit
339 ${EndIf}
341 ${If} ${IsWinXP}
342 ${OrIf} ${IsWin2003}
343 MessageBox MB_OK \
344 "Windows XP and Server 2003 are no longer supported.$\nPlease install ${PROGRAM_NAME} 1.12 or 1.10 instead." \
345 /SD IDOK
346 Quit
347 ${EndIf}
349 ${If} ${IsWinVista}
350 ${OrIf} ${IsWin2008}
351 MessageBox MB_OK \
352 "Windows Vista and Server 2008 are no longer supported.$\nPlease install ${PROGRAM_NAME} 2.2 instead." \
353 /SD IDOK
354 Quit
355 ${EndIf}
357 ${If} ${AtMostWin8.1}
358 ${OrIf} ${AtMostWin2012R2}
359 MessageBox MB_OK \
360 "Windows 7, 8, 8.1, Server 2008R2, and Server 2012 are no longer supported.$\nPlease install ${PROGRAM_NAME} 4.0 instead." \
361 /SD IDOK
362 Quit
363 ${EndIf}
365 !insertmacro IsWiresharkRunning
367 ; Default control values.
368 StrCpy $START_MENU_STATE ${BST_CHECKED}
369 StrCpy $DESKTOP_ICON_STATE ${BST_UNCHECKED}
370 StrCpy $FILE_ASSOCIATE_STATE ${BST_CHECKED}
372 ; Copied from https://nsis.sourceforge.io/Auto-uninstall_old_before_installing_new
373 ReadRegStr $OLD_UNINSTALLER HKLM \
374 "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" \
375 "UninstallString"
376 StrCmp $OLD_UNINSTALLER "" check_wix
378 ReadRegStr $OLD_INSTDIR HKLM \
379 "Software\Microsoft\Windows\CurrentVersion\App Paths\${PROGRAM_NAME}.exe" \
380 "Path"
381 StrCmp $OLD_INSTDIR "" check_wix
383 ReadRegStr $OLD_DISPLAYNAME HKLM \
384 "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" \
385 "DisplayName"
386 StrCmp $OLD_DISPLAYNAME "" done
388 ; We're reinstalling. Flip our control states according to what the
389 ; user chose before.
390 ; (we use the "all users" start menu, so select it first)
391 SetShellVarContext all
392 ; MessageBox MB_OK|MB_ICONINFORMATION "oninit 1 sm $START_MENU_STATE di $DESKTOP_ICON_STATE"
393 ${IfNot} ${FileExists} $SMPROGRAMS\${PROGRAM_NAME}.lnk
394 StrCpy $START_MENU_STATE ${BST_UNCHECKED}
395 ${Endif}
396 ${If} ${FileExists} $DESKTOP\${PROGRAM_NAME}.lnk
397 StrCpy $DESKTOP_ICON_STATE ${BST_CHECKED}
398 ${Endif}
399 ; Leave FILE_ASSOCIATE_STATE checked.
400 ; MessageBox MB_OK|MB_ICONINFORMATION "oninit 2 sm $START_MENU_STATE $SMPROGRAMS\${PROGRAM_NAME}\${PROGRAM_NAME}.lnk \
401 ; $\ndi $DESKTOP_ICON_STATE $DESKTOP\${PROGRAM_NAME}.lnk
403 MessageBox MB_YESNOCANCEL|MB_ICONQUESTION \
404 "$OLD_DISPLAYNAME is already installed.\
405 $\n$\nWould you like to uninstall it first?" \
406 /SD IDYES \
407 IDYES prep_nsis_uninstaller \
408 IDNO done
409 Abort
411 ; Copy the uninstaller to $TEMP and run it.
412 ; The uninstaller normally does this by itself, but doesn't wait around
413 ; for the executable to finish, which means ExecWait won't work correctly.
414 prep_nsis_uninstaller:
415 ClearErrors
416 StrCpy $TMP_UNINSTALLER "$TEMP\${PROGRAM_NAME}_uninstaller.exe"
417 ; ...because we surround UninstallString in quotes.
418 StrCpy $0 $OLD_UNINSTALLER -1 1
419 StrCpy $1 "$TEMP\${PROGRAM_NAME}_uninstaller.exe"
420 StrCpy $2 1
421 System::Call 'kernel32::CopyFile(t r0, t r1, b r2) 1'
422 ExecWait "$TMP_UNINSTALLER /S _?=$OLD_INSTDIR"
424 Delete "$TMP_UNINSTALLER"
426 ; Look for a WiX-installed package.
428 check_wix:
429 StrCpy $REGISTRY_BITS 64
430 SetRegView 64
431 check_wix_restart:
432 StrCpy $0 0
433 wix_reg_enum_loop:
434 EnumRegKey $TMP_PRODUCT_GUID HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" $0
435 StrCmp $TMP_PRODUCT_GUID "" wix_enum_reg_done
436 IntOp $0 $0 + 1
437 ReadRegStr $WIX_DISPLAYNAME HKLM \
438 "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$TMP_PRODUCT_GUID" \
439 "DisplayName"
440 ; MessageBox MB_OK|MB_ICONINFORMATION "Reading HKLM SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$1 DisplayName = $2"
441 ; Look for "Wireshark".
442 StrCmp $WIX_DISPLAYNAME "${PROGRAM_NAME}" wix_found wix_reg_enum_loop
444 wix_found:
445 ReadRegStr $WIX_DISPLAYVERSION HKLM \
446 "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$TMP_PRODUCT_GUID" \
447 "DisplayVersion"
448 ReadRegStr $WIX_UNINSTALLSTRING HKLM \
449 "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$TMP_PRODUCT_GUID" \
450 "UninstallString"
451 StrCmp $WIX_UNINSTALLSTRING "" done
452 MessageBox MB_YESNOCANCEL|MB_ICONQUESTION \
453 "$WIX_DISPLAYNAME $WIX_DISPLAYVERSION (msi) is already installed.\
454 $\n$\nWould you like to uninstall it first?" \
455 /SD IDYES \
456 IDYES prep_wix_uninstaller \
457 IDNO done
458 Abort
460 ; Run the WiX-provided UninstallString.
461 prep_wix_uninstaller:
462 ClearErrors
463 ExecWait "$WIX_UNINSTALLSTRING"
465 Goto done
467 wix_enum_reg_done:
468 ; MessageBox MB_OK|MB_ICONINFORMATION "Checked $0 $REGISTRY_BITS bit keys"
469 IntCmp $REGISTRY_BITS 32 done
470 StrCpy $REGISTRY_BITS 32
471 SetRegView 32
472 Goto check_wix_restart
474 done:
476 ; Command line parameters
477 ${GetParameters} $R0
479 ${GetOptions} $R0 "/desktopicon=" $R1
480 ${If} $R1 == "yes"
481 StrCpy $DESKTOP_ICON_STATE ${BST_CHECKED}
482 ${ElseIf} $R1 == "no"
483 StrCpy $DESKTOP_ICON_STATE ${BST_UNCHECKED}
484 ${Endif}
486 ;Extract InstallOptions INI files
487 ;!insertmacro INSTALLOPTIONS_EXTRACT "AdditionalTasksPage.ini"
488 !insertmacro INSTALLOPTIONS_EXTRACT "DonatePage.ini"
489 !insertmacro INSTALLOPTIONS_EXTRACT "NpcapPage.ini"
490 !insertmacro INSTALLOPTIONS_EXTRACT "USBPcapPage.ini"
491 FunctionEnd
493 !ifdef QT_DIR
494 Function DisplayAdditionalTasksPage
495 Call fnc_AdditionalTasksPage_Show
496 FunctionEnd
497 !endif
499 Function DisplayDonatePage
500 !insertmacro MUI_HEADER_TEXT "Your donations keep these releases coming" "Donate today"
501 !insertmacro INSTALLOPTIONS_DISPLAY "DonatePage.ini"
502 FunctionEnd
504 Function DisplayNpcapPage
505 !insertmacro MUI_HEADER_TEXT "Packet Capture" "Wireshark requires Npcap to capture live network data."
506 !insertmacro INSTALLOPTIONS_DISPLAY "NpcapPage.ini"
507 FunctionEnd
509 Function DisplayUSBPcapPage
510 !insertmacro MUI_HEADER_TEXT "USB Capture" "USBPcap is required to capture USB traffic. Should USBPcap be installed (experimental)?"
511 !insertmacro INSTALLOPTIONS_DISPLAY "USBPcapPage.ini"
512 FunctionEnd
514 ; ============================================================================
515 ; Installation execution commands
516 ; ============================================================================
518 Var USBPCAP_UNINSTALL ;declare variable for holding the value of a registry key
519 ;Var WIRESHARK_UNINSTALL ;declare variable for holding the value of a registry key
521 Section "-Required"
522 ;-------------------------------------------
525 ; Install for every user
527 SetShellVarContext all
529 SetOutPath $INSTDIR
530 !ifndef SKIP_UNINSTALLER
531 WriteUninstaller "$INSTDIR\${UNINSTALLER_NAME}"
532 !endif
533 File "${STAGING_DIR}\libwiretap.dll"
534 File "${STAGING_DIR}\libwireshark.dll"
535 File "${STAGING_DIR}\libwsutil.dll"
537 !include wireshark-manifest.nsh
539 File "${STAGING_DIR}\COPYING.txt"
540 File "${STAGING_DIR}\README.txt"
541 File "${STAGING_DIR}\wka"
542 File "${STAGING_DIR}\pdml2html.xsl"
543 File "${STAGING_DIR}\ws.css"
544 File "${STAGING_DIR}\wireshark.html"
545 File "${STAGING_DIR}\wireshark-filter.html"
546 File "${STAGING_DIR}\dumpcap.exe"
547 File "${STAGING_DIR}\dumpcap.html"
548 File "${STAGING_DIR}\extcap.html"
549 File "${STAGING_DIR}\ipmap.html"
550 File "${STAGING_DIR}\release-notes.html"
552 !ifdef USE_VCREDIST
553 ; C-runtime redistributable
554 ; vc_redist.x64.exe or vc_redist.x86.exe - copy and execute the redistributable installer
555 File "${VCREDIST_DIR}\${VCREDIST_EXE}"
556 ; If the user already has the redistributable installed they will see a
557 ; Big Ugly Dialog by default, asking if they want to uninstall or repair.
558 ; Ideally we should add a checkbox for this somewhere. In the meantime,
559 ; just do a "quiet" install.
561 ; http://asawicki.info/news_1597_installing_visual_c_redistributable_package_from_command_line.html
562 ExecWait '"$INSTDIR\${VCREDIST_EXE}" /install /quiet /norestart' $0
563 DetailPrint "${VCREDIST_EXE} returned $0"
565 ; https://docs.microsoft.com/en-us/windows/desktop/Msi/error-codes
566 !define ERROR_SUCCESS 0
567 !define ERROR_SUCCESS_REBOOT_INITIATED 1641
568 !define ERROR_PRODUCT_VERSION 1638
569 !define ERROR_SUCCESS_REBOOT_REQUIRED 3010
570 ${Switch} $0
571 ${Case} ${ERROR_SUCCESS}
572 ${Case} ${ERROR_PRODUCT_VERSION}
573 ${Break}
574 ${Case} ${ERROR_SUCCESS_REBOOT_INITIATED} ; Shouldn't happen.
575 ${Case} ${ERROR_SUCCESS_REBOOT_REQUIRED}
576 SetRebootFlag true
577 ${Break}
578 ${Default}
579 MessageBox MB_OK "The Visual C++ Redistributable installer failed with error $0.$\nUnable to continue installation." /SD IDOK
580 Abort
581 ${Break}
582 ${EndSwitch}
584 Delete "$INSTDIR\${VCREDIST_EXE}"
585 !endif
588 ; global config files - don't overwrite if already existing
589 ;IfFileExists cfilters dont_overwrite_cfilters
590 File "${STAGING_DIR}\cfilters"
591 ;dont_overwrite_cfilters:
592 ;IfFileExists colorfilters dont_overwrite_colorfilters
593 File "${STAGING_DIR}\colorfilters"
594 ;dont_overwrite_colorfilters:
595 ;IfFileExists dfilters dont_overwrite_dfilters
596 File "${STAGING_DIR}\dfilters"
597 ;dont_overwrite_dfilters:
598 ;IfFileExists smi_modules dont_overwrite_smi_modules
599 File "${STAGING_DIR}\smi_modules"
600 ;dont_overwrite_smi_modules:
604 ; Install the Diameter DTD and XML files in the "diameter" subdirectory
605 ; of the installation directory.
607 SetOutPath $INSTDIR\diameter
608 File "${STAGING_DIR}\diameter\AlcatelLucent.xml"
609 File "${STAGING_DIR}\diameter\chargecontrol.xml"
610 File "${STAGING_DIR}\diameter\Cisco.xml"
611 File "${STAGING_DIR}\diameter\CiscoSystems.xml"
612 File "${STAGING_DIR}\diameter\Custom.xml"
613 File "${STAGING_DIR}\diameter\dictionary.dtd"
614 File "${STAGING_DIR}\diameter\dictionary.xml"
615 File "${STAGING_DIR}\diameter\eap.xml"
616 File "${STAGING_DIR}\diameter\Ericsson.xml"
617 File "${STAGING_DIR}\diameter\etsie2e4.xml"
618 File "${STAGING_DIR}\diameter\HP.xml"
619 File "${STAGING_DIR}\diameter\Huawei.xml"
620 File "${STAGING_DIR}\diameter\Inovar.xml"
621 File "${STAGING_DIR}\diameter\Juniper.xml"
622 File "${STAGING_DIR}\diameter\Metaswitch.xml"
623 File "${STAGING_DIR}\diameter\Microsoft.xml"
624 File "${STAGING_DIR}\diameter\mobileipv4.xml"
625 File "${STAGING_DIR}\diameter\mobileipv6.xml"
626 File "${STAGING_DIR}\diameter\nasreq.xml"
627 File "${STAGING_DIR}\diameter\Nokia.xml"
628 File "${STAGING_DIR}\diameter\NokiaSolutionsAndNetworks.xml"
629 File "${STAGING_DIR}\diameter\Oracle.xml"
630 File "${STAGING_DIR}\diameter\Siemens.xml"
631 File "${STAGING_DIR}\diameter\sip.xml"
632 File "${STAGING_DIR}\diameter\Starent.xml"
633 File "${STAGING_DIR}\diameter\sunping.xml"
634 File "${STAGING_DIR}\diameter\Telefonica.xml"
635 File "${STAGING_DIR}\diameter\TGPP.xml"
636 File "${STAGING_DIR}\diameter\TGPP2.xml"
637 File "${STAGING_DIR}\diameter\Travelping.xml"
638 File "${STAGING_DIR}\diameter\Vodafone.xml"
639 File "${STAGING_DIR}\diameter\VerizonWireless.xml"
640 !include "custom_diameter_xmls.txt"
641 SetOutPath $INSTDIR
644 ; Install the RADIUS directory files in the "radius" subdirectory
645 ; of the installation directory.
647 SetOutPath $INSTDIR\radius
648 File "${STAGING_DIR}\radius\README.radius_dictionary"
649 File "${STAGING_DIR}\radius\custom.includes"
650 File "${STAGING_DIR}\radius\dictionary"
651 File "${STAGING_DIR}\radius\dictionary.3com"
652 File "${STAGING_DIR}\radius\dictionary.3gpp"
653 File "${STAGING_DIR}\radius\dictionary.3gpp2"
654 File "${STAGING_DIR}\radius\dictionary.5x9"
655 File "${STAGING_DIR}\radius\dictionary.acc"
656 File "${STAGING_DIR}\radius\dictionary.acme"
657 File "${STAGING_DIR}\radius\dictionary.actelis"
658 File "${STAGING_DIR}\radius\dictionary.adtran"
659 File "${STAGING_DIR}\radius\dictionary.adva"
660 File "${STAGING_DIR}\radius\dictionary.aerohive"
661 File "${STAGING_DIR}\radius\dictionary.airespace"
662 File "${STAGING_DIR}\radius\dictionary.alcatel"
663 File "${STAGING_DIR}\radius\dictionary.alcatel-lucent.aaa"
664 File "${STAGING_DIR}\radius\dictionary.alcatel.esam"
665 File "${STAGING_DIR}\radius\dictionary.alcatel.sr"
666 File "${STAGING_DIR}\radius\dictionary.alphion"
667 File "${STAGING_DIR}\radius\dictionary.alteon"
668 File "${STAGING_DIR}\radius\dictionary.altiga"
669 File "${STAGING_DIR}\radius\dictionary.alvarion"
670 File "${STAGING_DIR}\radius\dictionary.alvarion.wimax.v2_2"
671 File "${STAGING_DIR}\radius\dictionary.apc"
672 File "${STAGING_DIR}\radius\dictionary.aptilo"
673 File "${STAGING_DIR}\radius\dictionary.aptis"
674 File "${STAGING_DIR}\radius\dictionary.arbor"
675 File "${STAGING_DIR}\radius\dictionary.arista"
676 File "${STAGING_DIR}\radius\dictionary.aruba"
677 File "${STAGING_DIR}\radius\dictionary.ascend"
678 File "${STAGING_DIR}\radius\dictionary.ascend.illegal"
679 File "${STAGING_DIR}\radius\dictionary.ascend.illegal.extended"
680 File "${STAGING_DIR}\radius\dictionary.asn"
681 File "${STAGING_DIR}\radius\dictionary.audiocodes"
682 File "${STAGING_DIR}\radius\dictionary.avaya"
683 File "${STAGING_DIR}\radius\dictionary.azaire"
684 File "${STAGING_DIR}\radius\dictionary.bay"
685 File "${STAGING_DIR}\radius\dictionary.bintec"
686 File "${STAGING_DIR}\radius\dictionary.bigswitch"
687 File "${STAGING_DIR}\radius\dictionary.bintec"
688 File "${STAGING_DIR}\radius\dictionary.bluecoat"
689 File "${STAGING_DIR}\radius\dictionary.boingo"
690 File "${STAGING_DIR}\radius\dictionary.bristol"
691 File "${STAGING_DIR}\radius\dictionary.broadsoft"
692 File "${STAGING_DIR}\radius\dictionary.brocade"
693 File "${STAGING_DIR}\radius\dictionary.bskyb"
694 File "${STAGING_DIR}\radius\dictionary.bt"
695 File "${STAGING_DIR}\radius\dictionary.cablelabs"
696 File "${STAGING_DIR}\radius\dictionary.cabletron"
697 File "${STAGING_DIR}\radius\dictionary.calix"
698 File "${STAGING_DIR}\radius\dictionary.cambium"
699 File "${STAGING_DIR}\radius\dictionary.camiant"
700 File "${STAGING_DIR}\radius\dictionary.centec"
701 File "${STAGING_DIR}\radius\dictionary.checkpoint"
702 File "${STAGING_DIR}\radius\dictionary.chillispot"
703 File "${STAGING_DIR}\radius\dictionary.ciena"
704 File "${STAGING_DIR}\radius\dictionary.cisco"
705 File "${STAGING_DIR}\radius\dictionary.cisco.asa"
706 File "${STAGING_DIR}\radius\dictionary.cisco.bbsm"
707 File "${STAGING_DIR}\radius\dictionary.cisco.vpn3000"
708 File "${STAGING_DIR}\radius\dictionary.cisco.vpn5000"
709 File "${STAGING_DIR}\radius\dictionary.citrix"
710 File "${STAGING_DIR}\radius\dictionary.ckey"
711 File "${STAGING_DIR}\radius\dictionary.clavister"
712 File "${STAGING_DIR}\radius\dictionary.cnergee"
713 File "${STAGING_DIR}\radius\dictionary.colubris"
714 File "${STAGING_DIR}\radius\dictionary.columbia_university"
715 File "${STAGING_DIR}\radius\dictionary.compat"
716 File "${STAGING_DIR}\radius\dictionary.compatible"
717 File "${STAGING_DIR}\radius\dictionary.cosine"
718 File "${STAGING_DIR}\radius\dictionary.covaro"
719 File "${STAGING_DIR}\radius\dictionary.dante"
720 File "${STAGING_DIR}\radius\dictionary.dellemc"
721 File "${STAGING_DIR}\radius\dictionary.digium"
722 File "${STAGING_DIR}\radius\dictionary.dlink"
723 File "${STAGING_DIR}\radius\dictionary.dragonwave"
724 File "${STAGING_DIR}\radius\dictionary.efficientip"
725 File "${STAGING_DIR}\radius\dictionary.eleven"
726 File "${STAGING_DIR}\radius\dictionary.eltex"
727 File "${STAGING_DIR}\radius\dictionary.enterasys"
728 File "${STAGING_DIR}\radius\dictionary.epygi"
729 File "${STAGING_DIR}\radius\dictionary.equallogic"
730 File "${STAGING_DIR}\radius\dictionary.ericsson"
731 File "${STAGING_DIR}\radius\dictionary.ericsson.ab"
732 File "${STAGING_DIR}\radius\dictionary.ericsson.packet.core.networks"
733 File "${STAGING_DIR}\radius\dictionary.erx"
734 File "${STAGING_DIR}\radius\dictionary.extreme"
735 File "${STAGING_DIR}\radius\dictionary.f5"
736 File "${STAGING_DIR}\radius\dictionary.fdxtended"
737 File "${STAGING_DIR}\radius\dictionary.force10"
738 File "${STAGING_DIR}\radius\dictionary.fortinet"
739 File "${STAGING_DIR}\radius\dictionary.foundry"
740 File "${STAGING_DIR}\radius\dictionary.freedhcp"
741 File "${STAGING_DIR}\radius\dictionary.freeradius"
742 File "${STAGING_DIR}\radius\dictionary.freeradius.evs5"
743 File "${STAGING_DIR}\radius\dictionary.freeradius.internal"
744 File "${STAGING_DIR}\radius\dictionary.freeswitch"
745 File "${STAGING_DIR}\radius\dictionary.gandalf"
746 File "${STAGING_DIR}\radius\dictionary.garderos"
747 File "${STAGING_DIR}\radius\dictionary.gemtek"
748 File "${STAGING_DIR}\radius\dictionary.h3c"
749 File "${STAGING_DIR}\radius\dictionary.hillstone"
750 File "${STAGING_DIR}\radius\dictionary.hp"
751 File "${STAGING_DIR}\radius\dictionary.huawei"
752 File "${STAGING_DIR}\radius\dictionary.iana"
753 File "${STAGING_DIR}\radius\dictionary.identity_engines"
754 File "${STAGING_DIR}\radius\dictionary.iea"
755 File "${STAGING_DIR}\radius\dictionary.infinera"
756 File "${STAGING_DIR}\radius\dictionary.infoblox"
757 File "${STAGING_DIR}\radius\dictionary.infonet"
758 File "${STAGING_DIR}\radius\dictionary.ingate"
759 File "${STAGING_DIR}\radius\dictionary.ipunplugged"
760 File "${STAGING_DIR}\radius\dictionary.issanni"
761 File "${STAGING_DIR}\radius\dictionary.itk"
762 File "${STAGING_DIR}\radius\dictionary.jradius"
763 File "${STAGING_DIR}\radius\dictionary.juniper"
764 File "${STAGING_DIR}\radius\dictionary.karlnet"
765 File "${STAGING_DIR}\radius\dictionary.kineto"
766 File "${STAGING_DIR}\radius\dictionary.lancom"
767 File "${STAGING_DIR}\radius\dictionary.lantronix"
768 File "${STAGING_DIR}\radius\dictionary.livingston"
769 File "${STAGING_DIR}\radius\dictionary.localweb"
770 File "${STAGING_DIR}\radius\dictionary.lucent"
771 File "${STAGING_DIR}\radius\dictionary.manzara"
772 File "${STAGING_DIR}\radius\dictionary.meinberg"
773 File "${STAGING_DIR}\radius\dictionary.mellanox"
774 File "${STAGING_DIR}\radius\dictionary.meraki"
775 File "${STAGING_DIR}\radius\dictionary.merit"
776 File "${STAGING_DIR}\radius\dictionary.meru"
777 File "${STAGING_DIR}\radius\dictionary.microsemi"
778 File "${STAGING_DIR}\radius\dictionary.microsoft"
779 File "${STAGING_DIR}\radius\dictionary.mikrotik"
780 File "${STAGING_DIR}\radius\dictionary.mimosa"
781 File "${STAGING_DIR}\radius\dictionary.motorola"
782 File "${STAGING_DIR}\radius\dictionary.motorola.illegal"
783 File "${STAGING_DIR}\radius\dictionary.motorola.wimax"
784 File "${STAGING_DIR}\radius\dictionary.navini"
785 File "${STAGING_DIR}\radius\dictionary.net"
786 File "${STAGING_DIR}\radius\dictionary.netelastic"
787 File "${STAGING_DIR}\radius\dictionary.netscreen"
788 File "${STAGING_DIR}\radius\dictionary.networkphysics"
789 File "${STAGING_DIR}\radius\dictionary.nexans"
790 File "${STAGING_DIR}\radius\dictionary.nile"
791 File "${STAGING_DIR}\radius\dictionary.nokia"
792 File "${STAGING_DIR}\radius\dictionary.nokia.conflict"
793 File "${STAGING_DIR}\radius\dictionary.nomadix"
794 File "${STAGING_DIR}\radius\dictionary.nortel"
795 File "${STAGING_DIR}\radius\dictionary.ntua"
796 File "${STAGING_DIR}\radius\dictionary.openser"
797 File "${STAGING_DIR}\radius\dictionary.openwifi"
798 File "${STAGING_DIR}\radius\dictionary.packeteer"
799 File "${STAGING_DIR}\radius\dictionary.paloalto"
800 File "${STAGING_DIR}\radius\dictionary.patton"
801 File "${STAGING_DIR}\radius\dictionary.perle"
802 File "${STAGING_DIR}\radius\dictionary.pfsense"
803 File "${STAGING_DIR}\radius\dictionary.pica8"
804 File "${STAGING_DIR}\radius\dictionary.propel"
805 File "${STAGING_DIR}\radius\dictionary.prosoft"
806 File "${STAGING_DIR}\radius\dictionary.proxim"
807 File "${STAGING_DIR}\radius\dictionary.purewave"
808 File "${STAGING_DIR}\radius\dictionary.quiconnect"
809 File "${STAGING_DIR}\radius\dictionary.quintum"
810 File "${STAGING_DIR}\radius\dictionary.rcntec"
811 File "${STAGING_DIR}\radius\dictionary.redcreek"
812 File "${STAGING_DIR}\radius\dictionary.rfc2865"
813 File "${STAGING_DIR}\radius\dictionary.rfc2866"
814 File "${STAGING_DIR}\radius\dictionary.rfc2867"
815 File "${STAGING_DIR}\radius\dictionary.rfc2868"
816 File "${STAGING_DIR}\radius\dictionary.rfc2869"
817 File "${STAGING_DIR}\radius\dictionary.rfc3162"
818 File "${STAGING_DIR}\radius\dictionary.rfc3576"
819 File "${STAGING_DIR}\radius\dictionary.rfc3580"
820 File "${STAGING_DIR}\radius\dictionary.rfc4072"
821 File "${STAGING_DIR}\radius\dictionary.rfc4372"
822 File "${STAGING_DIR}\radius\dictionary.rfc4603"
823 File "${STAGING_DIR}\radius\dictionary.rfc4675"
824 File "${STAGING_DIR}\radius\dictionary.rfc4679"
825 File "${STAGING_DIR}\radius\dictionary.rfc4818"
826 File "${STAGING_DIR}\radius\dictionary.rfc4849"
827 File "${STAGING_DIR}\radius\dictionary.rfc5090"
828 File "${STAGING_DIR}\radius\dictionary.rfc5176"
829 File "${STAGING_DIR}\radius\dictionary.rfc5447"
830 File "${STAGING_DIR}\radius\dictionary.rfc5580"
831 File "${STAGING_DIR}\radius\dictionary.rfc5607"
832 File "${STAGING_DIR}\radius\dictionary.rfc5904"
833 File "${STAGING_DIR}\radius\dictionary.rfc6519"
834 File "${STAGING_DIR}\radius\dictionary.rfc6572"
835 File "${STAGING_DIR}\radius\dictionary.rfc6677"
836 File "${STAGING_DIR}\radius\dictionary.rfc6911"
837 File "${STAGING_DIR}\radius\dictionary.rfc6929"
838 File "${STAGING_DIR}\radius\dictionary.rfc6930"
839 File "${STAGING_DIR}\radius\dictionary.rfc7055"
840 File "${STAGING_DIR}\radius\dictionary.rfc7155"
841 File "${STAGING_DIR}\radius\dictionary.rfc7268"
842 File "${STAGING_DIR}\radius\dictionary.rfc7499"
843 File "${STAGING_DIR}\radius\dictionary.rfc7930"
844 File "${STAGING_DIR}\radius\dictionary.rfc8045"
845 File "${STAGING_DIR}\radius\dictionary.rfc8559"
846 File "${STAGING_DIR}\radius\dictionary.riverbed"
847 File "${STAGING_DIR}\radius\dictionary.riverstone"
848 File "${STAGING_DIR}\radius\dictionary.roaringpenguin"
849 File "${STAGING_DIR}\radius\dictionary.ruckus"
850 File "${STAGING_DIR}\radius\dictionary.ruggedcom"
851 File "${STAGING_DIR}\radius\dictionary.sangoma"
852 File "${STAGING_DIR}\radius\dictionary.sg"
853 File "${STAGING_DIR}\radius\dictionary.shasta"
854 File "${STAGING_DIR}\radius\dictionary.shiva"
855 File "${STAGING_DIR}\radius\dictionary.siemens"
856 File "${STAGING_DIR}\radius\dictionary.slipstream"
857 File "${STAGING_DIR}\radius\dictionary.smartsharesystems"
858 File "${STAGING_DIR}\radius\dictionary.sofaware"
859 File "${STAGING_DIR}\radius\dictionary.softbank"
860 File "${STAGING_DIR}\radius\dictionary.sonicwall"
861 File "${STAGING_DIR}\radius\dictionary.springtide"
862 File "${STAGING_DIR}\radius\dictionary.starent"
863 File "${STAGING_DIR}\radius\dictionary.starent.vsa1"
864 File "${STAGING_DIR}\radius\dictionary.surfnet"
865 File "${STAGING_DIR}\radius\dictionary.symbol"
866 File "${STAGING_DIR}\radius\dictionary.t_systems_nova"
867 File "${STAGING_DIR}\radius\dictionary.telebit"
868 File "${STAGING_DIR}\radius\dictionary.telkom"
869 File "${STAGING_DIR}\radius\dictionary.telrad"
870 File "${STAGING_DIR}\radius\dictionary.terena"
871 File "${STAGING_DIR}\radius\dictionary.tplink"
872 File "${STAGING_DIR}\radius\dictionary.trapeze"
873 File "${STAGING_DIR}\radius\dictionary.travelping"
874 File "${STAGING_DIR}\radius\dictionary.tripplite"
875 File "${STAGING_DIR}\radius\dictionary.tropos"
876 File "${STAGING_DIR}\radius\dictionary.ukerna"
877 File "${STAGING_DIR}\radius\dictionary.unisphere"
878 File "${STAGING_DIR}\radius\dictionary.unix"
879 File "${STAGING_DIR}\radius\dictionary.usr"
880 File "${STAGING_DIR}\radius\dictionary.usr.illegal"
881 File "${STAGING_DIR}\radius\dictionary.utstarcom"
882 File "${STAGING_DIR}\radius\dictionary.valemount"
883 File "${STAGING_DIR}\radius\dictionary.vasexperts"
884 File "${STAGING_DIR}\radius\dictionary.verizon"
885 File "${STAGING_DIR}\radius\dictionary.versanet"
886 File "${STAGING_DIR}\radius\dictionary.walabi"
887 File "${STAGING_DIR}\radius\dictionary.waverider"
888 File "${STAGING_DIR}\radius\dictionary.wichorus"
889 File "${STAGING_DIR}\radius\dictionary.wifialliance"
890 File "${STAGING_DIR}\radius\dictionary.wimax"
891 File "${STAGING_DIR}\radius\dictionary.wimax.alvarion"
892 File "${STAGING_DIR}\radius\dictionary.wimax.wichorus"
893 File "${STAGING_DIR}\radius\dictionary.wispr"
894 File "${STAGING_DIR}\radius\dictionary.xedia"
895 File "${STAGING_DIR}\radius\dictionary.xylan"
896 File "${STAGING_DIR}\radius\dictionary.yubico"
897 File "${STAGING_DIR}\radius\dictionary.zeus"
898 File "${STAGING_DIR}\radius\dictionary.zte"
899 File "${STAGING_DIR}\radius\dictionary.zyxel"
900 !include "custom_radius_dict.txt"
901 SetOutPath $INSTDIR
904 ; install the dtds in the dtds subdirectory
906 SetOutPath $INSTDIR\dtds
907 File "${STAGING_DIR}\dtds\dc.dtd"
908 File "${STAGING_DIR}\dtds\itunes.dtd"
909 File "${STAGING_DIR}\dtds\mscml.dtd"
910 File "${STAGING_DIR}\dtds\pocsettings.dtd"
911 File "${STAGING_DIR}\dtds\presence.dtd"
912 File "${STAGING_DIR}\dtds\reginfo.dtd"
913 File "${STAGING_DIR}\dtds\rlmi.dtd"
914 File "${STAGING_DIR}\dtds\rss.dtd"
915 File "${STAGING_DIR}\dtds\smil.dtd"
916 File "${STAGING_DIR}\dtds\xcap-caps.dtd"
917 File "${STAGING_DIR}\dtds\xcap-error.dtd"
918 File "${STAGING_DIR}\dtds\watcherinfo.dtd"
919 SetOutPath $INSTDIR
921 ; Create the extcap directory
922 CreateDirectory $INSTDIR\extcap
925 ; install the protobuf .proto definitions in the protobuf subdirectory
927 SetOutPath $INSTDIR\protobuf
928 File "${STAGING_DIR}\protobuf\*.proto"
930 ; Install the TPNCP DAT file in the "tpncp" subdirectory
931 ; of the installation directory.
932 SetOutPath $INSTDIR\tpncp
933 File "${STAGING_DIR}\tpncp\tpncp.dat"
936 ; install the wimaxasncp TLV definitions in the wimaxasncp subdirectory
938 SetOutPath $INSTDIR\wimaxasncp
939 File "${STAGING_DIR}\wimaxasncp\dictionary.xml"
940 File "${STAGING_DIR}\wimaxasncp\dictionary.dtd"
941 SetOutPath $INSTDIR
943 ; Write the installation path into the registry for InstallDirRegKey
944 WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\${PROGRAM_NAME} InstallDir "$INSTDIR"
946 ; Write the uninstall keys for Windows
947 ; https://nsis.sourceforge.io/Add_uninstall_information_to_Add/Remove_Programs
948 ; https://docs.microsoft.com/en-us/previous-versions/ms954376(v=msdn.10)
949 ; https://docs.microsoft.com/en-us/windows/win32/msi/uninstall-registry-key
950 !define UNINSTALL_PATH "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}"
952 WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "Comments" "${DISPLAY_NAME}"
953 !ifdef QT_DIR
954 WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "DisplayIcon" "$INSTDIR\${PROGRAM_NAME_PATH},0"
955 !endif
956 WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "DisplayName" "${DISPLAY_NAME}"
957 WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "DisplayVersion" "${VERSION}"
958 WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "HelpLink" "https://ask.wireshark.org/"
959 WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "InstallLocation" "$INSTDIR"
960 WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "Publisher" "The Wireshark developer community, https://www.wireshark.org"
961 WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "URLInfoAbout" "https://www.wireshark.org"
962 WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "URLUpdateInfo" "https://www.wireshark.org/download.html"
964 WriteRegDWORD HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "NoModify" 1
965 WriteRegDWORD HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "NoRepair" 1
966 WriteRegDWORD HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "VersionMajor" ${MAJOR_VERSION}
967 WriteRegDWORD HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "VersionMinor" ${MINOR_VERSION}
969 WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "UninstallString" '"$INSTDIR\${UNINSTALLER_NAME}"'
970 WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "QuietUninstallString" '"$INSTDIR\${UNINSTALLER_NAME}" /S'
972 ; To quote https://web.archive.org/web/20150911221413/http://download.microsoft.com/download/0/4/6/046bbd36-0812-4c22-a870-41911c6487a6/WindowsUserExperience.pdf:
973 ; "Do not include Readme, Help, or Uninstall entries on the Programs menu."
974 Delete "$SMPROGRAMS\${PROGRAM_NAME}\Wireshark Web Site.lnk"
976 ; Create file extensions if the Associated Tasks page check box
977 ; is checked.
978 ${If} $FILE_ASSOCIATE_STATE == ${BST_CHECKED}
979 WriteRegStr HKCR ${WIRESHARK_ASSOC} "" "Wireshark capture file"
980 WriteRegStr HKCR "${WIRESHARK_ASSOC}\Shell\open\command" "" '"$INSTDIR\${PROGRAM_NAME_PATH}" "%1"'
981 WriteRegStr HKCR "${WIRESHARK_ASSOC}\DefaultIcon" "" '"$INSTDIR\${PROGRAM_NAME_PATH}",1'
982 ; We refresh the icon cache down in -Finally.
983 Call Associate
984 ; If you add something here be sure to sync it with the uninstall section and the
985 ; AdditionalTasks page
986 ${Endif}
988 ; if running as a silent installer, don't try to install npcap
989 IfSilent SecRequired_skip_Npcap
991 ; Install Npcap (depending on npcap page setting)
992 ReadINIStr $0 "$PLUGINSDIR\NpcapPage.ini" "Field 4" "State"
993 StrCmp $0 "0" SecRequired_skip_Npcap
994 SetOutPath $INSTDIR
995 File "${EXTRA_INSTALLER_DIR}\npcap-${NPCAP_PACKAGE_VERSION}.exe"
996 ExecWait '"$INSTDIR\npcap-${NPCAP_PACKAGE_VERSION}.exe" /winpcap_mode=no /loopback_support=no' $0
997 DetailPrint "Npcap installer returned $0"
998 SecRequired_skip_Npcap:
1000 ; If running as a silent installer, don't try to install USBPcap
1001 IfSilent SecRequired_skip_USBPcap
1003 ReadINIStr $0 "$PLUGINSDIR\USBPcapPage.ini" "Field 4" "State"
1004 StrCmp $0 "0" SecRequired_skip_USBPcap
1005 SetOutPath $INSTDIR
1006 File "${EXTRA_INSTALLER_DIR}\USBPcapSetup-${USBPCAP_PACKAGE_VERSION}.exe"
1007 ExecWait '"$INSTDIR\USBPcapSetup-${USBPCAP_PACKAGE_VERSION}.exe"' $0
1008 DetailPrint "USBPcap installer returned $0"
1009 ${If} $0 == "0"
1010 ${If} ${RunningX64}
1011 ${DisableX64FSRedirection}
1012 SetRegView 64
1013 ${EndIf}
1014 ReadRegStr $USBPCAP_UNINSTALL HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\USBPcap" "UninstallString"
1015 ${If} ${RunningX64}
1016 ${EnableX64FSRedirection}
1017 SetRegView 32
1018 ${EndIf}
1019 ${StrRep} $0 '$USBPCAP_UNINSTALL' 'Uninstall.exe' 'USBPcapCMD.exe'
1020 ${StrRep} $1 '$0' '"' ''
1021 CopyFiles /SILENT $1 $INSTDIR\extcap
1022 SetRebootFlag true
1023 ${EndIf}
1024 SecRequired_skip_USBPcap:
1026 ; If no user profile exists for Wireshark but for Ethereal, copy it over
1027 SetShellVarContext current
1028 IfFileExists $APPDATA\Wireshark profile_done
1029 IfFileExists $APPDATA\Ethereal 0 profile_done
1030 ;MessageBox MB_YESNO "This seems to be the first time you use Wireshark. Copy over the personal settings from Ethereal?" /SD IDYES IDNO profile_done
1031 CreateDirectory $APPDATA\Wireshark
1032 CopyFiles $APPDATA\Ethereal\*.* $APPDATA\Wireshark
1033 profile_done:
1034 SetShellVarContext all
1036 SectionEnd ; "Required"
1038 !ifdef QT_DIR
1039 Section "${PROGRAM_NAME}" SecWiresharkQt
1040 ;-------------------------------------------
1041 ; by default, Wireshark.exe is installed
1042 SetOutPath $INSTDIR
1043 File "${QT_DIR}\${PROGRAM_NAME_PATH}"
1044 File /r "${QT_DIR}\translations"
1045 ; Write an entry for ShellExecute
1046 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\${PROGRAM_NAME_PATH}" "" '$INSTDIR\${PROGRAM_NAME_PATH}'
1047 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\${PROGRAM_NAME_PATH}" "Path" '$INSTDIR'
1049 !ifndef SKIP_NSIS_QT_DLLS
1050 !include wireshark-qt-manifest.nsh
1051 !endif
1053 ; Is the Start Menu check box checked?
1054 ${If} $START_MENU_STATE == ${BST_CHECKED}
1055 CreateShortCut "$SMPROGRAMS\${PROGRAM_NAME}.lnk" "$INSTDIR\${PROGRAM_NAME_PATH}" "" "$INSTDIR\${PROGRAM_NAME_PATH}" 0 "" "" "${PROGRAM_FULL_NAME}"
1056 ${Endif}
1058 ${If} $DESKTOP_ICON_STATE == ${BST_CHECKED}
1059 CreateShortCut "$DESKTOP\${PROGRAM_NAME}.lnk" "$INSTDIR\${PROGRAM_NAME_PATH}" "" "$INSTDIR\${PROGRAM_NAME_PATH}" 0 "" "" "${PROGRAM_FULL_NAME}"
1060 ${Endif}
1062 SectionEnd ; "SecWiresharkQt"
1063 !endif
1066 Section "TShark" SecTShark
1067 ;-------------------------------------------
1068 SetOutPath $INSTDIR
1069 File "${STAGING_DIR}\tshark.exe"
1070 File "${STAGING_DIR}\tshark.html"
1071 SectionEnd
1073 Section "-Plugins & Extensions"
1075 SetOutPath '$INSTDIR\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\codecs'
1076 File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\codecs\g711.dll"
1077 !ifdef SPANDSP_FOUND
1078 File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\codecs\g722.dll"
1079 File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\codecs\g726.dll"
1080 !endif
1081 !ifdef BCG729_FOUND
1082 File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\codecs\g729.dll"
1083 !endif
1084 File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\codecs\l16mono.dll"
1085 !ifdef SBC_FOUND
1086 File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\codecs\sbc.dll"
1087 !endif
1088 !ifdef ILBC_FOUND
1089 File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\codecs\ilbc.dll"
1090 !endif
1091 !ifdef OPUS_FOUND
1092 File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\codecs\opus_dec.dll"
1093 !endif
1094 !ifdef AMRNB_FOUND
1095 File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\codecs\amrnb.dll"
1096 !endif
1098 ; This should be a function or macro
1099 SetOutPath '$INSTDIR\profiles\Bluetooth'
1100 File "${STAGING_DIR}\profiles\Bluetooth\colorfilters"
1101 File "${STAGING_DIR}\profiles\Bluetooth\preferences"
1102 SetOutPath '$INSTDIR\profiles\Classic'
1103 File "${STAGING_DIR}\profiles\Classic\colorfilters"
1104 SetOutPath '$INSTDIR\profiles\No Reassembly'
1105 File "${STAGING_DIR}\profiles\No Reassembly\preferences"
1107 SetOutPath '$INSTDIR\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan'
1108 File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan\ethercat.dll"
1109 File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan\gryphon.dll"
1110 File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan\ipaddr.dll"
1111 File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan\irda.dll"
1112 File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan\opcua.dll"
1113 File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan\profinet.dll"
1114 File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan\unistim.dll"
1115 File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan\wimax.dll"
1116 File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan\wimaxasncp.dll"
1117 File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan\wimaxmacphy.dll"
1118 !include "custom_plugins.txt"
1120 SetOutPath '$INSTDIR\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\wiretap'
1121 File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\wiretap\usbdump.dll"
1123 SetOutPath '$INSTDIR\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan'
1124 File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan\mate.dll"
1126 !ifdef SMI_DIR
1127 SetOutPath '$INSTDIR\snmp\mibs'
1128 File "${SMI_DIR}\share\mibs\iana\*"
1129 File "${SMI_DIR}\share\mibs\ietf\*"
1130 File "${SMI_DIR}\share\mibs\irtf\*"
1131 File "${SMI_DIR}\share\mibs\tubs\*"
1132 File "${SMI_DIR}\share\pibs\*"
1133 File "${SMI_DIR}\share\yang\*.yang"
1134 !include "custom_mibs.txt"
1135 !endif
1137 SetOutPath '$INSTDIR\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan'
1138 File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan\transum.dll"
1140 SetOutPath '$INSTDIR\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan'
1141 File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan\stats_tree.dll"
1143 SectionEnd ; "Plugins / Extensions"
1145 Section "-Additional command line tools"
1147 SetOutPath $INSTDIR
1148 File "${STAGING_DIR}\capinfos.exe"
1149 File "${STAGING_DIR}\capinfos.html"
1151 File "${STAGING_DIR}\captype.exe"
1152 File "${STAGING_DIR}\captype.html"
1154 File "${STAGING_DIR}\editcap.exe"
1155 File "${STAGING_DIR}\editcap.html"
1157 File "${STAGING_DIR}\mergecap.exe"
1158 File "${STAGING_DIR}\mergecap.html"
1160 !ifdef MMDBRESOLVE_EXE
1161 File "${STAGING_DIR}\mmdbresolve.html"
1162 File "${STAGING_DIR}\mmdbresolve.exe"
1163 !endif
1165 File "${STAGING_DIR}\randpkt.exe"
1166 File "${STAGING_DIR}\randpkt.html"
1168 File "${STAGING_DIR}\rawshark.exe"
1169 File "${STAGING_DIR}\rawshark.html"
1171 File "${STAGING_DIR}\reordercap.exe"
1172 File "${STAGING_DIR}\reordercap.html"
1174 File "${STAGING_DIR}\sharkd.exe"
1175 ;File "${STAGING_DIR}\sharkd.html"
1177 File "${STAGING_DIR}\text2pcap.exe"
1178 File "${STAGING_DIR}\text2pcap.html"
1180 SectionEnd ; "Tools"
1182 SectionGroup /e "External capture tools (extcap)" SecExtcapGroup
1184 Section /o "Androiddump" SecAndroiddump
1185 ;-------------------------------------------
1186 !insertmacro InstallExtcap "androiddump"
1187 SectionEnd
1188 !insertmacro CheckExtrasFlag "androiddump"
1190 !ifdef BUILD_etwdump
1191 Section "Etwdump" SecEtwdump
1192 ;-------------------------------------------
1193 !insertmacro InstallExtcap "Etwdump"
1194 SectionEnd
1195 !insertmacro CheckExtrasFlag "Etwdump"
1196 !endif
1198 Section /o "Randpktdump" SecRandpktdump
1199 ;-------------------------------------------
1200 !insertmacro InstallExtcap "randpktdump"
1201 SectionEnd
1202 !insertmacro CheckExtrasFlag "randpktdump"
1204 !ifdef LIBSSH_FOUND
1205 Section /o "Sshdump, Ciscodump, and Wifidump" SecSshdump
1206 ;-------------------------------------------
1207 !insertmacro InstallExtcap "sshdump"
1208 !insertmacro InstallExtcap "ciscodump"
1209 !insertmacro InstallExtcap "wifidump"
1210 SectionEnd
1211 !insertmacro CheckExtrasFlag "sshdump"
1212 !insertmacro CheckExtrasFlag "ciscodump"
1213 !insertmacro CheckExtrasFlag "wifidump"
1214 !endif
1216 Section /o "UDPdump" SecUDPdump
1217 ;-------------------------------------------
1218 !insertmacro InstallExtcap "udpdump"
1219 SectionEnd
1220 !insertmacro CheckExtrasFlag "udpdump"
1222 SectionGroupEnd ; "External Capture (extcap)"
1224 Section "-Clear Partial Selected"
1225 !insertmacro ClearSectionFlag ${SecExtcapGroup} ${SF_PSELECTED}
1226 SectionEnd
1228 !ifdef DOC_DIR
1229 Section "-Documentation"
1231 SetOutPath "$INSTDIR\Wireshark User's Guide"
1232 File /r "${DOC_DIR}\wsug_html_chunked\*.*"
1234 SetOutPath $INSTDIR
1235 File "${DOC_DIR}\faq.html"
1236 SectionEnd
1237 !endif
1239 Section "-Finally"
1241 !insertmacro UpdateIcons
1243 ; Compute and write the installation directory size
1244 ${GetSize} "$INSTDIR" "/S=0K" $0 $1 $2
1245 IntFmt $0 "0x%08X" $0
1246 WriteRegDWORD HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "EstimatedSize" "$0"
1248 SectionEnd
1250 ; ============================================================================
1251 ; Section macros
1252 ; ============================================================================
1253 !include "Sections.nsh"
1255 ; ============================================================================
1256 ; Uninstall page configuration
1257 ; ============================================================================
1258 ShowUninstDetails show
1260 ; ============================================================================
1261 ; Functions and macros
1262 ; ============================================================================
1264 Function un.Disassociate
1265 Push $R0
1266 !insertmacro PushFileExtensions
1268 Pop $EXTENSION
1269 ${DoUntil} $EXTENSION == ${FILE_EXTENSION_MARKER}
1270 ReadRegStr $R0 HKCR $EXTENSION ""
1271 StrCmp $R0 ${WIRESHARK_ASSOC} un.Disassociate.doDeregister
1272 Goto un.Disassociate.end
1273 un.Disassociate.doDeregister:
1274 ; The extension is associated with Wireshark so, we must destroy this!
1275 DeleteRegKey HKCR $EXTENSION
1276 DetailPrint "Deregistered file type: $EXTENSION"
1277 un.Disassociate.end:
1278 Pop $EXTENSION
1279 ${Loop}
1281 Pop $R0
1282 FunctionEnd
1284 Section "-Required"
1285 SectionEnd
1287 !define EXECUTABLE_MARKER "EXECUTABLE_MARKER"
1288 Var EXECUTABLE
1290 Section /o "Un.USBPcap" un.SecUSBPcap
1291 ;-------------------------------------------
1292 SectionIn 2
1293 ${If} ${RunningX64}
1294 ${DisableX64FSRedirection}
1295 SetRegView 64
1296 ${EndIf}
1297 ReadRegStr $1 HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\USBPcap" "UninstallString"
1298 ${If} ${RunningX64}
1299 ${EnableX64FSRedirection}
1300 SetRegView 32
1301 ${EndIf}
1302 ${If} $1 != ""
1303 ${UnStrRep} $2 '$1' '\Uninstall.exe' ''
1304 ${UnStrRep} $3 '$2' '"' ''
1305 ExecWait '$1 _?=$3' $0
1306 DetailPrint "USBPcap uninstaller returned $0"
1307 ${If} $0 == "0"
1308 Delete "$3\Uninstall.exe"
1309 Delete "$INSTDIR\extcap\wireshark\USBPcapCMD.exe"
1310 ${EndIf}
1311 ${EndIf}
1312 ClearErrors
1313 SectionEnd
1316 Section "Uninstall" un.SecUinstall
1317 ;-------------------------------------------
1319 ; UnInstall for every user
1321 SectionIn 1 2
1322 SetShellVarContext all
1324 !insertmacro IsWiresharkRunning
1326 Push "${EXECUTABLE_MARKER}"
1327 Push "${PROGRAM_NAME}"
1328 Push "capinfos"
1329 Push "captype"
1330 Push "dftest"
1331 Push "dumpcap"
1332 Push "editcap"
1333 Push "mergecap"
1334 Push "randpkt"
1335 Push "rawshark"
1336 Push "reordercap"
1337 Push "sharkd"
1338 Push "text2pcap"
1339 Push "tshark"
1341 !ifdef MMDBRESOLVE_EXE
1342 Push "mmdbresolve"
1343 !endif
1345 Pop $EXECUTABLE
1346 ${DoUntil} $EXECUTABLE == ${EXECUTABLE_MARKER}
1348 ; IsWiresharkRunning should make sure everything is closed down so we *shouldn't* run
1349 ; into any problems here.
1350 Delete "$INSTDIR\$EXECUTABLE.exe"
1351 IfErrors 0 deletionSuccess
1352 MessageBox MB_OK "$EXECUTABLE.exe could not be removed. Is it in use?" /SD IDOK IDOK 0
1353 Abort "$EXECUTABLE.exe could not be removed. Aborting the uninstall process."
1355 deletionSuccess:
1356 Pop $EXECUTABLE
1358 ${Loop}
1361 DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}"
1362 DeleteRegKey HKEY_LOCAL_MACHINE "Software\${PROGRAM_NAME}"
1363 DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\${PROGRAM_NAME}.exe"
1365 Call un.Disassociate
1367 DeleteRegKey HKCR ${WIRESHARK_ASSOC}
1368 DeleteRegKey HKCR "${WIRESHARK_ASSOC}\Shell\open\command"
1369 DeleteRegKey HKCR "${WIRESHARK_ASSOC}\DefaultIcon"
1371 Delete "$INSTDIR\*.dll"
1372 Delete "$INSTDIR\*.exe"
1373 Delete "$INSTDIR\*.html"
1374 Delete "$INSTDIR\*.qm"
1375 Delete "$INSTDIR\accessible\*.*"
1376 Delete "$INSTDIR\AUTHORS-SHORT"
1377 Delete "$INSTDIR\COPYING*"
1378 Delete "$INSTDIR\audio\*.*"
1379 Delete "$INSTDIR\bearer\*.*"
1380 Delete "$INSTDIR\diameter\*.*"
1381 Delete "$INSTDIR\extcap\androiddump.*"
1382 Delete "$INSTDIR\extcap\ciscodump.*"
1383 Delete "$INSTDIR\extcap\etwdump.*"
1384 Delete "$INSTDIR\extcap\randpktdump.*"
1385 Delete "$INSTDIR\extcap\sshdump.*"
1386 Delete "$INSTDIR\extcap\udpdump.*"
1387 Delete "$INSTDIR\extcap\wifidump.*"
1388 Delete "$INSTDIR\gpl-2.0-standalone.html"
1389 Delete "$INSTDIR\Acknowledgements.md"
1390 Delete "$INSTDIR\generic\*.*"
1391 Delete "$INSTDIR\help\*.*"
1392 Delete "$INSTDIR\iconengines\*.*"
1393 Delete "$INSTDIR\imageformats\*.*"
1394 Delete "$INSTDIR\mediaservice\*.*"
1395 Delete "$INSTDIR\multimedia\*.*"
1396 Delete "$INSTDIR\networkinformation\*.*"
1397 Delete "$INSTDIR\platforms\*.*"
1398 Delete "$INSTDIR\playlistformats\*.*"
1399 Delete "$INSTDIR\printsupport\*.*"
1400 Delete "$INSTDIR\share\glib-2.0\schemas\*.*"
1401 Delete "$INSTDIR\snmp\*.*"
1402 Delete "$INSTDIR\snmp\mibs\*.*"
1403 Delete "$INSTDIR\styles\translations\*.*"
1404 Delete "$INSTDIR\styles\*.*"
1405 Delete "$INSTDIR\protobuf\*.*"
1406 Delete "$INSTDIR\tls\*.*"
1407 Delete "$INSTDIR\tpncp\*.*"
1408 Delete "$INSTDIR\translations\*.*"
1409 Delete "$INSTDIR\ui\*.*"
1410 Delete "$INSTDIR\wimaxasncp\*.*"
1411 Delete "$INSTDIR\ws.css"
1412 ; previous versions installed these files
1413 Delete "$INSTDIR\*.manifest"
1414 ; previous versions installed this file
1415 Delete "$INSTDIR\AUTHORS-SHORT-FORMAT"
1416 Delete "$INSTDIR\README*"
1417 Delete "$INSTDIR\NEWS.txt"
1418 Delete "$INSTDIR\manuf"
1419 Delete "$INSTDIR\wka"
1420 Delete "$INSTDIR\services"
1421 Delete "$INSTDIR\pdml2html.xsl"
1422 Delete "$INSTDIR\pcrepattern.3.txt"
1423 Delete "$INSTDIR\user-guide.chm"
1424 Delete "$INSTDIR\example_snmp_users_file"
1425 Delete "$INSTDIR\ipmap.html"
1426 Delete "$INSTDIR\radius\*.*"
1427 Delete "$INSTDIR\dtds\*.*"
1428 Delete "$INSTDIR\browser_sslkeylog.lua"
1429 Delete "$INSTDIR\console.lua"
1430 Delete "$INSTDIR\dtd_gen.lua"
1431 Delete "$INSTDIR\init.lua"
1432 Delete "$INSTDIR\release-notes.html"
1434 RMDir "$INSTDIR\accessible"
1435 RMDir "$INSTDIR\audio"
1436 RMDir "$INSTDIR\bearer"
1437 RMDir "$INSTDIR\extcap"
1438 RMDir "$INSTDIR\extcap"
1439 RMDir "$INSTDIR\iconengines"
1440 RMDir "$INSTDIR\imageformats"
1441 RMDir "$INSTDIR\mediaservice"
1442 RMDir "$INSTDIR\multimedia"
1443 RMDir "$INSTDIR\networkinformation"
1444 RMDir "$INSTDIR\platforms"
1445 RMDir "$INSTDIR\playlistformats"
1446 RMDir "$INSTDIR\printsupport"
1447 RMDir "$INSTDIR\styles\translations"
1448 RMDir "$INSTDIR\styles"
1449 RMDir "$SMPROGRAMS\${PROGRAM_NAME}"
1450 RMDir "$INSTDIR\help"
1451 RMDir "$INSTDIR\generic"
1452 RMDir /r "$INSTDIR\Wireshark User's Guide"
1453 RMDir "$INSTDIR\diameter"
1454 RMDir "$INSTDIR\snmp\mibs"
1455 RMDir "$INSTDIR\snmp"
1456 RMDir "$INSTDIR\radius"
1457 RMDir "$INSTDIR\dtds"
1458 RMDir "$INSTDIR\protobuf"
1459 RMDir "$INSTDIR\tls"
1460 RMDir "$INSTDIR\tpncp"
1461 RMDir "$INSTDIR\translations"
1462 RMDir "$INSTDIR\ui"
1463 RMDir "$INSTDIR\wimaxasncp"
1464 RMDir "$INSTDIR"
1466 SectionEnd ; "Uinstall"
1468 Section "Un.Plugins" un.SecPlugins
1469 ;-------------------------------------------
1470 SectionIn 1 2
1471 ;Delete "$INSTDIR\plugins\${VERSION}\*.*"
1472 ;Delete "$INSTDIR\plugins\*.*"
1473 ;RMDir "$INSTDIR\plugins\${VERSION}"
1474 ;RMDir "$INSTDIR\plugins"
1475 RMDir /r "$INSTDIR\plugins"
1476 SectionEnd
1478 Section "Un.Global Profiles" un.SecProfiles
1479 ;-------------------------------------------
1480 SectionIn 1 2
1481 RMDir /r "$INSTDIR\profiles"
1482 SectionEnd
1484 Section "Un.Global Settings" un.SecGlobalSettings
1485 ;-------------------------------------------
1486 SectionIn 1 2
1487 Delete "$INSTDIR\cfilters"
1488 Delete "$INSTDIR\colorfilters"
1489 Delete "$INSTDIR\dfilters"
1490 Delete "$INSTDIR\enterprises.tsv"
1491 Delete "$INSTDIR\smi_modules"
1492 RMDir "$INSTDIR"
1493 SectionEnd
1495 Section /o "Un.Personal Settings" un.SecPersonalSettings
1496 ;-------------------------------------------
1497 SectionIn 2
1498 SetShellVarContext current
1499 Delete "$APPDATA\${PROGRAM_NAME}\*.*"
1500 RMDir "$APPDATA\${PROGRAM_NAME}"
1501 DeleteRegKey HKCU "Software\${PROGRAM_NAME}"
1502 SectionEnd
1504 ;VAR un.NPCAP_UNINSTALL
1506 Section /o "Un.Npcap" un.SecNpcap
1507 ;-------------------------------------------
1508 SectionIn 2
1509 ReadRegStr $1 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\NpcapInst" "UninstallString"
1510 ;IfErrors un.lbl_npcap_notinstalled ;if RegKey is unavailable, Npcap is not installed
1511 ${If} $1 != ""
1512 ;MessageBox MB_OK "Npcap $1" /SD IDOK
1513 ExecWait '$1' $0
1514 DetailPrint "Npcap uninstaller returned $0"
1515 ;SetRebootFlag true
1516 ${EndIf}
1517 ;un.lbl_npcap_notinstalled:
1518 SectionEnd
1520 Section "-Un.Finally"
1521 ;-------------------------------------------
1522 SectionIn 1 2
1524 !insertmacro UpdateIcons
1526 ; this test must be done after all other things uninstalled (e.g. Global Settings)
1527 IfFileExists "$INSTDIR" 0 NoFinalErrorMsg
1528 MessageBox MB_OK "Unable to remove $INSTDIR." /SD IDOK IDOK 0 ; skipped if dir doesn't exist
1529 NoFinalErrorMsg:
1530 SectionEnd
1532 ; Sign our installer and uninstaller during compilation.
1533 !ifdef ENABLE_SIGNED_NSIS
1534 !finalize 'sign-wireshark.bat "%1"' = 0 ; %1 is replaced by the installer exe to be signed.
1535 !uninstfinalize 'sign-wireshark.bat "%1"' = 0 ; %1 is replaced by the uninstaller exe to be signed.
1536 !endif
1538 ; ============================================================================
1539 ; PLEASE MAKE SURE, THAT THE DESCRIPTIVE TEXT FITS INTO THE DESCRIPTION FIELD!
1540 ; ============================================================================
1541 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
1542 !ifdef QT_DIR
1543 !insertmacro MUI_DESCRIPTION_TEXT ${SecWiresharkQt} "The main network protocol analyzer application."
1544 !endif
1545 !insertmacro MUI_DESCRIPTION_TEXT ${SecTShark} "Text based network protocol analyzer."
1547 !insertmacro MUI_DESCRIPTION_TEXT ${SecExtcapGroup} "External Capture Interfaces"
1548 !insertmacro MUI_DESCRIPTION_TEXT ${SecAndroiddump} "Provide capture interfaces from Android devices."
1549 !ifdef BUILD_etwdump
1550 !insertmacro MUI_DESCRIPTION_TEXT ${SecEtwdump} "Provide an interface to read Event Tracing for Windows (ETW) event trace (ETL)."
1551 !endif
1552 !insertmacro MUI_DESCRIPTION_TEXT ${SecRandpktdump} "Provide an interface to the random packet generator. (see also randpkt)"
1553 !ifdef LIBSSH_FOUND
1554 !insertmacro MUI_DESCRIPTION_TEXT ${SecSshdump} "Provide remote capture through SSH. (tcpdump, Cisco EPC, wifi)"
1555 !endif
1556 !insertmacro MUI_DESCRIPTION_TEXT ${SecUDPdump} "Provide capture interface to receive UDP packets streamed from network devices."
1558 !insertmacro MUI_FUNCTION_DESCRIPTION_END
1560 !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
1561 !insertmacro MUI_DESCRIPTION_TEXT ${un.SecUinstall} "Uninstall all ${PROGRAM_NAME} components."
1562 !insertmacro MUI_DESCRIPTION_TEXT ${un.SecPlugins} "Uninstall all Plugins (even from previous ${PROGRAM_NAME} versions)."
1563 !insertmacro MUI_DESCRIPTION_TEXT ${un.SecProfiles} "Uninstall all global configuration profiles."
1564 !insertmacro MUI_DESCRIPTION_TEXT ${un.SecGlobalSettings} "Uninstall global settings like: $INSTDIR\cfilters"
1565 !insertmacro MUI_DESCRIPTION_TEXT ${un.SecPersonalSettings} "Delete personal configuration folder: $APPDATA\${PROGRAM_NAME}."
1566 !insertmacro MUI_DESCRIPTION_TEXT ${un.SecNpcap} "Call Npcap's uninstall program."
1567 !insertmacro MUI_DESCRIPTION_TEXT ${un.SecUSBPcap} "Call USBPcap's uninstall program."
1568 !insertmacro MUI_UNFUNCTION_DESCRIPTION_END
1570 ; ============================================================================
1571 ; Callback functions
1572 ; ============================================================================
1573 !ifdef QT_DIR
1575 Var QT_SELECTED
1577 ; Called from fnc_AdditionalTasksPage_Create via DisplayAdditionalTasksPage.
1578 Function InitAdditionalTasksPage
1579 ; We've created the Additional tasks page. Update our control states
1580 ; before they are shown.
1581 ; We set XXX_STATE -> XxxCheckBox here and go the other direction below.
1582 ${NSD_SetState} $hCtl_AdditionalTasksPage_StartMenuCheckBox $START_MENU_STATE
1583 ${NSD_SetState} $hCtl_AdditionalTasksPage_DesktopIconCheckBox $DESKTOP_ICON_STATE
1584 ${NSD_SetState} $hCtl_AdditionalTasksPage_AssociateExtensionsCheckBox $FILE_ASSOCIATE_STATE
1586 StrCpy $QT_SELECTED 0
1587 ${If} ${SectionIsSelected} ${SecWiresharkQt}
1588 StrCpy $QT_SELECTED 1
1589 ${Endif}
1590 EnableWindow $hCtl_AdditionalTasksPage_CreateShortcutsLabel $QT_SELECTED
1591 EnableWindow $hCtl_AdditionalTasksPage_StartMenuCheckBox $QT_SELECTED
1592 EnableWindow $hCtl_AdditionalTasksPage_DesktopIconCheckBox $QT_SELECTED
1594 EnableWindow $hCtl_AdditionalTasksPage_ExtensionsLabel $QT_SELECTED
1595 EnableWindow $hCtl_AdditionalTasksPage_AssociateExtensionsCheckBox $QT_SELECTED
1596 EnableWindow $hCtl_AdditionalTasksPage_FileExtensionsLabel $QT_SELECTED
1597 FunctionEnd
1599 Function LeaveAdditionalTasksPage
1600 ; We're leaving the Additional tasks page. Get our control states
1601 ; before they're destroyed.
1602 ; We set XxxCheckBox -> XXX_STATE here and go the other direction above.
1603 ${NSD_GetState} $hCtl_AdditionalTasksPage_StartMenuCheckBox $START_MENU_STATE
1604 ${NSD_GetState} $hCtl_AdditionalTasksPage_DesktopIconCheckBox $DESKTOP_ICON_STATE
1605 ${NSD_GetState} $hCtl_AdditionalTasksPage_AssociateExtensionsCheckBox $FILE_ASSOCIATE_STATE
1606 FunctionEnd
1608 !endif ; QT_DIR
1610 Var NPCAP_NAME ; DisplayName from Npcap installation
1611 Var WINPCAP_NAME ; DisplayName from WinPcap installation
1612 Var NPCAP_DISPLAY_VERSION ; DisplayVersion from Npcap installation
1613 Var USBPCAP_NAME ; DisplayName from USBPcap installation
1615 Function myShowCallback
1617 ClearErrors
1618 ; detect if WinPcap should be installed
1619 WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 4" "Text" "Install Npcap ${NPCAP_PACKAGE_VERSION}"
1620 ReadRegStr $NPCAP_NAME HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\NpcapInst" "DisplayName"
1621 IfErrors 0 lbl_npcap_installed
1622 ; check also if WinPcap is installed
1623 ReadRegStr $WINPCAP_NAME HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinPcapInst" "DisplayName"
1624 IfErrors 0 lbl_winpcap_installed ;if RegKey is available, WinPcap is already installed
1625 WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 2" "Text" "Neither of these are installed"
1626 WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 2" "Flags" "DISABLED"
1627 WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 5" "Text" "(Use Add/Remove Programs first to uninstall any undetected old Npcap or WinPcap versions)"
1628 Goto lbl_npcap_done
1630 lbl_npcap_installed:
1631 ReadRegStr $NPCAP_DISPLAY_VERSION HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\NpcapInst" "DisplayVersion"
1632 WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 1" "Text" "Currently installed Npcap version"
1633 StrCmp $NPCAP_NAME "Npcap" 0 +3
1634 WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 2" "Text" "Npcap $NPCAP_DISPLAY_VERSION"
1635 Goto +2
1636 WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 2" "Text" "$NPCAP_NAME"
1638 ; Compare the installed build against the one we have.
1639 StrCmp $NPCAP_DISPLAY_VERSION "" lbl_npcap_do_install ; Npcap wasn't installed improperly?
1640 ${VersionConvert} $NPCAP_DISPLAY_VERSION "" $R0 ; 0.99-r7 -> 0.99.114.7
1641 ${VersionConvert} "${NPCAP_PACKAGE_VERSION}" "" $R1
1642 ${VersionCompare} $R0 $R1 $1
1643 StrCmp $1 "2" lbl_npcap_do_install
1645 WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 4" "State" "0"
1646 WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 4" "Flags" "DISABLED"
1647 WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 5" "Text" "If you wish to install Npcap, please uninstall $NPCAP_NAME manually first."
1648 WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 5" "Flags" "DISABLED"
1649 Goto lbl_npcap_done
1651 lbl_winpcap_installed:
1652 WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 2" "Text" "$WINPCAP_NAME"
1653 WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 4" "State" "1"
1654 WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 5" "Text" "The currently installed $WINPCAP_NAME may be uninstalled first."
1655 Goto lbl_npcap_done
1657 lbl_npcap_do_install:
1658 ; seems to be an old version, install newer one
1659 WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 4" "State" "1"
1660 StrCmp $NPCAP_NAME "Npcap" 0 +3
1661 WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 5" "Text" "The currently installed Npcap $NPCAP_DISPLAY_VERSION will be uninstalled first."
1662 Goto +2
1663 WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 5" "Text" "The currently installed $NPCAP_NAME will be uninstalled first."
1665 lbl_npcap_done:
1667 ; detect if USBPcap should be installed
1668 WriteINIStr "$PLUGINSDIR\USBPcapPage.ini" "Field 4" "Text" "Install USBPcap ${USBPCAP_PACKAGE_VERSION}"
1669 ${If} ${RunningX64}
1670 ${DisableX64FSRedirection}
1671 SetRegView 64
1672 ${EndIf}
1673 ReadRegStr $USBPCAP_NAME HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\USBPcap" "DisplayName"
1674 ${If} ${RunningX64}
1675 ${EnableX64FSRedirection}
1676 SetRegView 32
1677 ${EndIf}
1678 IfErrors 0 lbl_usbpcap_installed ;if RegKey is available, USBPcap is already installed
1679 WriteINIStr "$PLUGINSDIR\USBPcapPage.ini" "Field 2" "Text" "USBPcap is currently not installed"
1680 WriteINIStr "$PLUGINSDIR\USBPcapPage.ini" "Field 2" "Flags" "DISABLED"
1681 WriteINIStr "$PLUGINSDIR\USBPcapPage.ini" "Field 5" "Text" "(Use Add/Remove Programs first to uninstall any undetected old USBPcap versions)"
1682 Goto lbl_usbpcap_done
1684 lbl_usbpcap_installed:
1685 WriteINIStr "$PLUGINSDIR\USBPcapPage.ini" "Field 2" "Text" "$USBPCAP_NAME"
1686 WriteINIStr "$PLUGINSDIR\USBPcapPage.ini" "Field 4" "State" "0"
1687 WriteINIStr "$PLUGINSDIR\USBPcapPage.ini" "Field 4" "Flags" "DISABLED"
1688 WriteINIStr "$PLUGINSDIR\USBPcapPage.ini" "Field 5" "Text" "If you wish to install USBPcap ${USBPCAP_PACKAGE_VERSION}, please uninstall $USBPCAP_NAME manually first."
1689 WriteINIStr "$PLUGINSDIR\USBPcapPage.ini" "Field 5" "Flags" "DISABLED"
1690 Goto lbl_usbpcap_done
1692 lbl_usbpcap_done:
1694 FunctionEnd