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 !ifdef GTK1_DIR & GTK2_DIR
15 InstType "Wireshark (GTK2 user interface)"
16 InstType "Wireshark (legacy GTK1 user interface)"
19 InstType "un.Default (keep Personal Settings and WinPcap)"
20 InstType "un.All (remove all)"
22 ; Used to refresh the display of file association
23 !define SHCNE_ASSOCCHANGED 0x08000000
24 !define SHCNF_IDLIST 0
26 ; Used to add associations between file extensions and Wireshark
27 !define WIRESHARK_ASSOC "wireshark-file"
29 ; ============================================================================
30 ; Header configuration
31 ; ============================================================================
32 ; The name of the installer
33 !define PROGRAM_NAME "Wireshark"
35 Name "${PROGRAM_NAME} ${VERSION}"
38 OutFile "${DEST}-setup-${VERSION}.exe"
40 ; Icon of installer and uninstaller
41 Icon "..\..\image\wireshark.ico"
42 UninstallIcon "..\..\image\wireshark.ico"
44 ; Uninstall stuff (NSIS 2.08: "\r\n" don't work here)
45 !define MUI_UNCONFIRMPAGE_TEXT_TOP "The following Wireshark installation will be uninstalled. Click 'Next' to continue."
46 ; Uninstall stuff (this text isn't used with the MODERN_UI!)
47 ;UninstallText "This will uninstall Wireshark.\r\nBefore starting the uninstallation, make sure Wireshark is not running.\r\nClick 'Next' to continue."
53 ; ============================================================================
55 ; ============================================================================
56 ; The modern user interface will look much better than the common one.
57 ; However, as the development of the modern UI is still going on, and the script
58 ; syntax changes, you will need exactly that NSIS version, which this script is
59 ; made for. This is the current (December 2003) latest version: V2.0b4
60 ; If you are using a different version, it's not predictable what will happen.
63 ;!addplugindir ".\Plugins"
65 !define MUI_ICON "..\..\image\wireshark.ico"
66 !define MUI_UNICON "..\..\image\wireshark.ico"
68 !define MUI_COMPONENTSPAGE_SMALLDESC
69 !define MUI_FINISHPAGE_NOAUTOCLOSE
70 !define MUI_UNFINISHPAGE_NOAUTOCLOSE
71 !define MUI_WELCOMEPAGE_TEXT "This wizard will guide you through the installation of Wireshark.\r\n\r\nBefore starting the installation, make sure Wireshark is not running.\r\n\r\nClick 'Next' to continue."
72 ;!define MUI_FINISHPAGE_LINK "Install WinPcap to be able to capture packets from a network!"
73 ;!define MUI_FINISHPAGE_LINK_LOCATION "http://www.winpcap.org"
75 ; NSIS shows Readme files by opening the Readme file with the default application for
76 ; the file's extension. "README.win32" won't work in most cases, because extension "win32"
77 ; is usually not associated with an appropriate text editor. We should use extension "txt"
78 ; for a text file or "html" for an html README file.
79 !define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\NEWS.txt"
80 !define MUI_FINISHPAGE_SHOWREADME_TEXT "Show News"
81 !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
82 !define MUI_FINISHPAGE_RUN "$INSTDIR\wireshark.exe"
83 !define MUI_FINISHPAGE_RUN_NOTCHECKED
87 !define MUI_PAGE_CUSTOMFUNCTION_SHOW myShowCallback
89 ; ============================================================================
91 ; ============================================================================
93 !insertmacro MUI_PAGE_WELCOME
94 !insertmacro MUI_PAGE_LICENSE "..\..\COPYING"
95 !insertmacro MUI_PAGE_COMPONENTS
96 Page custom DisplayAdditionalTasksPage
97 !insertmacro MUI_PAGE_DIRECTORY
98 Page custom DisplayWinPcapPage
99 !insertmacro MUI_PAGE_INSTFILES
100 !insertmacro MUI_PAGE_FINISH
102 !insertmacro MUI_UNPAGE_WELCOME
103 !insertmacro MUI_UNPAGE_CONFIRM
104 !insertmacro MUI_UNPAGE_COMPONENTS
105 !insertmacro MUI_UNPAGE_INSTFILES
106 !insertmacro MUI_UNPAGE_FINISH
108 ; ============================================================================
110 ; ============================================================================
112 !insertmacro MUI_LANGUAGE "English"
114 ; ============================================================================
116 ; ============================================================================
118 ;Things that need to be extracted on first (keep these lines before any File command!)
119 ;Only useful for BZIP2 compression
121 ReserveFile "AdditionalTasksPage.ini"
122 ReserveFile "WinPcapPage.ini"
123 !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
125 ; ============================================================================
127 ; ============================================================================
128 !include "Sections.nsh"
130 ; ========= Macro to unselect and disable a section =========
132 !macro DisableSection SECTION
135 SectionGetFlags "${SECTION}" $0
136 IntOp $0 $0 & ${SECTION_OFF}
137 IntOp $0 $0 | ${SF_RO}
138 SectionSetFlags "${SECTION}" $0
143 ; ========= Macro to enable (unreadonly) a section =========
144 !define SECTION_ENABLE 0xFFFFFFEF
145 !macro EnableSection SECTION
148 SectionGetFlags "${SECTION}" $0
149 IntOp $0 $0 & ${SECTION_ENABLE}
150 SectionSetFlags "${SECTION}" $0
155 ; ============================================================================
157 ; ============================================================================
158 !include "servicelib.nsh"
160 ; ============================================================================
162 ; ============================================================================
163 !include "FileFunc.nsh"
165 !insertmacro GetParameters
166 !insertmacro GetOptions
168 ; ============================================================================
169 ; License page configuration
170 ; ============================================================================
171 LicenseText "Wireshark is distributed under the GNU General Public License."
172 LicenseData "..\..\COPYING"
174 ; ============================================================================
175 ; Component page configuration
176 ; ============================================================================
177 ComponentText "The following components are available for installation."
179 ; Component check boxes
180 ; Commented out for NSIS v 2.0
181 ; EnabledBitmap "..\..\image\nsis-checked.bmp"
182 ; DisabledBitmap "..\..\image\nsis-unchecked.bmp"
184 ; ============================================================================
185 ; Directory selection page configuration
186 ; ============================================================================
187 ; The text to prompt the user to enter a directory
188 DirText "Choose a directory in which to install Wireshark."
190 ; The default installation directory
191 InstallDir $PROGRAMFILES\Wireshark\
193 ; See if this is an upgrade; if so, use the old InstallDir as default
194 InstallDirRegKey HKEY_LOCAL_MACHINE SOFTWARE\Wireshark "InstallDir"
197 ; ============================================================================
198 ; Install page configuration
199 ; ============================================================================
201 ShowUninstDetails show
203 ; ============================================================================
204 ; Functions and macros
205 ; ============================================================================
211 !define UPDATEICONS_UNIQUE ${__LINE__}
213 IfFileExists "$SYSDIR\shell32.dll" UpdateIcons.next1_${UPDATEICONS_UNIQUE} UpdateIcons.error1_${UPDATEICONS_UNIQUE}
214 UpdateIcons.next1_${UPDATEICONS_UNIQUE}:
215 GetDllVersion "$SYSDIR\shell32.dll" $R0 $R1
216 IntOp $R2 $R0 / 0x00010000
217 IntCmp $R2 4 UpdateIcons.next2_${UPDATEICONS_UNIQUE} UpdateIcons.error2_${UPDATEICONS_UNIQUE}
218 UpdateIcons.next2_${UPDATEICONS_UNIQUE}:
219 System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (${SHCNE_ASSOCCHANGED}, ${SHCNF_IDLIST}, 0, 0)'
220 Goto UpdateIcons.quit_${UPDATEICONS_UNIQUE}
222 UpdateIcons.error1_${UPDATEICONS_UNIQUE}:
223 MessageBox MB_OK|MB_ICONSTOP "Can't find 'shell32.dll' library. Impossible to update icons"
224 Goto UpdateIcons.quit_${UPDATEICONS_UNIQUE}
225 UpdateIcons.error2_${UPDATEICONS_UNIQUE}:
226 MessageBox MB_OK|MB_ICONINFORMATION "You should install the free 'Microsoft Layer for Unicode' to update Wireshark capture file icons"
227 Goto UpdateIcons.quit_${UPDATEICONS_UNIQUE}
228 UpdateIcons.quit_${UPDATEICONS_UNIQUE}:
229 !undef UPDATEICONS_UNIQUE
237 ; $R0 should contain the prefix to associate to Wireshark
240 ReadRegStr $R1 HKCR $R0 ""
241 StrCmp $R1 "" Associate.doRegister
243 Associate.doRegister:
244 ;The extension is not associated to any program, we can do the link
245 WriteRegStr HKCR $R0 "" ${WIRESHARK_ASSOC}
251 ; $R0 should contain the prefix to unlink
254 ReadRegStr $R1 HKCR $R0 ""
255 StrCmp $R1 ${WIRESHARK_ASSOC} un.unlink.doUnlink
258 ; The extension is associated with Wireshark so, we must destroy this!
259 DeleteRegKey HKCR $R0
265 ;Extract InstallOptions INI files
266 !insertmacro MUI_INSTALLOPTIONS_EXTRACT "AdditionalTasksPage.ini"
267 !insertmacro MUI_INSTALLOPTIONS_EXTRACT "WinpcapPage.ini"
270 Function DisplayAdditionalTasksPage
271 !insertmacro MUI_HEADER_TEXT "Select Additional Tasks" "Which additional tasks should be done?"
272 !insertmacro MUI_INSTALLOPTIONS_DISPLAY "AdditionalTasksPage.ini"
275 Function DisplayWinPcapPage
276 !insertmacro MUI_HEADER_TEXT "Install WinPcap?" "WinPcap is required to capture live network data. Should WinPcap be installed?"
277 !insertmacro MUI_INSTALLOPTIONS_DISPLAY "WinPcapPage.ini"
280 ; ============================================================================
281 ; Installation execution commands
282 ; ============================================================================
284 Var WINPCAP_UNINSTALL ;declare variable for holding the value of a registry key
285 ;Var WIRESHARK_UNINSTALL ;declare variable for holding the value of a registry key
288 ;-------------------------------------------
291 ; Install for every user
293 !ifdef GTK1_DIR & GTK2_DIR
296 SetShellVarContext all
301 File "..\..\wiretap\wiretap-${WTAP_VERSION}.dll"
302 !ifdef ENABLE_LIBWIRESHARK
303 File "..\..\epan\libwireshark.dll"
305 File "${GLIB_DIR}\bin\libglib-2.0-0.dll"
306 File "${GLIB_DIR}\bin\libgmodule-2.0-0.dll"
307 File "${GLIB_DIR}\bin\libgobject-2.0-0.dll"
308 File "${ICONV_DIR}\bin\iconv.dll"
309 File "${GETTEXT_DIR}\bin\intl.dll"
311 File "${ZLIB_DIR}\zlib1.dll"
314 File "${ADNS_DIR}\adns_win32\LIB\adns_dll.dll"
317 File "${PCRE_DIR}\bin\pcre.dll"
318 File "${PCRE_DIR}\man\cat3\pcrepattern.3.txt"
321 File "${KFW_DIR}\bin\comerr32.dll"
322 File "${KFW_DIR}\bin\krb5_32.dll"
325 File "${GNUTLS_DIR}\bin\libgcrypt-11.dll"
326 File "${GNUTLS_DIR}\bin\libgnutls-13.dll"
327 File "${GNUTLS_DIR}\bin\libgnutls-extra-13.dll"
328 File "${GNUTLS_DIR}\bin\libgnutls-openssl-13.dll"
329 File "${GNUTLS_DIR}\bin\libgpg-error-0.dll"
330 File "${GNUTLS_DIR}\bin\libtasn1-3.dll"
333 File "${LUA_DIR}\lib\dll\lua5.1.dll"
334 File "..\..\epan\wslua\init.lua"
335 File "..\..\epan\wslua\console.lua"
336 File "..\..\epan\wslua\dtd_gen.lua"
340 File "..\..\README.win32"
341 File "..\..\AUTHORS-SHORT"
345 File "..\..\doc\wireshark.html"
346 File "..\..\doc\wireshark-filter.html"
347 File "..\..\dumpcap.exe"
348 File "..\..\doc\dumpcap.html"
349 File "..\..\example_snmp_users_file"
351 ; manifest files needed for MSVC2005 / MSVC2005EE / DOTNET20
352 !if ${MSVC_VARIANT} == "MSVC2005"
353 File "..\..\wiretap\wiretap-${WTAP_VERSION}.dll.manifest"
354 File "..\..\*.manifest"
355 File "${ZLIB_DIR}\zlib1.dll.manifest"
357 !if ${MSVC_VARIANT} == "MSVC2005EE"
358 File "..\..\wiretap\wiretap-${WTAP_VERSION}.dll.manifest"
359 File "..\..\*.manifest"
360 File "${ZLIB_DIR}\zlib1.dll.manifest"
362 !if ${MSVC_VARIANT} == "DOTNET20"
363 File "..\..\wiretap\wiretap-${WTAP_VERSION}.dll.manifest"
364 File "..\..\*.manifest"
365 File "${ZLIB_DIR}\zlib1.dll.manifest"
368 ; C-runtime redistributable
370 ; vcredist_x86.exe (MSVC V8) - copy and execute the redistributable installer
371 File "${VCREDIST_EXE}"
372 ExecWait '"$INSTDIR\vcredist_x86.exe"' $0
373 DetailPrint "vcredist_x86 returned $0"
376 ; msvcr*.dll (MSVC V7 or V7.1) - simply copy the dll file
379 !if ${MSVC_VARIANT} != "MSVC6"
380 !error "C-Runtime redistributable for this package not available / not redistributable!"
383 !endif ; VCREDIST_EXE
386 ; global config files - don't overwrite if already existing
387 ;IfFileExists cfilters dont_overwrite_cfilters
388 File "..\..\cfilters"
389 ;dont_overwrite_cfilters:
390 ;IfFileExists colorfilters dont_overwrite_colorfilters
391 File "..\..\colorfilters"
392 ;dont_overwrite_colorfilters:
393 ;IfFileExists dfilters dont_overwrite_dfilters
394 File "..\..\dfilters"
395 ;dont_overwrite_dfilters:
399 ; Install the Diameter DTD and XML files in the "diameter" subdirectory
400 ; of the installation directory.
402 SetOutPath $INSTDIR\diameter
403 File "..\..\diameter\chargecontrol.xml"
404 File "..\..\diameter\dictionary.dtd"
405 File "..\..\diameter\dictionary.xml"
406 File "..\..\diameter\imscxdx.xml"
407 File "..\..\diameter\mobileipv4.xml"
408 File "..\..\diameter\nasreq.xml"
409 File "..\..\diameter\sip.xml"
410 File "..\..\diameter\sunping.xml"
411 File "..\..\diameter\TGPPSh.xml"
417 ; Install the RADIUS directory files in the "radius" subdirectory
418 ; of the installation directory.
420 SetOutPath $INSTDIR\radius
421 File "..\..\radius\dictionary"
422 File "..\..\radius\dictionary.3com"
423 File "..\..\radius\dictionary.3gpp"
424 File "..\..\radius\dictionary.3gpp2"
425 File "..\..\radius\dictionary.acc"
426 File "..\..\radius\dictionary.alcatel"
427 File "..\..\radius\dictionary.alteon"
428 File "..\..\radius\dictionary.altiga"
429 File "..\..\radius\dictionary.aptis"
430 File "..\..\radius\dictionary.ascend"
431 File "..\..\radius\dictionary.bay"
432 File "..\..\radius\dictionary.bintec"
433 File "..\..\radius\dictionary.bristol"
434 File "..\..\radius\dictionary.cablelabs"
435 File "..\..\radius\dictionary.cabletron"
436 File "..\..\radius\dictionary.cisco"
437 File "..\..\radius\dictionary.cisco.bbsm"
438 File "..\..\radius\dictionary.cisco.vpn3000"
439 File "..\..\radius\dictionary.cisco.vpn5000"
440 File "..\..\radius\dictionary.colubris"
441 File "..\..\radius\dictionary.columbia_university"
442 File "..\..\radius\dictionary.compat"
443 File "..\..\radius\dictionary.cosine"
444 File "..\..\radius\dictionary.ericsson"
445 File "..\..\radius\dictionary.erx"
446 File "..\..\radius\dictionary.extreme"
447 File "..\..\radius\dictionary.foundry"
448 File "..\..\radius\dictionary.freeradius"
449 File "..\..\radius\dictionary.gandalf"
450 File "..\..\radius\dictionary.garderos"
451 File "..\..\radius\dictionary.gemtek"
452 File "..\..\radius\dictionary.itk"
453 File "..\..\radius\dictionary.juniper"
454 File "..\..\radius\dictionary.karlnet"
455 File "..\..\radius\dictionary.livingston"
456 File "..\..\radius\dictionary.localweb"
457 File "..\..\radius\dictionary.merit"
458 File "..\..\radius\dictionary.microsoft"
459 File "..\..\radius\dictionary.mikrotik"
460 File "..\..\radius\dictionary.navini"
461 File "..\..\radius\dictionary.netscreen"
462 File "..\..\radius\dictionary.nokia"
463 File "..\..\radius\dictionary.nomadix"
464 File "..\..\radius\dictionary.propel"
465 File "..\..\radius\dictionary.quintum"
466 File "..\..\radius\dictionary.redback"
467 File "..\..\radius\dictionary.redcreek"
468 File "..\..\radius\dictionary.shasta"
469 File "..\..\radius\dictionary.shiva"
470 File "..\..\radius\dictionary.sonicwall"
471 File "..\..\radius\dictionary.springtide"
472 File "..\..\radius\dictionary.t_systems_nova"
473 File "..\..\radius\dictionary.telebit"
474 File "..\..\radius\dictionary.trapeze"
475 File "..\..\radius\dictionary.tunnel"
476 File "..\..\radius\dictionary.unisphere"
477 File "..\..\radius\dictionary.unix"
478 File "..\..\radius\dictionary.usr"
479 File "..\..\radius\dictionary.valemount"
480 File "..\..\radius\dictionary.versanet"
481 File "..\..\radius\dictionary.wispr"
482 File "..\..\radius\dictionary.xedia"
486 ; install the dtds in the dtds subdirectory
488 SetOutPath $INSTDIR\dtds
489 File "..\..\dtds\dc.dtd"
490 File "..\..\dtds\itunes.dtd"
491 File "..\..\dtds\mscml.dtd"
492 File "..\..\dtds\pocsettings.dtd"
493 File "..\..\dtds\presence.dtd"
494 File "..\..\dtds\reginfo.dtd"
495 File "..\..\dtds\rlmi.dtd"
496 File "..\..\dtds\rss.dtd"
497 File "..\..\dtds\smil.dtd"
498 File "..\..\dtds\xcap-caps.dtd"
499 File "..\..\dtds\watcherinfo.dtd"
502 SetOutPath $INSTDIR\help
503 File "..\..\help\toc"
504 File "..\..\help\overview.txt"
505 File "..\..\help\getting_started.txt"
506 File "..\..\help\capturing.txt"
507 File "..\..\help\capture_filters.txt"
508 File "..\..\help\display_filters.txt"
509 File "..\..\help\faq.txt"
511 ; Write the uninstall keys for Windows
512 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "DisplayVersion" "${VERSION}"
513 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "DisplayName" "Wireshark ${VERSION}"
514 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "UninstallString" '"$INSTDIR\uninstall.exe"'
515 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "Publisher" "The Wireshark developer community, http://www.wireshark.org"
516 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "HelpLink" "mailto:wireshark-users@wireshark.org"
517 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "URLInfoAbout" "http://www.wireshark.org"
518 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "URLUpdateInfo" "http://www.wireshark.org/download/win32/"
519 WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "NoModify" 1
520 WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "NoRepair" 1
521 WriteUninstaller "uninstall.exe"
523 ; Write an entry for ShellExecute
524 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\wireshark.exe" "" '$INSTDIR\wireshark.exe'
525 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\wireshark.exe" "Path" '$INSTDIR'
527 ; Create start menu entries (depending on additional tasks page)
528 ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 2" "State"
529 StrCmp $0 "0" SecRequired_skip_StartMenu
531 CreateDirectory "$SMPROGRAMS\Wireshark"
532 ; To qoute "http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwue/html/ch11d.asp":
533 ; "Do not include Readme, Help, or Uninstall entries on the Programs menu."
534 Delete "$SMPROGRAMS\Wireshark\Wireshark Web Site.lnk"
535 ;WriteINIStr "$SMPROGRAMS\Wireshark\Wireshark Web Site.url" "InternetShortcut" "URL" "http://www.wireshark.org/"
536 CreateShortCut "$SMPROGRAMS\Wireshark\Wireshark.lnk" "$INSTDIR\wireshark.exe" "" "$INSTDIR\wireshark.exe" 0 "" "" "The Wireshark Network Protocol Analyzer"
537 ;CreateShortCut "$SMPROGRAMS\Wireshark\Wireshark Manual.lnk" "$INSTDIR\wireshark.html"
538 ;CreateShortCut "$SMPROGRAMS\Wireshark\Display Filters Manual.lnk" "$INSTDIR\wireshark-filter.html"
539 CreateShortCut "$SMPROGRAMS\Wireshark\Wireshark Program Directory.lnk" \
541 ;CreateShortCut "$SMPROGRAMS\Wireshark\Uninstall Wireshark.lnk" "$INSTDIR\uninstall.exe"
542 SecRequired_skip_StartMenu:
544 ; is command line option "/desktopicon" set?
546 ${GetOptions} $R0 "/desktopicon=" $R1
547 StrCmp $R1 "no" SecRequired_skip_DesktopIcon
548 StrCmp $R1 "yes" SecRequired_install_DesktopIcon
550 ; Create desktop icon (depending on additional tasks page and command line option)
551 ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 3" "State"
552 StrCmp $0 "0" SecRequired_skip_DesktopIcon
553 SecRequired_install_DesktopIcon:
554 CreateShortCut "$DESKTOP\Wireshark.lnk" "$INSTDIR\wireshark.exe" "" "$INSTDIR\wireshark.exe" 0 "" "" "The Wireshark Network Protocol Analyzer"
555 SecRequired_skip_DesktopIcon:
557 ; is command line option "/quicklaunchicon" set?
559 ${GetOptions} $R0 "/quicklaunchicon=" $R1
560 StrCmp $R1 "no" SecRequired_skip_QuickLaunchIcon
561 StrCmp $R1 "yes" SecRequired_install_QuickLaunchIcon
563 ; Create quick launch icon (depending on additional tasks page and command line option)
564 ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 4" "State"
565 StrCmp $0 "0" SecRequired_skip_QuickLaunchIcon
566 SecRequired_install_QuickLaunchIcon:
567 CreateShortCut "$QUICKLAUNCH\Wireshark.lnk" "$INSTDIR\wireshark.exe" "" "$INSTDIR\wireshark.exe" 0 "" "" "The Wireshark Network Protocol Analyzer"
568 SecRequired_skip_QuickLaunchIcon:
570 ; Create File Extensions (depending on additional tasks page)
571 ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 6" "State"
572 StrCmp $0 "0" SecRequired_skip_FileExtensions
573 WriteRegStr HKCR ${WIRESHARK_ASSOC} "" "Wireshark file"
574 WriteRegStr HKCR "${WIRESHARK_ASSOC}\Shell\open\command" "" '"$INSTDIR\wireshark.exe" "%1"'
575 WriteRegStr HKCR "${WIRESHARK_ASSOC}\DefaultIcon" "" '"$INSTDIR\wireshark.exe",1'
615 ; if somethings added here, add it also to the uninstall section and the AdditionalTask page
617 !insertmacro UpdateIcons
618 SecRequired_skip_FileExtensions:
620 ; if running as a silent installer, don't try to install winpcap
621 IfSilent SecRequired_skip_Winpcap
623 ; Install WinPcap (depending on winpcap page setting)
624 ReadINIStr $0 "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "State"
625 StrCmp $0 "0" SecRequired_skip_Winpcap
626 ; Uinstall old WinPcap first
627 ReadRegStr $WINPCAP_UNINSTALL HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinPcapInst" "UninstallString"
628 IfErrors lbl_winpcap_notinstalled ;if RegKey is unavailable, WinPcap is not installed
629 ; from released version 3.1, WinPcap will uninstall an old version by itself
630 ;ExecWait '$WINPCAP_UNINSTALL' $0
631 ;DetailPrint "WinPcap uninstaller returned $0"
632 lbl_winpcap_notinstalled:
634 File "WinPcap_3_1.exe"
635 ExecWait '"$INSTDIR\WinPcap_3_1.exe"' $0
636 DetailPrint "WinPcap installer returned $0"
637 SecRequired_skip_Winpcap:
639 ; Load Winpcap NPF service at startup (depending on winpcap page)
640 ReadINIStr $0 "$PLUGINSDIR\WinPcapPage.ini" "Field 8" "State"
641 StrCmp $0 "0" SecRequired_no_WinpcapService
642 WriteRegDWORD HKEY_LOCAL_MACHINE "SYSTEM\CurrentControlSet\Services\NPF" "Start" 2 ;set NPF to (SERVICE_AUTO_START)
643 !insertmacro SERVICE "start" "NPF" ""
644 Goto SecRequired_done_WinpcapService
645 SecRequired_no_WinpcapService:
646 WriteRegDWORD HKEY_LOCAL_MACHINE "SYSTEM\CurrentControlSet\Services\NPF" "Start" 3 ;set NPF to (SERVICE_DEMAND_START)
647 !insertmacro SERVICE "stop" "NPF" ""
648 SecRequired_done_WinpcapService:
650 ; If no user profile exists for Wireshark but for Ethereal, copy it over
651 SetShellVarContext current
652 IfFileExists $APPDATA\Wireshark profile_done
653 IfFileExists $APPDATA\Ethereal 0 profile_done
654 ;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
655 CreateDirectory $APPDATA\Wireshark
656 CopyFiles $APPDATA\Ethereal\*.* $APPDATA\Wireshark
658 SetShellVarContext all
660 SectionEnd ; "Required"
663 SectionGroup "!Wireshark" SecWiresharkGroup
666 Section "Wireshark GTK1" SecWiresharkGTK1
667 ;-------------------------------------------
668 !ifdef GTK1_DIR & GTK2_DIR
672 File "..\..\wireshark.exe"
673 File "${GTK1_DIR}\lib\libgtk-0.dll"
674 File "${GTK1_DIR}\lib\libgdk-0.dll"
679 Section "Wireshark GTK2" SecWiresharkGTK2
680 ;-------------------------------------------
681 !ifdef GTK1_DIR & GTK2_DIR
685 File /oname=wireshark.exe "..\..\wireshark-gtk2.exe"
686 IfFileExists $INSTDIR\wireshark-gtk2.exe.manifest 0 +2
687 Rename $INSTDIR\wireshark-gtk2.exe.manifest $INSTDIR\wireshark.exe.manifest
688 File "${GTK2_DIR}\bin\libgdk-win32-2.0-0.dll"
689 File "${GTK2_DIR}\bin\libgdk_pixbuf-2.0-0.dll"
690 File "${GTK2_DIR}\bin\libgtk-win32-2.0-0.dll"
691 File "${GTK2_DIR}\bin\libatk-1.0-0.dll"
692 File "${GTK2_DIR}\bin\libpango-1.0-0.dll"
693 File "${GTK2_DIR}\bin\libpangowin32-1.0-0.dll"
694 !ifdef NEED_CAIRO_DLL
695 File "${GTK2_DIR}\bin\libcairo-2.dll"
696 File "${GTK2_DIR}\bin\libpangocairo-1.0-0.dll"
698 !ifdef NEED_LIBPNG_DLL
699 File "${GTK2_DIR}\bin\libpng13.dll"
701 SetOutPath $INSTDIR\etc\gtk-2.0
702 File "${GTK2_DIR}\etc\gtk-2.0\*.*"
703 SetOutPath $INSTDIR\etc\pango
704 File "${GTK2_DIR}\etc\pango\pango.*"
705 SetOutPath $INSTDIR\lib\gtk-2.0\${GTK2_LIB_DIR}\loaders
706 File "${GTK2_DIR}\lib\gtk-2.0\${GTK2_LIB_DIR}\loaders\libpixbufloader-*.dll"
707 SetOutPath $INSTDIR\lib\gtk-2.0\${GTK2_LIB_DIR}\immodules
708 File "${GTK2_DIR}\lib\gtk-2.0\${GTK2_LIB_DIR}\immodules\im-*.dll"
709 # Not needed with pango 1.14.5
710 #SetOutPath $INSTDIR\lib\pango\${PANGO_LIB_DIR}\modules
711 #File "${GTK2_DIR}\lib\pango\${PANGO_LIB_DIR}\modules\pango-*.dll"
716 Section "GTK-Wimp" SecGTKWimp
717 ;-------------------------------------------
719 SetOutPath $INSTDIR\${GTK_WIMP_DLLDST_DIR}
720 File "${GTK_WIMP_DLLSRC_DIR}\libwimp.dll"
721 SetOutPath $INSTDIR\${GTK_WIMP_RCDST_DIR}
722 File "${GTK_WIMP_RCSRC_DIR}\gtkrc"
727 SectionGroupEnd ; "Wireshark"
730 Section "TShark" SecTShark
731 ;-------------------------------------------
732 !ifdef GTK1_DIR & GTK2_DIR
736 File "..\..\tshark.exe"
737 File "..\..\doc\tshark.html"
740 SectionGroup "Plugins / Extensions" SecPluginsGroup
742 Section "Dissector Plugins" SecPlugins
743 ;-------------------------------------------
744 !ifdef GTK1_DIR & GTK2_DIR
747 SetOutPath $INSTDIR\plugins\${VERSION}
748 File "..\..\plugins\agentx\agentx.dll"
749 File "..\..\plugins\artnet\artnet.dll"
750 File "..\..\plugins\asn1\asn1.dll"
751 File "..\..\plugins\ciscosm\ciscosm.dll"
752 File "..\..\plugins\docsis\docsis.dll"
753 File "..\..\plugins\enttec\enttec.dll"
754 File "..\..\plugins\giop\coseventcomm.dll"
755 File "..\..\plugins\giop\cosnaming.dll"
756 File "..\..\plugins\giop\parlay.dll"
757 File "..\..\plugins\giop\tango.dll"
758 File "..\..\plugins\gryphon\gryphon.dll"
759 File "..\..\plugins\h223\h223.dll"
760 File "..\..\plugins\irda\irda.dll"
761 File "..\..\plugins\lwres\lwres.dll"
762 File "..\..\plugins\megaco\megaco.dll"
763 File "..\..\plugins\mgcp\mgcp.dll"
764 File "..\..\plugins\opsi\opsi.dll"
765 File "..\..\plugins\pcli\pcli.dll"
766 File "..\..\plugins\profinet\profinet.dll"
767 File "..\..\plugins\rlm\rlm.dll"
768 File "..\..\plugins\rtnet\rtnet.dll"
769 File "..\..\plugins\rudp\rudp.dll"
770 File "..\..\plugins\sbus\sbus.dll"
771 File "..\..\plugins\v5ua\v5ua.dll"
774 Section "Tree Statistics Plugin" SecStatsTree
775 ;-------------------------------------------
776 !ifdef GTK1_DIR & GTK2_DIR
779 SetOutPath $INSTDIR\plugins\${VERSION}
780 File "..\..\plugins\stats_tree\stats_tree.dll"
783 Section "Mate - Meta Analysis and Tracing Engine" SecMate
784 ;-------------------------------------------
785 SetOutPath $INSTDIR\plugins\${VERSION}
786 File "..\..\plugins\mate\mate.dll"
791 Section "SNMP MIBs" SecMIBs
792 ;-------------------------------------------
793 !ifdef GTK1_DIR & GTK2_DIR
796 SetOutPath $INSTDIR\snmp\mibs
797 File "${NET_SNMP_DIR}\mibs\*.txt"
801 SectionGroupEnd ; "Plugins / Extensions"
804 SectionGroup "Tools" SecToolsGroup
806 Section "Editcap" SecEditcap
807 ;-------------------------------------------
808 !ifdef GTK1_DIR & GTK2_DIR
812 File "..\..\editcap.exe"
813 File "..\..\doc\editcap.html"
816 Section "Text2Pcap" SecText2Pcap
817 ;-------------------------------------------
818 !ifdef GTK1_DIR & GTK2_DIR
822 File "..\..\text2pcap.exe"
823 File "..\..\doc\text2pcap.html"
826 Section "Mergecap" SecMergecap
827 ;-------------------------------------------
828 !ifdef GTK1_DIR & GTK2_DIR
832 File "..\..\mergecap.exe"
833 File "..\..\doc\mergecap.html"
836 Section "Capinfos" SecCapinfos
837 ;-------------------------------------------
838 !ifdef GTK1_DIR & GTK2_DIR
842 File "..\..\capinfos.exe"
843 File "..\..\doc\capinfos.html"
846 SectionGroupEnd ; "Tools"
849 Section "User's Guide" SecUsersGuide
850 ;-------------------------------------------
851 !ifdef GTK1_DIR & GTK2_DIR
855 File "..\..\docbook\user-guide.chm"
859 Section "Uninstall" un.SecUinstall
860 ;-------------------------------------------
863 ; UnInstall for every user
866 SetShellVarContext all
868 Delete "$INSTDIR\tshark.exe"
869 IfErrors 0 NoTSharkErrorMsg
870 MessageBox MB_OK "Please note: tshark.exe could not be removed, it's probably in use!" IDOK 0 ;skipped if tshark.exe removed
871 Abort "Please note: tshark.exe could not be removed, it's probably in use! Abort uninstall process!"
874 Delete "$INSTDIR\wireshark.exe"
875 IfErrors 0 NoWiresharkErrorMsg
876 MessageBox MB_OK "Please note: wireshark.exe could not be removed, it's probably in use!" IDOK 0 ;skipped if wireshark.exe removed
877 Abort "Please note: wireshark.exe could not be removed, it's probably in use! Abort uninstall process!"
880 DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark"
881 DeleteRegKey HKEY_LOCAL_MACHINE "Software\Wireshark"
882 DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\wireshark.exe"
925 DeleteRegKey HKCR ${WIRESHARK_ASSOC}
926 DeleteRegKey HKCR "${WIRESHARK_ASSOC}\Shell\open\command"
927 DeleteRegKey HKCR "${WIRESHARK_ASSOC}\DefaultIcon"
928 !insertmacro UpdateIcons
930 ; regardless if we currently installed GTK1 or 2, try to uninstall GTK2 files too
931 Delete "$INSTDIR\etc\gtk-2.0\*.*"
932 Delete "$INSTDIR\etc\pango\*.*"
933 Delete "$INSTDIR\lib\gtk-2.0\2.2.0\engines\*.*"
934 Delete "$INSTDIR\lib\gtk-2.0\2.2.0\loaders\*.*"
935 Delete "$INSTDIR\lib\gtk-2.0\2.2.0\immodules\*.*"
936 Delete "$INSTDIR\lib\gtk-2.0\2.4.0\engines\*.*"
937 Delete "$INSTDIR\lib\gtk-2.0\2.4.0\loaders\*.*"
938 Delete "$INSTDIR\lib\gtk-2.0\2.4.0\immodules\*.*"
939 Delete "$INSTDIR\lib\gtk-2.0\2.10.0\engines\*.*"
940 Delete "$INSTDIR\lib\gtk-2.0\2.10.0\loaders\*.*"
941 Delete "$INSTDIR\lib\gtk-2.0\2.10.0\immodules\*.*"
942 Delete "$INSTDIR\lib\pango\1.2.0\modules\*.*"
943 Delete "$INSTDIR\lib\pango\1.4.0\modules\*.*"
944 Delete "$INSTDIR\lib\pango\1.5.0\modules\*.*"
945 Delete "$INSTDIR\share\themes\Default\gtk-2.0\*.*"
946 Delete "$INSTDIR\help\*.*"
947 Delete "$INSTDIR\diameter\*.*"
948 Delete "$INSTDIR\snmp\mibs\*.*"
949 Delete "$INSTDIR\snmp\*.*"
950 Delete "$INSTDIR\*.exe"
951 Delete "$INSTDIR\*.dll"
952 Delete "$INSTDIR\*.html"
953 Delete "$INSTDIR\COPYING"
954 Delete "$INSTDIR\AUTHORS-SHORT"
955 Delete "$INSTDIR\*.manifest"
956 ; previous versions installed this file
957 Delete "$INSTDIR\AUTHORS-SHORT-FORMAT"
958 Delete "$INSTDIR\README*"
959 Delete "$INSTDIR\FAQ"
960 Delete "$INSTDIR\NEWS.txt"
961 Delete "$INSTDIR\manuf"
962 Delete "$INSTDIR\pcrepattern.3.txt"
963 Delete "$INSTDIR\user-guide.chm"
964 Delete "$INSTDIR\radius\*.*"
965 Delete "$INSTDIR\dtds\*.*"
966 Delete "$SMPROGRAMS\Wireshark\*.*"
967 Delete "$DESKTOP\Wireshark.lnk"
968 Delete "$QUICKLAUNCH\Wireshark.lnk"
970 RMDir "$INSTDIR\etc\gtk-2.0"
971 RMDir "$INSTDIR\etc\pango"
973 RMDir "$INSTDIR\lib\gtk-2.0\2.2.0\engines"
974 RMDir "$INSTDIR\lib\gtk-2.0\2.2.0\loaders"
975 RMDir "$INSTDIR\lib\gtk-2.0\2.2.0\immodules"
976 RMDir "$INSTDIR\lib\gtk-2.0\2.2.0"
977 RMDir "$INSTDIR\lib\gtk-2.0\2.4.0\engines"
978 RMDir "$INSTDIR\lib\gtk-2.0\2.4.0\loaders"
979 RMDir "$INSTDIR\lib\gtk-2.0\2.4.0\immodules"
980 RMDir "$INSTDIR\lib\gtk-2.0\2.4.0"
981 RMDir "$INSTDIR\lib\gtk-2.0\2.10.0\engines"
982 RMDir "$INSTDIR\lib\gtk-2.0\2.10.0\loaders"
983 RMDir "$INSTDIR\lib\gtk-2.0\2.10.0\immodules"
984 RMDir "$INSTDIR\lib\gtk-2.0\2.10.0"
985 RMDir "$INSTDIR\lib\gtk-2.0"
986 RMDir "$INSTDIR\lib\pango\1.2.0\modules"
987 RMDir "$INSTDIR\lib\pango\1.2.0"
988 RMDir "$INSTDIR\lib\pango\1.4.0\modules"
989 RMDir "$INSTDIR\lib\pango\1.4.0"
990 RMDir "$INSTDIR\lib\pango\1.5.0\modules"
991 RMDir "$INSTDIR\lib\pango\1.5.0"
992 RMDir "$INSTDIR\lib\pango"
994 RMDir "$INSTDIR\share\themes\Default\gtk-2.0"
995 RMDir "$INSTDIR\share\themes\Default"
996 RMDir "$INSTDIR\share\themes"
997 RMDir "$INSTDIR\share"
998 RMDir "$SMPROGRAMS\Wireshark"
999 RMDir "$INSTDIR\help"
1000 RMDir "$INSTDIR\diameter"
1001 RMDir "$INSTDIR\snmp\mibs"
1002 RMDir "$INSTDIR\snmp"
1003 RMDir "$INSTDIR\radius"
1004 RMDir "$INSTDIR\dtds"
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"
1031 Section /o "Un.Personal Settings" un.SecPersonalSettings
1032 ;-------------------------------------------
1034 SetShellVarContext current
1035 Delete "$APPDATA\Wireshark\*.*"
1036 RMDir "$APPDATA\Wireshark"
1039 ;VAR un.WINPCAP_UNINSTALL
1041 Section /o "Un.WinPcap" un.SecWinPcap
1042 ;-------------------------------------------
1044 ReadRegStr $1 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinPcapInst" "UninstallString"
1045 ;IfErrors un.lbl_winpcap_notinstalled ;if RegKey is unavailable, WinPcap is not installed
1046 ;MessageBox MB_OK "WinPcap $1"
1048 DetailPrint "WinPcap uninstaller returned $0"
1050 ;un.lbl_winpcap_notinstalled:
1053 Section "-Un.Finally"
1054 ;-------------------------------------------
1056 ; this test must be done after all other things uninstalled (e.g. Global Settings)
1057 IfFileExists "$INSTDIR" 0 NoFinalErrorMsg
1058 MessageBox MB_OK "Please note: The directory $INSTDIR could not be removed!" IDOK 0 ; skipped if dir doesn't exist
1063 ; ============================================================================
1064 ; PLEASE MAKE SURE, THAT THE DESCRIPTIVE TEXT FITS INTO THE DESCRIPTION FIELD!
1065 ; ============================================================================
1066 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
1067 !insertmacro MUI_DESCRIPTION_TEXT ${SecWiresharkGroup} "${PROGRAM_NAME} is a GUI network protocol analyzer."
1069 !insertmacro MUI_DESCRIPTION_TEXT ${SecWiresharkGTK1} "${PROGRAM_NAME} using the classical GTK1 user interface."
1072 !insertmacro MUI_DESCRIPTION_TEXT ${SecWiresharkGTK2} "${PROGRAM_NAME} using the modern GTK2 user interface."
1074 !insertmacro MUI_DESCRIPTION_TEXT ${SecGTKWimp} "GTK-Wimp is the GTK2 windows impersonator (native Win32 look and feel, for Win2000 and up)."
1077 !insertmacro MUI_DESCRIPTION_TEXT ${SecTShark} "TShark is a text based network protocol analyzer."
1078 !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsGroup} "Some plugins and extensions for both Wireshark and TShark."
1079 !insertmacro MUI_DESCRIPTION_TEXT ${SecPlugins} "Plugins with some extended dissections."
1080 !insertmacro MUI_DESCRIPTION_TEXT ${SecStatsTree} "Plugin for some extended statistics."
1081 !insertmacro MUI_DESCRIPTION_TEXT ${SecMate} "Plugin - Meta Analysis and Tracing Engine (Experimental)."
1083 !insertmacro MUI_DESCRIPTION_TEXT ${SecMIBs} "SNMP MIBs for better SNMP dissection."
1085 !insertmacro MUI_DESCRIPTION_TEXT ${SecToolsGroup} "Additional command line based tools."
1086 !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."
1087 !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."
1088 !insertmacro MUI_DESCRIPTION_TEXT ${SecMergecap} "Mergecap is a program that combines multiple saved capture files into a single output file"
1089 !insertmacro MUI_DESCRIPTION_TEXT ${SecCapinfos} "Capinfos is a program that provides information on capture files."
1091 !insertmacro MUI_DESCRIPTION_TEXT ${SecUsersGuide} "The user's guide as the online help system."
1093 !insertmacro MUI_FUNCTION_DESCRIPTION_END
1095 !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
1096 !insertmacro MUI_DESCRIPTION_TEXT ${un.SecUinstall} "Uninstall all Wireshark components."
1097 !insertmacro MUI_DESCRIPTION_TEXT ${un.SecPlugins} "Uninstall all Plugins (even from previous Wireshark versions)."
1098 !insertmacro MUI_DESCRIPTION_TEXT ${un.SecGlobalSettings} "Uninstall global settings like: $INSTDIR\cfilters"
1099 !insertmacro MUI_DESCRIPTION_TEXT ${un.SecPersonalSettings} "Uninstall personal settings like your preferences file from your profile: $PROFILE."
1100 !insertmacro MUI_DESCRIPTION_TEXT ${un.SecWinPcap} "Call WinPcap's uninstall program."
1101 !insertmacro MUI_UNFUNCTION_DESCRIPTION_END
1103 ; ============================================================================
1104 ; Callback functions
1105 ; ============================================================================
1106 !ifdef GTK1_DIR & GTK2_DIR
1107 ;Disable GTK-Wimp for GTK1
1109 Function .onSelChange
1111 SectionGetFlags ${SecWiresharkGTK1} $0
1113 IntCmp $0 1 onSelChange.disableGTK2Sections
1114 ;enable GTK2Sections
1115 !insertmacro EnableSection ${SecGTKWimp}
1116 Goto onSelChange.end
1117 onSelChange.disableGTK2Sections:
1118 !insertmacro DisableSection ${SecGTKWimp}
1119 Goto onSelChange.end
1125 !ifdef GTK1_DIR | GTK2_DIR
1126 ; Disable FileExtension if Wireshark isn't selected
1127 Function .onSelChange
1130 SectionGetFlags ${SecWiresharkGTK1} $0
1132 IntCmp $0 0 onSelChange.unselect
1133 SectionGetFlags ${SecFileExtensions} $0
1135 IntCmp $0 16 onSelChange.unreadonly
1136 Goto onSelChange.end
1138 SectionGetFlags ${SecWiresharkGTK2} $0
1140 IntCmp $0 0 onSelChange.unselect
1141 SectionGetFlags ${SecFileExtensions} $0
1143 IntCmp $0 16 onSelChange.unreadonly
1144 Goto onSelChange.end
1146 onSelChange.unselect:
1147 SectionGetFlags ${SecFileExtensions} $0
1148 IntOp $0 $0 & 0xFFFFFFFE
1150 SectionSetFlags ${SecFileExtensions} $0
1151 Goto onSelChange.end
1152 onSelChange.unreadonly:
1153 SectionGetFlags ${SecFileExtensions} $0
1154 IntOp $0 $0 & 0xFFFFFFEF
1155 SectionSetFlags ${SecFileExtensions} $0
1156 Goto onSelChange.end
1164 !include "GetWindowsVersion.nsh"
1165 !include WinMessages.nsh
1167 Var NPF_START ;declare variable for holding the value of a registry key
1168 Var WINPCAP_VERSION ;declare variable for holding the value of a registry key
1170 Function myShowCallback
1172 ; Uinstall old Wireshark first
1173 ; XXX - doesn't work, but kept here for further experiments
1174 ;ReadRegStr $WIRESHARK_UNINSTALL HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "UninstallString"
1175 ;IfErrors lbl_wireshark_notinstalled ;if RegKey is unavailable, WinPcap is not installed
1176 ;MessageBox MB_YESNO|MB_ICONQUESTION "Uninstall the old Wireshark version first (recommended)?"
1177 ; Hide the installer while uninstalling
1178 ;GetDlgItem $0 $HWNDPARENT 1
1179 ;FindWindow $0 "#32770" "" $HWNDPARENT
1180 ;MessageBox MB_OK "Window $0"
1181 ;ShowWindow $0 ${SW_HIDE}
1183 ;ExecWait '$WIRESHARK_UNINSTALL' $0
1184 ;DetailPrint "WinPcap uninstaller returned $0"
1185 ;GetDlgItem $0 $HWNDPARENT 1
1186 ;ShowWindow $0 ${SW_SHOW}
1187 ;MessageBox MB_OK "Uninstalled"
1188 ;lbl_wireshark_notinstalled:
1191 ; Get the Windows version
1192 Call GetWindowsVersion
1193 Pop $R0 ; Windows Version
1195 ; Check if we're able to run with this version
1196 StrCmp $R0 '95' lbl_winversion_unsupported
1197 StrCmp $R0 '98' lbl_winversion_unsupported
1198 StrCmp $R0 'ME' lbl_winversion_unsupported
1199 ;StrCmp $R0 'NT 4.0' lbl_winversion_unsupported
1200 Goto lbl_winversion_supported
1201 lbl_winversion_unsupported:
1202 MessageBox MB_OK "Windows $R0 is no longer supported. The last known version working with 98/ME was Ethereal 0.99.0!"
1205 lbl_winversion_supported:
1207 ; Enable GTK-Wimp only for Windows 2000/XP/2003
1208 ; ...as Win9x/ME/NT known to have problems with it!
1210 ;DetailPrint 'Windows Version: $R0'
1211 StrCmp $R0 '2000' lbl_select_wimp
1212 StrCmp $R0 'XP' lbl_select_wimp
1213 StrCmp $R0 '2003' lbl_select_wimp
1214 DetailPrint "Windows $R0 doesn't support GTK-Wimp!"
1216 Goto lbl_ignore_wimp
1218 !insertmacro SelectSection ${SecGTKWimp}
1224 ; detect if WinPcap should be installed
1225 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "Text" "Install WinPcap 3.1"
1226 ReadRegStr $WINPCAP_VERSION HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinPcapInst" "DisplayName"
1227 IfErrors 0 lbl_winpcap_installed ;if RegKey is available, WinPcap is already installed
1228 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 2" "Text" "WinPcap is currently not installed"
1229 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 2" "Flags" "DISABLED"
1230 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Text" "(Use Add/Remove Programs first to uninstall any undetected old WinPcap versions)"
1231 Goto lbl_winpcap_done
1233 lbl_winpcap_installed:
1234 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 2" "Text" "$WINPCAP_VERSION"
1235 ; WinPcap 2.x (including betas): the version string starts with "WinPcap 2."
1236 StrCpy $1 "$WINPCAP_VERSION" 10
1237 StrCmp $1 "WinPcap 2." lbl_winpcap_do_install
1238 ; WinPcap 3.0 (including betas): the version string starts with "WinPcap 3.0"
1239 StrCpy $1 "$WINPCAP_VERSION" 11
1240 StrCmp $1 "WinPcap 3.0" lbl_winpcap_do_install
1241 ; WinPcap 3.1 previous beta's; exact string match
1242 StrCmp "$WINPCAP_VERSION" "WinPcap 3.1 beta" lbl_winpcap_do_install
1243 StrCmp "$WINPCAP_VERSION" "WinPcap 3.1 beta2" lbl_winpcap_do_install
1244 StrCmp "$WINPCAP_VERSION" "WinPcap 3.1 beta3" lbl_winpcap_do_install
1245 StrCmp "$WINPCAP_VERSION" "WinPcap 3.1 beta4" lbl_winpcap_do_install
1246 ; WinPcap 4.0 (including betas): the version string starts with "WinPcap 4.0"
1247 StrCpy $1 "$WINPCAP_VERSION" 11
1248 StrCmp $1 "WinPcap 4.0" lbl_winpcap_dont_upgrade
1250 ;lbl_winpcap_dont_install:
1251 ; seems to be the current version, so don't install
1252 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "State" "0"
1253 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Text" "If selected, the currently installed $WINPCAP_VERSION will be uninstalled first."
1254 Goto lbl_winpcap_done
1256 lbl_winpcap_dont_upgrade:
1257 ; force the user to upgrade by hand
1258 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "State" "0"
1259 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "Flags" "DISABLED"
1260 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Text" "If you wish to install WinPcap 3.1, please uninstall $WINPCAP_VERSION manually first."
1261 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Flags" "DISABLED"
1262 Goto lbl_winpcap_done
1264 lbl_winpcap_do_install:
1265 ; seems to be an old version, install newer one
1266 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "State" "1"
1267 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Text" "The currently installed $WINPCAP_VERSION will be uninstalled first."
1271 ; Disable NPF service setting for Win OT
1272 StrCmp $R0 '95' lbl_npf_disable
1273 StrCmp $R0 '98' lbl_npf_disable
1274 StrCmp $R0 'ME' lbl_npf_disable
1275 ReadRegDWORD $NPF_START HKEY_LOCAL_MACHINE "SYSTEM\CurrentControlSet\Services\NPF" "Start"
1276 ; (Winpcap may not be installed already, so no regKey is no error here)
1277 IfErrors lbl_npf_done ;RegKey not available, so do not set it
1278 IntCmp $NPF_START 2 0 lbl_npf_done lbl_npf_done
1279 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 8" "State" "1"
1283 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 8" "State" "0"
1284 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 8" "Flags" "DISABLED"
1285 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 9" "Flags" "DISABLED"
1289 ; if Wireshark was previously installed, unselect previously not installed icons etc.
1290 ; detect if Wireshark is already installed ->
1291 ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "UninstallString"
1292 IfErrors lbl_wireshark_notinstalled ;if RegKey is unavailable, Wireshark is not installed
1294 ; only select Start Menu Group, if previously installed
1295 ; (we use the "all users" start menu, so select it first)
1296 SetShellVarContext all
1297 IfFileExists "$SMPROGRAMS\Wireshark\Wireshark.lnk" lbl_have_startmenu
1298 WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 2" "State" "0"
1301 ; only select Desktop Icon, if previously installed
1302 IfFileExists "$DESKTOP\Wireshark.lnk" lbl_have_desktopicon
1303 WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 3" "State" "0"
1304 lbl_have_desktopicon:
1306 ; only select Quick Launch Icon, if previously installed
1307 IfFileExists "$QUICKLAUNCH\Wireshark.lnk" lbl_have_quicklaunchicon
1308 WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 4" "State" "0"
1309 lbl_have_quicklaunchicon:
1311 lbl_wireshark_notinstalled: