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