7 ; Set the compression mechanism first.
8 ; As of NSIS 2.07, solid compression which makes installer about 1MB smaller
9 ; is no longer the default, so use the /SOLID switch.
10 ; This unfortunately is unknown to NSIS prior to 2.07 and creates an error.
11 ; So if you get an error here, please update to at least NSIS 2.07!
12 SetCompressor /SOLID lzma
14 InstType "un.Default (keep Personal Settings and WinPcap)"
15 InstType "un.All (remove all)"
17 ; Used to refresh the display of file association
18 !define SHCNE_ASSOCCHANGED 0x08000000
19 !define SHCNF_IDLIST 0
21 ; Used to add associations between file extensions and Wireshark
22 !define WIRESHARK_ASSOC "wireshark-capture-file"
24 ; ============================================================================
25 ; Header configuration
26 ; ============================================================================
27 ; The name of the installer
28 !define PROGRAM_NAME "Wireshark"
29 !if ${PLATFORM} == "win32"
35 Name "${PROGRAM_NAME} ${VERSION} (${BITS}-bit)"
38 OutFile "wireshark-${PLATFORM}-${VERSION}.exe"
40 ; Icon of installer and uninstaller
41 Icon "..\..\image\wireshark.ico"
42 UninstallIcon "..\..\image\wireshark.ico"
44 ; Uninstall stuff (NSIS 2.08: "\r\n" don't work here)
45 !define MUI_UNCONFIRMPAGE_TEXT_TOP "The following Wireshark installation will be uninstalled. Click 'Next' to continue."
46 ; Uninstall stuff (this text isn't used with the MODERN_UI!)
47 ;UninstallText "This will uninstall Wireshark.\r\nBefore starting the uninstallation, make sure Wireshark is not running.\r\nClick 'Next' to continue."
53 ; ============================================================================
55 ; ============================================================================
56 ; The modern user interface will look much better than the common one.
57 ; However, as the development of the modern UI is still going on, and the script
58 ; syntax changes, you will need exactly that NSIS version, which this script is
59 ; made for. This is the current (December 2003) latest version: V2.0b4
60 ; If you are using a different version, it's not predictable what will happen.
63 ;!addplugindir ".\Plugins"
65 !define MUI_ICON "..\..\image\wireshark.ico"
66 !define MUI_UNICON "..\..\image\wireshark.ico"
68 !define MUI_COMPONENTSPAGE_SMALLDESC
69 !define MUI_FINISHPAGE_NOAUTOCLOSE
70 !define MUI_UNFINISHPAGE_NOAUTOCLOSE
71 !define MUI_WELCOMEPAGE_TEXT "This wizard will guide you through the installation of Wireshark.\r\n\r\nBefore starting the installation, make sure Wireshark is not running.\r\n\r\nClick 'Next' to continue."
72 ;!define MUI_FINISHPAGE_LINK "Install WinPcap to be able to capture packets from a network!"
73 ;!define MUI_FINISHPAGE_LINK_LOCATION "http://www.winpcap.org"
75 ; NSIS shows Readme files by opening the Readme file with the default application for
76 ; the file's extension. "README.win32" won't work in most cases, because extension "win32"
77 ; is usually not associated with an appropriate text editor. We should use extension "txt"
78 ; for a text file or "html" for an html README file.
79 !define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\NEWS.txt"
80 !define MUI_FINISHPAGE_SHOWREADME_TEXT "Show News"
81 !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
82 !define MUI_FINISHPAGE_RUN "$INSTDIR\wireshark.exe"
83 !define MUI_FINISHPAGE_RUN_NOTCHECKED
87 !define MUI_PAGE_CUSTOMFUNCTION_SHOW myShowCallback
89 ; ============================================================================
91 ; ============================================================================
93 !insertmacro MUI_PAGE_WELCOME
94 !insertmacro MUI_PAGE_LICENSE "..\..\COPYING"
95 !insertmacro MUI_PAGE_COMPONENTS
96 Page custom DisplayAdditionalTasksPage
97 !insertmacro MUI_PAGE_DIRECTORY
98 Page custom DisplayWinPcapPage
99 !insertmacro MUI_PAGE_INSTFILES
100 !insertmacro MUI_PAGE_FINISH
102 !insertmacro MUI_UNPAGE_WELCOME
103 !insertmacro MUI_UNPAGE_CONFIRM
104 !insertmacro MUI_UNPAGE_COMPONENTS
105 !insertmacro MUI_UNPAGE_INSTFILES
106 !insertmacro MUI_UNPAGE_FINISH
108 ; ============================================================================
110 ; ============================================================================
112 !insertmacro MUI_LANGUAGE "English"
114 ; ============================================================================
116 ; ============================================================================
118 ;Things that need to be extracted on first (keep these lines before any File command!)
119 ;Only useful for BZIP2 compression
121 ReserveFile "AdditionalTasksPage.ini"
122 ReserveFile "WinPcapPage.ini"
123 !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
125 ; ============================================================================
127 ; ============================================================================
128 !include "Sections.nsh"
130 ; ========= Macro to unselect and disable a section =========
132 !macro DisableSection SECTION
135 SectionGetFlags "${SECTION}" $0
136 IntOp $0 $0 & ${SECTION_OFF}
137 IntOp $0 $0 | ${SF_RO}
138 SectionSetFlags "${SECTION}" $0
143 ; ========= Macro to enable (unreadonly) a section =========
144 !define SECTION_ENABLE 0xFFFFFFEF
145 !macro EnableSection SECTION
148 SectionGetFlags "${SECTION}" $0
149 IntOp $0 $0 & ${SECTION_ENABLE}
150 SectionSetFlags "${SECTION}" $0
155 ; ============================================================================
157 ; ============================================================================
158 !include "servicelib.nsh"
160 ; ============================================================================
162 ; ============================================================================
163 !include "FileFunc.nsh"
165 !insertmacro GetParameters
166 !insertmacro GetOptions
168 ; ============================================================================
169 ; License page configuration
170 ; ============================================================================
171 LicenseText "Wireshark is distributed under the GNU General Public License."
172 LicenseData "..\..\COPYING"
174 ; ============================================================================
175 ; Component page configuration
176 ; ============================================================================
177 ComponentText "The following components are available for installation."
179 ; Component check boxes
180 ; Commented out for NSIS v 2.0
181 ; EnabledBitmap "..\..\image\nsis-checked.bmp"
182 ; DisabledBitmap "..\..\image\nsis-unchecked.bmp"
184 ; ============================================================================
185 ; Directory selection page configuration
186 ; ============================================================================
187 ; The text to prompt the user to enter a directory
188 DirText "Choose a directory in which to install Wireshark."
190 ; The default installation directory
191 InstallDir $PROGRAMFILES\Wireshark\
193 ; See if this is an upgrade; if so, use the old InstallDir as default
194 InstallDirRegKey HKEY_LOCAL_MACHINE SOFTWARE\Wireshark "InstallDir"
197 ; ============================================================================
198 ; Install page configuration
199 ; ============================================================================
201 ShowUninstDetails show
203 ; ============================================================================
204 ; Functions and macros
205 ; ============================================================================
211 !define UPDATEICONS_UNIQUE ${__LINE__}
213 IfFileExists "$SYSDIR\shell32.dll" UpdateIcons.next1_${UPDATEICONS_UNIQUE} UpdateIcons.error1_${UPDATEICONS_UNIQUE}
214 UpdateIcons.next1_${UPDATEICONS_UNIQUE}:
215 GetDllVersion "$SYSDIR\shell32.dll" $R0 $R1
216 IntOp $R2 $R0 / 0x00010000
217 IntCmp $R2 4 UpdateIcons.next2_${UPDATEICONS_UNIQUE} UpdateIcons.error2_${UPDATEICONS_UNIQUE}
218 UpdateIcons.next2_${UPDATEICONS_UNIQUE}:
219 System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (${SHCNE_ASSOCCHANGED}, ${SHCNF_IDLIST}, 0, 0)'
220 Goto UpdateIcons.quit_${UPDATEICONS_UNIQUE}
222 UpdateIcons.error1_${UPDATEICONS_UNIQUE}:
223 MessageBox MB_OK|MB_ICONSTOP "Can't find 'shell32.dll' library. Impossible to update icons"
224 Goto UpdateIcons.quit_${UPDATEICONS_UNIQUE}
225 UpdateIcons.error2_${UPDATEICONS_UNIQUE}:
226 MessageBox MB_OK|MB_ICONINFORMATION "You should install the free 'Microsoft Layer for Unicode' to update Wireshark capture file icons"
227 Goto UpdateIcons.quit_${UPDATEICONS_UNIQUE}
228 UpdateIcons.quit_${UPDATEICONS_UNIQUE}:
229 !undef UPDATEICONS_UNIQUE
237 ; $R0 should contain the prefix to associate to Wireshark
240 ReadRegStr $R1 HKCR $R0 ""
241 StrCmp $R1 "" Associate.doRegister
243 Associate.doRegister:
244 ;The extension is not associated to any program, we can do the link
245 WriteRegStr HKCR $R0 "" ${WIRESHARK_ASSOC}
251 ; $R0 should contain the prefix to unlink
254 ReadRegStr $R1 HKCR $R0 ""
255 StrCmp $R1 ${WIRESHARK_ASSOC} un.unlink.doUnlink
258 ; The extension is associated with Wireshark so, we must destroy this!
259 DeleteRegKey HKCR $R0
270 ; Copied from http://nsis.sourceforge.net/Auto-uninstall_old_before_installing_new
271 ReadRegStr $OLD_UNINSTALLER HKLM \
272 "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" \
274 StrCmp $OLD_UNINSTALLER "" done
276 ReadRegStr $OLD_INSTDIR HKLM \
277 "Software\Microsoft\Windows\CurrentVersion\App Paths\wireshark.exe" \
279 StrCmp $OLD_INSTDIR "" done
281 ReadRegStr $OLD_DISPLAYNAME HKLM \
282 "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" \
284 StrCmp $OLD_DISPLAYNAME "" done
286 MessageBox MB_YESNOCANCEL|MB_ICONQUESTION \
287 "$OLD_DISPLAYNAME is already installed.\
288 $\n$\nWould you like to uninstall it first?" \
293 ; Copy the uninstaller to $TEMP and run it.
294 ; The uninstaller normally does this by itself, but doesn't wait around
295 ; for the executable to finish, which means ExecWait won't work correctly.
298 StrCpy $TMP_UNINSTALLER "$TEMP\wireshark_uninstaller.exe"
299 ; ...because we surround UninstallString in quotes.
300 StrCpy $0 $OLD_UNINSTALLER -1 1
301 StrCpy $1 "$TEMP\wireshark_uninstaller.exe"
303 System::Call 'kernel32::CopyFile(t r0, t r1, b r2) 1'
304 ExecWait "$TMP_UNINSTALLER _?=$OLD_INSTDIR"
305 Delete "$TMP_UNINSTALLER"
308 ;Extract InstallOptions INI files
309 !insertmacro MUI_INSTALLOPTIONS_EXTRACT "AdditionalTasksPage.ini"
310 !insertmacro MUI_INSTALLOPTIONS_EXTRACT "WinpcapPage.ini"
313 Function DisplayAdditionalTasksPage
314 !insertmacro MUI_HEADER_TEXT "Select Additional Tasks" "Which additional tasks should be done?"
315 !insertmacro MUI_INSTALLOPTIONS_DISPLAY "AdditionalTasksPage.ini"
318 Function DisplayWinPcapPage
319 !insertmacro MUI_HEADER_TEXT "Install WinPcap?" "WinPcap is required to capture live network data. Should WinPcap be installed?"
320 !insertmacro MUI_INSTALLOPTIONS_DISPLAY "WinPcapPage.ini"
323 ; ============================================================================
324 ; Installation execution commands
325 ; ============================================================================
327 Var WINPCAP_UNINSTALL ;declare variable for holding the value of a registry key
328 ;Var WIRESHARK_UNINSTALL ;declare variable for holding the value of a registry key
331 ;-------------------------------------------
334 ; Install for every user
336 SetShellVarContext all
341 File "..\..\wiretap\wiretap-${WTAP_VERSION}.dll"
342 !ifdef ENABLE_LIBWIRESHARK
343 File "..\..\epan\libwireshark.dll"
345 File "..\..\wsutil\libwsutil.dll"
346 File "${GLIB_DIR}\bin\libgio-2.0-0.dll"
347 File "${GLIB_DIR}\bin\libglib-2.0-0.dll"
348 File "${GLIB_DIR}\bin\libgobject-2.0-0.dll"
349 File "${GLIB_DIR}\bin\libgmodule-2.0-0.dll"
351 File "${ICONV_DIR}\bin\iconv.dll"
353 File "${GETTEXT_DIR}\bin\intl.dll"
355 File "${ZLIB_DIR}\zlib1.dll"
358 File "${C_ARES_DIR}\cares.dll"
361 File "${ADNS_DIR}\..\${MSVC_VARIANT}\adns\adns_dll.dll"
364 File "${PCRE_DIR}\bin\pcre3.dll"
365 File "${PCRE_DIR}\man\cat3\pcrepattern.3.txt"
368 File "${KFW_DIR}\bin\comerr32.dll"
369 File "${KFW_DIR}\bin\krb5_32.dll"
372 File "${GNUTLS_DIR}\bin\libgcrypt-11.dll"
373 File "${GNUTLS_DIR}\bin\libgnutls-26.dll"
374 File "${GNUTLS_DIR}\bin\libgnutls-extra-26.dll"
375 File "${GNUTLS_DIR}\bin\libgnutls-openssl-26.dll"
376 File "${GNUTLS_DIR}\bin\libgpg-error-0.dll"
377 File "${GNUTLS_DIR}\bin\libtasn1-3.dll"
380 File "${LUA_DIR}\lua5.1.dll"
381 File "..\..\epan\wslua\init.lua"
382 File "..\..\epan\wslua\console.lua"
383 File "..\..\epan\wslua\dtd_gen.lua"
386 File "${SMI_DIR}\lib\smi.dll"
389 File "..\..\README.win32"
390 File "..\..\AUTHORS-SHORT"
394 File "..\..\services"
395 File "..\..\doc\ws.css"
396 File "..\..\doc\wireshark.html"
397 File "..\..\doc\wireshark-filter.html"
398 File "..\..\dumpcap.exe"
399 File "..\..\doc\dumpcap.html"
400 File "..\..\ipmap.html"
402 ; C-runtime redistributable
404 ; vcredist_x86.exe (MSVC V8) - copy and execute the redistributable installer
405 File "${VCREDIST_EXE}"
406 ExecWait '"$INSTDIR\vcredist_x86.exe"' $0
407 DetailPrint "vcredist_x86 returned $0"
410 ; msvcr*.dll (MSVC V7 or V7.1) - simply copy the dll file
411 !echo "IF YOU GET AN ERROR HERE, check the MSVC_VARIANT setting in config.nmake: MSVC2005 vs. MSVC2005EE!"
414 !if ${MSVC_VARIANT} != "MSVC6"
415 !error "C-Runtime redistributable for this package not available / not redistributable!"
418 !endif ; VCREDIST_EXE
421 ; global config files - don't overwrite if already existing
422 ;IfFileExists cfilters dont_overwrite_cfilters
423 File "..\..\cfilters"
424 ;dont_overwrite_cfilters:
425 ;IfFileExists colorfilters dont_overwrite_colorfilters
426 File "..\..\colorfilters"
427 ;dont_overwrite_colorfilters:
428 ;IfFileExists dfilters dont_overwrite_dfilters
429 File "..\..\dfilters"
430 ;dont_overwrite_dfilters:
431 ;IfFileExists smi_modules dont_overwrite_smi_modules
432 File "..\..\smi_modules"
433 ;dont_overwrite_smi_modules:
437 ; Install the Diameter DTD and XML files in the "diameter" subdirectory
438 ; of the installation directory.
440 SetOutPath $INSTDIR\diameter
441 File "..\..\diameter\chargecontrol.xml"
442 File "..\..\diameter\dictionary.dtd"
443 File "..\..\diameter\dictionary.xml"
444 File "..\..\diameter\Ericsson.xml"
445 File "..\..\diameter\etsie2e4.xml"
446 File "..\..\diameter\gqpolicy.xml"
447 File "..\..\diameter\imscxdx.xml"
448 File "..\..\diameter\mobileipv4.xml"
449 File "..\..\diameter\nasreq.xml"
450 File "..\..\diameter\sip.xml"
451 File "..\..\diameter\sunping.xml"
452 File "..\..\diameter\TGPPGmb.xml"
453 File "..\..\diameter\TGPPRx.xml"
454 File "..\..\diameter\TGPPSh.xml"
460 ; Install the RADIUS directory files in the "radius" subdirectory
461 ; of the installation directory.
463 SetOutPath $INSTDIR\radius
464 File "..\..\radius\dictionary"
465 File "..\..\radius\dictionary.3com"
466 File "..\..\radius\dictionary.3gpp"
467 File "..\..\radius\dictionary.3gpp2"
468 File "..\..\radius\dictionary.acc"
469 File "..\..\radius\dictionary.alcatel"
470 File "..\..\radius\dictionary.alteon"
471 File "..\..\radius\dictionary.altiga"
472 File "..\..\radius\dictionary.aptis"
473 File "..\..\radius\dictionary.ascend"
474 File "..\..\radius\dictionary.aruba"
475 File "..\..\radius\dictionary.bay"
476 File "..\..\radius\dictionary.bintec"
477 File "..\..\radius\dictionary.bristol"
478 File "..\..\radius\dictionary.cablelabs"
479 File "..\..\radius\dictionary.cabletron"
480 File "..\..\radius\dictionary.cisco"
481 File "..\..\radius\dictionary.cisco.bbsm"
482 File "..\..\radius\dictionary.cisco.vpn3000"
483 File "..\..\radius\dictionary.cisco.vpn5000"
484 File "..\..\radius\dictionary.colubris"
485 File "..\..\radius\dictionary.columbia_university"
486 File "..\..\radius\dictionary.compat"
487 File "..\..\radius\dictionary.cosine"
488 File "..\..\radius\dictionary.ericsson"
489 File "..\..\radius\dictionary.erx"
490 File "..\..\radius\dictionary.extreme"
491 File "..\..\radius\dictionary.foundry"
492 File "..\..\radius\dictionary.freeradius"
493 File "..\..\radius\dictionary.gandalf"
494 File "..\..\radius\dictionary.garderos"
495 File "..\..\radius\dictionary.gemtek"
496 File "..\..\radius\dictionary.itk"
497 File "..\..\radius\dictionary.juniper"
498 File "..\..\radius\dictionary.karlnet"
499 File "..\..\radius\dictionary.livingston"
500 File "..\..\radius\dictionary.localweb"
501 File "..\..\radius\dictionary.merit"
502 File "..\..\radius\dictionary.microsoft"
503 File "..\..\radius\dictionary.mikrotik"
504 File "..\..\radius\dictionary.navini"
505 File "..\..\radius\dictionary.netscreen"
506 File "..\..\radius\dictionary.nokia"
507 File "..\..\radius\dictionary.nomadix"
508 File "..\..\radius\dictionary.propel"
509 File "..\..\radius\dictionary.quintum"
510 File "..\..\radius\dictionary.redback"
511 File "..\..\radius\dictionary.redcreek"
512 File "..\..\radius\dictionary.shasta"
513 File "..\..\radius\dictionary.shiva"
514 File "..\..\radius\dictionary.sonicwall"
515 File "..\..\radius\dictionary.springtide"
516 File "..\..\radius\dictionary.t_systems_nova"
517 File "..\..\radius\dictionary.telebit"
518 File "..\..\radius\dictionary.trapeze"
519 File "..\..\radius\dictionary.tunnel"
520 File "..\..\radius\dictionary.unisphere"
521 File "..\..\radius\dictionary.unix"
522 File "..\..\radius\dictionary.usr"
523 File "..\..\radius\dictionary.valemount"
524 File "..\..\radius\dictionary.versanet"
525 File "..\..\radius\dictionary.wispr"
526 File "..\..\radius\dictionary.xedia"
530 ; install the dtds in the dtds subdirectory
532 SetOutPath $INSTDIR\dtds
533 File "..\..\dtds\dc.dtd"
534 File "..\..\dtds\itunes.dtd"
535 File "..\..\dtds\mscml.dtd"
536 File "..\..\dtds\pocsettings.dtd"
537 File "..\..\dtds\presence.dtd"
538 File "..\..\dtds\reginfo.dtd"
539 File "..\..\dtds\rlmi.dtd"
540 File "..\..\dtds\rss.dtd"
541 File "..\..\dtds\smil.dtd"
542 File "..\..\dtds\xcap-caps.dtd"
543 File "..\..\dtds\xcap-error.dtd"
544 File "..\..\dtds\watcherinfo.dtd"
547 ; Install the TPNCP DAT file in the "tpncp" subdirectory
548 ; of the installation directory.
549 SetOutPath $INSTDIR\tpncp
550 File "..\..\tpncp\tpncp.dat"
553 ; install the wimaxasncp TLV definitions in the wimaxasncp subdirectory
555 SetOutPath $INSTDIR\wimaxasncp
556 File "..\..\wimaxasncp\dictionary.xml"
557 File "..\..\wimaxasncp\dictionary.dtd"
560 SetOutPath $INSTDIR\help
561 File "..\..\help\toc"
562 File "..\..\help\overview.txt"
563 File "..\..\help\getting_started.txt"
564 File "..\..\help\capturing.txt"
565 File "..\..\help\capture_filters.txt"
566 File "..\..\help\display_filters.txt"
567 File "..\..\help\faq.txt"
569 ; Write the uninstall keys for Windows
570 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "DisplayVersion" "${VERSION}"
571 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "DisplayName" "Wireshark ${VERSION}"
572 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "UninstallString" '"$INSTDIR\uninstall.exe"'
573 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "Publisher" "The Wireshark developer community, http://www.wireshark.org"
574 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "HelpLink" "mailto:wireshark-users@wireshark.org"
575 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "URLInfoAbout" "http://www.wireshark.org"
576 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "URLUpdateInfo" "http://www.wireshark.org/download/win32/"
577 WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "NoModify" 1
578 WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "NoRepair" 1
579 WriteUninstaller "uninstall.exe"
581 ; Write an entry for ShellExecute
582 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\wireshark.exe" "" '$INSTDIR\wireshark.exe'
583 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\wireshark.exe" "Path" '$INSTDIR'
585 ; Create start menu entries (depending on additional tasks page)
586 ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 2" "State"
587 StrCmp $0 "0" SecRequired_skip_StartMenu
589 ;CreateDirectory "$SMPROGRAMS\Wireshark"
590 ; To qoute "http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwue/html/ch11d.asp":
591 ; "Do not include Readme, Help, or Uninstall entries on the Programs menu."
592 Delete "$SMPROGRAMS\Wireshark\Wireshark Web Site.lnk"
593 ;WriteINIStr "$SMPROGRAMS\Wireshark\Wireshark Web Site.url" "InternetShortcut" "URL" "http://www.wireshark.org/"
594 CreateShortCut "$SMPROGRAMS\Wireshark.lnk" "$INSTDIR\wireshark.exe" "" "$INSTDIR\wireshark.exe" 0 "" "" "The Wireshark Network Protocol Analyzer"
595 ;CreateShortCut "$SMPROGRAMS\Wireshark\Wireshark Manual.lnk" "$INSTDIR\wireshark.html"
596 ;CreateShortCut "$SMPROGRAMS\Wireshark\Display Filters Manual.lnk" "$INSTDIR\wireshark-filter.html"
597 ;CreateShortCut "$SMPROGRAMS\Wireshark\Wireshark Program Directory.lnk" "$INSTDIR"
598 ;CreateShortCut "$SMPROGRAMS\Wireshark\Uninstall Wireshark.lnk" "$INSTDIR\uninstall.exe"
599 SecRequired_skip_StartMenu:
601 ; is command line option "/desktopicon" set?
603 ${GetOptions} $R0 "/desktopicon=" $R1
604 StrCmp $R1 "no" SecRequired_skip_DesktopIcon
605 StrCmp $R1 "yes" SecRequired_install_DesktopIcon
607 ; Create desktop icon (depending on additional tasks page and command line option)
608 ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 3" "State"
609 StrCmp $0 "0" SecRequired_skip_DesktopIcon
610 SecRequired_install_DesktopIcon:
611 CreateShortCut "$DESKTOP\Wireshark.lnk" "$INSTDIR\wireshark.exe" "" "$INSTDIR\wireshark.exe" 0 "" "" "The Wireshark Network Protocol Analyzer"
612 SecRequired_skip_DesktopIcon:
614 ; is command line option "/quicklaunchicon" set?
616 ${GetOptions} $R0 "/quicklaunchicon=" $R1
617 StrCmp $R1 "no" SecRequired_skip_QuickLaunchIcon
618 StrCmp $R1 "yes" SecRequired_install_QuickLaunchIcon
620 ; Create quick launch icon (depending on additional tasks page and command line option)
621 ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 4" "State"
622 StrCmp $0 "0" SecRequired_skip_QuickLaunchIcon
623 SecRequired_install_QuickLaunchIcon:
624 CreateShortCut "$QUICKLAUNCH\Wireshark.lnk" "$INSTDIR\wireshark.exe" "" "$INSTDIR\wireshark.exe" 0 "" "" "The Wireshark Network Protocol Analyzer"
625 SecRequired_skip_QuickLaunchIcon:
627 ; Create File Extensions (depending on additional tasks page)
628 ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 6" "State"
629 StrCmp $0 "0" SecRequired_skip_FileExtensions
630 WriteRegStr HKCR ${WIRESHARK_ASSOC} "" "Wireshark capture file"
631 WriteRegStr HKCR "${WIRESHARK_ASSOC}\Shell\open\command" "" '"$INSTDIR\wireshark.exe" "%1"'
632 WriteRegStr HKCR "${WIRESHARK_ASSOC}\DefaultIcon" "" '"$INSTDIR\wireshark.exe",1'
674 ; if somethings added here, add it also to the uninstall section and the AdditionalTask page
676 !insertmacro UpdateIcons
677 SecRequired_skip_FileExtensions:
679 ; if running as a silent installer, don't try to install winpcap
680 IfSilent SecRequired_skip_Winpcap
682 ; Install WinPcap (depending on winpcap page setting)
683 ReadINIStr $0 "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "State"
684 StrCmp $0 "0" SecRequired_skip_Winpcap
685 ; Uinstall old WinPcap first
686 ReadRegStr $WINPCAP_UNINSTALL HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinPcapInst" "UninstallString"
687 IfErrors lbl_winpcap_notinstalled ;if RegKey is unavailable, WinPcap is not installed
688 ; from released version 3.1, WinPcap will uninstall an old version by itself
689 ;ExecWait '$WINPCAP_UNINSTALL' $0
690 ;DetailPrint "WinPcap uninstaller returned $0"
691 lbl_winpcap_notinstalled:
693 File "WinPcap_4_0_2.exe"
694 ExecWait '"$INSTDIR\WinPcap_4_0_2.exe"' $0
695 DetailPrint "WinPcap installer returned $0"
696 SecRequired_skip_Winpcap:
698 ; Load Winpcap NPF service at startup (depending on winpcap page)
699 ReadINIStr $0 "$PLUGINSDIR\WinPcapPage.ini" "Field 8" "State"
700 StrCmp $0 "0" SecRequired_no_WinpcapService
701 WriteRegDWORD HKEY_LOCAL_MACHINE "SYSTEM\CurrentControlSet\Services\NPF" "Start" 2 ;set NPF to (SERVICE_AUTO_START)
702 !insertmacro SERVICE "start" "NPF" ""
703 Goto SecRequired_done_WinpcapService
704 SecRequired_no_WinpcapService:
705 WriteRegDWORD HKEY_LOCAL_MACHINE "SYSTEM\CurrentControlSet\Services\NPF" "Start" 3 ;set NPF to (SERVICE_DEMAND_START)
706 !insertmacro SERVICE "stop" "NPF" ""
707 SecRequired_done_WinpcapService:
709 ; If no user profile exists for Wireshark but for Ethereal, copy it over
710 SetShellVarContext current
711 IfFileExists $APPDATA\Wireshark profile_done
712 IfFileExists $APPDATA\Ethereal 0 profile_done
713 ;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
714 CreateDirectory $APPDATA\Wireshark
715 CopyFiles $APPDATA\Ethereal\*.* $APPDATA\Wireshark
717 SetShellVarContext all
719 SectionEnd ; "Required"
722 Section "Wireshark" SecWireshark
723 ;-------------------------------------------
725 File "..\..\wireshark.exe"
726 File "${GTK_DIR}\bin\libgdk-win32-2.0-0.dll"
727 File "${GTK_DIR}\bin\libgdk_pixbuf-2.0-0.dll"
728 File "${GTK_DIR}\bin\libgtk-win32-2.0-0.dll"
729 File "${GTK_DIR}\bin\libatk-1.0-0.dll"
730 File "${GTK_DIR}\bin\libpango-1.0-0.dll"
731 File "${GTK_DIR}\bin\libpangowin32-1.0-0.dll"
732 !ifdef NEED_CAIRO_DLL
733 File "${GTK_DIR}\bin\libcairo-2.dll"
734 File "${GTK_DIR}\bin\libpangocairo-1.0-0.dll"
736 !ifdef NEED_LIBPNG_DLL
737 File "${GTK_DIR}\bin\libpng12-0.dll"
739 !ifdef NEED_LIBTIFF_DLL
740 File "${GTK_DIR}\bin\libtiff3.dll"
742 !ifdef NEED_LIBJPEG_DLL
743 File "${GTK_DIR}\bin\jpeg62.dll"
745 SetOutPath $INSTDIR\etc\gtk-2.0
746 File "${GTK_DIR}\etc\gtk-2.0\*.*"
747 SetOutPath $INSTDIR\etc\pango
748 File "${GTK_DIR}\etc\pango\pango.*"
749 SetOutPath $INSTDIR\lib\gtk-2.0\${GTK_LIB_DIR}\loaders
750 File "${GTK_DIR}\lib\gtk-2.0\${GTK_LIB_DIR}\loaders\libpixbufloader-*.dll"
751 SetOutPath $INSTDIR\lib\gtk-2.0\${GTK_LIB_DIR}\engines
752 File "${GTK_DIR}\lib\gtk-2.0\${GTK_LIB_DIR}\engines\libpixmap.dll"
753 SetOutPath $INSTDIR\lib\gtk-2.0\modules
754 File "${GTK_DIR}\lib\gtk-2.0\modules\libgail.dll"
755 # Not needed with pango 1.14.5
756 #SetOutPath $INSTDIR\lib\pango\${PANGO_LIB_DIR}\modules
757 #File "${GTK_DIR}\lib\pango\${PANGO_LIB_DIR}\modules\pango-*.dll"
759 ; GTK MS-Windows Engine (GTK-Wimp)
760 SetOutPath $INSTDIR\${GTK_WIMP_DLLDST_DIR}
761 File "${GTK_WIMP_DLLSRC_DIR}\libwimp.dll"
762 SetOutPath $INSTDIR\${GTK_WIMP_RCDST_DIR}
763 File "${GTK_WIMP_RCSRC_DIR}\gtkrc"
765 SectionEnd ; "Wireshark"
769 Section "TShark" SecTShark
770 ;-------------------------------------------
772 File "..\..\tshark.exe"
773 File "..\..\doc\tshark.html"
776 SectionGroup "Plugins / Extensions" SecPluginsGroup
778 Section "Dissector Plugins" SecPlugins
779 ;-------------------------------------------
780 SetOutPath $INSTDIR\plugins\${VERSION}
781 File "..\..\plugins\agentx\agentx.dll"
782 File "..\..\plugins\artnet\artnet.dll"
783 File "..\..\plugins\asn1\asn1.dll"
784 File "..\..\plugins\ciscosm\ciscosm.dll"
785 File "..\..\plugins\docsis\docsis.dll"
786 File "..\..\plugins\enttec\enttec.dll"
787 File "..\..\plugins\ethercat\ethercat.dll"
788 File "..\..\plugins\giop\coseventcomm.dll"
789 File "..\..\plugins\giop\cosnaming.dll"
790 File "..\..\plugins\giop\parlay.dll"
791 File "..\..\plugins\giop\tango.dll"
792 File "..\..\plugins\gryphon\gryphon.dll"
793 File "..\..\plugins\infiniband\infiniband.dll"
794 File "..\..\plugins\irda\irda.dll"
795 File "..\..\plugins\lwres\lwres.dll"
796 File "..\..\plugins\m2m\m2m.dll"
797 File "..\..\plugins\opsi\opsi.dll"
798 File "..\..\plugins\pcli\pcli.dll"
799 File "..\..\plugins\profinet\profinet.dll"
800 File "..\..\plugins\rlm\rlm.dll"
801 File "..\..\plugins\rtnet\rtnet.dll"
802 File "..\..\plugins\rudp\rudp.dll"
803 File "..\..\plugins\sbus\sbus.dll"
804 File "..\..\plugins\sercosiii\sercosiii.dll"
805 File "..\..\plugins\unistim\unistim.dll"
806 File "..\..\plugins\v5ua\v5ua.dll"
807 File "..\..\plugins\wimax\wimax.dll"
808 File "..\..\plugins\wimaxasncp\wimaxasncp.dll"
811 Section "Tree Statistics Plugin" SecStatsTree
812 ;-------------------------------------------
813 SetOutPath $INSTDIR\plugins\${VERSION}
814 File "..\..\plugins\stats_tree\stats_tree.dll"
817 Section "Mate - Meta Analysis and Tracing Engine" SecMate
818 ;-------------------------------------------
819 SetOutPath $INSTDIR\plugins\${VERSION}
820 File "..\..\plugins\mate\mate.dll"
825 Section "SNMP MIBs" SecMIBs
826 ;-------------------------------------------
827 SetOutPath $INSTDIR\snmp\mibs
828 File "${NET_SNMP_DIR}\mibs\*.txt"
833 Section "SNMP MIBs" SecMIBs
834 ;-------------------------------------------
835 SetOutPath $INSTDIR\snmp\mibs
836 File "${SMI_DIR}\mibs\*"
840 SectionGroupEnd ; "Plugins / Extensions"
843 SectionGroup "Tools" SecToolsGroup
845 Section "Editcap" SecEditcap
846 ;-------------------------------------------
848 File "..\..\editcap.exe"
849 File "..\..\doc\editcap.html"
852 Section "Text2Pcap" SecText2Pcap
853 ;-------------------------------------------
855 File "..\..\text2pcap.exe"
856 File "..\..\doc\text2pcap.html"
859 Section "Mergecap" SecMergecap
860 ;-------------------------------------------
862 File "..\..\mergecap.exe"
863 File "..\..\doc\mergecap.html"
866 Section "Capinfos" SecCapinfos
867 ;-------------------------------------------
869 File "..\..\capinfos.exe"
870 File "..\..\doc\capinfos.html"
873 Section "Rawshark" SecRawshark
874 ;-------------------------------------------
876 File "..\..\rawshark.exe"
877 File "..\..\doc\rawshark.html"
880 SectionGroupEnd ; "Tools"
883 Section "User's Guide" SecUsersGuide
884 ;-------------------------------------------
886 File "user-guide.chm"
890 Section "Uninstall" un.SecUinstall
891 ;-------------------------------------------
894 ; UnInstall for every user
897 SetShellVarContext all
899 Delete "$INSTDIR\rawshark.exe"
900 IfErrors 0 NoRawsharkErrorMsg
901 MessageBox MB_OK "Please note: rawshark.exe could not be removed, it's probably in use!" IDOK 0 ;skipped if rawshark.exe removed
902 Abort "Please note: rawshark.exe could not be removed, it's probably in use! Abort uninstall process!"
905 Delete "$INSTDIR\tshark.exe"
906 IfErrors 0 NoTSharkErrorMsg
907 MessageBox MB_OK "Please note: tshark.exe could not be removed, it's probably in use!" IDOK 0 ;skipped if tshark.exe removed
908 Abort "Please note: tshark.exe could not be removed, it's probably in use! Abort uninstall process!"
911 Delete "$INSTDIR\wireshark.exe"
912 IfErrors 0 NoWiresharkErrorMsg
913 MessageBox MB_OK "Please note: wireshark.exe could not be removed, it's probably in use!" IDOK 0 ;skipped if wireshark.exe removed
914 Abort "Please note: wireshark.exe could not be removed, it's probably in use! Abort uninstall process!"
917 DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark"
918 DeleteRegKey HKEY_LOCAL_MACHINE "Software\Wireshark"
919 DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\wireshark.exe"
964 DeleteRegKey HKCR ${WIRESHARK_ASSOC}
965 DeleteRegKey HKCR "${WIRESHARK_ASSOC}\Shell\open\command"
966 DeleteRegKey HKCR "${WIRESHARK_ASSOC}\DefaultIcon"
967 !insertmacro UpdateIcons
969 Delete "$INSTDIR\etc\gtk-2.0\*.*"
970 Delete "$INSTDIR\etc\pango\*.*"
971 Delete "$INSTDIR\lib\gtk-2.0\2.2.0\engines\*.*"
972 Delete "$INSTDIR\lib\gtk-2.0\2.2.0\loaders\*.*"
973 Delete "$INSTDIR\lib\gtk-2.0\2.2.0\immodules\*.*"
974 Delete "$INSTDIR\lib\gtk-2.0\2.4.0\engines\*.*"
975 Delete "$INSTDIR\lib\gtk-2.0\2.4.0\loaders\*.*"
976 Delete "$INSTDIR\lib\gtk-2.0\2.4.0\immodules\*.*"
977 Delete "$INSTDIR\lib\gtk-2.0\2.10.0\engines\*.*"
978 Delete "$INSTDIR\lib\gtk-2.0\2.10.0\loaders\*.*"
979 Delete "$INSTDIR\lib\gtk-2.0\2.10.0\immodules\*.*"
980 Delete "$INSTDIR\lib\gtk-2.0\modules\*.*"
981 Delete "$INSTDIR\lib\pango\1.2.0\modules\*.*"
982 Delete "$INSTDIR\lib\pango\1.4.0\modules\*.*"
983 Delete "$INSTDIR\lib\pango\1.5.0\modules\*.*"
984 Delete "$INSTDIR\share\themes\Default\gtk-2.0\*.*"
985 Delete "$INSTDIR\help\*.*"
986 Delete "$INSTDIR\diameter\*.*"
987 Delete "$INSTDIR\snmp\mibs\*.*"
988 Delete "$INSTDIR\snmp\*.*"
989 Delete "$INSTDIR\tpncp\*.*"
990 Delete "$INSTDIR\wimaxasncp\*.*"
991 Delete "$INSTDIR\*.exe"
992 Delete "$INSTDIR\*.dll"
993 Delete "$INSTDIR\*.html"
994 Delete "$INSTDIR\ws.css"
995 Delete "$INSTDIR\COPYING"
996 Delete "$INSTDIR\AUTHORS-SHORT"
997 ; previous versions installed these files
998 Delete "$INSTDIR\*.manifest"
999 ; previous versions installed this file
1000 Delete "$INSTDIR\AUTHORS-SHORT-FORMAT"
1001 Delete "$INSTDIR\README*"
1002 Delete "$INSTDIR\NEWS.txt"
1003 Delete "$INSTDIR\manuf"
1004 Delete "$INSTDIR\services"
1005 Delete "$INSTDIR\pcrepattern.3.txt"
1006 Delete "$INSTDIR\user-guide.chm"
1007 Delete "$INSTDIR\example_snmp_users_file"
1008 Delete "$INSTDIR\ipmap.html"
1009 Delete "$INSTDIR\radius\*.*"
1010 Delete "$INSTDIR\dtds\*.*"
1011 Delete "$SMPROGRAMS\Wireshark\*.*"
1012 Delete "$SMPROGRAMS\Wireshark.lnk"
1013 Delete "$DESKTOP\Wireshark.lnk"
1014 Delete "$QUICKLAUNCH\Wireshark.lnk"
1016 RMDir "$INSTDIR\etc\gtk-2.0"
1017 RMDir "$INSTDIR\etc\pango"
1018 RMDir "$INSTDIR\etc"
1019 RMDir "$INSTDIR\lib\gtk-2.0\2.2.0\engines"
1020 RMDir "$INSTDIR\lib\gtk-2.0\2.2.0\loaders"
1021 RMDir "$INSTDIR\lib\gtk-2.0\2.2.0\immodules"
1022 RMDir "$INSTDIR\lib\gtk-2.0\2.2.0"
1023 RMDir "$INSTDIR\lib\gtk-2.0\2.4.0\engines"
1024 RMDir "$INSTDIR\lib\gtk-2.0\2.4.0\loaders"
1025 RMDir "$INSTDIR\lib\gtk-2.0\2.4.0\immodules"
1026 RMDir "$INSTDIR\lib\gtk-2.0\2.4.0"
1027 RMDir "$INSTDIR\lib\gtk-2.0\2.10.0\engines"
1028 RMDir "$INSTDIR\lib\gtk-2.0\2.10.0\loaders"
1029 RMDir "$INSTDIR\lib\gtk-2.0\2.10.0\immodules"
1030 RMDir "$INSTDIR\lib\gtk-2.0\2.10.0"
1031 RMDir "$INSTDIR\lib\gtk-2.0\modules"
1032 RMDir "$INSTDIR\lib\gtk-2.0"
1033 RMDir "$INSTDIR\lib\pango\1.2.0\modules"
1034 RMDir "$INSTDIR\lib\pango\1.2.0"
1035 RMDir "$INSTDIR\lib\pango\1.4.0\modules"
1036 RMDir "$INSTDIR\lib\pango\1.4.0"
1037 RMDir "$INSTDIR\lib\pango\1.5.0\modules"
1038 RMDir "$INSTDIR\lib\pango\1.5.0"
1039 RMDir "$INSTDIR\lib\pango"
1040 RMDir "$INSTDIR\lib"
1041 RMDir "$INSTDIR\share\themes\Default\gtk-2.0"
1042 RMDir "$INSTDIR\share\themes\Default"
1043 RMDir "$INSTDIR\share\themes"
1044 RMDir "$INSTDIR\share"
1045 RMDir "$SMPROGRAMS\Wireshark"
1046 RMDir "$INSTDIR\help"
1047 RMDir "$INSTDIR\diameter"
1048 RMDir "$INSTDIR\snmp\mibs"
1049 RMDir "$INSTDIR\snmp"
1050 RMDir "$INSTDIR\radius"
1051 RMDir "$INSTDIR\dtds"
1052 RMDir "$INSTDIR\tpncp"
1053 RMDir "$INSTDIR\wimaxasncp"
1056 SectionEnd ; "Uinstall"
1058 Section "Un.Plugins" un.SecPlugins
1059 ;-------------------------------------------
1061 ;Delete "$INSTDIR\plugins\${VERSION}\*.*"
1062 ;Delete "$INSTDIR\plugins\*.*"
1063 ;RMDir "$INSTDIR\plugins\${VERSION}"
1064 ;RMDir "$INSTDIR\plugins"
1065 RMDir /r "$INSTDIR\plugins"
1068 Section "Un.Global Settings" un.SecGlobalSettings
1069 ;-------------------------------------------
1071 Delete "$INSTDIR\cfilters"
1072 Delete "$INSTDIR\colorfilters"
1073 Delete "$INSTDIR\dfilters"
1074 Delete "$INSTDIR\init.lua"
1075 Delete "$INSTDIR\console.lua"
1076 Delete "$INSTDIR\dtd_gen.lua"
1077 Delete "$INSTDIR\smi_modules"
1081 Section /o "Un.Personal Settings" un.SecPersonalSettings
1082 ;-------------------------------------------
1084 SetShellVarContext current
1085 Delete "$APPDATA\Wireshark\*.*"
1086 RMDir "$APPDATA\Wireshark"
1089 ;VAR un.WINPCAP_UNINSTALL
1091 Section /o "Un.WinPcap" un.SecWinPcap
1092 ;-------------------------------------------
1094 ReadRegStr $1 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinPcapInst" "UninstallString"
1095 ;IfErrors un.lbl_winpcap_notinstalled ;if RegKey is unavailable, WinPcap is not installed
1096 ;MessageBox MB_OK "WinPcap $1"
1098 DetailPrint "WinPcap uninstaller returned $0"
1100 ;un.lbl_winpcap_notinstalled:
1103 Section "-Un.Finally"
1104 ;-------------------------------------------
1106 ; this test must be done after all other things uninstalled (e.g. Global Settings)
1107 IfFileExists "$INSTDIR" 0 NoFinalErrorMsg
1108 MessageBox MB_OK "Please note: The directory $INSTDIR could not be removed!" IDOK 0 ; skipped if dir doesn't exist
1113 ; ============================================================================
1114 ; PLEASE MAKE SURE, THAT THE DESCRIPTIVE TEXT FITS INTO THE DESCRIPTION FIELD!
1115 ; ============================================================================
1116 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
1118 !insertmacro MUI_DESCRIPTION_TEXT ${SecWireshark} "${PROGRAM_NAME} is a GUI network protocol analyzer."
1120 !insertmacro MUI_DESCRIPTION_TEXT ${SecTShark} "TShark is a text based network protocol analyzer."
1121 !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsGroup} "Some plugins and extensions for both Wireshark and TShark."
1122 !insertmacro MUI_DESCRIPTION_TEXT ${SecPlugins} "Plugins with some extended dissections."
1123 !insertmacro MUI_DESCRIPTION_TEXT ${SecStatsTree} "Plugin for some extended statistics."
1124 !insertmacro MUI_DESCRIPTION_TEXT ${SecMate} "Plugin - Meta Analysis and Tracing Engine (Experimental)."
1126 !insertmacro MUI_DESCRIPTION_TEXT ${SecMIBs} "SNMP MIBs for better SNMP dissection."
1129 !insertmacro MUI_DESCRIPTION_TEXT ${SecMIBs} "SNMP MIBs for better SNMP dissection."
1131 !insertmacro MUI_DESCRIPTION_TEXT ${SecToolsGroup} "Additional command line based tools."
1132 !insertmacro MUI_DESCRIPTION_TEXT ${SecEditCap} "Editcap is a program that reads a capture file and writes some or all of the packets into another capture file."
1133 !insertmacro MUI_DESCRIPTION_TEXT ${SecText2Pcap} "Text2pcap is a program that reads in an ASCII hex dump and writes the data into a libpcap-style capture file."
1134 !insertmacro MUI_DESCRIPTION_TEXT ${SecMergecap} "Mergecap is a program that combines multiple saved capture files into a single output file"
1135 !insertmacro MUI_DESCRIPTION_TEXT ${SecCapinfos} "Capinfos is a program that provides information on capture files."
1136 !insertmacro MUI_DESCRIPTION_TEXT ${SecRawshark} "Rawshark is a raw packet filter."
1138 !insertmacro MUI_DESCRIPTION_TEXT ${SecUsersGuide} "Install the user's guide, so an internet connection is not required to read the help pages."
1140 !insertmacro MUI_FUNCTION_DESCRIPTION_END
1142 !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
1143 !insertmacro MUI_DESCRIPTION_TEXT ${un.SecUinstall} "Uninstall all Wireshark components."
1144 !insertmacro MUI_DESCRIPTION_TEXT ${un.SecPlugins} "Uninstall all Plugins (even from previous Wireshark versions)."
1145 !insertmacro MUI_DESCRIPTION_TEXT ${un.SecGlobalSettings} "Uninstall global settings like: $INSTDIR\cfilters"
1146 !insertmacro MUI_DESCRIPTION_TEXT ${un.SecPersonalSettings} "Uninstall personal settings like your preferences file from your profile: $PROFILE."
1147 !insertmacro MUI_DESCRIPTION_TEXT ${un.SecWinPcap} "Call WinPcap's uninstall program."
1148 !insertmacro MUI_UNFUNCTION_DESCRIPTION_END
1150 ; ============================================================================
1151 ; Callback functions
1152 ; ============================================================================
1154 ; Disable File extensions if Wireshark isn't selected
1155 Function .onSelChange
1157 SectionGetFlags ${SecWireshark} $0
1159 IntCmp $0 0 onSelChange.unselect
1160 WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 6" "State" 1
1161 WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 6" "Flags" ""
1162 WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 7" "Flags" ""
1163 Goto onSelChange.end
1165 onSelChange.unselect:
1166 WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 6" "State" 0
1167 WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 6" "Flags" "DISABLED"
1168 WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 7" "Flags" "DISABLED"
1169 Goto onSelChange.end
1177 !include "GetWindowsVersion.nsh"
1178 !include WinMessages.nsh
1179 !include "VersionCompare.nsh"
1181 Var NPF_START ; NPF service registry key
1182 Var WINPCAP_NAME ; DisplayName from WinPcap installation
1183 Var WINPCAP_VERSION ; DisplayVersion from WinPcap installation
1185 Function myShowCallback
1187 ; Get the Windows version
1188 Call GetWindowsVersion
1189 Pop $R0 ; Windows Version
1191 ; Check if we're able to run with this version
1192 StrCmp $R0 '95' lbl_winversion_unsupported
1193 StrCmp $R0 '98' lbl_winversion_unsupported
1194 StrCmp $R0 'ME' lbl_winversion_unsupported
1195 StrCmp $R0 'NT 4.0' lbl_winversion_unsupported_nt4
1196 Goto lbl_winversion_supported
1197 lbl_winversion_unsupported:
1198 MessageBox MB_OK "Windows $R0 is no longer supported. The last known version working with 98/ME was Ethereal 0.99.0!"
1201 lbl_winversion_unsupported_nt4:
1202 MessageBox MB_OK "Windows $R0 is no longer supported. The last known version working with NT 4.0 was Wireshark 0.99.4!"
1205 lbl_winversion_supported:
1207 ; detect if WinPcap should be installed
1208 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "Text" "Install WinPcap 4.0.2"
1209 ReadRegStr $WINPCAP_NAME HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinPcapInst" "DisplayName"
1210 IfErrors 0 lbl_winpcap_installed ;if RegKey is available, WinPcap is already installed
1211 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 2" "Text" "WinPcap is currently not installed"
1212 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 2" "Flags" "DISABLED"
1213 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Text" "(Use Add/Remove Programs first to uninstall any undetected old WinPcap versions)"
1214 Goto lbl_winpcap_done
1216 lbl_winpcap_installed:
1217 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 2" "Text" "$WINPCAP_NAME"
1218 ; Compare the installed build against the one we have.
1219 ReadRegStr $WINPCAP_VERSION HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinPcapInst" "DisplayVersion"
1220 StrCmp $WINPCAP_VERSION "" lbl_winpcap_do_install ; WinPcap is really old(?) or installed improperly.
1221 ${VersionCompare} $WINPCAP_VERSION "4.0.0.1040" $1 ; WinPcap 4.0.2
1222 StrCmp $1 "2" lbl_winpcap_do_install
1224 ;lbl_winpcap_dont_install:
1225 ; The installed version is >= to what we have, so don't install
1226 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "State" "0"
1227 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Text" "If selected, the currently installed $WINPCAP_NAME will be uninstalled first."
1228 Goto lbl_winpcap_done
1230 ;lbl_winpcap_dont_upgrade:
1231 ; force the user to upgrade by hand
1232 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "State" "0"
1233 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "Flags" "DISABLED"
1234 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Text" "If you wish to install WinPcap 4.0.2, please uninstall $WINPCAP_NAME manually first."
1235 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Flags" "DISABLED"
1236 Goto lbl_winpcap_done
1238 lbl_winpcap_do_install:
1239 ; seems to be an old version, install newer one
1240 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "State" "1"
1241 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Text" "The currently installed $WINPCAP_NAME will be uninstalled first."
1245 ; Disable NPF service setting for Win OT
1246 StrCmp $R0 '95' lbl_npf_disable
1247 StrCmp $R0 '98' lbl_npf_disable
1248 StrCmp $R0 'ME' lbl_npf_disable
1249 ; Enable NPF by default under Vista.
1250 StrCmp $R0 'Vista' lbl_npf_enable
1251 ReadRegDWORD $NPF_START HKEY_LOCAL_MACHINE "SYSTEM\CurrentControlSet\Services\NPF" "Start"
1252 ; (Winpcap may not be installed already, so no regKey is no error here)
1253 IfErrors lbl_npf_done ;RegKey not available, so do not set it
1254 IntCmp $NPF_START 2 0 lbl_npf_done lbl_npf_done
1256 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 8" "State" "1"
1260 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 8" "State" "0"
1261 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 8" "Flags" "DISABLED"
1262 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 9" "Flags" "DISABLED"
1266 ; if Wireshark was previously installed, unselect previously not installed icons etc.
1267 ; detect if Wireshark is already installed ->
1268 ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "UninstallString"
1269 IfErrors lbl_wireshark_notinstalled ;if RegKey is unavailable, Wireshark is not installed
1271 ; only select Start Menu Group, if previously installed
1272 ; (we use the "all users" start menu, so select it first)
1273 SetShellVarContext all
1274 IfFileExists "$SMPROGRAMS\Wireshark\Wireshark.lnk" lbl_have_startmenu
1275 IfFileExists "$SMPROGRAMS\Wireshark.lnk" lbl_have_startmenu
1276 WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 2" "State" "0"
1279 ; only select Desktop Icon, if previously installed
1280 IfFileExists "$DESKTOP\Wireshark.lnk" lbl_have_desktopicon
1281 WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 3" "State" "0"
1282 lbl_have_desktopicon:
1284 ; only select Quick Launch Icon, if previously installed
1285 IfFileExists "$QUICKLAUNCH\Wireshark.lnk" lbl_have_quicklaunchicon
1286 WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 4" "State" "0"
1287 lbl_have_quicklaunchicon:
1289 lbl_wireshark_notinstalled: