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 ${WIRESHARK_TARGET_PLATFORM} == "win32"
35 Name "${PROGRAM_NAME} ${VERSION} (${BITS}-bit)"
38 OutFile "wireshark-${WIRESHARK_TARGET_PLATFORM}-${VERSION}.exe"
40 ; Icon of installer and uninstaller
41 Icon "..\..\image\wiresharkinst.ico"
42 UninstallIcon "..\..\image\wiresharkinst.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\wiresharkinst.ico"
66 !define MUI_UNICON "..\..\image\wiresharkinst.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 !if ${WIRESHARK_TARGET_PLATFORM} == "win64"
192 InstallDir $PROGRAMFILES64\Wireshark
194 InstallDir $PROGRAMFILES\Wireshark
197 ; See if this is an upgrade; if so, use the old InstallDir as default
198 InstallDirRegKey HKEY_LOCAL_MACHINE SOFTWARE\Wireshark "InstallDir"
201 ; ============================================================================
202 ; Install page configuration
203 ; ============================================================================
205 ShowUninstDetails show
207 ; ============================================================================
208 ; Functions and macros
209 ; ============================================================================
215 !define UPDATEICONS_UNIQUE ${__LINE__}
217 IfFileExists "$SYSDIR\shell32.dll" UpdateIcons.ok_shell32_${UPDATEICONS_UNIQUE} UpdateIcons.error_shell32_${UPDATEICONS_UNIQUE}
218 UpdateIcons.ok_shell32_${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.error_shell32_${UPDATEICONS_UNIQUE}:
223 MessageBox MB_OK|MB_ICONSTOP \
224 "Can't find 'shell32.dll' library. Impossible to update icons" \
226 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
269 ; ============================================================================
271 ; ============================================================================
275 !if ${WIRESHARK_TARGET_PLATFORM} == "win64"
276 ; http://forums.winamp.com/printthread.php?s=16ffcdd04a8c8d52bee90c0cae273ac5&threadid=262873
277 ${IfNot} ${RunningX64}
278 MessageBox MB_OK "This version of Wireshark only runs on x64 machines.\nTry installing the 32-bit version instead."
283 ; Copied from http://nsis.sourceforge.net/Auto-uninstall_old_before_installing_new
284 ReadRegStr $OLD_UNINSTALLER HKLM \
285 "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" \
287 StrCmp $OLD_UNINSTALLER "" done
289 ReadRegStr $OLD_INSTDIR HKLM \
290 "Software\Microsoft\Windows\CurrentVersion\App Paths\wireshark.exe" \
292 StrCmp $OLD_INSTDIR "" done
294 ReadRegStr $OLD_DISPLAYNAME HKLM \
295 "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" \
297 StrCmp $OLD_DISPLAYNAME "" done
299 MessageBox MB_YESNOCANCEL|MB_ICONQUESTION \
300 "$OLD_DISPLAYNAME is already installed.\
301 $\n$\nWould you like to uninstall it first?" \
303 IDYES prep_uninstaller \
307 ; Copy the uninstaller to $TEMP and run it.
308 ; The uninstaller normally does this by itself, but doesn't wait around
309 ; for the executable to finish, which means ExecWait won't work correctly.
312 StrCpy $TMP_UNINSTALLER "$TEMP\wireshark_uninstaller.exe"
313 ; ...because we surround UninstallString in quotes.
314 StrCpy $0 $OLD_UNINSTALLER -1 1
315 StrCpy $1 "$TEMP\wireshark_uninstaller.exe"
317 System::Call 'kernel32::CopyFile(t r0, t r1, b r2) 1'
318 IfSilent silent_uninstall
319 ExecWait "$TMP_UNINSTALLER _?=$OLD_INSTDIR"
323 ExecWait "$TMP_UNINSTALLER /S _?=$OLD_INSTDIR"
326 Delete "$TMP_UNINSTALLER"
329 ;Extract InstallOptions INI files
330 !insertmacro MUI_INSTALLOPTIONS_EXTRACT "AdditionalTasksPage.ini"
331 !insertmacro MUI_INSTALLOPTIONS_EXTRACT "WinpcapPage.ini"
334 Function DisplayAdditionalTasksPage
335 !insertmacro MUI_HEADER_TEXT "Select Additional Tasks" "Which additional tasks should be done?"
336 !insertmacro MUI_INSTALLOPTIONS_DISPLAY "AdditionalTasksPage.ini"
339 Function DisplayWinPcapPage
340 !insertmacro MUI_HEADER_TEXT "Install WinPcap?" "WinPcap is required to capture live network data. Should WinPcap be installed?"
341 !insertmacro MUI_INSTALLOPTIONS_DISPLAY "WinPcapPage.ini"
344 ; ============================================================================
345 ; Installation execution commands
346 ; ============================================================================
348 Var WINPCAP_UNINSTALL ;declare variable for holding the value of a registry key
349 ;Var WIRESHARK_UNINSTALL ;declare variable for holding the value of a registry key
352 ;-------------------------------------------
355 ; Install for every user
357 SetShellVarContext all
362 File "..\..\wiretap\wiretap-${WTAP_VERSION}.dll"
363 !ifdef ENABLE_LIBWIRESHARK
364 File "..\..\epan\libwireshark.dll"
366 File "..\..\wsutil\libwsutil.dll"
367 File "${GLIB_DIR}\bin\libgio-2.0-0.dll"
368 File "${GLIB_DIR}\bin\libglib-2.0-0.dll"
369 File "${GLIB_DIR}\bin\libgobject-2.0-0.dll"
370 File "${GLIB_DIR}\bin\libgmodule-2.0-0.dll"
372 File "${ICONV_DIR}\bin\iconv.dll"
374 File "${GETTEXT_DIR}\bin\${GETTEXT_DLL}"
376 File "${ZLIB_DIR}\zlib1.dll"
379 File "${C_ARES_DIR}\cares.dll"
382 File "${ADNS_DIR}\..\${MSVC_VARIANT}\adns\adns_dll.dll"
385 File "${PCRE_DIR}\bin\pcre3.dll"
386 File "${PCRE_DIR}\man\cat3\pcrepattern.3.txt"
389 File "${KFW_DIR}\bin\comerr32.dll"
390 File "${KFW_DIR}\bin\krb5_32.dll"
393 File "${GNUTLS_DIR}\bin\libgcrypt-11.dll"
394 File "${GNUTLS_DIR}\bin\libgnutls-26.dll"
395 File "${GNUTLS_DIR}\bin\libgnutls-extra-26.dll"
396 File "${GNUTLS_DIR}\bin\libgnutls-openssl-26.dll"
397 File "${GNUTLS_DIR}\bin\libgpg-error-0.dll"
398 File "${GNUTLS_DIR}\bin\libtasn1-3.dll"
401 File "${LUA_DIR}\lua5.1.dll"
402 File "..\..\epan\wslua\init.lua"
403 File "..\..\epan\wslua\console.lua"
404 File "..\..\epan\wslua\dtd_gen.lua"
407 File "${SMI_DIR}\lib\smi.dll"
410 File "..\..\README.win32"
411 File "..\..\AUTHORS-SHORT"
415 File "..\..\services"
416 File "..\..\doc\ws.css"
417 File "..\..\doc\wireshark.html"
418 File "..\..\doc\wireshark-filter.html"
419 File "..\..\dumpcap.exe"
420 File "..\..\doc\dumpcap.html"
421 File "..\..\ipmap.html"
423 ; C-runtime redistributable
425 ; vcredist_x86.exe (MSVC V8) - copy and execute the redistributable installer
426 File "${VCREDIST_EXE}"
427 ExecWait '"$INSTDIR\vcredist_x86.exe"' $0
428 DetailPrint "vcredist_x86 returned $0"
431 ; msvcr*.dll (MSVC V7 or V7.1) - simply copy the dll file
432 !echo "IF YOU GET AN ERROR HERE, check the MSVC_VARIANT setting in config.nmake: MSVC2005 vs. MSVC2005EE!"
435 !if ${MSVC_VARIANT} != "MSVC6"
436 !error "C-Runtime redistributable for this package not available / not redistributable!"
439 !endif ; VCREDIST_EXE
442 ; global config files - don't overwrite if already existing
443 ;IfFileExists cfilters dont_overwrite_cfilters
444 File "..\..\cfilters"
445 ;dont_overwrite_cfilters:
446 ;IfFileExists colorfilters dont_overwrite_colorfilters
447 File "..\..\colorfilters"
448 ;dont_overwrite_colorfilters:
449 ;IfFileExists dfilters dont_overwrite_dfilters
450 File "..\..\dfilters"
451 ;dont_overwrite_dfilters:
452 ;IfFileExists smi_modules dont_overwrite_smi_modules
453 File "..\..\smi_modules"
454 ;dont_overwrite_smi_modules:
458 ; Install the Diameter DTD and XML files in the "diameter" subdirectory
459 ; of the installation directory.
461 SetOutPath $INSTDIR\diameter
462 File "..\..\diameter\chargecontrol.xml"
463 File "..\..\diameter\dictionary.dtd"
464 File "..\..\diameter\dictionary.xml"
465 File "..\..\diameter\Ericsson.xml"
466 File "..\..\diameter\etsie2e4.xml"
467 File "..\..\diameter\gqpolicy.xml"
468 File "..\..\diameter\imscxdx.xml"
469 File "..\..\diameter\mobileipv4.xml"
470 File "..\..\diameter\nasreq.xml"
471 File "..\..\diameter\sip.xml"
472 File "..\..\diameter\sunping.xml"
473 File "..\..\diameter\TGPPGmb.xml"
474 File "..\..\diameter\TGPPRx.xml"
475 File "..\..\diameter\TGPPSh.xml"
481 ; Install the RADIUS directory files in the "radius" subdirectory
482 ; of the installation directory.
484 SetOutPath $INSTDIR\radius
485 File "..\..\radius\dictionary"
486 File "..\..\radius\dictionary.3com"
487 File "..\..\radius\dictionary.3gpp"
488 File "..\..\radius\dictionary.3gpp2"
489 File "..\..\radius\dictionary.acc"
490 File "..\..\radius\dictionary.alcatel"
491 File "..\..\radius\dictionary.alteon"
492 File "..\..\radius\dictionary.altiga"
493 File "..\..\radius\dictionary.aptis"
494 File "..\..\radius\dictionary.ascend"
495 File "..\..\radius\dictionary.aruba"
496 File "..\..\radius\dictionary.bay"
497 File "..\..\radius\dictionary.bintec"
498 File "..\..\radius\dictionary.bristol"
499 File "..\..\radius\dictionary.cablelabs"
500 File "..\..\radius\dictionary.cabletron"
501 File "..\..\radius\dictionary.cisco"
502 File "..\..\radius\dictionary.cisco.bbsm"
503 File "..\..\radius\dictionary.cisco.vpn3000"
504 File "..\..\radius\dictionary.cisco.vpn5000"
505 File "..\..\radius\dictionary.colubris"
506 File "..\..\radius\dictionary.columbia_university"
507 File "..\..\radius\dictionary.compat"
508 File "..\..\radius\dictionary.cosine"
509 File "..\..\radius\dictionary.ericsson"
510 File "..\..\radius\dictionary.erx"
511 File "..\..\radius\dictionary.extreme"
512 File "..\..\radius\dictionary.foundry"
513 File "..\..\radius\dictionary.freeradius"
514 File "..\..\radius\dictionary.gandalf"
515 File "..\..\radius\dictionary.garderos"
516 File "..\..\radius\dictionary.gemtek"
517 File "..\..\radius\dictionary.itk"
518 File "..\..\radius\dictionary.juniper"
519 File "..\..\radius\dictionary.karlnet"
520 File "..\..\radius\dictionary.livingston"
521 File "..\..\radius\dictionary.localweb"
522 File "..\..\radius\dictionary.merit"
523 File "..\..\radius\dictionary.microsoft"
524 File "..\..\radius\dictionary.mikrotik"
525 File "..\..\radius\dictionary.navini"
526 File "..\..\radius\dictionary.netscreen"
527 File "..\..\radius\dictionary.nokia"
528 File "..\..\radius\dictionary.nomadix"
529 File "..\..\radius\dictionary.propel"
530 File "..\..\radius\dictionary.quintum"
531 File "..\..\radius\dictionary.redback"
532 File "..\..\radius\dictionary.redcreek"
533 File "..\..\radius\dictionary.shasta"
534 File "..\..\radius\dictionary.shiva"
535 File "..\..\radius\dictionary.sonicwall"
536 File "..\..\radius\dictionary.springtide"
537 File "..\..\radius\dictionary.starent"
538 File "..\..\radius\dictionary.t_systems_nova"
539 File "..\..\radius\dictionary.telebit"
540 File "..\..\radius\dictionary.trapeze"
541 File "..\..\radius\dictionary.tunnel"
542 File "..\..\radius\dictionary.unisphere"
543 File "..\..\radius\dictionary.unix"
544 File "..\..\radius\dictionary.usr"
545 File "..\..\radius\dictionary.valemount"
546 File "..\..\radius\dictionary.versanet"
547 File "..\..\radius\dictionary.wimax"
548 File "..\..\radius\dictionary.wispr"
549 File "..\..\radius\dictionary.xedia"
553 ; install the dtds in the dtds subdirectory
555 SetOutPath $INSTDIR\dtds
556 File "..\..\dtds\dc.dtd"
557 File "..\..\dtds\itunes.dtd"
558 File "..\..\dtds\mscml.dtd"
559 File "..\..\dtds\pocsettings.dtd"
560 File "..\..\dtds\presence.dtd"
561 File "..\..\dtds\reginfo.dtd"
562 File "..\..\dtds\rlmi.dtd"
563 File "..\..\dtds\rss.dtd"
564 File "..\..\dtds\smil.dtd"
565 File "..\..\dtds\xcap-caps.dtd"
566 File "..\..\dtds\xcap-error.dtd"
567 File "..\..\dtds\watcherinfo.dtd"
570 ; Install the TPNCP DAT file in the "tpncp" subdirectory
571 ; of the installation directory.
572 SetOutPath $INSTDIR\tpncp
573 File "..\..\tpncp\tpncp.dat"
576 ; install the wimaxasncp TLV definitions in the wimaxasncp subdirectory
578 SetOutPath $INSTDIR\wimaxasncp
579 File "..\..\wimaxasncp\dictionary.xml"
580 File "..\..\wimaxasncp\dictionary.dtd"
583 SetOutPath $INSTDIR\help
584 File "..\..\help\toc"
585 File "..\..\help\overview.txt"
586 File "..\..\help\getting_started.txt"
587 File "..\..\help\capturing.txt"
588 File "..\..\help\capture_filters.txt"
589 File "..\..\help\display_filters.txt"
590 File "..\..\help\faq.txt"
592 ; Write the uninstall keys for Windows
593 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "DisplayVersion" "${VERSION}"
594 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "DisplayName" "Wireshark ${VERSION}"
595 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "UninstallString" '"$INSTDIR\uninstall.exe"'
596 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "Publisher" "The Wireshark developer community, http://www.wireshark.org"
597 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "HelpLink" "mailto:wireshark-users@wireshark.org"
598 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "URLInfoAbout" "http://www.wireshark.org"
599 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "URLUpdateInfo" "http://www.wireshark.org/download/win32/"
600 WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "NoModify" 1
601 WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "NoRepair" 1
602 WriteUninstaller "uninstall.exe"
604 ; Write an entry for ShellExecute
605 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\wireshark.exe" "" '$INSTDIR\wireshark.exe'
606 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\wireshark.exe" "Path" '$INSTDIR'
608 ; Create start menu entries (depending on additional tasks page)
609 ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 2" "State"
610 StrCmp $0 "0" SecRequired_skip_StartMenu
612 ;CreateDirectory "$SMPROGRAMS\Wireshark"
613 ; To qoute "http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwue/html/ch11d.asp":
614 ; "Do not include Readme, Help, or Uninstall entries on the Programs menu."
615 Delete "$SMPROGRAMS\Wireshark\Wireshark Web Site.lnk"
616 ;WriteINIStr "$SMPROGRAMS\Wireshark\Wireshark Web Site.url" "InternetShortcut" "URL" "http://www.wireshark.org/"
617 CreateShortCut "$SMPROGRAMS\Wireshark.lnk" "$INSTDIR\wireshark.exe" "" "$INSTDIR\wireshark.exe" 0 "" "" "The Wireshark Network Protocol Analyzer"
618 ;CreateShortCut "$SMPROGRAMS\Wireshark\Wireshark Manual.lnk" "$INSTDIR\wireshark.html"
619 ;CreateShortCut "$SMPROGRAMS\Wireshark\Display Filters Manual.lnk" "$INSTDIR\wireshark-filter.html"
620 ;CreateShortCut "$SMPROGRAMS\Wireshark\Wireshark Program Directory.lnk" "$INSTDIR"
621 ;CreateShortCut "$SMPROGRAMS\Wireshark\Uninstall Wireshark.lnk" "$INSTDIR\uninstall.exe"
622 SecRequired_skip_StartMenu:
624 ; is command line option "/desktopicon" set?
626 ${GetOptions} $R0 "/desktopicon=" $R1
627 StrCmp $R1 "no" SecRequired_skip_DesktopIcon
628 StrCmp $R1 "yes" SecRequired_install_DesktopIcon
630 ; Create desktop icon (depending on additional tasks page and command line option)
631 ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 3" "State"
632 StrCmp $0 "0" SecRequired_skip_DesktopIcon
633 SecRequired_install_DesktopIcon:
634 CreateShortCut "$DESKTOP\Wireshark.lnk" "$INSTDIR\wireshark.exe" "" "$INSTDIR\wireshark.exe" 0 "" "" "The Wireshark Network Protocol Analyzer"
635 SecRequired_skip_DesktopIcon:
637 ; is command line option "/quicklaunchicon" set?
639 ${GetOptions} $R0 "/quicklaunchicon=" $R1
640 StrCmp $R1 "no" SecRequired_skip_QuickLaunchIcon
641 StrCmp $R1 "yes" SecRequired_install_QuickLaunchIcon
643 ; Create quick launch icon (depending on additional tasks page and command line option)
644 ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 4" "State"
645 StrCmp $0 "0" SecRequired_skip_QuickLaunchIcon
646 SecRequired_install_QuickLaunchIcon:
647 CreateShortCut "$QUICKLAUNCH\Wireshark.lnk" "$INSTDIR\wireshark.exe" "" "$INSTDIR\wireshark.exe" 0 "" "" "The Wireshark Network Protocol Analyzer"
648 SecRequired_skip_QuickLaunchIcon:
650 ; Create File Extensions (depending on additional tasks page)
651 ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 6" "State"
652 StrCmp $0 "0" SecRequired_skip_FileExtensions
653 WriteRegStr HKCR ${WIRESHARK_ASSOC} "" "Wireshark capture file"
654 WriteRegStr HKCR "${WIRESHARK_ASSOC}\Shell\open\command" "" '"$INSTDIR\wireshark.exe" "%1"'
655 WriteRegStr HKCR "${WIRESHARK_ASSOC}\DefaultIcon" "" '"$INSTDIR\wireshark.exe",1'
699 ; if somethings added here, add it also to the uninstall section and the AdditionalTask page
701 !insertmacro UpdateIcons
702 SecRequired_skip_FileExtensions:
704 ; if running as a silent installer, don't try to install winpcap
705 IfSilent SecRequired_skip_Winpcap
707 ; Install WinPcap (depending on winpcap page setting)
708 ReadINIStr $0 "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "State"
709 StrCmp $0 "0" SecRequired_skip_Winpcap
710 ; Uinstall old WinPcap first
711 ReadRegStr $WINPCAP_UNINSTALL HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinPcapInst" "UninstallString"
712 IfErrors lbl_winpcap_notinstalled ;if RegKey is unavailable, WinPcap is not installed
713 ; from released version 3.1, WinPcap will uninstall an old version by itself
714 ;ExecWait '$WINPCAP_UNINSTALL' $0
715 ;DetailPrint "WinPcap uninstaller returned $0"
716 lbl_winpcap_notinstalled:
718 File "WinPcap_4_0_2.exe"
719 ExecWait '"$INSTDIR\WinPcap_4_0_2.exe"' $0
720 DetailPrint "WinPcap installer returned $0"
721 SecRequired_skip_Winpcap:
723 ; Load Winpcap NPF service at startup (depending on winpcap page)
724 ReadINIStr $0 "$PLUGINSDIR\WinPcapPage.ini" "Field 8" "State"
725 StrCmp $0 "0" SecRequired_no_WinpcapService
726 WriteRegDWORD HKEY_LOCAL_MACHINE "SYSTEM\CurrentControlSet\Services\NPF" "Start" 2 ;set NPF to (SERVICE_AUTO_START)
727 !insertmacro SERVICE "start" "NPF" ""
728 Goto SecRequired_done_WinpcapService
729 SecRequired_no_WinpcapService:
730 WriteRegDWORD HKEY_LOCAL_MACHINE "SYSTEM\CurrentControlSet\Services\NPF" "Start" 3 ;set NPF to (SERVICE_DEMAND_START)
731 !insertmacro SERVICE "stop" "NPF" ""
732 SecRequired_done_WinpcapService:
734 ; If no user profile exists for Wireshark but for Ethereal, copy it over
735 SetShellVarContext current
736 IfFileExists $APPDATA\Wireshark profile_done
737 IfFileExists $APPDATA\Ethereal 0 profile_done
738 ;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
739 CreateDirectory $APPDATA\Wireshark
740 CopyFiles $APPDATA\Ethereal\*.* $APPDATA\Wireshark
742 SetShellVarContext all
744 SectionEnd ; "Required"
747 Section "Wireshark" SecWireshark
748 ;-------------------------------------------
750 File "..\..\wireshark.exe"
751 File "${GTK_DIR}\bin\libgdk-win32-2.0-0.dll"
752 File "${GTK_DIR}\bin\libgdk_pixbuf-2.0-0.dll"
753 File "${GTK_DIR}\bin\libgtk-win32-2.0-0.dll"
754 File "${GTK_DIR}\bin\libatk-1.0-0.dll"
755 File "${GTK_DIR}\bin\libpango-1.0-0.dll"
756 File "${GTK_DIR}\bin\libpangowin32-1.0-0.dll"
757 !ifdef NEED_CAIRO_DLL
758 File "${GTK_DIR}\bin\libcairo-2.dll"
759 File "${GTK_DIR}\bin\libpangocairo-1.0-0.dll"
761 !ifdef NEED_LIBPNG_DLL
762 File "${GTK_DIR}\bin\libpng12-0.dll"
764 !ifdef NEED_LIBTIFF_DLL
765 File "${GTK_DIR}\bin\${TIFF_DLL}"
767 !ifdef NEED_LIBJPEG_DLL
768 File "${GTK_DIR}\bin\${JPEG_DLL}"
770 SetOutPath $INSTDIR\etc\gtk-2.0
771 File "${GTK_DIR}\etc\gtk-2.0\*.*"
773 !if ${WIRESHARK_TARGET_PLATFORM} == "win32"
774 SetOutPath $INSTDIR\etc\pango
775 File "${GTK_DIR}\etc\pango\pango.*"
776 SetOutPath $INSTDIR\lib\gtk-2.0\${GTK_LIB_DIR}\loaders
777 File "${GTK_DIR}\lib\gtk-2.0\${GTK_LIB_DIR}\loaders\libpixbufloader-*.dll"
780 SetOutPath $INSTDIR\lib\gtk-2.0\${GTK_LIB_DIR}\engines
781 File "${GTK_DIR}\lib\gtk-2.0\${GTK_LIB_DIR}\engines\libpixmap.dll"
782 SetOutPath $INSTDIR\lib\gtk-2.0\modules
783 File "${GTK_DIR}\lib\gtk-2.0\modules\libgail.dll"
784 # Not needed with pango 1.14.5
785 #SetOutPath $INSTDIR\lib\pango\${PANGO_LIB_DIR}\modules
786 #File "${GTK_DIR}\lib\pango\${PANGO_LIB_DIR}\modules\pango-*.dll"
788 ; GTK MS-Windows Engine (GTK-Wimp)
789 SetOutPath $INSTDIR\${GTK_WIMP_DLLDST_DIR}
790 File "${GTK_WIMP_DLLSRC_DIR}\libwimp.dll"
791 SetOutPath $INSTDIR\${GTK_WIMP_RCDST_DIR}
792 File "${GTK_WIMP_RCSRC_DIR}\gtkrc"
794 SectionEnd ; "Wireshark"
798 Section "TShark" SecTShark
799 ;-------------------------------------------
801 File "..\..\tshark.exe"
802 File "..\..\doc\tshark.html"
805 SectionGroup "Plugins / Extensions" SecPluginsGroup
807 Section "Dissector Plugins" SecPlugins
808 ;-------------------------------------------
809 SetOutPath $INSTDIR\plugins\${VERSION}
810 File "..\..\plugins\asn1\asn1.dll"
811 File "..\..\plugins\docsis\docsis.dll"
812 File "..\..\plugins\ethercat\ethercat.dll"
813 File "..\..\plugins\giop\coseventcomm.dll"
814 File "..\..\plugins\giop\cosnaming.dll"
815 File "..\..\plugins\giop\parlay.dll"
816 File "..\..\plugins\giop\tango.dll"
817 File "..\..\plugins\gryphon\gryphon.dll"
818 File "..\..\plugins\irda\irda.dll"
819 File "..\..\plugins\m2m\m2m.dll"
820 File "..\..\plugins\profinet\profinet.dll"
821 File "..\..\plugins\sercosiii\sercosiii.dll"
822 File "..\..\plugins\unistim\unistim.dll"
823 File "..\..\plugins\wimax\wimax.dll"
824 File "..\..\plugins\wimaxasncp\wimaxasncp.dll"
827 Section "Tree Statistics Plugin" SecStatsTree
828 ;-------------------------------------------
829 SetOutPath $INSTDIR\plugins\${VERSION}
830 File "..\..\plugins\stats_tree\stats_tree.dll"
833 Section "Mate - Meta Analysis and Tracing Engine" SecMate
834 ;-------------------------------------------
835 SetOutPath $INSTDIR\plugins\${VERSION}
836 File "..\..\plugins\mate\mate.dll"
841 Section "SNMP MIBs" SecMIBs
842 ;-------------------------------------------
843 SetOutPath $INSTDIR\snmp\mibs
844 File "${NET_SNMP_DIR}\mibs\*.txt"
849 Section "SNMP MIBs" SecMIBs
850 ;-------------------------------------------
851 SetOutPath $INSTDIR\snmp\mibs
852 File "${SMI_DIR}\mibs\*"
856 SectionGroupEnd ; "Plugins / Extensions"
859 SectionGroup "Tools" SecToolsGroup
861 Section "Editcap" SecEditcap
862 ;-------------------------------------------
864 File "..\..\editcap.exe"
865 File "..\..\doc\editcap.html"
868 Section "Text2Pcap" SecText2Pcap
869 ;-------------------------------------------
871 File "..\..\text2pcap.exe"
872 File "..\..\doc\text2pcap.html"
875 Section "Mergecap" SecMergecap
876 ;-------------------------------------------
878 File "..\..\mergecap.exe"
879 File "..\..\doc\mergecap.html"
882 Section "Capinfos" SecCapinfos
883 ;-------------------------------------------
885 File "..\..\capinfos.exe"
886 File "..\..\doc\capinfos.html"
889 Section "Rawshark" SecRawshark
890 ;-------------------------------------------
892 File "..\..\rawshark.exe"
893 File "..\..\doc\rawshark.html"
896 SectionGroupEnd ; "Tools"
899 Section "User's Guide" SecUsersGuide
900 ;-------------------------------------------
902 File "user-guide.chm"
906 Section "Uninstall" un.SecUinstall
907 ;-------------------------------------------
910 ; UnInstall for every user
913 SetShellVarContext all
915 Delete "$INSTDIR\rawshark.exe"
916 IfErrors 0 NoRawsharkErrorMsg
917 MessageBox MB_OK "Please note: rawshark.exe could not be removed, it's probably in use!" IDOK 0 ;skipped if rawshark.exe removed
918 Abort "Please note: rawshark.exe could not be removed, it's probably in use! Abort uninstall process!"
921 Delete "$INSTDIR\tshark.exe"
922 IfErrors 0 NoTSharkErrorMsg
923 MessageBox MB_OK "Please note: tshark.exe could not be removed, it's probably in use!" IDOK 0 ;skipped if tshark.exe removed
924 Abort "Please note: tshark.exe could not be removed, it's probably in use! Abort uninstall process!"
927 Delete "$INSTDIR\wireshark.exe"
928 IfErrors 0 NoWiresharkErrorMsg
929 MessageBox MB_OK "Please note: wireshark.exe could not be removed, it's probably in use!" IDOK 0 ;skipped if wireshark.exe removed
930 Abort "Please note: wireshark.exe could not be removed, it's probably in use! Abort uninstall process!"
933 DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark"
934 DeleteRegKey HKEY_LOCAL_MACHINE "Software\Wireshark"
935 DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\wireshark.exe"
980 DeleteRegKey HKCR ${WIRESHARK_ASSOC}
981 DeleteRegKey HKCR "${WIRESHARK_ASSOC}\Shell\open\command"
982 DeleteRegKey HKCR "${WIRESHARK_ASSOC}\DefaultIcon"
983 !insertmacro UpdateIcons
985 Delete "$INSTDIR\etc\gtk-2.0\*.*"
986 Delete "$INSTDIR\etc\pango\*.*"
987 Delete "$INSTDIR\lib\gtk-2.0\2.2.0\engines\*.*"
988 Delete "$INSTDIR\lib\gtk-2.0\2.2.0\loaders\*.*"
989 Delete "$INSTDIR\lib\gtk-2.0\2.2.0\immodules\*.*"
990 Delete "$INSTDIR\lib\gtk-2.0\2.4.0\engines\*.*"
991 Delete "$INSTDIR\lib\gtk-2.0\2.4.0\loaders\*.*"
992 Delete "$INSTDIR\lib\gtk-2.0\2.4.0\immodules\*.*"
993 Delete "$INSTDIR\lib\gtk-2.0\2.10.0\engines\*.*"
994 Delete "$INSTDIR\lib\gtk-2.0\2.10.0\loaders\*.*"
995 Delete "$INSTDIR\lib\gtk-2.0\2.10.0\immodules\*.*"
996 Delete "$INSTDIR\lib\gtk-2.0\modules\*.*"
997 Delete "$INSTDIR\lib\pango\1.2.0\modules\*.*"
998 Delete "$INSTDIR\lib\pango\1.4.0\modules\*.*"
999 Delete "$INSTDIR\lib\pango\1.5.0\modules\*.*"
1000 Delete "$INSTDIR\share\themes\Default\gtk-2.0\*.*"
1001 Delete "$INSTDIR\help\*.*"
1002 Delete "$INSTDIR\diameter\*.*"
1003 Delete "$INSTDIR\snmp\mibs\*.*"
1004 Delete "$INSTDIR\snmp\*.*"
1005 Delete "$INSTDIR\tpncp\*.*"
1006 Delete "$INSTDIR\wimaxasncp\*.*"
1007 Delete "$INSTDIR\*.exe"
1008 Delete "$INSTDIR\*.dll"
1009 Delete "$INSTDIR\*.html"
1010 Delete "$INSTDIR\ws.css"
1011 Delete "$INSTDIR\COPYING"
1012 Delete "$INSTDIR\AUTHORS-SHORT"
1013 ; previous versions installed these files
1014 Delete "$INSTDIR\*.manifest"
1015 ; previous versions installed this file
1016 Delete "$INSTDIR\AUTHORS-SHORT-FORMAT"
1017 Delete "$INSTDIR\README*"
1018 Delete "$INSTDIR\NEWS.txt"
1019 Delete "$INSTDIR\manuf"
1020 Delete "$INSTDIR\services"
1021 Delete "$INSTDIR\pcrepattern.3.txt"
1022 Delete "$INSTDIR\user-guide.chm"
1023 Delete "$INSTDIR\example_snmp_users_file"
1024 Delete "$INSTDIR\ipmap.html"
1025 Delete "$INSTDIR\radius\*.*"
1026 Delete "$INSTDIR\dtds\*.*"
1027 Delete "$SMPROGRAMS\Wireshark\*.*"
1028 Delete "$SMPROGRAMS\Wireshark.lnk"
1029 Delete "$DESKTOP\Wireshark.lnk"
1030 Delete "$QUICKLAUNCH\Wireshark.lnk"
1032 RMDir "$INSTDIR\etc\gtk-2.0"
1033 RMDir "$INSTDIR\etc\pango"
1034 RMDir "$INSTDIR\etc"
1035 RMDir "$INSTDIR\lib\gtk-2.0\2.2.0\engines"
1036 RMDir "$INSTDIR\lib\gtk-2.0\2.2.0\loaders"
1037 RMDir "$INSTDIR\lib\gtk-2.0\2.2.0\immodules"
1038 RMDir "$INSTDIR\lib\gtk-2.0\2.2.0"
1039 RMDir "$INSTDIR\lib\gtk-2.0\2.4.0\engines"
1040 RMDir "$INSTDIR\lib\gtk-2.0\2.4.0\loaders"
1041 RMDir "$INSTDIR\lib\gtk-2.0\2.4.0\immodules"
1042 RMDir "$INSTDIR\lib\gtk-2.0\2.4.0"
1043 RMDir "$INSTDIR\lib\gtk-2.0\2.10.0\engines"
1044 RMDir "$INSTDIR\lib\gtk-2.0\2.10.0\loaders"
1045 RMDir "$INSTDIR\lib\gtk-2.0\2.10.0\immodules"
1046 RMDir "$INSTDIR\lib\gtk-2.0\2.10.0"
1047 RMDir "$INSTDIR\lib\gtk-2.0\modules"
1048 RMDir "$INSTDIR\lib\gtk-2.0"
1049 RMDir "$INSTDIR\lib\pango\1.2.0\modules"
1050 RMDir "$INSTDIR\lib\pango\1.2.0"
1051 RMDir "$INSTDIR\lib\pango\1.4.0\modules"
1052 RMDir "$INSTDIR\lib\pango\1.4.0"
1053 RMDir "$INSTDIR\lib\pango\1.5.0\modules"
1054 RMDir "$INSTDIR\lib\pango\1.5.0"
1055 RMDir "$INSTDIR\lib\pango"
1056 RMDir "$INSTDIR\lib"
1057 RMDir "$INSTDIR\share\themes\Default\gtk-2.0"
1058 RMDir "$INSTDIR\share\themes\Default"
1059 RMDir "$INSTDIR\share\themes"
1060 RMDir "$INSTDIR\share"
1061 RMDir "$SMPROGRAMS\Wireshark"
1062 RMDir "$INSTDIR\help"
1063 RMDir "$INSTDIR\diameter"
1064 RMDir "$INSTDIR\snmp\mibs"
1065 RMDir "$INSTDIR\snmp"
1066 RMDir "$INSTDIR\radius"
1067 RMDir "$INSTDIR\dtds"
1068 RMDir "$INSTDIR\tpncp"
1069 RMDir "$INSTDIR\wimaxasncp"
1072 SectionEnd ; "Uinstall"
1074 Section "Un.Plugins" un.SecPlugins
1075 ;-------------------------------------------
1077 ;Delete "$INSTDIR\plugins\${VERSION}\*.*"
1078 ;Delete "$INSTDIR\plugins\*.*"
1079 ;RMDir "$INSTDIR\plugins\${VERSION}"
1080 ;RMDir "$INSTDIR\plugins"
1081 RMDir /r "$INSTDIR\plugins"
1084 Section "Un.Global Settings" un.SecGlobalSettings
1085 ;-------------------------------------------
1087 Delete "$INSTDIR\cfilters"
1088 Delete "$INSTDIR\colorfilters"
1089 Delete "$INSTDIR\dfilters"
1090 Delete "$INSTDIR\init.lua"
1091 Delete "$INSTDIR\console.lua"
1092 Delete "$INSTDIR\dtd_gen.lua"
1093 Delete "$INSTDIR\smi_modules"
1097 Section /o "Un.Personal Settings" un.SecPersonalSettings
1098 ;-------------------------------------------
1100 SetShellVarContext current
1101 Delete "$APPDATA\Wireshark\*.*"
1102 RMDir "$APPDATA\Wireshark"
1105 ;VAR un.WINPCAP_UNINSTALL
1107 Section /o "Un.WinPcap" un.SecWinPcap
1108 ;-------------------------------------------
1110 ReadRegStr $1 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinPcapInst" "UninstallString"
1111 ;IfErrors un.lbl_winpcap_notinstalled ;if RegKey is unavailable, WinPcap is not installed
1112 ;MessageBox MB_OK "WinPcap $1"
1114 DetailPrint "WinPcap uninstaller returned $0"
1116 ;un.lbl_winpcap_notinstalled:
1119 Section "-Un.Finally"
1120 ;-------------------------------------------
1122 ; this test must be done after all other things uninstalled (e.g. Global Settings)
1123 IfFileExists "$INSTDIR" 0 NoFinalErrorMsg
1124 MessageBox MB_OK "Please note: The directory $INSTDIR could not be removed!" IDOK 0 ; skipped if dir doesn't exist
1129 ; ============================================================================
1130 ; PLEASE MAKE SURE, THAT THE DESCRIPTIVE TEXT FITS INTO THE DESCRIPTION FIELD!
1131 ; ============================================================================
1132 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
1134 !insertmacro MUI_DESCRIPTION_TEXT ${SecWireshark} "${PROGRAM_NAME} is a GUI network protocol analyzer."
1136 !insertmacro MUI_DESCRIPTION_TEXT ${SecTShark} "TShark is a text based network protocol analyzer."
1137 !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsGroup} "Some plugins and extensions for both Wireshark and TShark."
1138 !insertmacro MUI_DESCRIPTION_TEXT ${SecPlugins} "Plugins with some extended dissections."
1139 !insertmacro MUI_DESCRIPTION_TEXT ${SecStatsTree} "Plugin for some extended statistics."
1140 !insertmacro MUI_DESCRIPTION_TEXT ${SecMate} "Plugin - Meta Analysis and Tracing Engine (Experimental)."
1142 !insertmacro MUI_DESCRIPTION_TEXT ${SecMIBs} "SNMP MIBs for better SNMP dissection."
1145 !insertmacro MUI_DESCRIPTION_TEXT ${SecMIBs} "SNMP MIBs for better SNMP dissection."
1147 !insertmacro MUI_DESCRIPTION_TEXT ${SecToolsGroup} "Additional command line based tools."
1148 !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."
1149 !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."
1150 !insertmacro MUI_DESCRIPTION_TEXT ${SecMergecap} "Mergecap is a program that combines multiple saved capture files into a single output file"
1151 !insertmacro MUI_DESCRIPTION_TEXT ${SecCapinfos} "Capinfos is a program that provides information on capture files."
1152 !insertmacro MUI_DESCRIPTION_TEXT ${SecRawshark} "Rawshark is a raw packet filter."
1154 !insertmacro MUI_DESCRIPTION_TEXT ${SecUsersGuide} "Install the user's guide, so an internet connection is not required to read the help pages."
1156 !insertmacro MUI_FUNCTION_DESCRIPTION_END
1158 !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
1159 !insertmacro MUI_DESCRIPTION_TEXT ${un.SecUinstall} "Uninstall all Wireshark components."
1160 !insertmacro MUI_DESCRIPTION_TEXT ${un.SecPlugins} "Uninstall all Plugins (even from previous Wireshark versions)."
1161 !insertmacro MUI_DESCRIPTION_TEXT ${un.SecGlobalSettings} "Uninstall global settings like: $INSTDIR\cfilters"
1162 !insertmacro MUI_DESCRIPTION_TEXT ${un.SecPersonalSettings} "Uninstall personal settings like your preferences file from your profile: $PROFILE."
1163 !insertmacro MUI_DESCRIPTION_TEXT ${un.SecWinPcap} "Call WinPcap's uninstall program."
1164 !insertmacro MUI_UNFUNCTION_DESCRIPTION_END
1166 ; ============================================================================
1167 ; Callback functions
1168 ; ============================================================================
1170 ; Disable File extensions if Wireshark isn't selected
1171 Function .onSelChange
1173 SectionGetFlags ${SecWireshark} $0
1175 IntCmp $0 0 onSelChange.unselect
1176 WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 6" "State" 1
1177 WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 6" "Flags" ""
1178 WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 7" "Flags" ""
1179 Goto onSelChange.end
1181 onSelChange.unselect:
1182 WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 6" "State" 0
1183 WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 6" "Flags" "DISABLED"
1184 WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 7" "Flags" "DISABLED"
1185 Goto onSelChange.end
1193 !include "GetWindowsVersion.nsh"
1194 !include WinMessages.nsh
1195 !include "VersionCompare.nsh"
1197 Var NPF_START ; NPF service registry key
1198 Var WINPCAP_NAME ; DisplayName from WinPcap installation
1199 Var WINPCAP_VERSION ; DisplayVersion from WinPcap installation
1201 Function myShowCallback
1203 ; Get the Windows version
1204 Call GetWindowsVersion
1205 Pop $R0 ; Windows Version
1207 ; Check if we're able to run with this version
1208 StrCmp $R0 '95' lbl_winversion_unsupported
1209 StrCmp $R0 '98' lbl_winversion_unsupported
1210 StrCmp $R0 'ME' lbl_winversion_unsupported
1211 StrCmp $R0 'NT 4.0' lbl_winversion_unsupported_nt4
1212 Goto lbl_winversion_supported
1213 lbl_winversion_unsupported:
1215 "Windows $R0 is no longer supported. The last known version working with 98/ME was Ethereal 0.99.0!" \
1220 lbl_winversion_unsupported_nt4:
1222 "Windows $R0 is no longer supported. The last known version working with NT 4.0 was Wireshark 0.99.4!" \
1226 lbl_winversion_supported:
1228 ; detect if WinPcap should be installed
1229 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "Text" "Install WinPcap 4.0.2"
1230 ReadRegStr $WINPCAP_NAME HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinPcapInst" "DisplayName"
1231 IfErrors 0 lbl_winpcap_installed ;if RegKey is available, WinPcap is already installed
1232 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 2" "Text" "WinPcap is currently not installed"
1233 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 2" "Flags" "DISABLED"
1234 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Text" "(Use Add/Remove Programs first to uninstall any undetected old WinPcap versions)"
1235 Goto lbl_winpcap_done
1237 lbl_winpcap_installed:
1238 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 2" "Text" "$WINPCAP_NAME"
1239 ; Compare the installed build against the one we have.
1240 ReadRegStr $WINPCAP_VERSION HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinPcapInst" "DisplayVersion"
1241 StrCmp $WINPCAP_VERSION "" lbl_winpcap_do_install ; WinPcap is really old(?) or installed improperly.
1242 ${VersionCompare} $WINPCAP_VERSION "4.0.0.1040" $1 ; WinPcap 4.0.2
1243 StrCmp $1 "2" lbl_winpcap_do_install
1245 ;lbl_winpcap_dont_install:
1246 ; The installed version is >= to what we have, so don't install
1247 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "State" "0"
1248 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Text" "If selected, the currently installed $WINPCAP_NAME will be uninstalled first."
1249 Goto lbl_winpcap_done
1251 ;lbl_winpcap_dont_upgrade:
1252 ; force the user to upgrade by hand
1253 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "State" "0"
1254 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "Flags" "DISABLED"
1255 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Text" "If you wish to install WinPcap 4.0.2, please uninstall $WINPCAP_NAME manually first."
1256 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Flags" "DISABLED"
1257 Goto lbl_winpcap_done
1259 lbl_winpcap_do_install:
1260 ; seems to be an old version, install newer one
1261 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "State" "1"
1262 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Text" "The currently installed $WINPCAP_NAME will be uninstalled first."
1266 ; Disable NPF service setting for Win OT
1267 StrCmp $R0 '95' lbl_npf_disable
1268 StrCmp $R0 '98' lbl_npf_disable
1269 StrCmp $R0 'ME' lbl_npf_disable
1270 ; Enable NPF by default under Vista.
1271 StrCmp $R0 'Vista' lbl_npf_enable
1272 ReadRegDWORD $NPF_START HKEY_LOCAL_MACHINE "SYSTEM\CurrentControlSet\Services\NPF" "Start"
1273 ; (Winpcap may not be installed already, so no regKey is no error here)
1274 IfErrors lbl_npf_done ;RegKey not available, so do not set it
1275 IntCmp $NPF_START 2 0 lbl_npf_done lbl_npf_done
1277 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 8" "State" "1"
1281 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 8" "State" "0"
1282 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 8" "Flags" "DISABLED"
1283 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 9" "Flags" "DISABLED"
1287 ; if Wireshark was previously installed, unselect previously not installed icons etc.
1288 ; detect if Wireshark is already installed ->
1289 ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "UninstallString"
1290 IfErrors lbl_wireshark_notinstalled ;if RegKey is unavailable, Wireshark is not installed
1292 ; only select Start Menu Group, if previously installed
1293 ; (we use the "all users" start menu, so select it first)
1294 SetShellVarContext all
1295 IfFileExists "$SMPROGRAMS\Wireshark\Wireshark.lnk" lbl_have_startmenu
1296 IfFileExists "$SMPROGRAMS\Wireshark.lnk" lbl_have_startmenu
1297 WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 2" "State" "0"
1300 ; only select Desktop Icon, if previously installed
1301 IfFileExists "$DESKTOP\Wireshark.lnk" lbl_have_desktopicon
1302 WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 3" "State" "0"
1303 lbl_have_desktopicon:
1305 ; only select Quick Launch Icon, if previously installed
1306 IfFileExists "$QUICKLAUNCH\Wireshark.lnk" lbl_have_quicklaunchicon
1307 WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 4" "State" "0"
1308 lbl_have_quicklaunchicon:
1310 lbl_wireshark_notinstalled: