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\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 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.ok_shell32_${UPDATEICONS_UNIQUE} UpdateIcons.error_shell32_${UPDATEICONS_UNIQUE}
214 UpdateIcons.ok_shell32_${UPDATEICONS_UNIQUE}:
215 System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (${SHCNE_ASSOCCHANGED}, ${SHCNF_IDLIST}, 0, 0)'
216 Goto UpdateIcons.quit_${UPDATEICONS_UNIQUE}
218 UpdateIcons.error_shell32_${UPDATEICONS_UNIQUE}:
219 MessageBox MB_OK|MB_ICONSTOP \
220 "Can't find 'shell32.dll' library. Impossible to update icons" \
222 Goto UpdateIcons.quit_${UPDATEICONS_UNIQUE}
224 UpdateIcons.quit_${UPDATEICONS_UNIQUE}:
225 !undef UPDATEICONS_UNIQUE
233 ; $R0 should contain the prefix to associate to Wireshark
236 ReadRegStr $R1 HKCR $R0 ""
237 StrCmp $R1 "" Associate.doRegister
239 Associate.doRegister:
240 ;The extension is not associated to any program, we can do the link
241 WriteRegStr HKCR $R0 "" ${WIRESHARK_ASSOC}
247 ; $R0 should contain the prefix to unlink
250 ReadRegStr $R1 HKCR $R0 ""
251 StrCmp $R1 ${WIRESHARK_ASSOC} un.unlink.doUnlink
254 ; The extension is associated with Wireshark so, we must destroy this!
255 DeleteRegKey HKCR $R0
266 ; Copied from http://nsis.sourceforge.net/Auto-uninstall_old_before_installing_new
267 ReadRegStr $OLD_UNINSTALLER HKLM \
268 "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" \
270 StrCmp $OLD_UNINSTALLER "" done
272 ReadRegStr $OLD_INSTDIR HKLM \
273 "Software\Microsoft\Windows\CurrentVersion\App Paths\wireshark.exe" \
275 StrCmp $OLD_INSTDIR "" done
277 ReadRegStr $OLD_DISPLAYNAME HKLM \
278 "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" \
280 StrCmp $OLD_DISPLAYNAME "" done
282 MessageBox MB_YESNOCANCEL|MB_ICONQUESTION \
283 "$OLD_DISPLAYNAME is already installed.\
284 $\n$\nWould you like to uninstall it first?" \
286 IDYES prep_uninstaller \
290 ; Copy the uninstaller to $TEMP and run it.
291 ; The uninstaller normally does this by itself, but doesn't wait around
292 ; for the executable to finish, which means ExecWait won't work correctly.
295 StrCpy $TMP_UNINSTALLER "$TEMP\wireshark_uninstaller.exe"
296 ; ...because we surround UninstallString in quotes.
297 StrCpy $0 $OLD_UNINSTALLER -1 1
298 StrCpy $1 "$TEMP\wireshark_uninstaller.exe"
300 System::Call 'kernel32::CopyFile(t r0, t r1, b r2) 1'
301 IfSilent silent_uninstall
302 ExecWait "$TMP_UNINSTALLER _?=$OLD_INSTDIR"
306 ExecWait "$TMP_UNINSTALLER /S _?=$OLD_INSTDIR"
309 Delete "$TMP_UNINSTALLER"
312 ;Extract InstallOptions INI files
313 !insertmacro MUI_INSTALLOPTIONS_EXTRACT "AdditionalTasksPage.ini"
314 !insertmacro MUI_INSTALLOPTIONS_EXTRACT "WinpcapPage.ini"
317 Function DisplayAdditionalTasksPage
318 !insertmacro MUI_HEADER_TEXT "Select Additional Tasks" "Which additional tasks should be done?"
319 !insertmacro MUI_INSTALLOPTIONS_DISPLAY "AdditionalTasksPage.ini"
322 Function DisplayWinPcapPage
323 !insertmacro MUI_HEADER_TEXT "Install WinPcap?" "WinPcap is required to capture live network data. Should WinPcap be installed?"
324 !insertmacro MUI_INSTALLOPTIONS_DISPLAY "WinPcapPage.ini"
327 ; ============================================================================
328 ; Installation execution commands
329 ; ============================================================================
331 Var WINPCAP_UNINSTALL ;declare variable for holding the value of a registry key
332 ;Var WIRESHARK_UNINSTALL ;declare variable for holding the value of a registry key
335 ;-------------------------------------------
338 ; Install for every user
340 SetShellVarContext all
345 File "..\..\wiretap\wiretap-${WTAP_VERSION}.dll"
346 !ifdef ENABLE_LIBWIRESHARK
347 File "..\..\epan\libwireshark.dll"
349 File "..\..\wsutil\libwsutil.dll"
350 File "${GLIB_DIR}\bin\libgio-2.0-0.dll"
351 File "${GLIB_DIR}\bin\libglib-2.0-0.dll"
352 File "${GLIB_DIR}\bin\libgobject-2.0-0.dll"
353 File "${GLIB_DIR}\bin\libgmodule-2.0-0.dll"
355 File "${ICONV_DIR}\bin\iconv.dll"
357 File "${GETTEXT_DIR}\bin\intl.dll"
359 File "${ZLIB_DIR}\zlib1.dll"
362 File "${C_ARES_DIR}\cares.dll"
365 File "${ADNS_DIR}\..\${MSVC_VARIANT}\adns\adns_dll.dll"
368 File "${PCRE_DIR}\bin\pcre3.dll"
369 File "${PCRE_DIR}\man\cat3\pcrepattern.3.txt"
372 File "${KFW_DIR}\bin\comerr32.dll"
373 File "${KFW_DIR}\bin\krb5_32.dll"
376 File "${GNUTLS_DIR}\bin\libgcrypt-11.dll"
377 File "${GNUTLS_DIR}\bin\libgnutls-26.dll"
378 File "${GNUTLS_DIR}\bin\libgnutls-extra-26.dll"
379 File "${GNUTLS_DIR}\bin\libgnutls-openssl-26.dll"
380 File "${GNUTLS_DIR}\bin\libgpg-error-0.dll"
381 File "${GNUTLS_DIR}\bin\libtasn1-3.dll"
384 File "${LUA_DIR}\lua5.1.dll"
385 File "..\..\epan\wslua\init.lua"
386 File "..\..\epan\wslua\console.lua"
387 File "..\..\epan\wslua\dtd_gen.lua"
390 File "${SMI_DIR}\lib\smi.dll"
393 File "..\..\README.win32"
394 File "..\..\AUTHORS-SHORT"
398 File "..\..\services"
399 File "..\..\doc\ws.css"
400 File "..\..\doc\wireshark.html"
401 File "..\..\doc\wireshark-filter.html"
402 File "..\..\dumpcap.exe"
403 File "..\..\doc\dumpcap.html"
404 File "..\..\ipmap.html"
406 ; C-runtime redistributable
408 ; vcredist_x86.exe (MSVC V8) - copy and execute the redistributable installer
409 File "${VCREDIST_EXE}"
410 ExecWait '"$INSTDIR\vcredist_x86.exe"' $0
411 DetailPrint "vcredist_x86 returned $0"
414 ; msvcr*.dll (MSVC V7 or V7.1) - simply copy the dll file
415 !echo "IF YOU GET AN ERROR HERE, check the MSVC_VARIANT setting in config.nmake: MSVC2005 vs. MSVC2005EE!"
418 !if ${MSVC_VARIANT} != "MSVC6"
419 !error "C-Runtime redistributable for this package not available / not redistributable!"
422 !endif ; VCREDIST_EXE
425 ; global config files - don't overwrite if already existing
426 ;IfFileExists cfilters dont_overwrite_cfilters
427 File "..\..\cfilters"
428 ;dont_overwrite_cfilters:
429 ;IfFileExists colorfilters dont_overwrite_colorfilters
430 File "..\..\colorfilters"
431 ;dont_overwrite_colorfilters:
432 ;IfFileExists dfilters dont_overwrite_dfilters
433 File "..\..\dfilters"
434 ;dont_overwrite_dfilters:
435 ;IfFileExists smi_modules dont_overwrite_smi_modules
436 File "..\..\smi_modules"
437 ;dont_overwrite_smi_modules:
441 ; Install the Diameter DTD and XML files in the "diameter" subdirectory
442 ; of the installation directory.
444 SetOutPath $INSTDIR\diameter
445 File "..\..\diameter\chargecontrol.xml"
446 File "..\..\diameter\dictionary.dtd"
447 File "..\..\diameter\dictionary.xml"
448 File "..\..\diameter\Ericsson.xml"
449 File "..\..\diameter\etsie2e4.xml"
450 File "..\..\diameter\gqpolicy.xml"
451 File "..\..\diameter\imscxdx.xml"
452 File "..\..\diameter\mobileipv4.xml"
453 File "..\..\diameter\nasreq.xml"
454 File "..\..\diameter\sip.xml"
455 File "..\..\diameter\sunping.xml"
456 File "..\..\diameter\TGPPGmb.xml"
457 File "..\..\diameter\TGPPRx.xml"
458 File "..\..\diameter\TGPPSh.xml"
464 ; Install the RADIUS directory files in the "radius" subdirectory
465 ; of the installation directory.
467 SetOutPath $INSTDIR\radius
468 File "..\..\radius\dictionary"
469 File "..\..\radius\dictionary.3com"
470 File "..\..\radius\dictionary.3gpp"
471 File "..\..\radius\dictionary.3gpp2"
472 File "..\..\radius\dictionary.acc"
473 File "..\..\radius\dictionary.alcatel"
474 File "..\..\radius\dictionary.alteon"
475 File "..\..\radius\dictionary.altiga"
476 File "..\..\radius\dictionary.aptis"
477 File "..\..\radius\dictionary.ascend"
478 File "..\..\radius\dictionary.aruba"
479 File "..\..\radius\dictionary.bay"
480 File "..\..\radius\dictionary.bintec"
481 File "..\..\radius\dictionary.bristol"
482 File "..\..\radius\dictionary.cablelabs"
483 File "..\..\radius\dictionary.cabletron"
484 File "..\..\radius\dictionary.cisco"
485 File "..\..\radius\dictionary.cisco.bbsm"
486 File "..\..\radius\dictionary.cisco.vpn3000"
487 File "..\..\radius\dictionary.cisco.vpn5000"
488 File "..\..\radius\dictionary.colubris"
489 File "..\..\radius\dictionary.columbia_university"
490 File "..\..\radius\dictionary.compat"
491 File "..\..\radius\dictionary.cosine"
492 File "..\..\radius\dictionary.ericsson"
493 File "..\..\radius\dictionary.erx"
494 File "..\..\radius\dictionary.extreme"
495 File "..\..\radius\dictionary.foundry"
496 File "..\..\radius\dictionary.freeradius"
497 File "..\..\radius\dictionary.gandalf"
498 File "..\..\radius\dictionary.garderos"
499 File "..\..\radius\dictionary.gemtek"
500 File "..\..\radius\dictionary.itk"
501 File "..\..\radius\dictionary.juniper"
502 File "..\..\radius\dictionary.karlnet"
503 File "..\..\radius\dictionary.livingston"
504 File "..\..\radius\dictionary.localweb"
505 File "..\..\radius\dictionary.merit"
506 File "..\..\radius\dictionary.microsoft"
507 File "..\..\radius\dictionary.mikrotik"
508 File "..\..\radius\dictionary.navini"
509 File "..\..\radius\dictionary.netscreen"
510 File "..\..\radius\dictionary.nokia"
511 File "..\..\radius\dictionary.nomadix"
512 File "..\..\radius\dictionary.propel"
513 File "..\..\radius\dictionary.quintum"
514 File "..\..\radius\dictionary.redback"
515 File "..\..\radius\dictionary.redcreek"
516 File "..\..\radius\dictionary.shasta"
517 File "..\..\radius\dictionary.shiva"
518 File "..\..\radius\dictionary.sonicwall"
519 File "..\..\radius\dictionary.springtide"
520 File "..\..\radius\dictionary.t_systems_nova"
521 File "..\..\radius\dictionary.telebit"
522 File "..\..\radius\dictionary.trapeze"
523 File "..\..\radius\dictionary.tunnel"
524 File "..\..\radius\dictionary.unisphere"
525 File "..\..\radius\dictionary.unix"
526 File "..\..\radius\dictionary.usr"
527 File "..\..\radius\dictionary.valemount"
528 File "..\..\radius\dictionary.versanet"
529 File "..\..\radius\dictionary.wispr"
530 File "..\..\radius\dictionary.xedia"
534 ; install the dtds in the dtds subdirectory
536 SetOutPath $INSTDIR\dtds
537 File "..\..\dtds\dc.dtd"
538 File "..\..\dtds\itunes.dtd"
539 File "..\..\dtds\mscml.dtd"
540 File "..\..\dtds\pocsettings.dtd"
541 File "..\..\dtds\presence.dtd"
542 File "..\..\dtds\reginfo.dtd"
543 File "..\..\dtds\rlmi.dtd"
544 File "..\..\dtds\rss.dtd"
545 File "..\..\dtds\smil.dtd"
546 File "..\..\dtds\xcap-caps.dtd"
547 File "..\..\dtds\xcap-error.dtd"
548 File "..\..\dtds\watcherinfo.dtd"
551 ; Install the TPNCP DAT file in the "tpncp" subdirectory
552 ; of the installation directory.
553 SetOutPath $INSTDIR\tpncp
554 File "..\..\tpncp\tpncp.dat"
557 ; install the wimaxasncp TLV definitions in the wimaxasncp subdirectory
559 SetOutPath $INSTDIR\wimaxasncp
560 File "..\..\wimaxasncp\dictionary.xml"
561 File "..\..\wimaxasncp\dictionary.dtd"
564 SetOutPath $INSTDIR\help
565 File "..\..\help\toc"
566 File "..\..\help\overview.txt"
567 File "..\..\help\getting_started.txt"
568 File "..\..\help\capturing.txt"
569 File "..\..\help\capture_filters.txt"
570 File "..\..\help\display_filters.txt"
571 File "..\..\help\faq.txt"
573 ; Write the uninstall keys for Windows
574 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "DisplayVersion" "${VERSION}"
575 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "DisplayName" "Wireshark ${VERSION}"
576 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "UninstallString" '"$INSTDIR\uninstall.exe"'
577 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "Publisher" "The Wireshark developer community, http://www.wireshark.org"
578 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "HelpLink" "mailto:wireshark-users@wireshark.org"
579 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "URLInfoAbout" "http://www.wireshark.org"
580 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "URLUpdateInfo" "http://www.wireshark.org/download/win32/"
581 WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "NoModify" 1
582 WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "NoRepair" 1
583 WriteUninstaller "uninstall.exe"
585 ; Write an entry for ShellExecute
586 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\wireshark.exe" "" '$INSTDIR\wireshark.exe'
587 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\wireshark.exe" "Path" '$INSTDIR'
589 ; Create start menu entries (depending on additional tasks page)
590 ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 2" "State"
591 StrCmp $0 "0" SecRequired_skip_StartMenu
593 ;CreateDirectory "$SMPROGRAMS\Wireshark"
594 ; To qoute "http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwue/html/ch11d.asp":
595 ; "Do not include Readme, Help, or Uninstall entries on the Programs menu."
596 Delete "$SMPROGRAMS\Wireshark\Wireshark Web Site.lnk"
597 ;WriteINIStr "$SMPROGRAMS\Wireshark\Wireshark Web Site.url" "InternetShortcut" "URL" "http://www.wireshark.org/"
598 CreateShortCut "$SMPROGRAMS\Wireshark.lnk" "$INSTDIR\wireshark.exe" "" "$INSTDIR\wireshark.exe" 0 "" "" "The Wireshark Network Protocol Analyzer"
599 ;CreateShortCut "$SMPROGRAMS\Wireshark\Wireshark Manual.lnk" "$INSTDIR\wireshark.html"
600 ;CreateShortCut "$SMPROGRAMS\Wireshark\Display Filters Manual.lnk" "$INSTDIR\wireshark-filter.html"
601 ;CreateShortCut "$SMPROGRAMS\Wireshark\Wireshark Program Directory.lnk" "$INSTDIR"
602 ;CreateShortCut "$SMPROGRAMS\Wireshark\Uninstall Wireshark.lnk" "$INSTDIR\uninstall.exe"
603 SecRequired_skip_StartMenu:
605 ; is command line option "/desktopicon" set?
607 ${GetOptions} $R0 "/desktopicon=" $R1
608 StrCmp $R1 "no" SecRequired_skip_DesktopIcon
609 StrCmp $R1 "yes" SecRequired_install_DesktopIcon
611 ; Create desktop icon (depending on additional tasks page and command line option)
612 ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 3" "State"
613 StrCmp $0 "0" SecRequired_skip_DesktopIcon
614 SecRequired_install_DesktopIcon:
615 CreateShortCut "$DESKTOP\Wireshark.lnk" "$INSTDIR\wireshark.exe" "" "$INSTDIR\wireshark.exe" 0 "" "" "The Wireshark Network Protocol Analyzer"
616 SecRequired_skip_DesktopIcon:
618 ; is command line option "/quicklaunchicon" set?
620 ${GetOptions} $R0 "/quicklaunchicon=" $R1
621 StrCmp $R1 "no" SecRequired_skip_QuickLaunchIcon
622 StrCmp $R1 "yes" SecRequired_install_QuickLaunchIcon
624 ; Create quick launch icon (depending on additional tasks page and command line option)
625 ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 4" "State"
626 StrCmp $0 "0" SecRequired_skip_QuickLaunchIcon
627 SecRequired_install_QuickLaunchIcon:
628 CreateShortCut "$QUICKLAUNCH\Wireshark.lnk" "$INSTDIR\wireshark.exe" "" "$INSTDIR\wireshark.exe" 0 "" "" "The Wireshark Network Protocol Analyzer"
629 SecRequired_skip_QuickLaunchIcon:
631 ; Create File Extensions (depending on additional tasks page)
632 ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 6" "State"
633 StrCmp $0 "0" SecRequired_skip_FileExtensions
634 WriteRegStr HKCR ${WIRESHARK_ASSOC} "" "Wireshark capture file"
635 WriteRegStr HKCR "${WIRESHARK_ASSOC}\Shell\open\command" "" '"$INSTDIR\wireshark.exe" "%1"'
636 WriteRegStr HKCR "${WIRESHARK_ASSOC}\DefaultIcon" "" '"$INSTDIR\wireshark.exe",1'
678 ; if somethings added here, add it also to the uninstall section and the AdditionalTask page
680 !insertmacro UpdateIcons
681 SecRequired_skip_FileExtensions:
683 ; if running as a silent installer, don't try to install winpcap
684 IfSilent SecRequired_skip_Winpcap
686 ; Install WinPcap (depending on winpcap page setting)
687 ReadINIStr $0 "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "State"
688 StrCmp $0 "0" SecRequired_skip_Winpcap
689 ; Uinstall old WinPcap first
690 ReadRegStr $WINPCAP_UNINSTALL HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinPcapInst" "UninstallString"
691 IfErrors lbl_winpcap_notinstalled ;if RegKey is unavailable, WinPcap is not installed
692 ; from released version 3.1, WinPcap will uninstall an old version by itself
693 ;ExecWait '$WINPCAP_UNINSTALL' $0
694 ;DetailPrint "WinPcap uninstaller returned $0"
695 lbl_winpcap_notinstalled:
697 File "WinPcap_4_0_2.exe"
698 ExecWait '"$INSTDIR\WinPcap_4_0_2.exe"' $0
699 DetailPrint "WinPcap installer returned $0"
700 SecRequired_skip_Winpcap:
702 ; Load Winpcap NPF service at startup (depending on winpcap page)
703 ReadINIStr $0 "$PLUGINSDIR\WinPcapPage.ini" "Field 8" "State"
704 StrCmp $0 "0" SecRequired_no_WinpcapService
705 WriteRegDWORD HKEY_LOCAL_MACHINE "SYSTEM\CurrentControlSet\Services\NPF" "Start" 2 ;set NPF to (SERVICE_AUTO_START)
706 !insertmacro SERVICE "start" "NPF" ""
707 Goto SecRequired_done_WinpcapService
708 SecRequired_no_WinpcapService:
709 WriteRegDWORD HKEY_LOCAL_MACHINE "SYSTEM\CurrentControlSet\Services\NPF" "Start" 3 ;set NPF to (SERVICE_DEMAND_START)
710 !insertmacro SERVICE "stop" "NPF" ""
711 SecRequired_done_WinpcapService:
713 ; If no user profile exists for Wireshark but for Ethereal, copy it over
714 SetShellVarContext current
715 IfFileExists $APPDATA\Wireshark profile_done
716 IfFileExists $APPDATA\Ethereal 0 profile_done
717 ;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
718 CreateDirectory $APPDATA\Wireshark
719 CopyFiles $APPDATA\Ethereal\*.* $APPDATA\Wireshark
721 SetShellVarContext all
723 SectionEnd ; "Required"
726 Section "Wireshark" SecWireshark
727 ;-------------------------------------------
729 File "..\..\wireshark.exe"
730 File "${GTK_DIR}\bin\libgdk-win32-2.0-0.dll"
731 File "${GTK_DIR}\bin\libgdk_pixbuf-2.0-0.dll"
732 File "${GTK_DIR}\bin\libgtk-win32-2.0-0.dll"
733 File "${GTK_DIR}\bin\libatk-1.0-0.dll"
734 File "${GTK_DIR}\bin\libpango-1.0-0.dll"
735 File "${GTK_DIR}\bin\libpangowin32-1.0-0.dll"
736 !ifdef NEED_CAIRO_DLL
737 File "${GTK_DIR}\bin\libcairo-2.dll"
738 File "${GTK_DIR}\bin\libpangocairo-1.0-0.dll"
740 !ifdef NEED_LIBPNG_DLL
741 File "${GTK_DIR}\bin\libpng12-0.dll"
743 !ifdef NEED_LIBTIFF_DLL
744 File "${GTK_DIR}\bin\libtiff3.dll"
746 !ifdef NEED_LIBJPEG_DLL
747 File "${GTK_DIR}\bin\jpeg62.dll"
749 SetOutPath $INSTDIR\etc\gtk-2.0
750 File "${GTK_DIR}\etc\gtk-2.0\*.*"
751 SetOutPath $INSTDIR\etc\pango
752 File "${GTK_DIR}\etc\pango\pango.*"
753 SetOutPath $INSTDIR\lib\gtk-2.0\${GTK_LIB_DIR}\loaders
754 File "${GTK_DIR}\lib\gtk-2.0\${GTK_LIB_DIR}\loaders\libpixbufloader-*.dll"
755 SetOutPath $INSTDIR\lib\gtk-2.0\${GTK_LIB_DIR}\engines
756 File "${GTK_DIR}\lib\gtk-2.0\${GTK_LIB_DIR}\engines\libpixmap.dll"
757 SetOutPath $INSTDIR\lib\gtk-2.0\modules
758 File "${GTK_DIR}\lib\gtk-2.0\modules\libgail.dll"
759 # Not needed with pango 1.14.5
760 #SetOutPath $INSTDIR\lib\pango\${PANGO_LIB_DIR}\modules
761 #File "${GTK_DIR}\lib\pango\${PANGO_LIB_DIR}\modules\pango-*.dll"
763 ; GTK MS-Windows Engine (GTK-Wimp)
764 SetOutPath $INSTDIR\${GTK_WIMP_DLLDST_DIR}
765 File "${GTK_WIMP_DLLSRC_DIR}\libwimp.dll"
766 SetOutPath $INSTDIR\${GTK_WIMP_RCDST_DIR}
767 File "${GTK_WIMP_RCSRC_DIR}\gtkrc"
769 SectionEnd ; "Wireshark"
773 Section "TShark" SecTShark
774 ;-------------------------------------------
776 File "..\..\tshark.exe"
777 File "..\..\doc\tshark.html"
780 SectionGroup "Plugins / Extensions" SecPluginsGroup
782 Section "Dissector Plugins" SecPlugins
783 ;-------------------------------------------
784 SetOutPath $INSTDIR\plugins\${VERSION}
785 File "..\..\plugins\agentx\agentx.dll"
786 File "..\..\plugins\artnet\artnet.dll"
787 File "..\..\plugins\asn1\asn1.dll"
788 File "..\..\plugins\ciscosm\ciscosm.dll"
789 File "..\..\plugins\docsis\docsis.dll"
790 File "..\..\plugins\enttec\enttec.dll"
791 File "..\..\plugins\ethercat\ethercat.dll"
792 File "..\..\plugins\giop\coseventcomm.dll"
793 File "..\..\plugins\giop\cosnaming.dll"
794 File "..\..\plugins\giop\parlay.dll"
795 File "..\..\plugins\giop\tango.dll"
796 File "..\..\plugins\gryphon\gryphon.dll"
797 File "..\..\plugins\infiniband\infiniband.dll"
798 File "..\..\plugins\irda\irda.dll"
799 File "..\..\plugins\m2m\m2m.dll"
800 File "..\..\plugins\profinet\profinet.dll"
801 File "..\..\plugins\sercosiii\sercosiii.dll"
802 File "..\..\plugins\unistim\unistim.dll"
803 File "..\..\plugins\wimax\wimax.dll"
804 File "..\..\plugins\wimaxasncp\wimaxasncp.dll"
807 Section "Tree Statistics Plugin" SecStatsTree
808 ;-------------------------------------------
809 SetOutPath $INSTDIR\plugins\${VERSION}
810 File "..\..\plugins\stats_tree\stats_tree.dll"
813 Section "Mate - Meta Analysis and Tracing Engine" SecMate
814 ;-------------------------------------------
815 SetOutPath $INSTDIR\plugins\${VERSION}
816 File "..\..\plugins\mate\mate.dll"
821 Section "SNMP MIBs" SecMIBs
822 ;-------------------------------------------
823 SetOutPath $INSTDIR\snmp\mibs
824 File "${NET_SNMP_DIR}\mibs\*.txt"
829 Section "SNMP MIBs" SecMIBs
830 ;-------------------------------------------
831 SetOutPath $INSTDIR\snmp\mibs
832 File "${SMI_DIR}\mibs\*"
836 SectionGroupEnd ; "Plugins / Extensions"
839 SectionGroup "Tools" SecToolsGroup
841 Section "Editcap" SecEditcap
842 ;-------------------------------------------
844 File "..\..\editcap.exe"
845 File "..\..\doc\editcap.html"
848 Section "Text2Pcap" SecText2Pcap
849 ;-------------------------------------------
851 File "..\..\text2pcap.exe"
852 File "..\..\doc\text2pcap.html"
855 Section "Mergecap" SecMergecap
856 ;-------------------------------------------
858 File "..\..\mergecap.exe"
859 File "..\..\doc\mergecap.html"
862 Section "Capinfos" SecCapinfos
863 ;-------------------------------------------
865 File "..\..\capinfos.exe"
866 File "..\..\doc\capinfos.html"
869 Section "Rawshark" SecRawshark
870 ;-------------------------------------------
872 File "..\..\rawshark.exe"
873 File "..\..\doc\rawshark.html"
876 SectionGroupEnd ; "Tools"
879 Section "User's Guide" SecUsersGuide
880 ;-------------------------------------------
882 File "user-guide.chm"
886 Section "Uninstall" un.SecUinstall
887 ;-------------------------------------------
890 ; UnInstall for every user
893 SetShellVarContext all
895 Delete "$INSTDIR\rawshark.exe"
896 IfErrors 0 NoRawsharkErrorMsg
897 MessageBox MB_OK "Please note: rawshark.exe could not be removed, it's probably in use!" IDOK 0 ;skipped if rawshark.exe removed
898 Abort "Please note: rawshark.exe could not be removed, it's probably in use! Abort uninstall process!"
901 Delete "$INSTDIR\tshark.exe"
902 IfErrors 0 NoTSharkErrorMsg
903 MessageBox MB_OK "Please note: tshark.exe could not be removed, it's probably in use!" IDOK 0 ;skipped if tshark.exe removed
904 Abort "Please note: tshark.exe could not be removed, it's probably in use! Abort uninstall process!"
907 Delete "$INSTDIR\wireshark.exe"
908 IfErrors 0 NoWiresharkErrorMsg
909 MessageBox MB_OK "Please note: wireshark.exe could not be removed, it's probably in use!" IDOK 0 ;skipped if wireshark.exe removed
910 Abort "Please note: wireshark.exe could not be removed, it's probably in use! Abort uninstall process!"
913 DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark"
914 DeleteRegKey HKEY_LOCAL_MACHINE "Software\Wireshark"
915 DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\wireshark.exe"
960 DeleteRegKey HKCR ${WIRESHARK_ASSOC}
961 DeleteRegKey HKCR "${WIRESHARK_ASSOC}\Shell\open\command"
962 DeleteRegKey HKCR "${WIRESHARK_ASSOC}\DefaultIcon"
963 !insertmacro UpdateIcons
965 Delete "$INSTDIR\etc\gtk-2.0\*.*"
966 Delete "$INSTDIR\etc\pango\*.*"
967 Delete "$INSTDIR\lib\gtk-2.0\2.2.0\engines\*.*"
968 Delete "$INSTDIR\lib\gtk-2.0\2.2.0\loaders\*.*"
969 Delete "$INSTDIR\lib\gtk-2.0\2.2.0\immodules\*.*"
970 Delete "$INSTDIR\lib\gtk-2.0\2.4.0\engines\*.*"
971 Delete "$INSTDIR\lib\gtk-2.0\2.4.0\loaders\*.*"
972 Delete "$INSTDIR\lib\gtk-2.0\2.4.0\immodules\*.*"
973 Delete "$INSTDIR\lib\gtk-2.0\2.10.0\engines\*.*"
974 Delete "$INSTDIR\lib\gtk-2.0\2.10.0\loaders\*.*"
975 Delete "$INSTDIR\lib\gtk-2.0\2.10.0\immodules\*.*"
976 Delete "$INSTDIR\lib\gtk-2.0\modules\*.*"
977 Delete "$INSTDIR\lib\pango\1.2.0\modules\*.*"
978 Delete "$INSTDIR\lib\pango\1.4.0\modules\*.*"
979 Delete "$INSTDIR\lib\pango\1.5.0\modules\*.*"
980 Delete "$INSTDIR\share\themes\Default\gtk-2.0\*.*"
981 Delete "$INSTDIR\help\*.*"
982 Delete "$INSTDIR\diameter\*.*"
983 Delete "$INSTDIR\snmp\mibs\*.*"
984 Delete "$INSTDIR\snmp\*.*"
985 Delete "$INSTDIR\tpncp\*.*"
986 Delete "$INSTDIR\wimaxasncp\*.*"
987 Delete "$INSTDIR\*.exe"
988 Delete "$INSTDIR\*.dll"
989 Delete "$INSTDIR\*.html"
990 Delete "$INSTDIR\ws.css"
991 Delete "$INSTDIR\COPYING"
992 Delete "$INSTDIR\AUTHORS-SHORT"
993 ; previous versions installed these files
994 Delete "$INSTDIR\*.manifest"
995 ; previous versions installed this file
996 Delete "$INSTDIR\AUTHORS-SHORT-FORMAT"
997 Delete "$INSTDIR\README*"
998 Delete "$INSTDIR\NEWS.txt"
999 Delete "$INSTDIR\manuf"
1000 Delete "$INSTDIR\services"
1001 Delete "$INSTDIR\pcrepattern.3.txt"
1002 Delete "$INSTDIR\user-guide.chm"
1003 Delete "$INSTDIR\example_snmp_users_file"
1004 Delete "$INSTDIR\ipmap.html"
1005 Delete "$INSTDIR\radius\*.*"
1006 Delete "$INSTDIR\dtds\*.*"
1007 Delete "$SMPROGRAMS\Wireshark\*.*"
1008 Delete "$SMPROGRAMS\Wireshark.lnk"
1009 Delete "$DESKTOP\Wireshark.lnk"
1010 Delete "$QUICKLAUNCH\Wireshark.lnk"
1012 RMDir "$INSTDIR\etc\gtk-2.0"
1013 RMDir "$INSTDIR\etc\pango"
1014 RMDir "$INSTDIR\etc"
1015 RMDir "$INSTDIR\lib\gtk-2.0\2.2.0\engines"
1016 RMDir "$INSTDIR\lib\gtk-2.0\2.2.0\loaders"
1017 RMDir "$INSTDIR\lib\gtk-2.0\2.2.0\immodules"
1018 RMDir "$INSTDIR\lib\gtk-2.0\2.2.0"
1019 RMDir "$INSTDIR\lib\gtk-2.0\2.4.0\engines"
1020 RMDir "$INSTDIR\lib\gtk-2.0\2.4.0\loaders"
1021 RMDir "$INSTDIR\lib\gtk-2.0\2.4.0\immodules"
1022 RMDir "$INSTDIR\lib\gtk-2.0\2.4.0"
1023 RMDir "$INSTDIR\lib\gtk-2.0\2.10.0\engines"
1024 RMDir "$INSTDIR\lib\gtk-2.0\2.10.0\loaders"
1025 RMDir "$INSTDIR\lib\gtk-2.0\2.10.0\immodules"
1026 RMDir "$INSTDIR\lib\gtk-2.0\2.10.0"
1027 RMDir "$INSTDIR\lib\gtk-2.0\modules"
1028 RMDir "$INSTDIR\lib\gtk-2.0"
1029 RMDir "$INSTDIR\lib\pango\1.2.0\modules"
1030 RMDir "$INSTDIR\lib\pango\1.2.0"
1031 RMDir "$INSTDIR\lib\pango\1.4.0\modules"
1032 RMDir "$INSTDIR\lib\pango\1.4.0"
1033 RMDir "$INSTDIR\lib\pango\1.5.0\modules"
1034 RMDir "$INSTDIR\lib\pango\1.5.0"
1035 RMDir "$INSTDIR\lib\pango"
1036 RMDir "$INSTDIR\lib"
1037 RMDir "$INSTDIR\share\themes\Default\gtk-2.0"
1038 RMDir "$INSTDIR\share\themes\Default"
1039 RMDir "$INSTDIR\share\themes"
1040 RMDir "$INSTDIR\share"
1041 RMDir "$SMPROGRAMS\Wireshark"
1042 RMDir "$INSTDIR\help"
1043 RMDir "$INSTDIR\diameter"
1044 RMDir "$INSTDIR\snmp\mibs"
1045 RMDir "$INSTDIR\snmp"
1046 RMDir "$INSTDIR\radius"
1047 RMDir "$INSTDIR\dtds"
1048 RMDir "$INSTDIR\tpncp"
1049 RMDir "$INSTDIR\wimaxasncp"
1052 SectionEnd ; "Uinstall"
1054 Section "Un.Plugins" un.SecPlugins
1055 ;-------------------------------------------
1057 ;Delete "$INSTDIR\plugins\${VERSION}\*.*"
1058 ;Delete "$INSTDIR\plugins\*.*"
1059 ;RMDir "$INSTDIR\plugins\${VERSION}"
1060 ;RMDir "$INSTDIR\plugins"
1061 RMDir /r "$INSTDIR\plugins"
1064 Section "Un.Global Settings" un.SecGlobalSettings
1065 ;-------------------------------------------
1067 Delete "$INSTDIR\cfilters"
1068 Delete "$INSTDIR\colorfilters"
1069 Delete "$INSTDIR\dfilters"
1070 Delete "$INSTDIR\init.lua"
1071 Delete "$INSTDIR\console.lua"
1072 Delete "$INSTDIR\dtd_gen.lua"
1073 Delete "$INSTDIR\smi_modules"
1077 Section /o "Un.Personal Settings" un.SecPersonalSettings
1078 ;-------------------------------------------
1080 SetShellVarContext current
1081 Delete "$APPDATA\Wireshark\*.*"
1082 RMDir "$APPDATA\Wireshark"
1085 ;VAR un.WINPCAP_UNINSTALL
1087 Section /o "Un.WinPcap" un.SecWinPcap
1088 ;-------------------------------------------
1090 ReadRegStr $1 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinPcapInst" "UninstallString"
1091 ;IfErrors un.lbl_winpcap_notinstalled ;if RegKey is unavailable, WinPcap is not installed
1092 ;MessageBox MB_OK "WinPcap $1"
1094 DetailPrint "WinPcap uninstaller returned $0"
1096 ;un.lbl_winpcap_notinstalled:
1099 Section "-Un.Finally"
1100 ;-------------------------------------------
1102 ; this test must be done after all other things uninstalled (e.g. Global Settings)
1103 IfFileExists "$INSTDIR" 0 NoFinalErrorMsg
1104 MessageBox MB_OK "Please note: The directory $INSTDIR could not be removed!" IDOK 0 ; skipped if dir doesn't exist
1109 ; ============================================================================
1110 ; PLEASE MAKE SURE, THAT THE DESCRIPTIVE TEXT FITS INTO THE DESCRIPTION FIELD!
1111 ; ============================================================================
1112 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
1114 !insertmacro MUI_DESCRIPTION_TEXT ${SecWireshark} "${PROGRAM_NAME} is a GUI network protocol analyzer."
1116 !insertmacro MUI_DESCRIPTION_TEXT ${SecTShark} "TShark is a text based network protocol analyzer."
1117 !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsGroup} "Some plugins and extensions for both Wireshark and TShark."
1118 !insertmacro MUI_DESCRIPTION_TEXT ${SecPlugins} "Plugins with some extended dissections."
1119 !insertmacro MUI_DESCRIPTION_TEXT ${SecStatsTree} "Plugin for some extended statistics."
1120 !insertmacro MUI_DESCRIPTION_TEXT ${SecMate} "Plugin - Meta Analysis and Tracing Engine (Experimental)."
1122 !insertmacro MUI_DESCRIPTION_TEXT ${SecMIBs} "SNMP MIBs for better SNMP dissection."
1125 !insertmacro MUI_DESCRIPTION_TEXT ${SecMIBs} "SNMP MIBs for better SNMP dissection."
1127 !insertmacro MUI_DESCRIPTION_TEXT ${SecToolsGroup} "Additional command line based tools."
1128 !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."
1129 !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."
1130 !insertmacro MUI_DESCRIPTION_TEXT ${SecMergecap} "Mergecap is a program that combines multiple saved capture files into a single output file"
1131 !insertmacro MUI_DESCRIPTION_TEXT ${SecCapinfos} "Capinfos is a program that provides information on capture files."
1132 !insertmacro MUI_DESCRIPTION_TEXT ${SecRawshark} "Rawshark is a raw packet filter."
1134 !insertmacro MUI_DESCRIPTION_TEXT ${SecUsersGuide} "Install the user's guide, so an internet connection is not required to read the help pages."
1136 !insertmacro MUI_FUNCTION_DESCRIPTION_END
1138 !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
1139 !insertmacro MUI_DESCRIPTION_TEXT ${un.SecUinstall} "Uninstall all Wireshark components."
1140 !insertmacro MUI_DESCRIPTION_TEXT ${un.SecPlugins} "Uninstall all Plugins (even from previous Wireshark versions)."
1141 !insertmacro MUI_DESCRIPTION_TEXT ${un.SecGlobalSettings} "Uninstall global settings like: $INSTDIR\cfilters"
1142 !insertmacro MUI_DESCRIPTION_TEXT ${un.SecPersonalSettings} "Uninstall personal settings like your preferences file from your profile: $PROFILE."
1143 !insertmacro MUI_DESCRIPTION_TEXT ${un.SecWinPcap} "Call WinPcap's uninstall program."
1144 !insertmacro MUI_UNFUNCTION_DESCRIPTION_END
1146 ; ============================================================================
1147 ; Callback functions
1148 ; ============================================================================
1150 ; Disable File extensions if Wireshark isn't selected
1151 Function .onSelChange
1153 SectionGetFlags ${SecWireshark} $0
1155 IntCmp $0 0 onSelChange.unselect
1156 WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 6" "State" 1
1157 WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 6" "Flags" ""
1158 WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 7" "Flags" ""
1159 Goto onSelChange.end
1161 onSelChange.unselect:
1162 WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 6" "State" 0
1163 WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 6" "Flags" "DISABLED"
1164 WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 7" "Flags" "DISABLED"
1165 Goto onSelChange.end
1173 !include "GetWindowsVersion.nsh"
1174 !include WinMessages.nsh
1175 !include "VersionCompare.nsh"
1177 Var NPF_START ; NPF service registry key
1178 Var WINPCAP_NAME ; DisplayName from WinPcap installation
1179 Var WINPCAP_VERSION ; DisplayVersion from WinPcap installation
1181 Function myShowCallback
1183 ; Get the Windows version
1184 Call GetWindowsVersion
1185 Pop $R0 ; Windows Version
1187 ; Check if we're able to run with this version
1188 StrCmp $R0 '95' lbl_winversion_unsupported
1189 StrCmp $R0 '98' lbl_winversion_unsupported
1190 StrCmp $R0 'ME' lbl_winversion_unsupported
1191 StrCmp $R0 'NT 4.0' lbl_winversion_unsupported_nt4
1192 Goto lbl_winversion_supported
1193 lbl_winversion_unsupported:
1195 "Windows $R0 is no longer supported. The last known version working with 98/ME was Ethereal 0.99.0!" \
1200 lbl_winversion_unsupported_nt4:
1202 "Windows $R0 is no longer supported. The last known version working with NT 4.0 was Wireshark 0.99.4!" \
1206 lbl_winversion_supported:
1208 ; detect if WinPcap should be installed
1209 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "Text" "Install WinPcap 4.0.2"
1210 ReadRegStr $WINPCAP_NAME HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinPcapInst" "DisplayName"
1211 IfErrors 0 lbl_winpcap_installed ;if RegKey is available, WinPcap is already installed
1212 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 2" "Text" "WinPcap is currently not installed"
1213 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 2" "Flags" "DISABLED"
1214 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Text" "(Use Add/Remove Programs first to uninstall any undetected old WinPcap versions)"
1215 Goto lbl_winpcap_done
1217 lbl_winpcap_installed:
1218 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 2" "Text" "$WINPCAP_NAME"
1219 ; Compare the installed build against the one we have.
1220 ReadRegStr $WINPCAP_VERSION HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinPcapInst" "DisplayVersion"
1221 StrCmp $WINPCAP_VERSION "" lbl_winpcap_do_install ; WinPcap is really old(?) or installed improperly.
1222 ${VersionCompare} $WINPCAP_VERSION "4.0.0.1040" $1 ; WinPcap 4.0.2
1223 StrCmp $1 "2" lbl_winpcap_do_install
1225 ;lbl_winpcap_dont_install:
1226 ; The installed version is >= to what we have, so don't install
1227 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "State" "0"
1228 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Text" "If selected, the currently installed $WINPCAP_NAME will be uninstalled first."
1229 Goto lbl_winpcap_done
1231 ;lbl_winpcap_dont_upgrade:
1232 ; force the user to upgrade by hand
1233 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "State" "0"
1234 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "Flags" "DISABLED"
1235 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Text" "If you wish to install WinPcap 4.0.2, please uninstall $WINPCAP_NAME manually first."
1236 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Flags" "DISABLED"
1237 Goto lbl_winpcap_done
1239 lbl_winpcap_do_install:
1240 ; seems to be an old version, install newer one
1241 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "State" "1"
1242 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Text" "The currently installed $WINPCAP_NAME will be uninstalled first."
1246 ; Disable NPF service setting for Win OT
1247 StrCmp $R0 '95' lbl_npf_disable
1248 StrCmp $R0 '98' lbl_npf_disable
1249 StrCmp $R0 'ME' lbl_npf_disable
1250 ; Enable NPF by default under Vista.
1251 StrCmp $R0 'Vista' lbl_npf_enable
1252 ReadRegDWORD $NPF_START HKEY_LOCAL_MACHINE "SYSTEM\CurrentControlSet\Services\NPF" "Start"
1253 ; (Winpcap may not be installed already, so no regKey is no error here)
1254 IfErrors lbl_npf_done ;RegKey not available, so do not set it
1255 IntCmp $NPF_START 2 0 lbl_npf_done lbl_npf_done
1257 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 8" "State" "1"
1261 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 8" "State" "0"
1262 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 8" "Flags" "DISABLED"
1263 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 9" "Flags" "DISABLED"
1267 ; if Wireshark was previously installed, unselect previously not installed icons etc.
1268 ; detect if Wireshark is already installed ->
1269 ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "UninstallString"
1270 IfErrors lbl_wireshark_notinstalled ;if RegKey is unavailable, Wireshark is not installed
1272 ; only select Start Menu Group, if previously installed
1273 ; (we use the "all users" start menu, so select it first)
1274 SetShellVarContext all
1275 IfFileExists "$SMPROGRAMS\Wireshark\Wireshark.lnk" lbl_have_startmenu
1276 IfFileExists "$SMPROGRAMS\Wireshark.lnk" lbl_have_startmenu
1277 WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 2" "State" "0"
1280 ; only select Desktop Icon, if previously installed
1281 IfFileExists "$DESKTOP\Wireshark.lnk" lbl_have_desktopicon
1282 WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 3" "State" "0"
1283 lbl_have_desktopicon:
1285 ; only select Quick Launch Icon, if previously installed
1286 IfFileExists "$QUICKLAUNCH\Wireshark.lnk" lbl_have_quicklaunchicon
1287 WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 4" "State" "0"
1288 lbl_have_quicklaunchicon:
1290 lbl_wireshark_notinstalled: