Update USBPcap installer packaged in our Windows installer and add a warning
[metze/wireshark/wip.git] / packaging / nsis / wireshark.nsi
1 ;
2 ; wireshark.nsi
3 ;
4
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
12
13 !include "common.nsh"
14 !include 'LogicLib.nsh'
15 !include "StrFunc.nsh"
16 ${StrRep}
17
18 ; See http://nsis.sourceforge.net/Check_if_a_file_exists_at_compile_time for documentation
19 !macro !defineifexist _VAR_NAME _FILE_NAME
20   !tempfile _TEMPFILE
21   !ifdef NSIS_WIN32_MAKENSIS
22     ; Windows - cmd.exe
23     !system 'if exist "${_FILE_NAME}" echo !define ${_VAR_NAME} > "${_TEMPFILE}"'
24   !else
25     ; Posix - sh
26     !system 'if [ -e "${_FILE_NAME}" ]; then echo "!define ${_VAR_NAME}" > "${_TEMPFILE}"; fi'
27   !endif
28   !include '${_TEMPFILE}'
29   !delfile '${_TEMPFILE}'
30   !undef _TEMPFILE
31 !macroend
32 !define !defineifexist "!insertmacro !defineifexist"
33
34 ; ============================================================================
35 ; Header configuration
36 ; ============================================================================
37
38 ; The file to write
39 OutFile "${PROGRAM_NAME}-${WIRESHARK_TARGET_PLATFORM}-${VERSION}.exe"
40 ; Installer icon
41 Icon "${TOP_SRC_DIR}\image\wiresharkinst.ico"
42
43 ; ============================================================================
44 ; Modern UI
45 ; ============================================================================
46 ; The modern user interface will look much better than the common one.
47 ; However, as the development of the modern UI is still going on, and the script
48 ; syntax changes, you will need exactly that NSIS version, which this script is
49 ; made for. This is the current (December 2003) latest version: V2.0b4
50 ; If you are using a different version, it's not predictable what will happen.
51
52 !include "MUI.nsh"
53 ;!addplugindir ".\Plugins"
54
55 !define MUI_ICON "${TOP_SRC_DIR}\image\wiresharkinst.ico"
56 BrandingText "Wireshark Installer (tm)"
57
58 !define MUI_COMPONENTSPAGE_SMALLDESC
59 !define MUI_FINISHPAGE_NOAUTOCLOSE
60 !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."
61 ;!define MUI_FINISHPAGE_LINK "Install WinPcap to be able to capture packets from a network."
62 ;!define MUI_FINISHPAGE_LINK_LOCATION "https://www.winpcap.org"
63
64 ; NSIS shows Readme files by opening the Readme file with the default application for
65 ; the file's extension. "README.win32" won't work in most cases, because extension "win32"
66 ; is usually not associated with an appropriate text editor. We should use extension "txt"
67 ; for a text file or "html" for an html README file.
68 !define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\NEWS.txt"
69 !define MUI_FINISHPAGE_SHOWREADME_TEXT "Show News"
70 !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
71 !define MUI_FINISHPAGE_RUN "$INSTDIR\${PROGRAM_NAME_PATH_QT}"
72 !define MUI_FINISHPAGE_RUN_NOTCHECKED
73
74 !define MUI_PAGE_CUSTOMFUNCTION_SHOW myShowCallback
75
76 ; ============================================================================
77 ; MUI Pages
78 ; ============================================================================
79
80 !insertmacro MUI_PAGE_WELCOME
81 !insertmacro MUI_PAGE_LICENSE "${STAGING_DIR}\COPYING.txt"
82 !insertmacro MUI_PAGE_COMPONENTS
83 Page custom DisplayAdditionalTasksPage
84 !insertmacro MUI_PAGE_DIRECTORY
85 Page custom DisplayWinPcapPage
86 Page custom DisplayUSBPcapPage
87 !insertmacro MUI_PAGE_INSTFILES
88 !insertmacro MUI_PAGE_FINISH
89
90 ; ============================================================================
91 ; MUI Languages
92 ; ============================================================================
93
94 !insertmacro MUI_LANGUAGE "English"
95
96 ; ============================================================================
97 ; Reserve Files
98 ; ============================================================================
99
100   ;Things that need to be extracted on first (keep these lines before any File command!)
101   ;Only useful for BZIP2 compression
102
103   ReserveFile "AdditionalTasksPage.ini"
104   ReserveFile "WinPcapPage.ini"
105   ReserveFile "USBPcapPage.ini"
106   !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
107
108 ; ============================================================================
109 ; Section macros
110 ; ============================================================================
111 !include "Sections.nsh"
112
113 ; ========= Macro to unselect and disable a section =========
114
115 !macro DisableSection SECTION
116
117   Push $0
118     SectionGetFlags "${SECTION}" $0
119     IntOp $0 $0 & ${SECTION_OFF}
120     IntOp $0 $0 | ${SF_RO}
121     SectionSetFlags "${SECTION}" $0
122   Pop $0
123
124 !macroend
125
126 ; ========= Macro to enable (unreadonly) a section =========
127 !define SECTION_ENABLE   0xFFFFFFEF
128 !macro EnableSection SECTION
129
130   Push $0
131     SectionGetFlags "${SECTION}" $0
132     IntOp $0 $0 & ${SECTION_ENABLE}
133     SectionSetFlags "${SECTION}" $0
134   Pop $0
135
136 !macroend
137
138 ; ============================================================================
139 ; Command Line
140 ; ============================================================================
141 !include "FileFunc.nsh"
142
143 !insertmacro GetParameters
144 !insertmacro GetOptions
145
146 ; ============================================================================
147 ; License page configuration
148 ; ============================================================================
149 LicenseText "Wireshark is distributed under the GNU General Public License."
150 LicenseData "${STAGING_DIR}\COPYING.txt"
151
152 ; ============================================================================
153 ; Component page configuration
154 ; ============================================================================
155 ComponentText "The following components are available for installation."
156
157 ; ============================================================================
158 ; Directory selection page configuration
159 ; ============================================================================
160 ; The text to prompt the user to enter a directory
161 DirText "Choose a directory in which to install ${PROGRAM_NAME}."
162
163 ; The default installation directory
164 !if ${WIRESHARK_TARGET_PLATFORM} == "win64"
165   InstallDir $PROGRAMFILES64\${PROGRAM_NAME}
166 !else
167   InstallDir $PROGRAMFILES\${PROGRAM_NAME}
168 !endif
169
170 ; See if this is an upgrade; if so, use the old InstallDir as default
171 InstallDirRegKey HKEY_LOCAL_MACHINE SOFTWARE\${PROGRAM_NAME} "InstallDir"
172
173
174 ; ============================================================================
175 ; Install page configuration
176 ; ============================================================================
177 ShowInstDetails show
178
179 ; ============================================================================
180 ; Functions and macros
181 ; ============================================================================
182
183 Var EXTENSION
184 ; https://msdn.microsoft.com/en-us/library/windows/desktop/cc144148.aspx
185 Function Associate
186     Push $R0
187 !insertmacro PushFileExtensions
188
189     Pop $EXTENSION
190
191     ${DoUntil} $EXTENSION == ${FILE_EXTENSION_MARKER}
192         ReadRegStr $R0 HKCR $EXTENSION ""
193         StrCmp $R0 "" Associate.doRegister
194         Goto Associate.end
195
196 Associate.doRegister:
197         ;The extension is not associated to any program, we can do the link
198         WriteRegStr HKCR $EXTENSION "" ${WIRESHARK_ASSOC}
199         DetailPrint "Registered file type: $EXTENSION"
200
201 Associate.end:
202         Pop $EXTENSION
203     ${Loop}
204
205     Pop $R0
206 FunctionEnd
207
208 Var OLD_UNINSTALLER
209 Var OLD_INSTDIR
210 Var OLD_DISPLAYNAME
211 Var TMP_UNINSTALLER
212
213 ; ============================================================================
214 ; 64-bit support
215 ; ============================================================================
216 !include x64.nsh
217
218 !include "GetWindowsVersion.nsh"
219 !include WinMessages.nsh
220
221 Function .onInit
222   !if ${WIRESHARK_TARGET_PLATFORM} == "win64"
223     ; http://forums.winamp.com/printthread.php?s=16ffcdd04a8c8d52bee90c0cae273ac5&threadid=262873
224     ${IfNot} ${RunningX64}
225       MessageBox MB_OK "This version of Wireshark only runs on x64 machines.$\nTry installing the 32-bit version instead." /SD IDOK
226       Abort
227     ${EndIf}
228   !endif
229
230     ; Get the Windows version
231     ${GetWindowsVersion} $R0
232
233     ; Uncomment to test.
234     ; MessageBox MB_OK "You're running Windows $R0."
235
236     ; Check if we're able to run with this version
237     StrCmp $R0 '95' lbl_winversion_unsupported
238     StrCmp $R0 '98' lbl_winversion_unsupported
239     StrCmp $R0 'ME' lbl_winversion_unsupported
240     StrCmp $R0 'NT 4.0' lbl_winversion_unsupported_nt4
241     StrCmp $R0 '2000' lbl_winversion_unsupported_2000
242     StrCmp $R0 'XP' lbl_winversion_unsupported_xp_2003
243     StrCmp $R0 '2003' lbl_winversion_unsupported_xp_2003
244     Goto lbl_winversion_supported
245
246 lbl_winversion_unsupported:
247     MessageBox MB_OK \
248         "Windows $R0 is no longer supported.$\nPlease install Ethereal 0.99.0 instead." \
249         /SD IDOK
250     Quit
251
252 lbl_winversion_unsupported_nt4:
253     MessageBox MB_OK \
254             "Windows $R0 is no longer supported.$\nPlease install Wireshark 0.99.4 instead." \
255             /SD IDOK
256     Quit
257
258 lbl_winversion_unsupported_2000:
259     MessageBox MB_OK \
260         "Windows $R0 is no longer supported.$\nPlease install Wireshark 1.2 or 1.0 instead." \
261         /SD IDOK
262     Quit
263
264 lbl_winversion_unsupported_xp_2003:
265     MessageBox MB_OK \
266         "Windows $R0 is no longer supported.$\nPlease install ${PROGRAM_NAME} 1.12 or 1.10 instead." \
267         /SD IDOK
268     Quit
269
270 lbl_winversion_supported:
271 !insertmacro IsWiresharkRunning
272
273   ; Copied from http://nsis.sourceforge.net/Auto-uninstall_old_before_installing_new
274   ReadRegStr $OLD_UNINSTALLER HKLM \
275     "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" \
276     "UninstallString"
277   StrCmp $OLD_UNINSTALLER "" done
278
279   ReadRegStr $OLD_INSTDIR HKLM \
280     "Software\Microsoft\Windows\CurrentVersion\App Paths\${PROGRAM_NAME}.exe" \
281     "Path"
282   StrCmp $OLD_INSTDIR "" done
283
284   ReadRegStr $OLD_DISPLAYNAME HKLM \
285     "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" \
286     "DisplayName"
287   StrCmp $OLD_DISPLAYNAME "" done
288
289   MessageBox MB_YESNOCANCEL|MB_ICONQUESTION \
290     "$OLD_DISPLAYNAME is already installed.\
291      $\n$\nWould you like to uninstall it first?" \
292       /SD IDYES \
293       IDYES prep_uninstaller \
294       IDNO done
295   Abort
296
297 ; Copy the uninstaller to $TEMP and run it.
298 ; The uninstaller normally does this by itself, but doesn't wait around
299 ; for the executable to finish, which means ExecWait won't work correctly.
300 prep_uninstaller:
301   ClearErrors
302   StrCpy $TMP_UNINSTALLER "$TEMP\${PROGRAM_NAME}_uninstaller.exe"
303   ; ...because we surround UninstallString in quotes.
304   StrCpy $0 $OLD_UNINSTALLER -1 1
305   StrCpy $1 "$TEMP\${PROGRAM_NAME}_uninstaller.exe"
306   StrCpy $2 1
307   System::Call 'kernel32::CopyFile(t r0, t r1, b r2) 1'
308   ExecWait "$TMP_UNINSTALLER /S _?=$OLD_INSTDIR"
309
310   Delete "$TMP_UNINSTALLER"
311
312 done:
313   ;Extract InstallOptions INI files
314   !insertmacro MUI_INSTALLOPTIONS_EXTRACT "AdditionalTasksPage.ini"
315   !insertmacro MUI_INSTALLOPTIONS_EXTRACT "WinpcapPage.ini"
316   !insertmacro MUI_INSTALLOPTIONS_EXTRACT "USBPcapPage.ini"
317 FunctionEnd
318
319 Function DisplayAdditionalTasksPage
320   !insertmacro MUI_HEADER_TEXT "Select Additional Tasks" "Which additional tasks should be done?"
321   !insertmacro MUI_INSTALLOPTIONS_DISPLAY "AdditionalTasksPage.ini"
322 FunctionEnd
323
324 Function DisplayWinPcapPage
325   !insertmacro MUI_HEADER_TEXT "Install WinPcap?" "WinPcap is required to capture live network data. Should WinPcap be installed?"
326   !insertmacro MUI_INSTALLOPTIONS_DISPLAY "WinPcapPage.ini"
327 FunctionEnd
328
329 Function DisplayUSBPcapPage
330   !insertmacro MUI_HEADER_TEXT "Install USBPcap?" "USBPcap is required to capture USB traffic. Should USBPcap be installed (experimental)?"
331   !insertmacro MUI_INSTALLOPTIONS_DISPLAY "USBPcapPage.ini"
332 FunctionEnd
333
334 ; ============================================================================
335 ; Installation execution commands
336 ; ============================================================================
337
338 Var WINPCAP_UNINSTALL ;declare variable for holding the value of a registry key
339 Var USBPCAP_UNINSTALL ;declare variable for holding the value of a registry key
340 ;Var WIRESHARK_UNINSTALL ;declare variable for holding the value of a registry key
341
342 !ifdef VCREDIST_EXE
343 Var VCREDIST_FLAGS ; silent vs passive, norestart
344 !endif
345
346 Section "-Required"
347 ;-------------------------------------------
348
349 ;
350 ; Install for every user
351 ;
352 SetShellVarContext all
353
354 SetOutPath $INSTDIR
355 File "${STAGING_DIR}\${UNINSTALLER_NAME}"
356 File "${STAGING_DIR}\wiretap-${WTAP_VERSION}.dll"
357 !ifdef ENABLE_LIBWIRESHARK
358 File "${STAGING_DIR}\libwireshark.dll"
359 !endif
360 File "${STAGING_DIR}\libwscodecs.dll"
361 File "${STAGING_DIR}\libwsutil.dll"
362
363 !include all-manifest.nsh
364
365 File "${STAGING_DIR}\COPYING.txt"
366 File "${STAGING_DIR}\NEWS.txt"
367 File "${STAGING_DIR}\README.txt"
368 File "${STAGING_DIR}\README.windows.txt"
369 File "${STAGING_DIR}\AUTHORS-SHORT"
370 File "${STAGING_DIR}\manuf"
371 File "${STAGING_DIR}\services"
372 File "${STAGING_DIR}\pdml2html.xsl"
373 File "${STAGING_DIR}\ws.css"
374 File "${STAGING_DIR}\wireshark.html"
375 File "${STAGING_DIR}\wireshark-filter.html"
376 File "${STAGING_DIR}\dumpcap.exe"
377 File "${STAGING_DIR}\dumpcap.html"
378 File "${STAGING_DIR}\extcap.html"
379 File "${STAGING_DIR}\ipmap.html"
380
381 ; C-runtime redistributable
382 !ifdef VCREDIST_EXE
383 ; vcredist_x64.exe - copy and execute the redistributable installer
384 File "${VCREDIST_EXE}"
385 ; If the user already has the redistributable installed they will see a
386 ; Big Ugly Dialog by default, asking if they want to uninstall or repair.
387 ; Ideally we should add a checkbox for this somewhere. In the meantime,
388 ; just do a "passive+norestart" install for MSVC 2010 and later and a
389 ; "silent" install otherwise.
390
391 ; http://blogs.msdn.com/b/astebner/archive/2010/10/20/10078468.aspx
392 ; http://allthingsconfigmgr.wordpress.com/2013/12/17/visual-c-redistributables-made-simple/
393 ; "!if ${MSVC_VER_REQUIRED} >= 1600" doesn't work.
394 !searchparse /noerrors ${MSVC_VER_REQUIRED} "1400" VCREDIST_FLAGS_Q "1500" VCREDIST_FLAGS_Q "1600" VCREDIST_FLAGS_Q_NORESTART
395 !ifdef VCREDIST_FLAGS_Q
396 StrCpy $VCREDIST_FLAGS "/q"
397 !else ; VCREDIST_FLAGS_Q
398 !ifdef VCREDIST_FLAGS_Q_NORESTART
399 StrCpy $VCREDIST_FLAGS "/q /norestart"
400 !else ; VCREDIST_FLAGS_Q_NORESTART
401 StrCpy $VCREDIST_FLAGS "/quiet /norestart"
402 !endif ; VCREDIST_FLAGS_Q_NORESTART
403 !endif ; VCREDIST_FLAGS_Q
404
405 ExecWait '"$INSTDIR\vcredist_${TARGET_MACHINE}.exe" $VCREDIST_FLAGS' $0
406 DetailPrint "vcredist_${TARGET_MACHINE} returned $0"
407 IntCmp $0 3010 redistReboot redistNoReboot
408 redistReboot:
409 SetRebootFlag true
410 redistNoReboot:
411 Delete "$INSTDIR\vcredist_${TARGET_MACHINE}.exe"
412 !else
413 !ifdef MSVCR_DLL
414 ; msvcr*.dll (MSVC V7 or V7.1) - simply copy the dll file
415 !echo "IF YOU GET AN ERROR HERE, check the MSVC_VARIANT setting in config.nmake: MSVC2005 vs. MSVC2005EE."
416 File "${MSVCR_DLL}"
417 !endif ; MSVCR_DLL
418 !endif ; VCREDIST_EXE
419
420
421 ; global config files - don't overwrite if already existing
422 ;IfFileExists cfilters dont_overwrite_cfilters
423 File "${STAGING_DIR}\cfilters"
424 ;dont_overwrite_cfilters:
425 ;IfFileExists colorfilters dont_overwrite_colorfilters
426 File "${STAGING_DIR}\colorfilters"
427 ;dont_overwrite_colorfilters:
428 ;IfFileExists dfilters dont_overwrite_dfilters
429 File "${STAGING_DIR}\dfilters"
430 ;dont_overwrite_dfilters:
431 ;IfFileExists smi_modules dont_overwrite_smi_modules
432 File "${STAGING_DIR}\smi_modules"
433 ;dont_overwrite_smi_modules:
434
435
436 ;
437 ; Install the Diameter DTD and XML files in the "diameter" subdirectory
438 ; of the installation directory.
439 ;
440 SetOutPath $INSTDIR\diameter
441 File "${STAGING_DIR}\diameter\AlcatelLucent.xml"
442 File "${STAGING_DIR}\diameter\chargecontrol.xml"
443 File "${STAGING_DIR}\diameter\Cisco.xml"
444 File "${STAGING_DIR}\diameter\Custom.xml"
445 File "${STAGING_DIR}\diameter\dictionary.dtd"
446 File "${STAGING_DIR}\diameter\dictionary.xml"
447 File "${STAGING_DIR}\diameter\eap.xml"
448 File "${STAGING_DIR}\diameter\Ericsson.xml"
449 File "${STAGING_DIR}\diameter\etsie2e4.xml"
450 File "${STAGING_DIR}\diameter\HP.xml"
451 File "${STAGING_DIR}\diameter\mobileipv4.xml"
452 File "${STAGING_DIR}\diameter\mobileipv6.xml"
453 File "${STAGING_DIR}\diameter\nasreq.xml"
454 File "${STAGING_DIR}\diameter\Nokia.xml"
455 File "${STAGING_DIR}\diameter\NokiaSolutionsAndNetworks.xml"
456 File "${STAGING_DIR}\diameter\Oracle.xml"
457 File "${STAGING_DIR}\diameter\sip.xml"
458 File "${STAGING_DIR}\diameter\Starent.xml"
459 File "${STAGING_DIR}\diameter\sunping.xml"
460 File "${STAGING_DIR}\diameter\TGPP.xml"
461 File "${STAGING_DIR}\diameter\TGPP2.xml"
462 File "${STAGING_DIR}\diameter\Vodafone.xml"
463 !include "custom_diameter_xmls.txt"
464 SetOutPath $INSTDIR
465
466 ;
467 ; Install the RADIUS directory files in the "radius" subdirectory
468 ; of the installation directory.
469 ;
470 SetOutPath $INSTDIR\radius
471 File "${STAGING_DIR}\radius\README.radius_dictionary"
472 File "${STAGING_DIR}\radius\custom.includes"
473 File "${STAGING_DIR}\radius\dictionary"
474 File "${STAGING_DIR}\radius\dictionary.3com"
475 File "${STAGING_DIR}\radius\dictionary.3gpp"
476 File "${STAGING_DIR}\radius\dictionary.3gpp2"
477 File "${STAGING_DIR}\radius\dictionary.acc"
478 File "${STAGING_DIR}\radius\dictionary.acme"
479 File "${STAGING_DIR}\radius\dictionary.airespace"
480 File "${STAGING_DIR}\radius\dictionary.actelis"
481 File "${STAGING_DIR}\radius\dictionary.aerohive"
482 File "${STAGING_DIR}\radius\dictionary.alcatel"
483 File "${STAGING_DIR}\radius\dictionary.alcatel.esam"
484 File "${STAGING_DIR}\radius\dictionary.alcatel.sr"
485 File "${STAGING_DIR}\radius\dictionary.alcatel-lucent.aaa"
486 File "${STAGING_DIR}\radius\dictionary.alteon"
487 File "${STAGING_DIR}\radius\dictionary.altiga"
488 File "${STAGING_DIR}\radius\dictionary.alvarion"
489 File "${STAGING_DIR}\radius\dictionary.alvarion.wimax.v2_2"
490 File "${STAGING_DIR}\radius\dictionary.apc"
491 File "${STAGING_DIR}\radius\dictionary.aptis"
492 File "${STAGING_DIR}\radius\dictionary.aruba"
493 File "${STAGING_DIR}\radius\dictionary.arbor"
494 File "${STAGING_DIR}\radius\dictionary.ascend"
495 File "${STAGING_DIR}\radius\dictionary.asn"
496 File "${STAGING_DIR}\radius\dictionary.audiocodes"
497 File "${STAGING_DIR}\radius\dictionary.avaya"
498 File "${STAGING_DIR}\radius\dictionary.azaire"
499 File "${STAGING_DIR}\radius\dictionary.bay"
500 File "${STAGING_DIR}\radius\dictionary.bluecoat"
501 File "${STAGING_DIR}\radius\dictionary.bintec"
502 File "${STAGING_DIR}\radius\dictionary.broadsoft"
503 File "${STAGING_DIR}\radius\dictionary.brocade"
504 File "${STAGING_DIR}\radius\dictionary.bskyb"
505 File "${STAGING_DIR}\radius\dictionary.bristol"
506 File "${STAGING_DIR}\radius\dictionary.bt"
507 File "${STAGING_DIR}\radius\dictionary.camiant"
508 File "${STAGING_DIR}\radius\dictionary.cablelabs"
509 File "${STAGING_DIR}\radius\dictionary.cabletron"
510 File "${STAGING_DIR}\radius\dictionary.chillispot"
511 File "${STAGING_DIR}\radius\dictionary.cisco"
512 File "${STAGING_DIR}\radius\dictionary.cisco.asa"
513 File "${STAGING_DIR}\radius\dictionary.cisco.bbsm"
514 File "${STAGING_DIR}\radius\dictionary.cisco.vpn3000"
515 File "${STAGING_DIR}\radius\dictionary.cisco.vpn5000"
516 File "${STAGING_DIR}\radius\dictionary.citrix"
517 File "${STAGING_DIR}\radius\dictionary.clavister"
518 File "${STAGING_DIR}\radius\dictionary.colubris"
519 File "${STAGING_DIR}\radius\dictionary.columbia_university"
520 File "${STAGING_DIR}\radius\dictionary.compatible"
521 File "${STAGING_DIR}\radius\dictionary.compat"
522 File "${STAGING_DIR}\radius\dictionary.cosine"
523 File "${STAGING_DIR}\radius\dictionary.dante"
524 File "${STAGING_DIR}\radius\dictionary.dhcp"
525 File "${STAGING_DIR}\radius\dictionary.dlink"
526 File "${STAGING_DIR}\radius\dictionary.digium"
527 File "${STAGING_DIR}\radius\dictionary.dragonwave"
528 File "${STAGING_DIR}\radius\dictionary.efficientip"
529 File "${STAGING_DIR}\radius\dictionary.eltex"
530 File "${STAGING_DIR}\radius\dictionary.epygi"
531 File "${STAGING_DIR}\radius\dictionary.equallogic"
532 File "${STAGING_DIR}\radius\dictionary.ericsson"
533 File "${STAGING_DIR}\radius\dictionary.ericsson.ab"
534 File "${STAGING_DIR}\radius\dictionary.ericsson.packet.core.networks"
535 File "${STAGING_DIR}\radius\dictionary.erx"
536 File "${STAGING_DIR}\radius\dictionary.extreme"
537 File "${STAGING_DIR}\radius\dictionary.f5"
538 File "${STAGING_DIR}\radius\dictionary.fdxtended"
539 File "${STAGING_DIR}\radius\dictionary.fortinet"
540 File "${STAGING_DIR}\radius\dictionary.foundry"
541 File "${STAGING_DIR}\radius\dictionary.freedhcp"
542 File "${STAGING_DIR}\radius\dictionary.freeradius"
543 File "${STAGING_DIR}\radius\dictionary.freeradius.internal"
544 File "${STAGING_DIR}\radius\dictionary.freeswitch"
545 File "${STAGING_DIR}\radius\dictionary.gandalf"
546 File "${STAGING_DIR}\radius\dictionary.garderos"
547 File "${STAGING_DIR}\radius\dictionary.gemtek"
548 File "${STAGING_DIR}\radius\dictionary.h3c"
549 File "${STAGING_DIR}\radius\dictionary.hp"
550 File "${STAGING_DIR}\radius\dictionary.huawei"
551 File "${STAGING_DIR}\radius\dictionary.iana"
552 File "${STAGING_DIR}\radius\dictionary.iea"
553 File "${STAGING_DIR}\radius\dictionary.infoblox"
554 File "${STAGING_DIR}\radius\dictionary.infonet"
555 File "${STAGING_DIR}\radius\dictionary.ipunplugged"
556 File "${STAGING_DIR}\radius\dictionary.issanni"
557 File "${STAGING_DIR}\radius\dictionary.itk"
558 File "${STAGING_DIR}\radius\dictionary.jradius"
559 File "${STAGING_DIR}\radius\dictionary.juniper"
560 File "${STAGING_DIR}\radius\dictionary.kineto"
561 File "${STAGING_DIR}\radius\dictionary.karlnet"
562 File "${STAGING_DIR}\radius\dictionary.lancom"
563 File "${STAGING_DIR}\radius\dictionary.livingston"
564 File "${STAGING_DIR}\radius\dictionary.localweb"
565 File "${STAGING_DIR}\radius\dictionary.lucent"
566 File "${STAGING_DIR}\radius\dictionary.manzara"
567 File "${STAGING_DIR}\radius\dictionary.meinberg"
568 File "${STAGING_DIR}\radius\dictionary.merit"
569 File "${STAGING_DIR}\radius\dictionary.meru"
570 File "${STAGING_DIR}\radius\dictionary.microsoft"
571 File "${STAGING_DIR}\radius\dictionary.mikrotik"
572 File "${STAGING_DIR}\radius\dictionary.motorola"
573 File "${STAGING_DIR}\radius\dictionary.motorola.wimax"
574 File "${STAGING_DIR}\radius\dictionary.navini"
575 File "${STAGING_DIR}\radius\dictionary.netscreen"
576 File "${STAGING_DIR}\radius\dictionary.networkphysics"
577 File "${STAGING_DIR}\radius\dictionary.nexans"
578 File "${STAGING_DIR}\radius\dictionary.nokia"
579 File "${STAGING_DIR}\radius\dictionary.nokia.conflict"
580 File "${STAGING_DIR}\radius\dictionary.nomadix"
581 File "${STAGING_DIR}\radius\dictionary.nortel"
582 File "${STAGING_DIR}\radius\dictionary.ntua"
583 File "${STAGING_DIR}\radius\dictionary.openser"
584 File "${STAGING_DIR}\radius\dictionary.packeteer"
585 File "${STAGING_DIR}\radius\dictionary.paloalto"
586 File "${STAGING_DIR}\radius\dictionary.patton"
587 File "${STAGING_DIR}\radius\dictionary.perle"
588 File "${STAGING_DIR}\radius\dictionary.propel"
589 File "${STAGING_DIR}\radius\dictionary.prosoft"
590 File "${STAGING_DIR}\radius\dictionary.proxim"
591 File "${STAGING_DIR}\radius\dictionary.purewave"
592 File "${STAGING_DIR}\radius\dictionary.quiconnect"
593 File "${STAGING_DIR}\radius\dictionary.quintum"
594 File "${STAGING_DIR}\radius\dictionary.redcreek"
595 File "${STAGING_DIR}\radius\dictionary.rfc2865"
596 File "${STAGING_DIR}\radius\dictionary.rfc2866"
597 File "${STAGING_DIR}\radius\dictionary.rfc2867"
598 File "${STAGING_DIR}\radius\dictionary.rfc2868"
599 File "${STAGING_DIR}\radius\dictionary.rfc2869"
600 File "${STAGING_DIR}\radius\dictionary.rfc3162"
601 File "${STAGING_DIR}\radius\dictionary.rfc3576"
602 File "${STAGING_DIR}\radius\dictionary.rfc3580"
603 File "${STAGING_DIR}\radius\dictionary.rfc4072"
604 File "${STAGING_DIR}\radius\dictionary.rfc4372"
605 File "${STAGING_DIR}\radius\dictionary.rfc4603"
606 File "${STAGING_DIR}\radius\dictionary.rfc4675"
607 File "${STAGING_DIR}\radius\dictionary.rfc4679"
608 File "${STAGING_DIR}\radius\dictionary.rfc4818"
609 File "${STAGING_DIR}\radius\dictionary.rfc4849"
610 File "${STAGING_DIR}\radius\dictionary.rfc5090"
611 File "${STAGING_DIR}\radius\dictionary.rfc5176"
612 File "${STAGING_DIR}\radius\dictionary.rfc5447"
613 File "${STAGING_DIR}\radius\dictionary.rfc5580"
614 File "${STAGING_DIR}\radius\dictionary.rfc5607"
615 File "${STAGING_DIR}\radius\dictionary.rfc5904"
616 File "${STAGING_DIR}\radius\dictionary.rfc6519"
617 File "${STAGING_DIR}\radius\dictionary.rfc6572"
618 File "${STAGING_DIR}\radius\dictionary.rfc6677"
619 File "${STAGING_DIR}\radius\dictionary.rfc6911"
620 File "${STAGING_DIR}\radius\dictionary.rfc6929"
621 File "${STAGING_DIR}\radius\dictionary.rfc6930"
622 File "${STAGING_DIR}\radius\dictionary.rfc7055"
623 File "${STAGING_DIR}\radius\dictionary.rfc7155"
624 File "${STAGING_DIR}\radius\dictionary.rfc7268"
625 File "${STAGING_DIR}\radius\dictionary.rfc7499"
626 File "${STAGING_DIR}\radius\dictionary.riverbed"
627 File "${STAGING_DIR}\radius\dictionary.riverstone"
628 File "${STAGING_DIR}\radius\dictionary.roaringpenguin"
629 File "${STAGING_DIR}\radius\dictionary.ruckus"
630 File "${STAGING_DIR}\radius\dictionary.ruggedcom"
631 File "${STAGING_DIR}\radius\dictionary.sg"
632 File "${STAGING_DIR}\radius\dictionary.shasta"
633 File "${STAGING_DIR}\radius\dictionary.shiva"
634 File "${STAGING_DIR}\radius\dictionary.siemens"
635 File "${STAGING_DIR}\radius\dictionary.slipstream"
636 File "${STAGING_DIR}\radius\dictionary.sofaware"
637 File "${STAGING_DIR}\radius\dictionary.sonicwall"
638 File "${STAGING_DIR}\radius\dictionary.springtide"
639 File "${STAGING_DIR}\radius\dictionary.starent"
640 File "${STAGING_DIR}\radius\dictionary.starent.vsa1"
641 File "${STAGING_DIR}\radius\dictionary.surfnet"
642 File "${STAGING_DIR}\radius\dictionary.symbol"
643 File "${STAGING_DIR}\radius\dictionary.t_systems_nova"
644 File "${STAGING_DIR}\radius\dictionary.telebit"
645 File "${STAGING_DIR}\radius\dictionary.telkom"
646 File "${STAGING_DIR}\radius\dictionary.terena"
647 File "${STAGING_DIR}\radius\dictionary.trapeze"
648 File "${STAGING_DIR}\radius\dictionary.travelping"
649 File "${STAGING_DIR}\radius\dictionary.tropos"
650 File "${STAGING_DIR}\radius\dictionary.ukerna"
651 File "${STAGING_DIR}\radius\dictionary.unix"
652 File "${STAGING_DIR}\radius\dictionary.usr"
653 File "${STAGING_DIR}\radius\dictionary.utstarcom"
654 File "${STAGING_DIR}\radius\dictionary.valemount"
655 File "${STAGING_DIR}\radius\dictionary.versanet"
656 File "${STAGING_DIR}\radius\dictionary.vqp"
657 File "${STAGING_DIR}\radius\dictionary.walabi"
658 File "${STAGING_DIR}\radius\dictionary.waverider"
659 File "${STAGING_DIR}\radius\dictionary.wichorus"
660 File "${STAGING_DIR}\radius\dictionary.wimax"
661 File "${STAGING_DIR}\radius\dictionary.wimax.alvarion"
662 File "${STAGING_DIR}\radius\dictionary.wimax.wichorus"
663 File "${STAGING_DIR}\radius\dictionary.wispr"
664 File "${STAGING_DIR}\radius\dictionary.xedia"
665 File "${STAGING_DIR}\radius\dictionary.xylan"
666 File "${STAGING_DIR}\radius\dictionary.yubico"
667 File "${STAGING_DIR}\radius\dictionary.zeus"
668 File "${STAGING_DIR}\radius\dictionary.zte"
669 File "${STAGING_DIR}\radius\dictionary.zyxel"
670 !include "custom_radius_dict.txt"
671 SetOutPath $INSTDIR
672
673 ;
674 ; install the dtds in the dtds subdirectory
675 ;
676 SetOutPath $INSTDIR\dtds
677 File "${STAGING_DIR}\dtds\dc.dtd"
678 File "${STAGING_DIR}\dtds\itunes.dtd"
679 File "${STAGING_DIR}\dtds\mscml.dtd"
680 File "${STAGING_DIR}\dtds\pocsettings.dtd"
681 File "${STAGING_DIR}\dtds\presence.dtd"
682 File "${STAGING_DIR}\dtds\reginfo.dtd"
683 File "${STAGING_DIR}\dtds\rlmi.dtd"
684 File "${STAGING_DIR}\dtds\rss.dtd"
685 File "${STAGING_DIR}\dtds\smil.dtd"
686 File "${STAGING_DIR}\dtds\xcap-caps.dtd"
687 File "${STAGING_DIR}\dtds\xcap-error.dtd"
688 File "${STAGING_DIR}\dtds\watcherinfo.dtd"
689 SetOutPath $INSTDIR
690
691 ; Install the TPNCP DAT file in the "tpncp" subdirectory
692 ; of the installation directory.
693 SetOutPath $INSTDIR\tpncp
694 File "${STAGING_DIR}\tpncp\tpncp.dat"
695
696 ;
697 ; install the wimaxasncp TLV definitions in the wimaxasncp subdirectory
698 ;
699 SetOutPath $INSTDIR\wimaxasncp
700 File "${STAGING_DIR}\wimaxasncp\dictionary.xml"
701 File "${STAGING_DIR}\wimaxasncp\dictionary.dtd"
702 SetOutPath $INSTDIR
703
704 SetOutPath $INSTDIR\help
705 File "${STAGING_DIR}\help\toc"
706 File "${STAGING_DIR}\help\overview.txt"
707 File "${STAGING_DIR}\help\getting_started.txt"
708 File "${STAGING_DIR}\help\capturing.txt"
709 File "${STAGING_DIR}\help\capture_filters.txt"
710 File "${STAGING_DIR}\help\display_filters.txt"
711 File "${STAGING_DIR}\help\faq.txt"
712
713 ; Write the uninstall keys for Windows
714 ; http://nsis.sourceforge.net/Add_uninstall_information_to_Add/Remove_Programs
715 ; https://msdn.microsoft.com/en-us/library/ms954376.aspx
716 ; https://msdn.microsoft.com/en-us/library/windows/desktop/aa372105.aspx
717 !define UNINSTALL_PATH "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}"
718
719 WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "Comments" "${DISPLAY_NAME}"
720 WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "DisplayIcon" "$INSTDIR\${PROGRAM_NAME_PATH_GTK},0"
721 WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "DisplayName" "${DISPLAY_NAME}"
722 WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "DisplayVersion" "${VERSION}"
723 WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "HelpLink" "https://ask.wireshark.org/"
724 WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "InstallLocation" "$INSTDIR"
725 WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "Publisher" "The Wireshark developer community, https://www.wireshark.org"
726 WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "URLInfoAbout" "https://www.wireshark.org"
727 WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "URLUpdateInfo" "https://www.wireshark.org/download.html"
728
729 WriteRegDWORD HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "NoModify" 1
730 WriteRegDWORD HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "NoRepair" 1
731 WriteRegDWORD HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "VersionMajor" ${VERSION_MAJOR}
732 WriteRegDWORD HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "VersionMinor" ${VERSION_MINOR}
733
734 WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "UninstallString" '"$INSTDIR\${UNINSTALLER_NAME}"'
735 WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "QuietUninstallString" '"$INSTDIR\${UNINSTALLER_NAME}" /S'
736
737 ; Write an entry for ShellExecute
738 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\${PROGRAM_NAME_PATH_GTK}" "" '$INSTDIR\${PROGRAM_NAME_PATH_GTK}'
739 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\${PROGRAM_NAME_PATH_GTK}" "Path" '$INSTDIR'
740 !ifdef QT_DIR
741 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\${PROGRAM_NAME_PATH_QT}" "" '$INSTDIR\${PROGRAM_NAME_PATH_QT}'
742 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\${PROGRAM_NAME_PATH_QT}" "Path" '$INSTDIR'
743 !endif
744
745 ; Create start menu entries (depending on additional tasks page)
746 ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 5" "State"
747 StrCmp $0 "0" SecRequired_skip_StartMenu
748 SetOutPath $PROFILE
749 ;CreateDirectory "$SMPROGRAMS\${PROGRAM_NAME}"
750 ; To quote "http://download.microsoft.com/download/0/4/6/046bbd36-0812-4c22-a870-41911c6487a6/WindowsUserExperience.pdf"
751 ; "Do not include Readme, Help, or Uninstall entries on the Programs menu."
752 Delete "$SMPROGRAMS\${PROGRAM_NAME}\Wireshark Web Site.lnk"
753 ;WriteINIStr "$SMPROGRAMS\${PROGRAM_NAME}\Wireshark Web Site.url" "InternetShortcut" "URL" "https://www.wireshark.org/"
754 CreateShortCut "$SMPROGRAMS\${PROGRAM_NAME_GTK}.lnk" "$INSTDIR\${PROGRAM_NAME_PATH_GTK}" "" "$INSTDIR\${PROGRAM_NAME_PATH_GTK}" 0 "" "" "${PROGRAM_FULL_NAME_GTK}"
755 ;CreateShortCut "$SMPROGRAMS\${PROGRAM_NAME}\Wireshark Manual.lnk" "$INSTDIR\wireshark.html"
756 ;CreateShortCut "$SMPROGRAMS\${PROGRAM_NAME}\Display Filters Manual.lnk" "$INSTDIR\wireshark-filter.html"
757 ;CreateShortCut "$SMPROGRAMS\${PROGRAM_NAME}\Wireshark Program Directory.lnk" "$INSTDIR"
758 SecRequired_skip_StartMenu:
759
760 ; is command line option "/desktopicon" set?
761 ${GetParameters} $R0
762 ${GetOptions} $R0 "/desktopicon=" $R1
763 StrCmp $R1 "no" SecRequired_skip_DesktopIcon
764 StrCmp $R1 "yes" SecRequired_install_DesktopIcon
765
766 ; Create desktop icon (depending on additional tasks page and command line option)
767 ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 6" "State"
768 StrCmp $0 "0" SecRequired_skip_DesktopIcon
769 SecRequired_install_DesktopIcon:
770 CreateShortCut "$DESKTOP\${PROGRAM_NAME_GTK}.lnk" "$INSTDIR\${PROGRAM_NAME_PATH_GTK}" "" "$INSTDIR\${PROGRAM_NAME_PATH_GTK}" 0 "" "" "${PROGRAM_FULL_NAME_GTK}"
771 SecRequired_skip_DesktopIcon:
772
773 ; is command line option "/quicklaunchicon" set?
774 ${GetParameters} $R0
775 ${GetOptions} $R0 "/quicklaunchicon=" $R1
776 StrCmp $R1 "no" SecRequired_skip_QuickLaunchIcon
777 StrCmp $R1 "yes" SecRequired_install_QuickLaunchIcon
778
779 ; Create quick launch icon (depending on additional tasks page and command line option)
780 ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 7" "State"
781 StrCmp $0 "0" SecRequired_skip_QuickLaunchIcon
782 SecRequired_install_QuickLaunchIcon:
783 CreateShortCut "$QUICKLAUNCH\${PROGRAM_NAME_GTK}.lnk" "$INSTDIR\${PROGRAM_NAME_PATH_GTK}" "" "$INSTDIR\${PROGRAM_NAME_PATH_GTK}" 0 "" "" "${PROGRAM_FULL_NAME_GTK}"
784 SecRequired_skip_QuickLaunchIcon:
785
786 ; Create File Extensions (depending on additional tasks page)
787 ; None Associate
788 ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 11" "State"
789 StrCmp $0 "1" SecRequired_skip_FileExtensions
790 ; GTK+ Associate
791 ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 10" "State"
792 StrCmp $0 "1" SecRequired_GTK_FileExtensions
793 ; Qt Associate
794 ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 9" "State"
795 StrCmp $0 "1" SecRequired_QT_FileExtensions
796
797 SecRequired_GTK_FileExtensions:
798 WriteRegStr HKCR ${WIRESHARK_ASSOC} "" "Wireshark capture file"
799 WriteRegStr HKCR "${WIRESHARK_ASSOC}\Shell\open\command" "" '"$INSTDIR\${PROGRAM_NAME_PATH_GTK}" "%1"'
800 WriteRegStr HKCR "${WIRESHARK_ASSOC}\DefaultIcon" "" '"$INSTDIR\${PROGRAM_NAME_PATH_GTK}",1'
801 Goto SecRequired_Associate_FileExtensions
802
803 SecRequired_QT_FileExtensions:
804 WriteRegStr HKCR ${WIRESHARK_ASSOC} "" "Wireshark capture file"
805 WriteRegStr HKCR "${WIRESHARK_ASSOC}\Shell\open\command" "" '"$INSTDIR\${PROGRAM_NAME_PATH_QT}" "%1"'
806 WriteRegStr HKCR "${WIRESHARK_ASSOC}\DefaultIcon" "" '"$INSTDIR\${PROGRAM_NAME_PATH_QT}",1'
807 Goto SecRequired_Associate_FileExtensions
808
809
810 SecRequired_Associate_FileExtensions:
811 ; We refresh the icon cache down in -Finally.
812 Call Associate
813 ; if somethings added here, add it also to the uninstall section and the AdditionalTask page
814
815 SecRequired_skip_FileExtensions:
816
817
818
819 ; if running as a silent installer, don't try to install winpcap
820 IfSilent SecRequired_skip_Winpcap
821
822 ; Install WinPcap (depending on winpcap page setting)
823 ReadINIStr $0 "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "State"
824 StrCmp $0 "0" SecRequired_skip_Winpcap
825 ; Uninstall old WinPcap first
826 ReadRegStr $WINPCAP_UNINSTALL HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinPcapInst" "UninstallString"
827 IfErrors lbl_winpcap_notinstalled ;if RegKey is unavailable, WinPcap is not installed
828 ; from released version 3.1, WinPcap will uninstall an old version by itself
829 ;ExecWait '$WINPCAP_UNINSTALL' $0
830 ;DetailPrint "WinPcap uninstaller returned $0"
831 lbl_winpcap_notinstalled:
832 SetOutPath $INSTDIR
833 File "${WIRESHARK_LIB_DIR}\WinPcap_${WINPCAP_PACKAGE_VERSION}.exe"
834 ExecWait '"$INSTDIR\WinPcap_${WINPCAP_PACKAGE_VERSION}.exe"' $0
835 DetailPrint "WinPcap installer returned $0"
836 SecRequired_skip_Winpcap:
837
838 ; If running as a silent installer, don't try to install USBPcap
839 IfSilent SecRequired_skip_USBPcap
840
841 ReadINIStr $0 "$PLUGINSDIR\USBPcapPage.ini" "Field 4" "State"
842 StrCmp $0 "0" SecRequired_skip_USBPcap
843 SetOutPath $INSTDIR
844 File "${WIRESHARK_LIB_DIR}\USBPcapSetup-${USBPCAP_DISPLAY_VERSION}.exe"
845 ExecWait '"$INSTDIR\USBPcapSetup-${USBPCAP_DISPLAY_VERSION}.exe"' $0
846 DetailPrint "USBPcap installer returned $0"
847 ${If} $0 == "0"
848     ${If} ${RunningX64}
849         ${DisableX64FSRedirection}
850         SetRegView 64
851     ${EndIf}
852     ReadRegStr $USBPCAP_UNINSTALL HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\USBPcap" "UninstallString"
853     ${If} ${RunningX64}
854         ${EnableX64FSRedirection}
855         SetRegView 32
856     ${EndIf}
857     CreateDirectory $INSTDIR\extcap
858     ${StrRep} $0 '$USBPCAP_UNINSTALL' 'Uninstall.exe' 'USBPcapCMD.exe'
859     ${StrRep} $1 '$0' '"' ''
860     CopyFiles  /SILENT $1 $INSTDIR\extcap
861     SetRebootFlag true
862 ${EndIf}
863 SecRequired_skip_USBPcap:
864
865 ; If no user profile exists for Wireshark but for Ethereal, copy it over
866 SetShellVarContext current
867 IfFileExists $APPDATA\Wireshark profile_done
868 IfFileExists $APPDATA\Ethereal 0 profile_done
869 ;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
870 CreateDirectory $APPDATA\Wireshark
871 CopyFiles $APPDATA\Ethereal\*.* $APPDATA\Wireshark
872 profile_done:
873 SetShellVarContext all
874
875 SectionEnd ; "Required"
876
877 !ifdef QT_DIR
878 Section "${PROGRAM_NAME}" SecWiresharkQt
879 ;-------------------------------------------
880 ; by default, Wireshark is installed but file is always associate with Wireshark GTK+
881 SetOutPath $INSTDIR
882 File "${QT_DIR}\${PROGRAM_NAME_PATH_QT}"
883 !include qt-dll-manifest.nsh
884 ${!defineifexist} TRANSLATIONS_FOLDER "${QT_DIR}\translations"
885 !ifdef TRANSLATIONS_FOLDER
886   ; Starting from Qt 5.5, *.qm files are put in a translations subfolder
887   File /r "${QT_DIR}\translations"
888 !else
889   File "${QT_DIR}\*.qm"
890 !endif
891
892 Push $0
893 ;SectionGetFlags ${SecWiresharkQt} $0
894 ;IntOp  $0 $0 & 1
895 ;CreateShortCut "$SMPROGRAMS\${PROGRAM_NAME_QT}.lnk" "$INSTDIR\${PROGRAM_NAME_PATH_QT}" "" "$INSTDIR\${PROGRAM_NAME_PATH_QT}" 0 "" "" "${PROGRAM_FULL_NAME_QT}"
896
897 ; Create start menu entries (depending on additional tasks page)
898 ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 2" "State"
899 StrCmp $0 "0" SecRequired_skip_StartMenuQt
900 CreateShortCut "$SMPROGRAMS\${PROGRAM_NAME_QT}.lnk" "$INSTDIR\${PROGRAM_NAME_PATH_QT}" "" "$INSTDIR\${PROGRAM_NAME_PATH_QT}" 0 "" "" "${PROGRAM_FULL_NAME_QT}"
901 SecRequired_skip_StartMenuQt:
902
903 ; is command line option "/desktopicon" set?
904 ${GetParameters} $R0
905 ${GetOptions} $R0 "/desktopicon=" $R1
906 StrCmp $R1 "no" SecRequired_skip_DesktopIconQt
907 StrCmp $R1 "yes" SecRequired_install_DesktopIconQt
908
909 ; Create desktop icon (depending on additional tasks page and command line option)
910 ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 3" "State"
911 StrCmp $0 "0" SecRequired_skip_DesktopIconQt
912 SecRequired_install_DesktopIconQt:
913 CreateShortCut "$DESKTOP\${PROGRAM_NAME_QT}.lnk" "$INSTDIR\${PROGRAM_NAME_PATH_QT}" "" "$INSTDIR\${PROGRAM_NAME_PATH_QT}" 0 "" "" "${PROGRAM_FULL_NAME_QT}"
914 SecRequired_skip_DesktopIconQt:
915
916 ; is command line option "/quicklaunchicon" set?
917 ${GetParameters} $R0
918 ${GetOptions} $R0 "/quicklaunchicon=" $R1
919 StrCmp $R1 "no" SecRequired_skip_QuickLaunchIconQt
920 StrCmp $R1 "yes" SecRequired_install_QuickLaunchIconQt
921
922 ; Create quick launch icon (depending on additional tasks page and command line option)
923 ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 4" "State"
924 StrCmp $0 "0" SecRequired_skip_QuickLaunchIconQt
925 SecRequired_install_QuickLaunchIconQt:
926 CreateShortCut "$QUICKLAUNCH\${PROGRAM_NAME_QT}.lnk" "$INSTDIR\${PROGRAM_NAME_PATH_QT}" "" "$INSTDIR\${PROGRAM_NAME_PATH_QT}" 0 "" "" "${PROGRAM_FULL_NAME_QT}"
927 SecRequired_skip_QuickLaunchIconQt:
928
929 Pop $0
930 SectionEnd ; "SecWiresharkQt"
931 !endif
932
933
934 Section "TShark" SecTShark
935 ;-------------------------------------------
936 SetOutPath $INSTDIR
937 File "${STAGING_DIR}\tshark.exe"
938 File "${STAGING_DIR}\tshark.html"
939 SectionEnd
940
941
942 !ifdef GTK_DIR
943 Section "${PROGRAM_NAME} 1" SecWiresharkGtk
944 ;-------------------------------------------
945 SetOutPath $INSTDIR
946 File "${STAGING_DIR}\${PROGRAM_NAME_PATH_GTK}"
947
948 !include gtk-dll-manifest.nsh
949
950 SectionEnd ; "SecWiresharkGtk"
951 !endif
952
953
954 SectionGroup "Plugins & Extensions" SecPluginsGroup
955
956 Section "Dissector Plugins" SecPlugins
957 ;-------------------------------------------
958 SetOutPath '$INSTDIR\plugins\${VERSION}'
959 File "${STAGING_DIR}\plugins\docsis.dll"
960 File "${STAGING_DIR}\plugins\ethercat.dll"
961 File "${STAGING_DIR}\plugins\gryphon.dll"
962 File "${STAGING_DIR}\plugins\irda.dll"
963 File "${STAGING_DIR}\plugins\m2m.dll"
964 File "${STAGING_DIR}\plugins\opcua.dll"
965 File "${STAGING_DIR}\plugins\profinet.dll"
966 File "${STAGING_DIR}\plugins\unistim.dll"
967 File "${STAGING_DIR}\plugins\wimax.dll"
968 File "${STAGING_DIR}\plugins\wimaxasncp.dll"
969 File "${STAGING_DIR}\plugins\wimaxmacphy.dll"
970 !include "custom_plugins.txt"
971 SectionEnd
972
973 Section "Tree Statistics Plugin" SecStatsTree
974 ;-------------------------------------------
975 SetOutPath '$INSTDIR\plugins\${VERSION}'
976 File "${STAGING_DIR}\plugins\stats_tree.dll"
977 SectionEnd
978
979 Section "Mate - Meta Analysis and Tracing Engine" SecMate
980 ;-------------------------------------------
981 SetOutPath '$INSTDIR\plugins\${VERSION}'
982 File "${STAGING_DIR}\plugins\mate.dll"
983 SectionEnd
984
985 Section "Configuration Profiles" SecProfiles
986 ;-------------------------------------------
987 ; This should be a function or macro
988 SetOutPath '$INSTDIR\profiles\Bluetooth'
989 File "${STAGING_DIR}\profiles\Bluetooth\colorfilters"
990 SetOutPath '$INSTDIR\profiles\Classic'
991 File "${STAGING_DIR}\profiles\Classic\colorfilters"
992 SectionEnd
993
994 !ifdef SMI_DIR
995 Section "SNMP MIBs" SecMIBs
996 ;-------------------------------------------
997 SetOutPath '$INSTDIR\snmp\mibs'
998 File "${SMI_DIR}\share\mibs\iana\*"
999 File "${SMI_DIR}\share\mibs\ietf\*"
1000 File "${SMI_DIR}\share\mibs\irtf\*"
1001 File "${SMI_DIR}\share\mibs\tubs\*"
1002 File "${SMI_DIR}\share\pibs\*"
1003 File "${SMI_DIR}\share\yang\*.yang"
1004 !include "custom_mibs.txt"
1005 SectionEnd
1006 !endif
1007
1008 SectionGroupEnd ; "Plugins / Extensions"
1009
1010
1011 SectionGroup "Tools" SecToolsGroup
1012
1013 Section "Editcap" SecEditcap
1014 ;-------------------------------------------
1015 SetOutPath $INSTDIR
1016 File "${STAGING_DIR}\editcap.exe"
1017 File "${STAGING_DIR}\editcap.html"
1018 SectionEnd
1019
1020 Section "Text2Pcap" SecText2Pcap
1021 ;-------------------------------------------
1022 SetOutPath $INSTDIR
1023 File "${STAGING_DIR}\text2pcap.exe"
1024 File "${STAGING_DIR}\text2pcap.html"
1025 SectionEnd
1026
1027 Section "Mergecap" SecMergecap
1028 ;-------------------------------------------
1029 SetOutPath $INSTDIR
1030 File "${STAGING_DIR}\mergecap.exe"
1031 File "${STAGING_DIR}\mergecap.html"
1032 SectionEnd
1033
1034 Section "Reordercap" SecReordercap
1035 ;-------------------------------------------
1036 SetOutPath $INSTDIR
1037 File "${STAGING_DIR}\reordercap.exe"
1038 SectionEnd
1039
1040 Section "Capinfos" SecCapinfos
1041 ;-------------------------------------------
1042 SetOutPath $INSTDIR
1043 File "${STAGING_DIR}\capinfos.exe"
1044 File "${STAGING_DIR}\capinfos.html"
1045 SectionEnd
1046
1047 Section "Rawshark" SecRawshark
1048 ;-------------------------------------------
1049 SetOutPath $INSTDIR
1050 File "${STAGING_DIR}\rawshark.exe"
1051 File "${STAGING_DIR}\rawshark.html"
1052 SectionEnd
1053
1054 Section /o "Androiddump" SecAndroiddumpinfos
1055 ;-------------------------------------------
1056 SetOutPath $INSTDIR
1057 File "${STAGING_DIR}\androiddump.html"
1058 SetOutPath $INSTDIR\extcap
1059 File "${STAGING_DIR}\extcap\androiddump.exe"
1060 SectionEnd
1061
1062 ;WIP: uncomment this section when sshdump on windows will be ready to go
1063 ;Section /o "Sshdump" SecSshdumpinfos
1064 ;-------------------------------------------
1065 ;SetOutPath $INSTDIR
1066 ;File "${STAGING_DIR}\sshdump.html"
1067 ;SetOutPath $INSTDIR\extcap
1068 ;File "${STAGING_DIR}\extcap\sshdump.exe"
1069 ;SectionEnd
1070
1071 Section /o "Randpktdump" SecRandpktdumpinfos
1072 ;-------------------------------------------
1073 SetOutPath $INSTDIR
1074 File "${STAGING_DIR}\randpktdump.html"
1075 SetOutPath $INSTDIR\extcap
1076 File "${STAGING_DIR}\extcap\randpktdump.exe"
1077 SectionEnd
1078
1079 SectionGroupEnd ; "Tools"
1080
1081 !ifdef USER_GUIDE_DIR
1082 Section "User's Guide" SecUsersGuide
1083 ;-------------------------------------------
1084 SetOutPath $INSTDIR
1085 File "${USER_GUIDE_DIR}\user-guide.chm"
1086 SectionEnd
1087 !endif
1088
1089 Section "-Finally"
1090
1091 !insertmacro UpdateIcons
1092
1093 ; Compute and write the installation directory size
1094 ${GetSize} "$INSTDIR" "/S=0K" $0 $1 $2
1095 IntFmt $0 "0x%08X" $0
1096 WriteRegDWORD HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "EstimatedSize" "$0"
1097
1098 SectionEnd
1099
1100 ; ============================================================================
1101 ; PLEASE MAKE SURE, THAT THE DESCRIPTIVE TEXT FITS INTO THE DESCRIPTION FIELD!
1102 ; ============================================================================
1103 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
1104 !ifdef QT_DIR
1105   !insertmacro MUI_DESCRIPTION_TEXT ${SecWiresharkQt} "The main network protocol analyzer application."
1106 !endif
1107   !insertmacro MUI_DESCRIPTION_TEXT ${SecTShark} "Text based network protocol analyzer."
1108 !ifdef GTK_DIR
1109   !insertmacro MUI_DESCRIPTION_TEXT ${SecWiresharkGtk} "The classic user interface."
1110 !endif
1111
1112   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsGroup} "Plugins and extensions for both ${PROGRAM_NAME} and TShark."
1113   !insertmacro MUI_DESCRIPTION_TEXT ${SecPlugins} "Additional protocol dissectors."
1114   !insertmacro MUI_DESCRIPTION_TEXT ${SecStatsTree} "Extended statistics."
1115   !insertmacro MUI_DESCRIPTION_TEXT ${SecMate} "Plugin - Meta Analysis and Tracing Engine (Experimental)."
1116
1117   !insertmacro MUI_DESCRIPTION_TEXT ${SecProfiles} "Configuration profiles"
1118
1119 !ifdef SMI_DIR
1120   !insertmacro MUI_DESCRIPTION_TEXT ${SecMIBs} "SNMP MIBs for better SNMP dissection."
1121 !endif
1122
1123   !insertmacro MUI_DESCRIPTION_TEXT ${SecToolsGroup} "Additional command line based tools."
1124   !insertmacro MUI_DESCRIPTION_TEXT ${SecAndroiddumpinfos} "Provide capture interfaces from Android devices"
1125 ;WIP: uncomment this section when sshdump on windows will be ready to go
1126 ;!insertmacro MUI_DESCRIPTION_TEXT ${SecSshdumpinfos} "Provide remote capture through SSH"
1127   !insertmacro MUI_DESCRIPTION_TEXT ${SecRandpktdumpinfos} "Provide random packet generator"
1128   !insertmacro MUI_DESCRIPTION_TEXT ${SecEditCap} "Copy packets to a new file, optionally trimmming packets, omitting them, or saving to a different format."
1129   !insertmacro MUI_DESCRIPTION_TEXT ${SecText2Pcap} "Read an ASCII hex dump and write the data into a libpcap-style capture file."
1130   !insertmacro MUI_DESCRIPTION_TEXT ${SecMergecap} "Combine multiple saved capture files into a single output file"
1131   !insertmacro MUI_DESCRIPTION_TEXT ${SecReordercap} "Copy packets to a new file, sorted by time."
1132   !insertmacro MUI_DESCRIPTION_TEXT ${SecCapinfos} "Pring information about capture files."
1133   !insertmacro MUI_DESCRIPTION_TEXT ${SecRawshark} "Raw packet filter."
1134
1135 !ifdef USER_GUIDE_DIR
1136   !insertmacro MUI_DESCRIPTION_TEXT ${SecUsersGuide} "Install an offline copy of the User's Guide."
1137 !endif
1138 !insertmacro MUI_FUNCTION_DESCRIPTION_END
1139
1140 ; ============================================================================
1141 ; Callback functions
1142 ; ============================================================================
1143 !ifdef QT_DIR
1144 ; Disable File extensions and icon if Wireshark (Qt / GTK+) isn't selected
1145 Function .onSelChange
1146     Push $0
1147     Goto onSelChange.checkqt
1148
1149 ;Check Wireshark Qt and after check GTK+
1150 onSelChange.checkqt:
1151     SectionGetFlags ${SecWiresharkQt} $0
1152     IntOp  $0 $0 & ${SF_SELECTED}
1153     IntCmp $0 0 onSelChange.unselectqt
1154     IntCmp $0 ${SF_SELECTED} onSelChange.selectqt
1155     Goto onSelChange.checkqt
1156
1157 onSelChange.unselectqt:
1158     ; Qt Icon
1159     WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 2" "Flags" "DISABLED"
1160     WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 2" "State" 0
1161     WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 3" "Flags" "DISABLED"
1162     WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 3" "State" 0
1163     WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 4" "Flags" "DISABLED"
1164     WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 4" "State" 0
1165     ; Qt Association
1166     WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 9" "State" 0
1167     WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 9" "Flags" "DISABLED"
1168     ; Select "None Association"
1169     WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 11" "State" 1
1170     Goto onSelChange.checkgtk
1171
1172 onSelChange.selectqt:
1173     ; Qt Icon
1174     WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 2" "Flags" ""
1175     WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 2" "State" 1
1176     WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 3" "Flags" ""
1177     WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 3" "State" 0
1178     WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 4" "Flags" ""
1179     WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 4" "State" 1
1180     ;Qt Association
1181     WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 9" "State" 1
1182     WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 9" "Flags" ""
1183     ; Force None and GTK+ Association to no selected
1184     WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 11" "State" 0
1185     WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 10" "State" 0
1186     Goto onSelChange.checkgtk
1187
1188 ;Check Wireshark GTK+
1189 onSelChange.checkgtk:
1190 !ifdef GTK_DIR
1191     SectionGetFlags ${SecWiresharkGtk} $0
1192     IntOp  $0 $0 & ${SF_SELECTED}
1193     IntCmp $0 0 onSelChange.unselectgtk
1194     IntCmp $0 ${SF_SELECTED} onSelChange.selectgtk
1195 !endif
1196     Goto onSelChange.end
1197
1198 !ifdef GTK_DIR
1199 onSelChange.unselectgtk:
1200     ;GTK+ Icon
1201     WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 5" "Flags" "DISABLED"
1202     WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 5" "State" 0
1203     WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 6" "Flags" "DISABLED"
1204     WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 6" "State" 0
1205     WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 7" "Flags" "DISABLED"
1206     WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 7" "State" 0
1207     ;GTK+ Association
1208     WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 10" "Flags" "DISABLED"
1209     Goto onSelChange.end
1210
1211 onSelChange.selectgtk:
1212     ;GTK+ Icon
1213     WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 5" "Flags" ""
1214     WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 5" "State" 1
1215     WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 6" "Flags" ""
1216     WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 6" "State" 0
1217     WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 7" "Flags" ""
1218     WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 7" "State" 1
1219     ;GTK+ Association
1220     WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 10" "Flags" ""
1221     Goto onSelChange.end
1222 !endif
1223
1224 onSelChange.end:
1225     Pop $0
1226 FunctionEnd
1227 !endif
1228
1229
1230 !include "VersionCompare.nsh"
1231
1232 Var WINPCAP_NAME ; DisplayName from WinPcap installation
1233 Var WINWINPCAP_VERSION ; DisplayVersion from WinPcap installation
1234 Var NPCAP_NAME ; DisplayName from Npcap installation
1235 Var USBPCAP_NAME ; DisplayName from USBPcap installation
1236
1237 Function myShowCallback
1238
1239 !ifdef GTK_DIR
1240     ; If GTK+ is available enable icon and associate from additional tasks
1241     ; GTK+ Icon
1242     WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 5" "Flags" ""
1243     WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 5" "State" 1
1244     WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 6" "Flags" ""
1245     WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 6" "State" 0
1246     WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 7" "Flags" ""
1247     WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 7" "State" 1
1248     ;Qt Association
1249     WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 10" "Flags" ""
1250 !endif
1251
1252     ClearErrors
1253     ; detect if WinPcap should be installed
1254     WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "Text" "Install WinPcap ${PCAP_DISPLAY_VERSION}"
1255     ReadRegStr $WINPCAP_NAME HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinPcapInst" "DisplayName"
1256     IfErrors 0 lbl_winpcap_installed ;if RegKey is available, WinPcap is already installed
1257     ; check also if Npcap is installed
1258     ReadRegStr $NPCAP_NAME HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\NpcapInst" "DisplayName"
1259     IfErrors 0 lbl_npcap_installed
1260     WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 2" "Text" "WinPcap is currently not installed"
1261     WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 2" "Flags" "DISABLED"
1262     WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Text" "(Use Add/Remove Programs first to uninstall any undetected old WinPcap versions)"
1263     Goto lbl_winpcap_done
1264
1265 lbl_winpcap_installed:
1266     WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 2" "Text" "$WINPCAP_NAME"
1267     ; Compare the installed build against the one we have.
1268     ReadRegStr $WINWINPCAP_VERSION HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinPcapInst" "DisplayVersion"
1269     StrCmp $WINWINPCAP_VERSION "" lbl_winpcap_do_install ; WinPcap is really old(?) or installed improperly.
1270     ${VersionCompare} $WINWINPCAP_VERSION "4.1.0.2980" $1 ; WinPcap 4.1.3
1271     StrCmp $1 "2" lbl_winpcap_do_install
1272
1273 ;lbl_winpcap_dont_install:
1274     ; The installed version is >= to what we have, so don't install
1275     WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "State" "0"
1276     WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Text" "If selected, the currently installed $WINPCAP_NAME will be uninstalled first."
1277     Goto lbl_winpcap_done
1278
1279 ;lbl_winpcap_dont_upgrade:
1280     ; force the user to upgrade by hand
1281     WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "State" "0"
1282     WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "Flags" "DISABLED"
1283     WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Text" "If you wish to install WinPcap ${PCAP_DISPLAY_VERSION}, please uninstall $WINPCAP_NAME manually first."
1284     WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Flags" "DISABLED"
1285     Goto lbl_winpcap_done
1286
1287 lbl_npcap_installed:
1288     ReadRegDWORD $0 HKEY_LOCAL_MACHINE "SOFTWARE\Npcap" "WinPcapCompatible"
1289     WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 1" "Text" "Currently installed Npcap version"
1290     ${If} $0 == "0"
1291         ; Npcap is installed without WinPcap API-compatible mode; WinPcap can be installed
1292         WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 2" "Text" "$NPCAP_NAME is currently installed without WinPcap API-compatible mode"
1293         WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "State" "1"
1294         WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Text" "(Use Add/Remove Programs first to uninstall any undetected old WinPcap versions)"
1295     ${Else}
1296         ; Npcap is installed with WinPcap API-compatible mode; WinPcap must not be installed
1297         WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 2" "Text" "$NPCAP_NAME"
1298         WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "State" "0"
1299         WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "Flags" "DISABLED"
1300         WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Text" "If you wish to install WinPcap ${PCAP_DISPLAY_VERSION}, please uninstall $NPCAP_NAME manually first."
1301         WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Flags" "DISABLED"
1302     ${EndIf}
1303     Goto lbl_winpcap_done
1304
1305 lbl_winpcap_do_install:
1306     ; seems to be an old version, install newer one
1307     WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "State" "1"
1308     WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Text" "The currently installed $WINPCAP_NAME will be uninstalled first."
1309
1310 lbl_winpcap_done:
1311
1312     ; detect if USBPcap should be installed
1313     WriteINIStr "$PLUGINSDIR\USBPcapPage.ini" "Field 4" "Text" "Install USBPcap ${USBPCAP_DISPLAY_VERSION}"
1314     ${If} ${RunningX64}
1315         ${DisableX64FSRedirection}
1316         SetRegView 64
1317     ${EndIf}
1318     ReadRegStr $USBPCAP_NAME HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\USBPcap" "DisplayName"
1319     ${If} ${RunningX64}
1320         ${EnableX64FSRedirection}
1321         SetRegView 32
1322     ${EndIf}
1323     IfErrors 0 lbl_usbpcap_installed ;if RegKey is available, USBPcap is already installed
1324     WriteINIStr "$PLUGINSDIR\USBPcapPage.ini" "Field 2" "Text" "USBPcap is currently not installed"
1325     WriteINIStr "$PLUGINSDIR\USBPcapPage.ini" "Field 2" "Flags" "DISABLED"
1326     WriteINIStr "$PLUGINSDIR\USBPcapPage.ini" "Field 5" "Text" "(Use Add/Remove Programs first to uninstall any undetected old USBPcap versions)"
1327     Goto lbl_usbpcap_done
1328
1329 lbl_usbpcap_installed:
1330     WriteINIStr "$PLUGINSDIR\USBPcapPage.ini" "Field 2" "Text" "$USBPCAP_NAME"
1331     WriteINIStr "$PLUGINSDIR\USBPcapPage.ini" "Field 4" "State" "0"
1332     WriteINIStr "$PLUGINSDIR\USBPcapPage.ini" "Field 4" "Flags" "DISABLED"
1333     WriteINIStr "$PLUGINSDIR\USBPcapPage.ini" "Field 5" "Text" "If you wish to install USBPcap ${USBPCAP_DISPLAY_VERSION}, please uninstall $USBPCAP_NAME manually first."
1334     WriteINIStr "$PLUGINSDIR\USBPcapPage.ini" "Field 5" "Flags" "DISABLED"
1335     Goto lbl_usbpcap_done
1336
1337 lbl_usbpcap_done:
1338
1339     ; if Wireshark was previously installed, unselect previously not installed icons etc.
1340     ; detect if Wireshark is already installed ->
1341     ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "UninstallString"
1342     IfErrors lbl_wireshark_notinstalled ;if RegKey is unavailable, Wireshark is not installed
1343
1344     ; only select Start Menu Group, if previously installed
1345     ; (we use the "all users" start menu, so select it first)
1346     SetShellVarContext all
1347
1348     ;Set State=1 to Desktop icon (no enable by default)
1349     WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 6" "State" "1"
1350 !ifdef QT_DIR
1351     WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 3" "State" "1"
1352 !endif
1353     IfFileExists "$SMPROGRAMS\${PROGRAM_NAME}\${PROGRAM_NAME}.lnk" lbl_have_gtk_startmenu
1354     IfFileExists "$SMPROGRAMS\${PROGRAM_NAME}.lnk" lbl_have_gtk_startmenu
1355     IfFileExists "$SMPROGRAMS\${PROGRAM_NAME_GTK}.lnk" lbl_have_gtk_startmenu
1356     WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 5" "State" "0"
1357 lbl_have_gtk_startmenu:
1358
1359     ; only select Desktop Icon, if previously installed
1360     IfFileExists "$DESKTOP\${PROGRAM_NAME}.lnk" lbl_have_gtk_desktopicon
1361     IfFileExists "$DESKTOP\${PROGRAM_NAME_GTK}.lnk" lbl_have_gtk_desktopicon
1362     WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 6" "State" "0"
1363 lbl_have_gtk_desktopicon:
1364
1365     ; only select Quick Launch Icon, if previously installed
1366     IfFileExists "$QUICKLAUNCH\${PROGRAM_NAME}.lnk" lbl_have_gtk_quicklaunchicon
1367     IfFileExists "$QUICKLAUNCH\${PROGRAM_NAME_GTK}.lnk" lbl_have_gtk_quicklaunchicon
1368     WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 7" "State" "0"
1369 lbl_have_gtk_quicklaunchicon:
1370
1371 !ifdef QT_DIR
1372     IfFileExists "$SMPROGRAMS\${PROGRAM_NAME_QT}.lnk" lbl_have_qt_startmenu
1373     WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 2" "State" "0"
1374 lbl_have_qt_startmenu:
1375
1376     ; only select Desktop Icon, if previously installed
1377     IfFileExists "$DESKTOP\${PROGRAM_NAME_QT}.lnk" lbl_have_qt_desktopicon
1378     WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 3" "State" "0"
1379 lbl_have_qt_desktopicon:
1380
1381     ; only select Quick Launch Icon, if previously installed
1382     IfFileExists "$QUICKLAUNCH\${PROGRAM_NAME_QT}.lnk" lbl_have_qt_quicklaunchicon
1383     WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 4" "State" "0"
1384 lbl_have_qt_quicklaunchicon:
1385 !endif
1386
1387 lbl_wireshark_notinstalled:
1388
1389 FunctionEnd
1390
1391 ;
1392 ; Editor modelines  -  https://www.wireshark.org/tools/modelines.html
1393 ;
1394 ; Local variables:
1395 ; c-basic-offset: 4
1396 ; tab-width: 8
1397 ; indent-tabs-mode: nil
1398 ; End:
1399 ;
1400 ; vi: set shiftwidth=4 tabstop=8 expandtab:
1401 ; :indentSize=4:tabSize=8:noTabs=true:
1402 ;