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-file"
24 ; ============================================================================
25 ; Header configuration
26 ; ============================================================================
27 ; The name of the installer
28 !define PROGRAM_NAME "Wireshark"
30 Name "${PROGRAM_NAME} ${VERSION}"
33 OutFile "wireshark-setup-${VERSION}.exe"
35 ; Icon of installer and uninstaller
36 Icon "..\..\image\wireshark.ico"
37 UninstallIcon "..\..\image\wireshark.ico"
39 ; Uninstall stuff (NSIS 2.08: "\r\n" don't work here)
40 !define MUI_UNCONFIRMPAGE_TEXT_TOP "The following Wireshark installation will be uninstalled. Click 'Next' to continue."
41 ; Uninstall stuff (this text isn't used with the MODERN_UI!)
42 ;UninstallText "This will uninstall Wireshark.\r\nBefore starting the uninstallation, make sure Wireshark is not running.\r\nClick 'Next' to continue."
48 ; ============================================================================
50 ; ============================================================================
51 ; The modern user interface will look much better than the common one.
52 ; However, as the development of the modern UI is still going on, and the script
53 ; syntax changes, you will need exactly that NSIS version, which this script is
54 ; made for. This is the current (December 2003) latest version: V2.0b4
55 ; If you are using a different version, it's not predictable what will happen.
58 ;!addplugindir ".\Plugins"
60 !define MUI_ICON "..\..\image\wireshark.ico"
61 !define MUI_UNICON "..\..\image\wireshark.ico"
63 !define MUI_COMPONENTSPAGE_SMALLDESC
64 !define MUI_FINISHPAGE_NOAUTOCLOSE
65 !define MUI_UNFINISHPAGE_NOAUTOCLOSE
66 !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."
67 ;!define MUI_FINISHPAGE_LINK "Install WinPcap to be able to capture packets from a network!"
68 ;!define MUI_FINISHPAGE_LINK_LOCATION "http://www.winpcap.org"
70 ; NSIS shows Readme files by opening the Readme file with the default application for
71 ; the file's extension. "README.win32" won't work in most cases, because extension "win32"
72 ; is usually not associated with an appropriate text editor. We should use extension "txt"
73 ; for a text file or "html" for an html README file.
74 !define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\NEWS.txt"
75 !define MUI_FINISHPAGE_SHOWREADME_TEXT "Show News"
76 !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
77 !define MUI_FINISHPAGE_RUN "$INSTDIR\wireshark.exe"
78 !define MUI_FINISHPAGE_RUN_NOTCHECKED
82 !define MUI_PAGE_CUSTOMFUNCTION_SHOW myShowCallback
84 ; ============================================================================
86 ; ============================================================================
88 !insertmacro MUI_PAGE_WELCOME
89 !insertmacro MUI_PAGE_LICENSE "..\..\COPYING"
90 !insertmacro MUI_PAGE_COMPONENTS
91 Page custom DisplayAdditionalTasksPage
92 !insertmacro MUI_PAGE_DIRECTORY
93 Page custom DisplayWinPcapPage
94 !insertmacro MUI_PAGE_INSTFILES
95 !insertmacro MUI_PAGE_FINISH
97 !insertmacro MUI_UNPAGE_WELCOME
98 !insertmacro MUI_UNPAGE_CONFIRM
99 !insertmacro MUI_UNPAGE_COMPONENTS
100 !insertmacro MUI_UNPAGE_INSTFILES
101 !insertmacro MUI_UNPAGE_FINISH
103 ; ============================================================================
105 ; ============================================================================
107 !insertmacro MUI_LANGUAGE "English"
109 ; ============================================================================
111 ; ============================================================================
113 ;Things that need to be extracted on first (keep these lines before any File command!)
114 ;Only useful for BZIP2 compression
116 ReserveFile "AdditionalTasksPage.ini"
117 ReserveFile "WinPcapPage.ini"
118 !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
120 ; ============================================================================
122 ; ============================================================================
123 !include "Sections.nsh"
125 ; ========= Macro to unselect and disable a section =========
127 !macro DisableSection SECTION
130 SectionGetFlags "${SECTION}" $0
131 IntOp $0 $0 & ${SECTION_OFF}
132 IntOp $0 $0 | ${SF_RO}
133 SectionSetFlags "${SECTION}" $0
138 ; ========= Macro to enable (unreadonly) a section =========
139 !define SECTION_ENABLE 0xFFFFFFEF
140 !macro EnableSection SECTION
143 SectionGetFlags "${SECTION}" $0
144 IntOp $0 $0 & ${SECTION_ENABLE}
145 SectionSetFlags "${SECTION}" $0
150 ; ============================================================================
152 ; ============================================================================
153 !include "servicelib.nsh"
155 ; ============================================================================
157 ; ============================================================================
158 !include "FileFunc.nsh"
160 !insertmacro GetParameters
161 !insertmacro GetOptions
163 ; ============================================================================
164 ; License page configuration
165 ; ============================================================================
166 LicenseText "Wireshark is distributed under the GNU General Public License."
167 LicenseData "..\..\COPYING"
169 ; ============================================================================
170 ; Component page configuration
171 ; ============================================================================
172 ComponentText "The following components are available for installation."
174 ; Component check boxes
175 ; Commented out for NSIS v 2.0
176 ; EnabledBitmap "..\..\image\nsis-checked.bmp"
177 ; DisabledBitmap "..\..\image\nsis-unchecked.bmp"
179 ; ============================================================================
180 ; Directory selection page configuration
181 ; ============================================================================
182 ; The text to prompt the user to enter a directory
183 DirText "Choose a directory in which to install Wireshark."
185 ; The default installation directory
186 InstallDir $PROGRAMFILES\Wireshark\
188 ; See if this is an upgrade; if so, use the old InstallDir as default
189 InstallDirRegKey HKEY_LOCAL_MACHINE SOFTWARE\Wireshark "InstallDir"
192 ; ============================================================================
193 ; Install page configuration
194 ; ============================================================================
196 ShowUninstDetails show
198 ; ============================================================================
199 ; Functions and macros
200 ; ============================================================================
206 !define UPDATEICONS_UNIQUE ${__LINE__}
208 IfFileExists "$SYSDIR\shell32.dll" UpdateIcons.next1_${UPDATEICONS_UNIQUE} UpdateIcons.error1_${UPDATEICONS_UNIQUE}
209 UpdateIcons.next1_${UPDATEICONS_UNIQUE}:
210 GetDllVersion "$SYSDIR\shell32.dll" $R0 $R1
211 IntOp $R2 $R0 / 0x00010000
212 IntCmp $R2 4 UpdateIcons.next2_${UPDATEICONS_UNIQUE} UpdateIcons.error2_${UPDATEICONS_UNIQUE}
213 UpdateIcons.next2_${UPDATEICONS_UNIQUE}:
214 System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (${SHCNE_ASSOCCHANGED}, ${SHCNF_IDLIST}, 0, 0)'
215 Goto UpdateIcons.quit_${UPDATEICONS_UNIQUE}
217 UpdateIcons.error1_${UPDATEICONS_UNIQUE}:
218 MessageBox MB_OK|MB_ICONSTOP "Can't find 'shell32.dll' library. Impossible to update icons"
219 Goto UpdateIcons.quit_${UPDATEICONS_UNIQUE}
220 UpdateIcons.error2_${UPDATEICONS_UNIQUE}:
221 MessageBox MB_OK|MB_ICONINFORMATION "You should install the free 'Microsoft Layer for Unicode' to update Wireshark capture file icons"
222 Goto UpdateIcons.quit_${UPDATEICONS_UNIQUE}
223 UpdateIcons.quit_${UPDATEICONS_UNIQUE}:
224 !undef UPDATEICONS_UNIQUE
232 ; $R0 should contain the prefix to associate to Wireshark
235 ReadRegStr $R1 HKCR $R0 ""
236 StrCmp $R1 "" Associate.doRegister
238 Associate.doRegister:
239 ;The extension is not associated to any program, we can do the link
240 WriteRegStr HKCR $R0 "" ${WIRESHARK_ASSOC}
246 ; $R0 should contain the prefix to unlink
249 ReadRegStr $R1 HKCR $R0 ""
250 StrCmp $R1 ${WIRESHARK_ASSOC} un.unlink.doUnlink
253 ; The extension is associated with Wireshark so, we must destroy this!
254 DeleteRegKey HKCR $R0
260 ;Extract InstallOptions INI files
261 !insertmacro MUI_INSTALLOPTIONS_EXTRACT "AdditionalTasksPage.ini"
262 !insertmacro MUI_INSTALLOPTIONS_EXTRACT "WinpcapPage.ini"
265 Function DisplayAdditionalTasksPage
266 !insertmacro MUI_HEADER_TEXT "Select Additional Tasks" "Which additional tasks should be done?"
267 !insertmacro MUI_INSTALLOPTIONS_DISPLAY "AdditionalTasksPage.ini"
270 Function DisplayWinPcapPage
271 !insertmacro MUI_HEADER_TEXT "Install WinPcap?" "WinPcap is required to capture live network data. Should WinPcap be installed?"
272 !insertmacro MUI_INSTALLOPTIONS_DISPLAY "WinPcapPage.ini"
275 ; ============================================================================
276 ; Installation execution commands
277 ; ============================================================================
279 Var WINPCAP_UNINSTALL ;declare variable for holding the value of a registry key
280 ;Var WIRESHARK_UNINSTALL ;declare variable for holding the value of a registry key
283 ;-------------------------------------------
286 ; Install for every user
288 SetShellVarContext all
293 File "..\..\wiretap\wiretap-${WTAP_VERSION}.dll"
294 !ifdef ENABLE_LIBWIRESHARK
295 File "..\..\epan\libwireshark.dll"
297 File "${GLIB_DIR}\bin\libglib-2.0-0.dll"
298 File "${GLIB_DIR}\bin\libgobject-2.0-0.dll"
299 File "${GLIB_DIR}\bin\libgmodule-2.0-0.dll"
301 File "${ICONV_DIR}\bin\iconv.dll"
303 File "${GETTEXT_DIR}\bin\intl.dll"
305 File "${ZLIB_DIR}\zlib1.dll"
308 File "${ADNS_DIR}\adns_win32\LIB\adns_dll.dll"
311 File "${PCRE_DIR}\bin\pcre3.dll"
312 File "${PCRE_DIR}\man\cat3\pcrepattern.3.txt"
315 File "${KFW_DIR}\bin\comerr32.dll"
316 File "${KFW_DIR}\bin\krb5_32.dll"
319 File "${GNUTLS_DIR}\bin\libgcrypt-11.dll"
320 File "${GNUTLS_DIR}\bin\libgnutls-13.dll"
321 File "${GNUTLS_DIR}\bin\libgnutls-extra-13.dll"
322 File "${GNUTLS_DIR}\bin\libgnutls-openssl-13.dll"
323 File "${GNUTLS_DIR}\bin\libgpg-error-0.dll"
324 File "${GNUTLS_DIR}\bin\libtasn1-3.dll"
327 File "${LUA_DIR}\lib\dll\lua5.1.dll"
328 File "..\..\epan\wslua\init.lua"
329 File "..\..\epan\wslua\console.lua"
330 File "..\..\epan\wslua\dtd_gen.lua"
333 File "${SMI_DIR}\lib\smi.dll"
337 File "..\..\README.win32"
338 File "..\..\AUTHORS-SHORT"
342 File "..\..\services"
343 File "..\..\doc\ws.css"
344 File "..\..\doc\wireshark.html"
345 File "..\..\doc\wireshark-filter.html"
346 File "..\..\dumpcap.exe"
347 File "..\..\doc\dumpcap.html"
348 File "..\..\example_snmp_users_file"
350 ; C-runtime redistributable
352 ; vcredist_x86.exe (MSVC V8) - copy and execute the redistributable installer
353 File "${VCREDIST_EXE}"
354 ExecWait '"$INSTDIR\vcredist_x86.exe"' $0
355 DetailPrint "vcredist_x86 returned $0"
358 ; msvcr*.dll (MSVC V7 or V7.1) - simply copy the dll file
359 !echo "IF YOU GET AN ERROR HERE, check the MSVC_VARIANT setting in config.nmake: MSVC2005 vs. MSVC2005EE!"
362 !if ${MSVC_VARIANT} != "MSVC6"
363 !error "C-Runtime redistributable for this package not available / not redistributable!"
366 !endif ; VCREDIST_EXE
369 ; global config files - don't overwrite if already existing
370 ;IfFileExists cfilters dont_overwrite_cfilters
371 File "..\..\cfilters"
372 ;dont_overwrite_cfilters:
373 ;IfFileExists colorfilters dont_overwrite_colorfilters
374 File "..\..\colorfilters"
375 ;dont_overwrite_colorfilters:
376 ;IfFileExists dfilters dont_overwrite_dfilters
377 File "..\..\dfilters"
378 ;dont_overwrite_dfilters:
379 ;IfFileExists dfilters dont_overwrite_smi_modules
380 File "..\..\smi_modules"
381 ;dont_overwrite_smi_modules:
385 ; Install the Diameter DTD and XML files in the "diameter" subdirectory
386 ; of the installation directory.
388 SetOutPath $INSTDIR\diameter
389 File "..\..\diameter\chargecontrol.xml"
390 File "..\..\diameter\dictionary.dtd"
391 File "..\..\diameter\dictionary.xml"
392 File "..\..\diameter\Ericsson.xml"
393 File "..\..\diameter\etsie2e4.xml"
394 File "..\..\diameter\gqpolicy.xml"
395 File "..\..\diameter\imscxdx.xml"
396 File "..\..\diameter\mobileipv4.xml"
397 File "..\..\diameter\nasreq.xml"
398 File "..\..\diameter\sip.xml"
399 File "..\..\diameter\sunping.xml"
400 File "..\..\diameter\TGPPGmb.xml"
401 File "..\..\diameter\TGPPSh.xml"
407 ; Install the RADIUS directory files in the "radius" subdirectory
408 ; of the installation directory.
410 SetOutPath $INSTDIR\radius
411 File "..\..\radius\dictionary"
412 File "..\..\radius\dictionary.3com"
413 File "..\..\radius\dictionary.3gpp"
414 File "..\..\radius\dictionary.3gpp2"
415 File "..\..\radius\dictionary.acc"
416 File "..\..\radius\dictionary.alcatel"
417 File "..\..\radius\dictionary.alteon"
418 File "..\..\radius\dictionary.altiga"
419 File "..\..\radius\dictionary.aptis"
420 File "..\..\radius\dictionary.ascend"
421 File "..\..\radius\dictionary.bay"
422 File "..\..\radius\dictionary.bintec"
423 File "..\..\radius\dictionary.bristol"
424 File "..\..\radius\dictionary.cablelabs"
425 File "..\..\radius\dictionary.cabletron"
426 File "..\..\radius\dictionary.cisco"
427 File "..\..\radius\dictionary.cisco.bbsm"
428 File "..\..\radius\dictionary.cisco.vpn3000"
429 File "..\..\radius\dictionary.cisco.vpn5000"
430 File "..\..\radius\dictionary.colubris"
431 File "..\..\radius\dictionary.columbia_university"
432 File "..\..\radius\dictionary.compat"
433 File "..\..\radius\dictionary.cosine"
434 File "..\..\radius\dictionary.ericsson"
435 File "..\..\radius\dictionary.erx"
436 File "..\..\radius\dictionary.extreme"
437 File "..\..\radius\dictionary.foundry"
438 File "..\..\radius\dictionary.freeradius"
439 File "..\..\radius\dictionary.gandalf"
440 File "..\..\radius\dictionary.garderos"
441 File "..\..\radius\dictionary.gemtek"
442 File "..\..\radius\dictionary.itk"
443 File "..\..\radius\dictionary.juniper"
444 File "..\..\radius\dictionary.karlnet"
445 File "..\..\radius\dictionary.livingston"
446 File "..\..\radius\dictionary.localweb"
447 File "..\..\radius\dictionary.merit"
448 File "..\..\radius\dictionary.microsoft"
449 File "..\..\radius\dictionary.mikrotik"
450 File "..\..\radius\dictionary.navini"
451 File "..\..\radius\dictionary.netscreen"
452 File "..\..\radius\dictionary.nokia"
453 File "..\..\radius\dictionary.nomadix"
454 File "..\..\radius\dictionary.propel"
455 File "..\..\radius\dictionary.quintum"
456 File "..\..\radius\dictionary.redback"
457 File "..\..\radius\dictionary.redcreek"
458 File "..\..\radius\dictionary.shasta"
459 File "..\..\radius\dictionary.shiva"
460 File "..\..\radius\dictionary.sonicwall"
461 File "..\..\radius\dictionary.springtide"
462 File "..\..\radius\dictionary.t_systems_nova"
463 File "..\..\radius\dictionary.telebit"
464 File "..\..\radius\dictionary.trapeze"
465 File "..\..\radius\dictionary.tunnel"
466 File "..\..\radius\dictionary.unisphere"
467 File "..\..\radius\dictionary.unix"
468 File "..\..\radius\dictionary.usr"
469 File "..\..\radius\dictionary.valemount"
470 File "..\..\radius\dictionary.versanet"
471 File "..\..\radius\dictionary.wispr"
472 File "..\..\radius\dictionary.xedia"
476 ; install the dtds in the dtds subdirectory
478 SetOutPath $INSTDIR\dtds
479 File "..\..\dtds\dc.dtd"
480 File "..\..\dtds\itunes.dtd"
481 File "..\..\dtds\mscml.dtd"
482 File "..\..\dtds\pocsettings.dtd"
483 File "..\..\dtds\presence.dtd"
484 File "..\..\dtds\reginfo.dtd"
485 File "..\..\dtds\rlmi.dtd"
486 File "..\..\dtds\rss.dtd"
487 File "..\..\dtds\smil.dtd"
488 File "..\..\dtds\xcap-caps.dtd"
489 File "..\..\dtds\xcap-error.dtd"
490 File "..\..\dtds\watcherinfo.dtd"
493 ; Install the TPNCP DAT file in the "tpncp" subdirectory
494 ; of the installation directory.
495 SetOutPath $INSTDIR\tpncp
496 File "..\..\tpncp\tpncp.dat"
499 ; install the wimaxasncp TLV definitions in the wimaxasncp subdirectory
501 SetOutPath $INSTDIR\wimaxasncp
502 File "..\..\wimaxasncp\dictionary.xml"
503 File "..\..\wimaxasncp\dictionary.dtd"
506 SetOutPath $INSTDIR\help
507 File "..\..\help\toc"
508 File "..\..\help\overview.txt"
509 File "..\..\help\getting_started.txt"
510 File "..\..\help\capturing.txt"
511 File "..\..\help\capture_filters.txt"
512 File "..\..\help\display_filters.txt"
513 File "..\..\help\faq.txt"
515 ; Write the uninstall keys for Windows
516 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "DisplayVersion" "${VERSION}"
517 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "DisplayName" "Wireshark ${VERSION}"
518 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "UninstallString" '"$INSTDIR\uninstall.exe"'
519 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "Publisher" "The Wireshark developer community, http://www.wireshark.org"
520 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "HelpLink" "mailto:wireshark-users@wireshark.org"
521 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "URLInfoAbout" "http://www.wireshark.org"
522 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "URLUpdateInfo" "http://www.wireshark.org/download/win32/"
523 WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "NoModify" 1
524 WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "NoRepair" 1
525 WriteUninstaller "uninstall.exe"
527 ; Write an entry for ShellExecute
528 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\wireshark.exe" "" '$INSTDIR\wireshark.exe'
529 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\wireshark.exe" "Path" '$INSTDIR'
531 ; Create start menu entries (depending on additional tasks page)
532 ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 2" "State"
533 StrCmp $0 "0" SecRequired_skip_StartMenu
535 CreateDirectory "$SMPROGRAMS\Wireshark"
536 ; To qoute "http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwue/html/ch11d.asp":
537 ; "Do not include Readme, Help, or Uninstall entries on the Programs menu."
538 Delete "$SMPROGRAMS\Wireshark\Wireshark Web Site.lnk"
539 ;WriteINIStr "$SMPROGRAMS\Wireshark\Wireshark Web Site.url" "InternetShortcut" "URL" "http://www.wireshark.org/"
540 CreateShortCut "$SMPROGRAMS\Wireshark\Wireshark.lnk" "$INSTDIR\wireshark.exe" "" "$INSTDIR\wireshark.exe" 0 "" "" "The Wireshark Network Protocol Analyzer"
541 ;CreateShortCut "$SMPROGRAMS\Wireshark\Wireshark Manual.lnk" "$INSTDIR\wireshark.html"
542 ;CreateShortCut "$SMPROGRAMS\Wireshark\Display Filters Manual.lnk" "$INSTDIR\wireshark-filter.html"
543 CreateShortCut "$SMPROGRAMS\Wireshark\Wireshark Program Directory.lnk" \
545 ;CreateShortCut "$SMPROGRAMS\Wireshark\Uninstall Wireshark.lnk" "$INSTDIR\uninstall.exe"
546 SecRequired_skip_StartMenu:
548 ; is command line option "/desktopicon" set?
550 ${GetOptions} $R0 "/desktopicon=" $R1
551 StrCmp $R1 "no" SecRequired_skip_DesktopIcon
552 StrCmp $R1 "yes" SecRequired_install_DesktopIcon
554 ; Create desktop icon (depending on additional tasks page and command line option)
555 ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 3" "State"
556 StrCmp $0 "0" SecRequired_skip_DesktopIcon
557 SecRequired_install_DesktopIcon:
558 CreateShortCut "$DESKTOP\Wireshark.lnk" "$INSTDIR\wireshark.exe" "" "$INSTDIR\wireshark.exe" 0 "" "" "The Wireshark Network Protocol Analyzer"
559 SecRequired_skip_DesktopIcon:
561 ; is command line option "/quicklaunchicon" set?
563 ${GetOptions} $R0 "/quicklaunchicon=" $R1
564 StrCmp $R1 "no" SecRequired_skip_QuickLaunchIcon
565 StrCmp $R1 "yes" SecRequired_install_QuickLaunchIcon
567 ; Create quick launch icon (depending on additional tasks page and command line option)
568 ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 4" "State"
569 StrCmp $0 "0" SecRequired_skip_QuickLaunchIcon
570 SecRequired_install_QuickLaunchIcon:
571 CreateShortCut "$QUICKLAUNCH\Wireshark.lnk" "$INSTDIR\wireshark.exe" "" "$INSTDIR\wireshark.exe" 0 "" "" "The Wireshark Network Protocol Analyzer"
572 SecRequired_skip_QuickLaunchIcon:
574 ; Create File Extensions (depending on additional tasks page)
575 ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 6" "State"
576 StrCmp $0 "0" SecRequired_skip_FileExtensions
577 WriteRegStr HKCR ${WIRESHARK_ASSOC} "" "Wireshark file"
578 WriteRegStr HKCR "${WIRESHARK_ASSOC}\Shell\open\command" "" '"$INSTDIR\wireshark.exe" "%1"'
579 WriteRegStr HKCR "${WIRESHARK_ASSOC}\DefaultIcon" "" '"$INSTDIR\wireshark.exe",1'
621 ; if somethings added here, add it also to the uninstall section and the AdditionalTask page
623 !insertmacro UpdateIcons
624 SecRequired_skip_FileExtensions:
626 ; if running as a silent installer, don't try to install winpcap
627 IfSilent SecRequired_skip_Winpcap
629 ; Install WinPcap (depending on winpcap page setting)
630 ReadINIStr $0 "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "State"
631 StrCmp $0 "0" SecRequired_skip_Winpcap
632 ; Uinstall old WinPcap first
633 ReadRegStr $WINPCAP_UNINSTALL HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinPcapInst" "UninstallString"
634 IfErrors lbl_winpcap_notinstalled ;if RegKey is unavailable, WinPcap is not installed
635 ; from released version 3.1, WinPcap will uninstall an old version by itself
636 ;ExecWait '$WINPCAP_UNINSTALL' $0
637 ;DetailPrint "WinPcap uninstaller returned $0"
638 lbl_winpcap_notinstalled:
640 File "WinPcap_4_0_2.exe"
641 ExecWait '"$INSTDIR\WinPcap_4_0_2.exe"' $0
642 DetailPrint "WinPcap installer returned $0"
643 SecRequired_skip_Winpcap:
645 ; Load Winpcap NPF service at startup (depending on winpcap page)
646 ReadINIStr $0 "$PLUGINSDIR\WinPcapPage.ini" "Field 8" "State"
647 StrCmp $0 "0" SecRequired_no_WinpcapService
648 WriteRegDWORD HKEY_LOCAL_MACHINE "SYSTEM\CurrentControlSet\Services\NPF" "Start" 2 ;set NPF to (SERVICE_AUTO_START)
649 !insertmacro SERVICE "start" "NPF" ""
650 Goto SecRequired_done_WinpcapService
651 SecRequired_no_WinpcapService:
652 WriteRegDWORD HKEY_LOCAL_MACHINE "SYSTEM\CurrentControlSet\Services\NPF" "Start" 3 ;set NPF to (SERVICE_DEMAND_START)
653 !insertmacro SERVICE "stop" "NPF" ""
654 SecRequired_done_WinpcapService:
656 ; If no user profile exists for Wireshark but for Ethereal, copy it over
657 SetShellVarContext current
658 IfFileExists $APPDATA\Wireshark profile_done
659 IfFileExists $APPDATA\Ethereal 0 profile_done
660 ;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
661 CreateDirectory $APPDATA\Wireshark
662 CopyFiles $APPDATA\Ethereal\*.* $APPDATA\Wireshark
664 SetShellVarContext all
666 SectionEnd ; "Required"
669 SectionGroup "!Wireshark" SecWiresharkGroup
672 Section "Wireshark GTK2" SecWiresharkGTK2
673 ;-------------------------------------------
675 File "..\..\wireshark.exe"
676 File "${GTK2_DIR}\bin\libgdk-win32-2.0-0.dll"
677 File "${GTK2_DIR}\bin\libgdk_pixbuf-2.0-0.dll"
678 File "${GTK2_DIR}\bin\libgtk-win32-2.0-0.dll"
679 File "${GTK2_DIR}\bin\libatk-1.0-0.dll"
680 File "${GTK2_DIR}\bin\libpango-1.0-0.dll"
681 File "${GTK2_DIR}\bin\libpangowin32-1.0-0.dll"
682 !ifdef NEED_CAIRO_DLL
683 File "${GTK2_DIR}\bin\libcairo-2.dll"
684 File "${GTK2_DIR}\bin\libpangocairo-1.0-0.dll"
686 !ifdef NEED_LIBPNG_DLL
687 File "${GTK2_DIR}\bin\libpng13.dll"
689 !ifdef NEED_LIBTIFF_DLL
690 File "${GTK2_DIR}\bin\libtiff3.dll"
692 !ifdef NEED_LIBJPEG_DLL
693 File "${GTK2_DIR}\bin\jpeg62.dll"
695 SetOutPath $INSTDIR\etc\gtk-2.0
696 File "${GTK2_DIR}\etc\gtk-2.0\*.*"
697 SetOutPath $INSTDIR\etc\pango
698 File "${GTK2_DIR}\etc\pango\pango.*"
699 SetOutPath $INSTDIR\lib\gtk-2.0\${GTK2_LIB_DIR}\loaders
700 File "${GTK2_DIR}\lib\gtk-2.0\${GTK2_LIB_DIR}\loaders\libpixbufloader-*.dll"
701 SetOutPath $INSTDIR\lib\gtk-2.0\${GTK2_LIB_DIR}\immodules
702 File "${GTK2_DIR}\lib\gtk-2.0\${GTK2_LIB_DIR}\immodules\im-*.dll"
703 # Not needed with pango 1.14.5
704 #SetOutPath $INSTDIR\lib\pango\${PANGO_LIB_DIR}\modules
705 #File "${GTK2_DIR}\lib\pango\${PANGO_LIB_DIR}\modules\pango-*.dll"
710 Section "GTK MS Windows Engine" SecGTKWimp
711 ;-------------------------------------------
713 SetOutPath $INSTDIR\${GTK_WIMP_DLLDST_DIR}
714 File "${GTK_WIMP_DLLSRC_DIR}\libwimp.dll"
715 SetOutPath $INSTDIR\${GTK_WIMP_RCDST_DIR}
716 File "${GTK_WIMP_RCSRC_DIR}\gtkrc"
721 SectionGroupEnd ; "Wireshark"
724 Section "TShark" SecTShark
725 ;-------------------------------------------
727 File "..\..\tshark.exe"
728 File "..\..\doc\tshark.html"
731 Section "Rawshark" SecRawshark
732 ;-------------------------------------------
734 File "..\..\rawshark.exe"
735 File "..\..\doc\rawshark.html"
738 SectionGroup "Plugins / Extensions" SecPluginsGroup
740 Section "Dissector Plugins" SecPlugins
741 ;-------------------------------------------
742 SetOutPath $INSTDIR\plugins\${VERSION}
743 File "..\..\plugins\agentx\agentx.dll"
744 File "..\..\plugins\artnet\artnet.dll"
745 File "..\..\plugins\asn1\asn1.dll"
746 File "..\..\plugins\ciscosm\ciscosm.dll"
747 File "..\..\plugins\docsis\docsis.dll"
748 File "..\..\plugins\enttec\enttec.dll"
749 File "..\..\plugins\ethercat\ethercat.dll"
750 File "..\..\plugins\giop\coseventcomm.dll"
751 File "..\..\plugins\giop\cosnaming.dll"
752 File "..\..\plugins\giop\parlay.dll"
753 File "..\..\plugins\giop\tango.dll"
754 File "..\..\plugins\gryphon\gryphon.dll"
755 File "..\..\plugins\infiniband\infiniband.dll"
756 File "..\..\plugins\irda\irda.dll"
757 File "..\..\plugins\lwres\lwres.dll"
758 File "..\..\plugins\m2m\m2m.dll"
759 File "..\..\plugins\opsi\opsi.dll"
760 File "..\..\plugins\pcli\pcli.dll"
761 File "..\..\plugins\profinet\profinet.dll"
762 File "..\..\plugins\rlm\rlm.dll"
763 File "..\..\plugins\rtnet\rtnet.dll"
764 File "..\..\plugins\rudp\rudp.dll"
765 File "..\..\plugins\sbus\sbus.dll"
766 File "..\..\plugins\unistim\unistim.dll"
767 File "..\..\plugins\v5ua\v5ua.dll"
768 File "..\..\plugins\wimax\wimax.dll"
769 File "..\..\plugins\wimaxasncp\wimaxasncp.dll"
772 Section "Tree Statistics Plugin" SecStatsTree
773 ;-------------------------------------------
774 SetOutPath $INSTDIR\plugins\${VERSION}
775 File "..\..\plugins\stats_tree\stats_tree.dll"
778 Section "Mate - Meta Analysis and Tracing Engine" SecMate
779 ;-------------------------------------------
780 SetOutPath $INSTDIR\plugins\${VERSION}
781 File "..\..\plugins\mate\mate.dll"
786 Section "SNMP MIBs" SecMIBs
787 ;-------------------------------------------
788 SetOutPath $INSTDIR\snmp\mibs
789 File "${NET_SNMP_DIR}\mibs\*.txt"
794 Section "SNMP MIBs" SecMIBs
795 ;-------------------------------------------
796 SetOutPath $INSTDIR\snmp\mibs
797 File "${SMI_DIR}\mibs\*"
801 SectionGroupEnd ; "Plugins / Extensions"
804 SectionGroup "Tools" SecToolsGroup
806 Section "Editcap" SecEditcap
807 ;-------------------------------------------
809 File "..\..\editcap.exe"
810 File "..\..\doc\editcap.html"
813 Section "Text2Pcap" SecText2Pcap
814 ;-------------------------------------------
816 File "..\..\text2pcap.exe"
817 File "..\..\doc\text2pcap.html"
820 Section "Mergecap" SecMergecap
821 ;-------------------------------------------
823 File "..\..\mergecap.exe"
824 File "..\..\doc\mergecap.html"
827 Section "Capinfos" SecCapinfos
828 ;-------------------------------------------
830 File "..\..\capinfos.exe"
831 File "..\..\doc\capinfos.html"
834 SectionGroupEnd ; "Tools"
837 Section "User's Guide" SecUsersGuide
838 ;-------------------------------------------
840 File "user-guide.chm"
844 Section "Uninstall" un.SecUinstall
845 ;-------------------------------------------
848 ; UnInstall for every user
851 SetShellVarContext all
853 Delete "$INSTDIR\rawshark.exe"
854 IfErrors 0 NoRawsharkErrorMsg
855 MessageBox MB_OK "Please note: rawshark.exe could not be removed, it's probably in use!" IDOK 0 ;skipped if rawshark.exe removed
856 Abort "Please note: rawshark.exe could not be removed, it's probably in use! Abort uninstall process!"
859 Delete "$INSTDIR\tshark.exe"
860 IfErrors 0 NoTSharkErrorMsg
861 MessageBox MB_OK "Please note: tshark.exe could not be removed, it's probably in use!" IDOK 0 ;skipped if tshark.exe removed
862 Abort "Please note: tshark.exe could not be removed, it's probably in use! Abort uninstall process!"
865 Delete "$INSTDIR\wireshark.exe"
866 IfErrors 0 NoWiresharkErrorMsg
867 MessageBox MB_OK "Please note: wireshark.exe could not be removed, it's probably in use!" IDOK 0 ;skipped if wireshark.exe removed
868 Abort "Please note: wireshark.exe could not be removed, it's probably in use! Abort uninstall process!"
871 DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark"
872 DeleteRegKey HKEY_LOCAL_MACHINE "Software\Wireshark"
873 DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\wireshark.exe"
918 DeleteRegKey HKCR ${WIRESHARK_ASSOC}
919 DeleteRegKey HKCR "${WIRESHARK_ASSOC}\Shell\open\command"
920 DeleteRegKey HKCR "${WIRESHARK_ASSOC}\DefaultIcon"
921 !insertmacro UpdateIcons
923 Delete "$INSTDIR\etc\gtk-2.0\*.*"
924 Delete "$INSTDIR\etc\pango\*.*"
925 Delete "$INSTDIR\lib\gtk-2.0\2.2.0\engines\*.*"
926 Delete "$INSTDIR\lib\gtk-2.0\2.2.0\loaders\*.*"
927 Delete "$INSTDIR\lib\gtk-2.0\2.2.0\immodules\*.*"
928 Delete "$INSTDIR\lib\gtk-2.0\2.4.0\engines\*.*"
929 Delete "$INSTDIR\lib\gtk-2.0\2.4.0\loaders\*.*"
930 Delete "$INSTDIR\lib\gtk-2.0\2.4.0\immodules\*.*"
931 Delete "$INSTDIR\lib\gtk-2.0\2.10.0\engines\*.*"
932 Delete "$INSTDIR\lib\gtk-2.0\2.10.0\loaders\*.*"
933 Delete "$INSTDIR\lib\gtk-2.0\2.10.0\immodules\*.*"
934 Delete "$INSTDIR\lib\pango\1.2.0\modules\*.*"
935 Delete "$INSTDIR\lib\pango\1.4.0\modules\*.*"
936 Delete "$INSTDIR\lib\pango\1.5.0\modules\*.*"
937 Delete "$INSTDIR\share\themes\Default\gtk-2.0\*.*"
938 Delete "$INSTDIR\help\*.*"
939 Delete "$INSTDIR\diameter\*.*"
940 Delete "$INSTDIR\snmp\mibs\*.*"
941 Delete "$INSTDIR\snmp\*.*"
942 Delete "$INSTDIR\tpncp\*.*"
943 Delete "$INSTDIR\wimaxasncp\*.*"
944 Delete "$INSTDIR\*.exe"
945 Delete "$INSTDIR\*.dll"
946 Delete "$INSTDIR\*.html"
947 Delete "$INSTDIR\ws.css"
948 Delete "$INSTDIR\COPYING"
949 Delete "$INSTDIR\AUTHORS-SHORT"
950 ; previous versions installed these files
951 Delete "$INSTDIR\*.manifest"
952 ; previous versions installed this file
953 Delete "$INSTDIR\AUTHORS-SHORT-FORMAT"
954 Delete "$INSTDIR\README*"
955 Delete "$INSTDIR\FAQ"
956 Delete "$INSTDIR\NEWS.txt"
957 Delete "$INSTDIR\manuf"
958 Delete "$INSTDIR\services"
959 Delete "$INSTDIR\pcrepattern.3.txt"
960 Delete "$INSTDIR\user-guide.chm"
961 Delete "$INSTDIR\example_snmp_users_file"
962 Delete "$INSTDIR\radius\*.*"
963 Delete "$INSTDIR\dtds\*.*"
964 Delete "$SMPROGRAMS\Wireshark\*.*"
965 Delete "$DESKTOP\Wireshark.lnk"
966 Delete "$QUICKLAUNCH\Wireshark.lnk"
968 RMDir "$INSTDIR\etc\gtk-2.0"
969 RMDir "$INSTDIR\etc\pango"
971 RMDir "$INSTDIR\lib\gtk-2.0\2.2.0\engines"
972 RMDir "$INSTDIR\lib\gtk-2.0\2.2.0\loaders"
973 RMDir "$INSTDIR\lib\gtk-2.0\2.2.0\immodules"
974 RMDir "$INSTDIR\lib\gtk-2.0\2.2.0"
975 RMDir "$INSTDIR\lib\gtk-2.0\2.4.0\engines"
976 RMDir "$INSTDIR\lib\gtk-2.0\2.4.0\loaders"
977 RMDir "$INSTDIR\lib\gtk-2.0\2.4.0\immodules"
978 RMDir "$INSTDIR\lib\gtk-2.0\2.4.0"
979 RMDir "$INSTDIR\lib\gtk-2.0\2.10.0\engines"
980 RMDir "$INSTDIR\lib\gtk-2.0\2.10.0\loaders"
981 RMDir "$INSTDIR\lib\gtk-2.0\2.10.0\immodules"
982 RMDir "$INSTDIR\lib\gtk-2.0\2.10.0"
983 RMDir "$INSTDIR\lib\gtk-2.0"
984 RMDir "$INSTDIR\lib\pango\1.2.0\modules"
985 RMDir "$INSTDIR\lib\pango\1.2.0"
986 RMDir "$INSTDIR\lib\pango\1.4.0\modules"
987 RMDir "$INSTDIR\lib\pango\1.4.0"
988 RMDir "$INSTDIR\lib\pango\1.5.0\modules"
989 RMDir "$INSTDIR\lib\pango\1.5.0"
990 RMDir "$INSTDIR\lib\pango"
992 RMDir "$INSTDIR\share\themes\Default\gtk-2.0"
993 RMDir "$INSTDIR\share\themes\Default"
994 RMDir "$INSTDIR\share\themes"
995 RMDir "$INSTDIR\share"
996 RMDir "$SMPROGRAMS\Wireshark"
997 RMDir "$INSTDIR\help"
998 RMDir "$INSTDIR\diameter"
999 RMDir "$INSTDIR\snmp\mibs"
1000 RMDir "$INSTDIR\snmp"
1001 RMDir "$INSTDIR\radius"
1002 RMDir "$INSTDIR\dtds"
1003 RMDir "$INSTDIR\tpncp"
1004 RMDir "$INSTDIR\wimaxasncp"
1007 SectionEnd ; "Uinstall"
1009 Section "Un.Plugins" un.SecPlugins
1010 ;-------------------------------------------
1012 ;Delete "$INSTDIR\plugins\${VERSION}\*.*"
1013 ;Delete "$INSTDIR\plugins\*.*"
1014 ;RMDir "$INSTDIR\plugins\${VERSION}"
1015 ;RMDir "$INSTDIR\plugins"
1016 RMDir /r "$INSTDIR\plugins"
1019 Section "Un.Global Settings" un.SecGlobalSettings
1020 ;-------------------------------------------
1022 Delete "$INSTDIR\cfilters"
1023 Delete "$INSTDIR\colorfilters"
1024 Delete "$INSTDIR\dfilters"
1025 Delete "$INSTDIR\init.lua"
1026 Delete "$INSTDIR\console.lua"
1027 Delete "$INSTDIR\dtd_gen.lua"
1028 Delete "$INSTDIR\smi_modules"
1032 Section /o "Un.Personal Settings" un.SecPersonalSettings
1033 ;-------------------------------------------
1035 SetShellVarContext current
1036 Delete "$APPDATA\Wireshark\*.*"
1037 RMDir "$APPDATA\Wireshark"
1040 ;VAR un.WINPCAP_UNINSTALL
1042 Section /o "Un.WinPcap" un.SecWinPcap
1043 ;-------------------------------------------
1045 ReadRegStr $1 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinPcapInst" "UninstallString"
1046 ;IfErrors un.lbl_winpcap_notinstalled ;if RegKey is unavailable, WinPcap is not installed
1047 ;MessageBox MB_OK "WinPcap $1"
1049 DetailPrint "WinPcap uninstaller returned $0"
1051 ;un.lbl_winpcap_notinstalled:
1054 Section "-Un.Finally"
1055 ;-------------------------------------------
1057 ; this test must be done after all other things uninstalled (e.g. Global Settings)
1058 IfFileExists "$INSTDIR" 0 NoFinalErrorMsg
1059 MessageBox MB_OK "Please note: The directory $INSTDIR could not be removed!" IDOK 0 ; skipped if dir doesn't exist
1064 ; ============================================================================
1065 ; PLEASE MAKE SURE, THAT THE DESCRIPTIVE TEXT FITS INTO THE DESCRIPTION FIELD!
1066 ; ============================================================================
1067 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
1068 !insertmacro MUI_DESCRIPTION_TEXT ${SecWiresharkGroup} "${PROGRAM_NAME} is a GUI network protocol analyzer."
1070 !insertmacro MUI_DESCRIPTION_TEXT ${SecWiresharkGTK2} "${PROGRAM_NAME} using the modern GTK2 user interface."
1072 !insertmacro MUI_DESCRIPTION_TEXT ${SecGTKWimp} "GTK MS Windows Engine - native Win32 look and feel, for Win2000 and up."
1075 !insertmacro MUI_DESCRIPTION_TEXT ${SecTShark} "TShark is a text based network protocol analyzer."
1076 !insertmacro MUI_DESCRIPTION_TEXT ${SecRawshark} "Rawshark is a raw packet filter."
1077 !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsGroup} "Some plugins and extensions for both Wireshark and TShark."
1078 !insertmacro MUI_DESCRIPTION_TEXT ${SecPlugins} "Plugins with some extended dissections."
1079 !insertmacro MUI_DESCRIPTION_TEXT ${SecStatsTree} "Plugin for some extended statistics."
1080 !insertmacro MUI_DESCRIPTION_TEXT ${SecMate} "Plugin - Meta Analysis and Tracing Engine (Experimental)."
1082 !insertmacro MUI_DESCRIPTION_TEXT ${SecMIBs} "SNMP MIBs for better SNMP dissection."
1085 !insertmacro MUI_DESCRIPTION_TEXT ${SecMIBs} "SNMP MIBs for better SNMP dissection."
1087 !insertmacro MUI_DESCRIPTION_TEXT ${SecToolsGroup} "Additional command line based tools."
1088 !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."
1089 !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."
1090 !insertmacro MUI_DESCRIPTION_TEXT ${SecMergecap} "Mergecap is a program that combines multiple saved capture files into a single output file"
1091 !insertmacro MUI_DESCRIPTION_TEXT ${SecCapinfos} "Capinfos is a program that provides information on capture files."
1093 !insertmacro MUI_DESCRIPTION_TEXT ${SecUsersGuide} "Install the user's guide, so an internet connection is not required to read the help pages."
1095 !insertmacro MUI_FUNCTION_DESCRIPTION_END
1097 !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
1098 !insertmacro MUI_DESCRIPTION_TEXT ${un.SecUinstall} "Uninstall all Wireshark components."
1099 !insertmacro MUI_DESCRIPTION_TEXT ${un.SecPlugins} "Uninstall all Plugins (even from previous Wireshark versions)."
1100 !insertmacro MUI_DESCRIPTION_TEXT ${un.SecGlobalSettings} "Uninstall global settings like: $INSTDIR\cfilters"
1101 !insertmacro MUI_DESCRIPTION_TEXT ${un.SecPersonalSettings} "Uninstall personal settings like your preferences file from your profile: $PROFILE."
1102 !insertmacro MUI_DESCRIPTION_TEXT ${un.SecWinPcap} "Call WinPcap's uninstall program."
1103 !insertmacro MUI_UNFUNCTION_DESCRIPTION_END
1105 ; ============================================================================
1106 ; Callback functions
1107 ; ============================================================================
1109 ; Disable FileExtension if Wireshark isn't selected
1110 Function .onSelChange
1112 SectionGetFlags ${SecWiresharkGTK2} $0
1114 IntCmp $0 0 onSelChange.unselect
1115 SectionGetFlags ${SecFileExtensions} $0
1117 IntCmp $0 16 onSelChange.unreadonly
1118 Goto onSelChange.end
1119 onSelChange.unselect:
1120 SectionGetFlags ${SecFileExtensions} $0
1121 IntOp $0 $0 & 0xFFFFFFFE
1123 SectionSetFlags ${SecFileExtensions} $0
1124 Goto onSelChange.end
1125 onSelChange.unreadonly:
1126 SectionGetFlags ${SecFileExtensions} $0
1127 IntOp $0 $0 & 0xFFFFFFEF
1128 SectionSetFlags ${SecFileExtensions} $0
1129 Goto onSelChange.end
1136 !include "GetWindowsVersion.nsh"
1137 !include WinMessages.nsh
1138 !include "VersionCompare.nsh"
1140 Var NPF_START ; NPF service registry key
1141 Var WINPCAP_NAME ; DisplayName from WinPcap installation
1142 Var WINPCAP_VERSION ; DisplayVersion from WinPcap installation
1144 Function myShowCallback
1146 ; Uinstall old Wireshark first
1147 ; XXX - doesn't work, but kept here for further experiments
1148 ;ReadRegStr $WIRESHARK_UNINSTALL HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "UninstallString"
1149 ;IfErrors lbl_wireshark_notinstalled ;if RegKey is unavailable, WinPcap is not installed
1150 ;MessageBox MB_YESNO|MB_ICONQUESTION "Uninstall the old Wireshark version first (recommended)?"
1151 ; Hide the installer while uninstalling
1152 ;GetDlgItem $0 $HWNDPARENT 1
1153 ;FindWindow $0 "#32770" "" $HWNDPARENT
1154 ;MessageBox MB_OK "Window $0"
1155 ;ShowWindow $0 ${SW_HIDE}
1157 ;ExecWait '$WIRESHARK_UNINSTALL' $0
1158 ;DetailPrint "WinPcap uninstaller returned $0"
1159 ;GetDlgItem $0 $HWNDPARENT 1
1160 ;ShowWindow $0 ${SW_SHOW}
1161 ;MessageBox MB_OK "Uninstalled"
1162 ;lbl_wireshark_notinstalled:
1165 ; Get the Windows version
1166 Call GetWindowsVersion
1167 Pop $R0 ; Windows Version
1169 ; Check if we're able to run with this version
1170 StrCmp $R0 '95' lbl_winversion_unsupported
1171 StrCmp $R0 '98' lbl_winversion_unsupported
1172 StrCmp $R0 'ME' lbl_winversion_unsupported
1173 StrCmp $R0 'NT 4.0' lbl_winversion_unsupported_nt4
1174 Goto lbl_winversion_supported
1175 lbl_winversion_unsupported:
1176 MessageBox MB_OK "Windows $R0 is no longer supported. The last known version working with 98/ME was Ethereal 0.99.0!"
1179 lbl_winversion_unsupported_nt4:
1180 MessageBox MB_OK "Windows $R0 is no longer supported. The last known version working with NT 4.0 was Wireshark 0.99.4!"
1183 lbl_winversion_supported:
1185 ; Enable GTK-Wimp only for Windows 2000/XP/2003
1186 ; ...as Win9x/ME/NT known to have problems with it!
1188 ;DetailPrint 'Windows Version: $R0'
1189 StrCmp $R0 '2000' lbl_select_wimp
1190 StrCmp $R0 'XP' lbl_select_wimp
1191 StrCmp $R0 '2003' lbl_select_wimp
1192 DetailPrint "Windows $R0 doesn't support the GTK MS Windows Engine!"
1194 Goto lbl_ignore_wimp
1196 !insertmacro SelectSection ${SecGTKWimp}
1202 ; detect if WinPcap should be installed
1203 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "Text" "Install WinPcap 4.0.2"
1204 ReadRegStr $WINPCAP_NAME HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinPcapInst" "DisplayName"
1205 IfErrors 0 lbl_winpcap_installed ;if RegKey is available, WinPcap is already installed
1206 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 2" "Text" "WinPcap is currently not installed"
1207 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 2" "Flags" "DISABLED"
1208 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Text" "(Use Add/Remove Programs first to uninstall any undetected old WinPcap versions)"
1209 Goto lbl_winpcap_done
1211 lbl_winpcap_installed:
1212 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 2" "Text" "$WINPCAP_NAME"
1213 ; Compare the installed build against the one we have.
1214 ReadRegStr $WINPCAP_VERSION HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinPcapInst" "DisplayVersion"
1215 StrCmp $WINPCAP_VERSION "" lbl_winpcap_do_install ; WinPcap is really old(?) or installed improperly.
1216 ${VersionCompare} $WINPCAP_VERSION "4.0.0.1040" $1 ; WinPcap 4.0.2
1217 StrCmp $1 "2" lbl_winpcap_do_install
1219 ;lbl_winpcap_dont_install:
1220 ; The installed version is >= to what we have, so don't install
1221 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "State" "0"
1222 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Text" "If selected, the currently installed $WINPCAP_NAME will be uninstalled first."
1223 Goto lbl_winpcap_done
1225 ;lbl_winpcap_dont_upgrade:
1226 ; force the user to upgrade by hand
1227 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "State" "0"
1228 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "Flags" "DISABLED"
1229 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Text" "If you wish to install WinPcap 4.0.2, please uninstall $WINPCAP_NAME manually first."
1230 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Flags" "DISABLED"
1231 Goto lbl_winpcap_done
1233 lbl_winpcap_do_install:
1234 ; seems to be an old version, install newer one
1235 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "State" "1"
1236 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Text" "The currently installed $WINPCAP_NAME will be uninstalled first."
1240 ; Disable NPF service setting for Win OT
1241 StrCmp $R0 '95' lbl_npf_disable
1242 StrCmp $R0 '98' lbl_npf_disable
1243 StrCmp $R0 'ME' lbl_npf_disable
1244 ; Enable NPF by default under Vista.
1245 StrCmp $R0 'Vista' lbl_npf_enable
1246 ReadRegDWORD $NPF_START HKEY_LOCAL_MACHINE "SYSTEM\CurrentControlSet\Services\NPF" "Start"
1247 ; (Winpcap may not be installed already, so no regKey is no error here)
1248 IfErrors lbl_npf_done ;RegKey not available, so do not set it
1249 IntCmp $NPF_START 2 0 lbl_npf_done lbl_npf_done
1251 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 8" "State" "1"
1255 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 8" "State" "0"
1256 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 8" "Flags" "DISABLED"
1257 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 9" "Flags" "DISABLED"
1261 ; if Wireshark was previously installed, unselect previously not installed icons etc.
1262 ; detect if Wireshark is already installed ->
1263 ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "UninstallString"
1264 IfErrors lbl_wireshark_notinstalled ;if RegKey is unavailable, Wireshark is not installed
1266 ; only select Start Menu Group, if previously installed
1267 ; (we use the "all users" start menu, so select it first)
1268 SetShellVarContext all
1269 IfFileExists "$SMPROGRAMS\Wireshark\Wireshark.lnk" lbl_have_startmenu
1270 WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 2" "State" "0"
1273 ; only select Desktop Icon, if previously installed
1274 IfFileExists "$DESKTOP\Wireshark.lnk" lbl_have_desktopicon
1275 WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 3" "State" "0"
1276 lbl_have_desktopicon:
1278 ; only select Quick Launch Icon, if previously installed
1279 IfFileExists "$QUICKLAUNCH\Wireshark.lnk" lbl_have_quicklaunchicon
1280 WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 4" "State" "0"
1281 lbl_have_quicklaunchicon:
1283 lbl_wireshark_notinstalled: