7 !ifdef MAKENSIS_MODERN_UI
8 ; Set the compression mechanism first.
9 ; As of NSIS 2.07, solid compression which makes installer about 1MB smaller
10 ; is no longer the default, so use the /SOLID switch.
11 ; This unfortunately is unknown to NSIS prior to 2.07 and creates an error.
12 ; So if you get an error here, please update to at least NSIS 2.07!
13 SetCompressor /SOLID lzma
16 !ifdef GTK1_DIR & GTK2_DIR
17 InstType "Ethereal (GTK2 user interface)"
18 InstType "Ethereal (legacy GTK1 user interface)"
21 InstType "un.Default (keep Personal Settings and WinPcap)"
22 InstType "un.All (remove all)"
24 ; Used to refresh the display of file association
25 !define SHCNE_ASSOCCHANGED 0x08000000
26 !define SHCNF_IDLIST 0
28 ; Used to add associations between file extensions and Ethereal
29 !define ETHEREAL_ASSOC "ethereal-file"
31 ; ============================================================================
32 ; Header configuration
33 ; ============================================================================
34 ; The name of the installer
35 !define PROGRAM_NAME "Ethereal"
37 Name "${PROGRAM_NAME} ${VERSION}"
40 OutFile "${DEST}-setup-${VERSION}.exe"
42 ; Icon of installer and uninstaller
43 Icon "..\..\image\ethereal.ico"
44 UninstallIcon "..\..\image\ethereal.ico"
46 ; Uninstall stuff (NSIS 2.08: "\r\n" don't work here)
47 !define MUI_UNCONFIRMPAGE_TEXT_TOP "The following Ethereal installation will be uninstalled. Click 'Next' to continue."
48 ; Uninstall stuff (this text isn't used with the MODERN_UI!)
49 ;UninstallText "This will uninstall Ethereal.\r\nBefore starting the uninstallation, make sure Ethereal is not running.\r\nClick 'Next' to continue."
54 !ifdef MAKENSIS_MODERN_UI
56 ; ============================================================================
58 ; ============================================================================
59 ; The modern user interface will look much better than the common one.
60 ; However, as the development of the modern UI is still going on, and the script
61 ; syntax changes, you will need exactly that NSIS version, which this script is
62 ; made for. This is the current (December 2003) latest version: V2.0b4
63 ; If you are using a different version, it's not predictable what will happen.
66 ;!addplugindir ".\Plugins"
68 !define MUI_ICON "..\..\image\ethereal.ico"
69 !define MUI_UNICON "..\..\image\ethereal.ico"
71 !define MUI_COMPONENTSPAGE_SMALLDESC
72 !define MUI_FINISHPAGE_NOAUTOCLOSE
73 !define MUI_UNFINISHPAGE_NOAUTOCLOSE
74 !define MUI_WELCOMEPAGE_TEXT "This wizard will guide you through the installation of Ethereal.\r\n\r\nBefore starting the installation, make sure Ethereal is not running.\r\n\r\nClick 'Next' to continue."
75 ;!define MUI_FINISHPAGE_LINK "Install WinPcap to be able to capture packets from a network!"
76 ;!define MUI_FINISHPAGE_LINK_LOCATION "http://www.winpcap.org"
78 ; NSIS shows Readme files by opening the Readme file with the default application for
79 ; the file's extension. "README.win32" won't work in most cases, because extension "win32"
80 ; is usually not associated with an appropriate text editor. We should use extension "txt"
81 ; for a text file or "html" for an html README file.
82 !define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\NEWS.txt"
83 !define MUI_FINISHPAGE_SHOWREADME_TEXT "Show News"
84 !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
85 !define MUI_FINISHPAGE_RUN "$INSTDIR\ethereal.exe"
86 !define MUI_FINISHPAGE_RUN_NOTCHECKED
90 !define MUI_PAGE_CUSTOMFUNCTION_SHOW myShowCallback
92 ; ============================================================================
94 ; ============================================================================
96 !insertmacro MUI_PAGE_WELCOME
97 !insertmacro MUI_PAGE_LICENSE "..\..\COPYING"
98 !insertmacro MUI_PAGE_COMPONENTS
99 Page custom DisplayAdditionalTasksPage
100 !insertmacro MUI_PAGE_DIRECTORY
101 Page custom DisplayWinPcapPage
102 !insertmacro MUI_PAGE_INSTFILES
103 !insertmacro MUI_PAGE_FINISH
105 !insertmacro MUI_UNPAGE_WELCOME
106 !insertmacro MUI_UNPAGE_CONFIRM
107 !insertmacro MUI_UNPAGE_COMPONENTS
108 !insertmacro MUI_UNPAGE_INSTFILES
109 !insertmacro MUI_UNPAGE_FINISH
111 ; ============================================================================
113 ; ============================================================================
115 !insertmacro MUI_LANGUAGE "English"
117 !endif ; MAKENSIS_MODERN_UI
119 ; ============================================================================
121 ; ============================================================================
123 ;Things that need to be extracted on first (keep these lines before any File command!)
124 ;Only useful for BZIP2 compression
126 ReserveFile "AdditionalTasksPage.ini"
127 ReserveFile "WinPcapPage.ini"
128 !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
130 ; ============================================================================
132 ; ============================================================================
133 !include "Sections.nsh"
135 ; ========= Macro to unselect and disable a section =========
137 !macro DisableSection SECTION
140 SectionGetFlags "${SECTION}" $0
141 IntOp $0 $0 & ${SECTION_OFF}
142 IntOp $0 $0 | ${SF_RO}
143 SectionSetFlags "${SECTION}" $0
148 ; ========= Macro to enable (unreadonly) a section =========
149 !define SECTION_ENABLE 0xFFFFFFEF
150 !macro EnableSection SECTION
153 SectionGetFlags "${SECTION}" $0
154 IntOp $0 $0 & ${SECTION_ENABLE}
155 SectionSetFlags "${SECTION}" $0
160 ; ============================================================================
162 ; ============================================================================
163 !include "servicelib.nsh"
165 ; ============================================================================
167 ; ============================================================================
168 !include "FileFunc.nsh"
170 !insertmacro GetParameters
171 !insertmacro GetOptions
173 ; ============================================================================
174 ; License page configuration
175 ; ============================================================================
176 LicenseText "Ethereal is distributed under the GNU General Public License."
177 LicenseData "..\..\COPYING"
179 ; ============================================================================
180 ; Component page configuration
181 ; ============================================================================
182 ComponentText "The following components are available for installation."
184 ; Component check boxes
185 ; Commented out for NSIS v 2.0
186 ; EnabledBitmap "..\..\image\nsis-checked.bmp"
187 ; DisabledBitmap "..\..\image\nsis-unchecked.bmp"
189 ; ============================================================================
190 ; Directory selection page configuration
191 ; ============================================================================
192 ; The text to prompt the user to enter a directory
193 DirText "Choose a directory in which to install Ethereal."
195 ; The default installation directory
196 InstallDir $PROGRAMFILES\Ethereal\
198 ; See if this is an upgrade; if so, use the old InstallDir as default
199 InstallDirRegKey HKEY_LOCAL_MACHINE SOFTWARE\Ethereal "InstallDir"
202 ; ============================================================================
203 ; Install page configuration
204 ; ============================================================================
206 ShowUninstDetails show
208 ; ============================================================================
209 ; Functions and macros
210 ; ============================================================================
216 !define UPDATEICONS_UNIQUE ${__LINE__}
218 IfFileExists "$SYSDIR\shell32.dll" UpdateIcons.next1_${UPDATEICONS_UNIQUE} UpdateIcons.error1_${UPDATEICONS_UNIQUE}
219 UpdateIcons.next1_${UPDATEICONS_UNIQUE}:
220 GetDllVersion "$SYSDIR\shell32.dll" $R0 $R1
221 IntOp $R2 $R0 / 0x00010000
222 IntCmp $R2 4 UpdateIcons.next2_${UPDATEICONS_UNIQUE} UpdateIcons.error2_${UPDATEICONS_UNIQUE}
223 UpdateIcons.next2_${UPDATEICONS_UNIQUE}:
224 System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (${SHCNE_ASSOCCHANGED}, ${SHCNF_IDLIST}, 0, 0)'
225 Goto UpdateIcons.quit_${UPDATEICONS_UNIQUE}
227 UpdateIcons.error1_${UPDATEICONS_UNIQUE}:
228 MessageBox MB_OK|MB_ICONSTOP "Can't find 'shell32.dll' library. Impossible to update icons"
229 Goto UpdateIcons.quit_${UPDATEICONS_UNIQUE}
230 UpdateIcons.error2_${UPDATEICONS_UNIQUE}:
231 MessageBox MB_OK|MB_ICONINFORMATION "You should install the free 'Microsoft Layer for Unicode' to update Ethereal capture file icons"
232 Goto UpdateIcons.quit_${UPDATEICONS_UNIQUE}
233 UpdateIcons.quit_${UPDATEICONS_UNIQUE}:
234 !undef UPDATEICONS_UNIQUE
242 ; $R0 should contain the prefix to associate to Ethereal
245 ReadRegStr $R1 HKCR $R0 ""
246 StrCmp $R1 "" Associate.doRegister
248 Associate.doRegister:
249 ;The extension is not associated to any program, we can do the link
250 WriteRegStr HKCR $R0 "" ${ETHEREAL_ASSOC}
256 ; $R0 should contain the prefix to unlink
259 ReadRegStr $R1 HKCR $R0 ""
260 StrCmp $R1 ${ETHEREAL_ASSOC} un.unlink.doUnlink
263 ; The extension is associated with Ethereal so, we must destroy this!
264 DeleteRegKey HKCR $R0
270 ;Extract InstallOptions INI files
271 !insertmacro MUI_INSTALLOPTIONS_EXTRACT "AdditionalTasksPage.ini"
272 !insertmacro MUI_INSTALLOPTIONS_EXTRACT "WinpcapPage.ini"
275 Function DisplayAdditionalTasksPage
276 !insertmacro MUI_HEADER_TEXT "Select Additional Tasks" "Which additional tasks should be done?"
277 !insertmacro MUI_INSTALLOPTIONS_DISPLAY "AdditionalTasksPage.ini"
280 Function DisplayWinPcapPage
281 !insertmacro MUI_HEADER_TEXT "Install WinPcap?" "WinPcap is required to capture live network data. Should WinPcap be installed?"
282 !insertmacro MUI_INSTALLOPTIONS_DISPLAY "WinPcapPage.ini"
285 ; ============================================================================
286 ; Installation execution commands
287 ; ============================================================================
289 Var WINPCAP_UNINSTALL ;declare variable for holding the value of a registry key
290 ;Var ETHEREAL_UNINSTALL ;declare variable for holding the value of a registry key
293 ;-------------------------------------------
296 ; Install for every user
298 !ifdef GTK1_DIR & GTK2_DIR
301 SetShellVarContext all
306 File "..\..\wiretap\wiretap-${WTAP_VERSION}.dll"
307 !ifdef ENABLE_LIBETHEREAL
308 File "..\..\epan\libethereal.dll"
310 File "${GLIB_DIR}\bin\libglib-2.0-0.dll"
311 File "${GLIB_DIR}\bin\libgmodule-2.0-0.dll"
312 File "${GLIB_DIR}\bin\libgobject-2.0-0.dll"
313 File "${ICONV_DIR}\bin\iconv.dll"
314 File "${GETTEXT_DIR}\bin\intl.dll"
316 File "${ZLIB_DIR}\zlib1.dll"
319 File "${ADNS_DIR}\adns_win32\LIB\adns_dll.dll"
322 File "${PCRE_DIR}\bin\pcre.dll"
323 File "${PCRE_DIR}\man\cat3\pcrepattern.3.txt"
327 File "..\..\README.win32"
328 File "..\..\AUTHORS-SHORT"
329 File "..\..\AUTHORS-SHORT-FORMAT"
333 File "..\..\doc\ethereal.html"
334 File "..\..\doc\ethereal-filter.html"
335 File "..\..\dumpcap.exe"
336 File "..\..\doc\dumpcap.html"
338 ; global config files - don't overwrite if already existing
339 ;IfFileExists cfilters dont_overwrite_cfilters
340 File "..\..\cfilters"
341 ;dont_overwrite_cfilters:
342 ;IfFileExists colorfilters dont_overwrite_colorfilters
343 File "..\..\colorfilters"
344 ;dont_overwrite_colorfilters:
345 ;IfFileExists dfilters dont_overwrite_dfilters
346 File "..\..\dfilters"
347 ;dont_overwrite_dfilters:
351 ; Install the Diameter DTD and XML files in the "diameter" subdirectory
352 ; of the installation directory.
354 SetOutPath $INSTDIR\diameter
355 File "..\..\diameter\chargecontrol.xml"
356 File "..\..\diameter\dictionary.dtd"
357 File "..\..\diameter\dictionary.xml"
358 File "..\..\diameter\imscxdx.xml"
359 File "..\..\diameter\mobileipv4.xml"
360 File "..\..\diameter\nasreq.xml"
361 File "..\..\diameter\sunping.xml"
362 File "..\..\diameter\TGPPSh.xml"
368 ; Install the RADIUS directory files in the "radius" subdirectory
369 ; of the installation directory.
371 SetOutPath $INSTDIR\radius
372 File "..\..\radius\dictionary"
373 File "..\..\radius\dictionary.3com"
374 File "..\..\radius\dictionary.3gpp"
375 File "..\..\radius\dictionary.3gpp2"
376 File "..\..\radius\dictionary.acc"
377 File "..\..\radius\dictionary.alcatel"
378 File "..\..\radius\dictionary.alteon"
379 File "..\..\radius\dictionary.altiga"
380 File "..\..\radius\dictionary.aptis"
381 File "..\..\radius\dictionary.ascend"
382 File "..\..\radius\dictionary.bay"
383 File "..\..\radius\dictionary.bintec"
384 File "..\..\radius\dictionary.bristol"
385 File "..\..\radius\dictionary.cablelabs"
386 File "..\..\radius\dictionary.cabletron"
387 File "..\..\radius\dictionary.cisco"
388 File "..\..\radius\dictionary.cisco.bbsm"
389 File "..\..\radius\dictionary.cisco.vpn3000"
390 File "..\..\radius\dictionary.cisco.vpn5000"
391 File "..\..\radius\dictionary.colubris"
392 File "..\..\radius\dictionary.columbia_university"
393 File "..\..\radius\dictionary.compat"
394 File "..\..\radius\dictionary.cosine"
395 File "..\..\radius\dictionary.ericsson"
396 File "..\..\radius\dictionary.erx"
397 File "..\..\radius\dictionary.extreme"
398 File "..\..\radius\dictionary.foundry"
399 File "..\..\radius\dictionary.freeradius"
400 File "..\..\radius\dictionary.gandalf"
401 File "..\..\radius\dictionary.garderos"
402 File "..\..\radius\dictionary.gemtek"
403 File "..\..\radius\dictionary.itk"
404 File "..\..\radius\dictionary.juniper"
405 File "..\..\radius\dictionary.karlnet"
406 File "..\..\radius\dictionary.livingston"
407 File "..\..\radius\dictionary.localweb"
408 File "..\..\radius\dictionary.merit"
409 File "..\..\radius\dictionary.microsoft"
410 File "..\..\radius\dictionary.mikrotik"
411 File "..\..\radius\dictionary.navini"
412 File "..\..\radius\dictionary.netscreen"
413 File "..\..\radius\dictionary.nokia"
414 File "..\..\radius\dictionary.nomadix"
415 File "..\..\radius\dictionary.propel"
416 File "..\..\radius\dictionary.quintum"
417 File "..\..\radius\dictionary.redback"
418 File "..\..\radius\dictionary.redcreek"
419 File "..\..\radius\dictionary.shasta"
420 File "..\..\radius\dictionary.shiva"
421 File "..\..\radius\dictionary.sonicwall"
422 File "..\..\radius\dictionary.springtide"
423 File "..\..\radius\dictionary.t_systems_nova"
424 File "..\..\radius\dictionary.telebit"
425 File "..\..\radius\dictionary.trapeze"
426 File "..\..\radius\dictionary.tunnel"
427 File "..\..\radius\dictionary.unisphere"
428 File "..\..\radius\dictionary.unix"
429 File "..\..\radius\dictionary.usr"
430 File "..\..\radius\dictionary.valemount"
431 File "..\..\radius\dictionary.versanet"
432 File "..\..\radius\dictionary.wispr"
433 File "..\..\radius\dictionary.xedia"
437 ; install the dtds in the dtds subdirectory
439 SetOutPath $INSTDIR\dtds
440 File "..\..\dtds\dc.dtd"
441 File "..\..\dtds\itunes.dtd"
442 File "..\..\dtds\rss.dtd"
443 File "..\..\dtds\smil.dtd"
446 SetOutPath $INSTDIR\help
447 File "..\..\help\toc"
448 File "..\..\help\overview.txt"
449 File "..\..\help\getting_started.txt"
450 File "..\..\help\capturing.txt"
451 File "..\..\help\capture_filters.txt"
452 File "..\..\help\display_filters.txt"
453 File "..\..\help\faq.txt"
455 ; Write the uninstall keys for Windows
456 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Ethereal" "DisplayVersion" "${VERSION}"
457 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Ethereal" "DisplayName" "Ethereal ${VERSION}"
458 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Ethereal" "UninstallString" '"$INSTDIR\uninstall.exe"'
459 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Ethereal" "Publisher" "The Ethereal developer community, http://www.ethereal.com"
460 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Ethereal" "HelpLink" "mailto:ethereal-users@ethereal.com"
461 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Ethereal" "URLInfoAbout" "http://www.ethereal.com"
462 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Ethereal" "URLUpdateInfo" "http://www.ethereal.com/distribution/win32/"
463 WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Ethereal" "NoModify" 1
464 WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Ethereal" "NoRepair" 1
465 WriteUninstaller "uninstall.exe"
467 ; Write an entry for ShellExecute
468 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\ethereal.exe" "" '$INSTDIR\ethereal.exe'
469 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\ethereal.exe" "Path" '$INSTDIR'
471 ; Create start menu entries (depending on additional tasks page)
472 ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 2" "State"
473 StrCmp $0 "0" SecRequired_skip_StartMenu
475 CreateDirectory "$SMPROGRAMS\Ethereal"
476 ; To qoute "http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwue/html/ch11d.asp":
477 ; "Do not include Readme, Help, or Uninstall entries on the Programs menu."
478 Delete "$SMPROGRAMS\Ethereal\Ethereal Web Site.lnk"
479 ;WriteINIStr "$SMPROGRAMS\Ethereal\Ethereal Web Site.url" "InternetShortcut" "URL" "http://www.ethereal.com/"
480 CreateShortCut "$SMPROGRAMS\Ethereal\Ethereal.lnk" "$INSTDIR\ethereal.exe" "" "$INSTDIR\ethereal.exe" 0 "" "" "The Ethereal Network Protocol Analyzer"
481 ;CreateShortCut "$SMPROGRAMS\Ethereal\Ethereal Manual.lnk" "$INSTDIR\ethereal.html"
482 ;CreateShortCut "$SMPROGRAMS\Ethereal\Display Filters Manual.lnk" "$INSTDIR\ethereal-filter.html"
483 CreateShortCut "$SMPROGRAMS\Ethereal\Ethereal Program Directory.lnk" \
485 ;CreateShortCut "$SMPROGRAMS\Ethereal\Uninstall Ethereal.lnk" "$INSTDIR\uninstall.exe"
486 SecRequired_skip_StartMenu:
488 ; is command line option "/desktopicon" set?
490 ${GetOptions} $R0 "/desktopicon=" $R1
491 StrCmp $R1 "no" SecRequired_skip_DesktopIcon
492 StrCmp $R1 "yes" SecRequired_install_DesktopIcon
494 ; Create desktop icon (depending on additional tasks page and command line option)
495 ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 3" "State"
496 StrCmp $0 "0" SecRequired_skip_DesktopIcon
497 SecRequired_install_DesktopIcon:
498 CreateShortCut "$DESKTOP\Ethereal.lnk" "$INSTDIR\ethereal.exe" "" "$INSTDIR\ethereal.exe" 0 "" "" "The Ethereal Network Protocol Analyzer"
499 SecRequired_skip_DesktopIcon:
501 ; is command line option "/quicklaunchicon" set?
503 ${GetOptions} $R0 "/quicklaunchicon=" $R1
504 StrCmp $R1 "no" SecRequired_skip_QuickLaunchIcon
505 StrCmp $R1 "yes" SecRequired_install_QuickLaunchIcon
507 ; Create quick launch icon (depending on additional tasks page and command line option)
508 ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 4" "State"
509 StrCmp $0 "0" SecRequired_skip_QuickLaunchIcon
510 SecRequired_install_QuickLaunchIcon:
511 CreateShortCut "$QUICKLAUNCH\Ethereal.lnk" "$INSTDIR\ethereal.exe" "" "$INSTDIR\ethereal.exe" 0 "" "" "The Ethereal Network Protocol Analyzer"
512 SecRequired_skip_QuickLaunchIcon:
514 ; Create File Extensions (depending on additional tasks page)
515 ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 6" "State"
516 StrCmp $0 "0" SecRequired_skip_FileExtensions
517 WriteRegStr HKCR ${ETHEREAL_ASSOC} "" "Ethereal file"
518 WriteRegStr HKCR "${ETHEREAL_ASSOC}\Shell\open\command" "" '"$INSTDIR\ethereal.exe" "%1"'
519 WriteRegStr HKCR "${ETHEREAL_ASSOC}\DefaultIcon" "" '"$INSTDIR\ethereal.exe",0'
559 ; if somethings added here, add it also to the uninstall section and the AdditionalTask page
561 !insertmacro UpdateIcons
562 SecRequired_skip_FileExtensions:
564 ; if running as a silent installer, don't try to install winpcap
565 IfSilent SecRequired_skip_Winpcap
567 ; Install WinPcap (depending on winpcap page setting)
568 ReadINIStr $0 "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "State"
569 StrCmp $0 "0" SecRequired_skip_Winpcap
570 ; Uinstall old WinPcap first
571 ReadRegStr $WINPCAP_UNINSTALL HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinPcapInst" "UninstallString"
572 IfErrors lbl_winpcap_notinstalled ;if RegKey is unavailable, WinPcap is not installed
573 ; from released version 3.1, WinPcap will uninstall an old version by itself
574 ;ExecWait '$WINPCAP_UNINSTALL' $0
575 ;DetailPrint "WinPcap uninstaller returned $0"
576 lbl_winpcap_notinstalled:
578 File "WinPcap_3_1.exe"
579 ExecWait '"$INSTDIR\WinPcap_3_1.exe"' $0
580 DetailPrint "WinPcap installer returned $0"
581 SecRequired_skip_Winpcap:
583 ; Load Winpcap NPF service at startup (depending on winpcap page)
584 ReadINIStr $0 "$PLUGINSDIR\WinPcapPage.ini" "Field 8" "State"
585 StrCmp $0 "0" SecRequired_no_WinpcapService
586 WriteRegDWORD HKEY_LOCAL_MACHINE "SYSTEM\CurrentControlSet\Services\NPF" "Start" 2 ;set NPF to (SERVICE_AUTO_START)
587 !insertmacro SERVICE "start" "NPF" ""
588 Goto SecRequired_done_WinpcapService
589 SecRequired_no_WinpcapService:
590 WriteRegDWORD HKEY_LOCAL_MACHINE "SYSTEM\CurrentControlSet\Services\NPF" "Start" 3 ;set NPF to (SERVICE_DEMAND_START)
591 !insertmacro SERVICE "stop" "NPF" ""
592 SecRequired_done_WinpcapService:
594 SectionEnd ; "Required"
597 SectionGroup "!Ethereal" SecEtherealGroup
600 Section "Ethereal GTK1" SecEtherealGTK1
601 ;-------------------------------------------
602 !ifdef GTK1_DIR & GTK2_DIR
606 File "..\..\ethereal.exe"
607 File "${GTK1_DIR}\lib\libgtk-0.dll"
608 File "${GTK1_DIR}\lib\libgdk-0.dll"
613 Section "Ethereal GTK2" SecEtherealGTK2
614 ;-------------------------------------------
615 !ifdef GTK1_DIR & GTK2_DIR
619 File /oname=ethereal.exe "..\..\ethereal-gtk2.exe"
620 File "${GTK2_DIR}\bin\libgdk-win32-2.0-0.dll"
621 File "${GTK2_DIR}\bin\libgdk_pixbuf-2.0-0.dll"
622 File "${GTK2_DIR}\bin\libgtk-win32-2.0-0.dll"
623 File "${GTK2_DIR}\bin\libatk-1.0-0.dll"
624 File "${GTK2_DIR}\bin\libpango-1.0-0.dll"
625 File "${GTK2_DIR}\bin\libpangowin32-1.0-0.dll"
626 !ifdef NEED_CAIRO_DLL
627 File "${GTK2_DIR}\bin\libcairo-2.dll"
628 File "${GTK2_DIR}\bin\libpangocairo-1.0-0.dll"
630 !ifdef NEED_LIBPNG_DLL
631 File "${GTK2_DIR}\bin\libpng13.dll"
633 SetOutPath $INSTDIR\etc\gtk-2.0
634 File "${GTK2_DIR}\etc\gtk-2.0\*.*"
635 SetOutPath $INSTDIR\etc\pango
636 File "${GTK2_DIR}\etc\pango\pango.*"
637 SetOutPath $INSTDIR\lib\gtk-2.0\${GTK2_LIB_DIR}\loaders
638 File "${GTK2_DIR}\lib\gtk-2.0\${GTK2_LIB_DIR}\loaders\libpixbufloader-*.dll"
639 SetOutPath $INSTDIR\lib\gtk-2.0\${GTK2_LIB_DIR}\immodules
640 File "${GTK2_DIR}\lib\gtk-2.0\${GTK2_LIB_DIR}\immodules\im-*.dll"
641 SetOutPath $INSTDIR\lib\pango\${PANGO_LIB_DIR}\modules
642 File "${GTK2_DIR}\lib\pango\${PANGO_LIB_DIR}\modules\pango-*.dll"
646 Section "GTK-Wimp" SecGTKWimp
647 ;-------------------------------------------
649 SetOutPath $INSTDIR\lib\gtk-2.0\${GTK2_LIB_DIR}\engines
650 File "${GTK_WIMP_DIR}\libwimp.dll"
651 ; GTK+ 2.8 looks for themes in "etc". We should really pick one
652 ; directory and install there.
653 SetOutPath $INSTDIR\share\themes\Default\gtk-2.0
654 File "${GTK_THEME_DIR}\gtkrc"
655 SetOutPath $INSTDIR\etc\gtk-2.0
656 File "${GTK_THEME_DIR}\gtkrc"
661 SectionGroupEnd ; "Ethereal"
664 Section "Tethereal" SecTethereal
665 ;-------------------------------------------
666 !ifdef GTK1_DIR & GTK2_DIR
670 File "..\..\tethereal.exe"
671 File "..\..\doc\tethereal.html"
674 SectionGroup "Plugins / Extensions" SecPluginsGroup
676 Section "Dissector Plugins" SecPlugins
677 ;-------------------------------------------
678 !ifdef GTK1_DIR & GTK2_DIR
681 SetOutPath $INSTDIR\plugins\${VERSION}
682 File "..\..\plugins\acn\acn.dll"
683 File "..\..\plugins\agentx\agentx.dll"
684 File "..\..\plugins\artnet\artnet.dll"
685 File "..\..\plugins\asn1\asn1.dll"
686 File "..\..\plugins\ciscosm\ciscosm.dll"
687 File "..\..\plugins\docsis\docsis.dll"
688 File "..\..\plugins\enttec\enttec.dll"
689 File "..\..\plugins\giop\coseventcomm.dll"
690 File "..\..\plugins\giop\cosnaming.dll"
691 File "..\..\plugins\giop\parlay.dll"
692 File "..\..\plugins\giop\tango.dll"
693 File "..\..\plugins\gryphon\gryphon.dll"
694 File "..\..\plugins\h223\h223.dll"
695 File "..\..\plugins\irda\irda.dll"
696 File "..\..\plugins\lwres\lwres.dll"
697 File "..\..\plugins\megaco\megaco.dll"
698 File "..\..\plugins\mgcp\mgcp.dll"
699 File "..\..\plugins\opsi\opsi.dll"
700 File "..\..\plugins\pcli\pcli.dll"
701 File "..\..\plugins\profinet\profinet.dll"
702 File "..\..\plugins\rdm\rdm.dll"
703 File "..\..\plugins\rlm\rlm.dll"
704 File "..\..\plugins\rtnet\rtnet.dll"
705 File "..\..\plugins\rudp\rudp.dll"
706 File "..\..\plugins\v5ua\v5ua.dll"
709 Section "Tree Statistics Plugin" SecStatsTree
710 ;-------------------------------------------
711 !ifdef GTK1_DIR & GTK2_DIR
714 SetOutPath $INSTDIR\plugins\${VERSION}
715 File "..\..\plugins\stats_tree\stats_tree.dll"
718 Section "Mate - Meta Analysis and Tracing Engine" SecMate
719 ;-------------------------------------------
720 SetOutPath $INSTDIR\plugins\${VERSION}
721 File "..\..\plugins\mate\mate.dll"
725 Section "LUA Plugin" SecLua
726 ;-------------------------------------------
727 SetOutPath $INSTDIR\plugins\${VERSION}
728 File "..\..\plugins\lua\lua.dll"
732 Section "SNMP MIBs" SecMIBs
733 ;-------------------------------------------
734 !ifdef GTK1_DIR & GTK2_DIR
737 SetOutPath $INSTDIR\snmp\mibs
738 File "${NET_SNMP_DIR}\mibs\*.txt"
741 SectionGroupEnd ; "Plugins / Extensions"
744 SectionGroup "Tools" SecToolsGroup
746 Section "Editcap" SecEditcap
747 ;-------------------------------------------
748 !ifdef GTK1_DIR & GTK2_DIR
752 File "..\..\editcap.exe"
753 File "..\..\doc\editcap.html"
756 Section "Text2Pcap" SecText2Pcap
757 ;-------------------------------------------
758 !ifdef GTK1_DIR & GTK2_DIR
762 File "..\..\text2pcap.exe"
763 File "..\..\doc\text2pcap.html"
766 Section "Mergecap" SecMergecap
767 ;-------------------------------------------
768 !ifdef GTK1_DIR & GTK2_DIR
772 File "..\..\mergecap.exe"
773 File "..\..\doc\mergecap.html"
776 Section "Capinfos" SecCapinfos
777 ;-------------------------------------------
778 !ifdef GTK1_DIR & GTK2_DIR
782 File "..\..\capinfos.exe"
783 File "..\..\doc\capinfos.html"
786 SectionGroupEnd ; "Tools"
789 Section "Uninstall" un.SecUinstall
790 ;-------------------------------------------
793 ; UnInstall for every user
796 SetShellVarContext all
798 Delete "$INSTDIR\tethereal.exe"
799 IfErrors 0 NoTetherealErrorMsg
800 MessageBox MB_OK "Please note: tethereal.exe could not be removed, it's probably in use!" IDOK 0 ;skipped if tethereal.exe removed
801 Abort "Please note: tethereal.exe could not be removed, it's probably in use! Abort uninstall process!"
804 Delete "$INSTDIR\ethereal.exe"
805 IfErrors 0 NoEtherealErrorMsg
806 MessageBox MB_OK "Please note: ethereal.exe could not be removed, it's probably in use!" IDOK 0 ;skipped if ethereal.exe removed
807 Abort "Please note: ethereal.exe could not be removed, it's probably in use! Abort uninstall process!"
810 DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Ethereal"
811 DeleteRegKey HKEY_LOCAL_MACHINE "Software\Ethereal"
812 DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\ethereal.exe"
855 DeleteRegKey HKCR ${ETHEREAL_ASSOC}
856 DeleteRegKey HKCR "${ETHEREAL_ASSOC}\Shell\open\command"
857 DeleteRegKey HKCR "${ETHEREAL_ASSOC}\DefaultIcon"
858 !insertmacro UpdateIcons
860 ; regardless if we currently installed GTK1 or 2, try to uninstall GTK2 files too
861 Delete "$INSTDIR\etc\gtk-2.0\*.*"
862 Delete "$INSTDIR\etc\pango\*.*"
863 Delete "$INSTDIR\lib\gtk-2.0\2.2.0\engines\*.*"
864 Delete "$INSTDIR\lib\gtk-2.0\2.2.0\loaders\*.*"
865 Delete "$INSTDIR\lib\gtk-2.0\2.2.0\immodules\*.*"
866 Delete "$INSTDIR\lib\gtk-2.0\2.4.0\engines\*.*"
867 Delete "$INSTDIR\lib\gtk-2.0\2.4.0\loaders\*.*"
868 Delete "$INSTDIR\lib\gtk-2.0\2.4.0\immodules\*.*"
869 Delete "$INSTDIR\lib\pango\1.2.0\modules\*.*"
870 Delete "$INSTDIR\lib\pango\1.4.0\modules\*.*"
871 Delete "$INSTDIR\share\themes\Default\gtk-2.0\*.*"
872 Delete "$INSTDIR\help\*.*"
873 Delete "$INSTDIR\diameter\*.*"
874 Delete "$INSTDIR\snmp\mibs\*.*"
875 Delete "$INSTDIR\snmp\*.*"
876 Delete "$INSTDIR\*.exe"
877 Delete "$INSTDIR\*.dll"
878 Delete "$INSTDIR\*.html"
879 Delete "$INSTDIR\COPYING"
880 Delete "$INSTDIR\AUTHORS-SHORT"
881 Delete "$INSTDIR\AUTHORS-SHORT-FORMAT"
882 Delete "$INSTDIR\README*"
883 Delete "$INSTDIR\FAQ"
884 Delete "$INSTDIR\NEWS.txt"
885 Delete "$INSTDIR\manuf"
886 Delete "$INSTDIR\pcrepattern.3.txt"
887 Delete "$INSTDIR\radius\*.*"
888 Delete "$INSTDIR\dtds\*.*"
889 Delete "$SMPROGRAMS\Ethereal\*.*"
890 Delete "$DESKTOP\Ethereal.lnk"
891 Delete "$QUICKLAUNCH\Ethereal.lnk"
893 RMDir "$INSTDIR\etc\gtk-2.0"
894 RMDir "$INSTDIR\etc\pango"
896 RMDir "$INSTDIR\lib\gtk-2.0\2.2.0\engines"
897 RMDir "$INSTDIR\lib\gtk-2.0\2.2.0\loaders"
898 RMDir "$INSTDIR\lib\gtk-2.0\2.2.0\immodules"
899 RMDir "$INSTDIR\lib\gtk-2.0\2.2.0"
900 RMDir "$INSTDIR\lib\gtk-2.0\2.4.0\engines"
901 RMDir "$INSTDIR\lib\gtk-2.0\2.4.0\loaders"
902 RMDir "$INSTDIR\lib\gtk-2.0\2.4.0\immodules"
903 RMDir "$INSTDIR\lib\gtk-2.0\2.4.0"
904 RMDir "$INSTDIR\lib\gtk-2.0"
905 RMDir "$INSTDIR\lib\pango\1.2.0\modules"
906 RMDir "$INSTDIR\lib\pango\1.2.0"
907 RMDir "$INSTDIR\lib\pango\1.4.0\modules"
908 RMDir "$INSTDIR\lib\pango\1.4.0"
909 RMDir "$INSTDIR\lib\pango"
911 RMDir "$INSTDIR\share\themes\Default\gtk-2.0"
912 RMDir "$INSTDIR\share\themes\Default"
913 RMDir "$INSTDIR\share\themes"
914 RMDir "$INSTDIR\share"
915 RMDir "$SMPROGRAMS\Ethereal"
916 RMDir "$INSTDIR\help"
917 RMDir "$INSTDIR\diameter"
918 RMDir "$INSTDIR\snmp\mibs"
919 RMDir "$INSTDIR\snmp"
920 RMDir "$INSTDIR\radius"
921 RMDir "$INSTDIR\dtds"
924 SectionEnd ; "Uinstall"
926 Section "Un.Plugins" un.SecPlugins
927 ;-------------------------------------------
929 ;Delete "$INSTDIR\plugins\${VERSION}\*.*"
930 ;Delete "$INSTDIR\plugins\*.*"
931 ;RMDir "$INSTDIR\plugins\${VERSION}"
932 ;RMDir "$INSTDIR\plugins"
933 RMDir /r "$INSTDIR\plugins"
936 Section "Un.Global Settings" un.SecGlobalSettings
937 ;-------------------------------------------
939 Delete "$INSTDIR\cfilters"
940 Delete "$INSTDIR\colorfilters"
941 Delete "$INSTDIR\dfilters"
945 Section /o "Un.Personal Settings" un.SecPersonalSettings
946 ;-------------------------------------------
948 SetShellVarContext current
949 Delete "$APPDATA\Ethereal\*.*"
950 RMDir "$APPDATA\Ethereal"
953 ;VAR un.WINPCAP_UNINSTALL
955 Section /o "Un.WinPcap" un.SecWinPcap
956 ;-------------------------------------------
958 ReadRegStr $1 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinPcapInst" "UninstallString"
959 ;IfErrors un.lbl_winpcap_notinstalled ;if RegKey is unavailable, WinPcap is not installed
960 ;MessageBox MB_OK "WinPcap $1"
962 DetailPrint "WinPcap uninstaller returned $0"
964 ;un.lbl_winpcap_notinstalled:
967 Section "-Un.Finally"
968 ;-------------------------------------------
970 ; this test must be done after all other things uninstalled (e.g. Global Settings)
971 IfFileExists "$INSTDIR" 0 NoFinalErrorMsg
972 MessageBox MB_OK "Please note: The directory $INSTDIR could not be removed!" IDOK 0 ; skipped if dir doesn't exist
977 ; ============================================================================
978 ; PLEASE MAKE SURE, THAT THE DESCRIPTIVE TEXT FITS INTO THE DESCRIPTION FIELD!
979 ; ============================================================================
980 !ifdef MAKENSIS_MODERN_UI
981 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
982 !insertmacro MUI_DESCRIPTION_TEXT ${SecEtherealGroup} "${PROGRAM_NAME} is a GUI network protocol analyzer."
984 !insertmacro MUI_DESCRIPTION_TEXT ${SecEtherealGTK1} "${PROGRAM_NAME} using the classical GTK1 user interface."
987 !insertmacro MUI_DESCRIPTION_TEXT ${SecEtherealGTK2} "${PROGRAM_NAME} using the modern GTK2 user interface."
989 !insertmacro MUI_DESCRIPTION_TEXT ${SecGTKWimp} "GTK-Wimp is the GTK2 windows impersonator (native Win32 look and feel, for Win2000 and up)."
992 !insertmacro MUI_DESCRIPTION_TEXT ${SecTethereal} "Tethereal is a text based network protocol analyzer."
993 !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsGroup} "Some plugins and extensions for both Ethereal and Tethereal."
994 !insertmacro MUI_DESCRIPTION_TEXT ${SecPlugins} "Plugins with some extended dissections."
995 !insertmacro MUI_DESCRIPTION_TEXT ${SecStatsTree} "Plugin for some extended statistics."
996 !insertmacro MUI_DESCRIPTION_TEXT ${SecMate} "Plugin - Meta Analysis and Tracing Engine (Experimental)."
998 !insertmacro MUI_DESCRIPTION_TEXT ${SecLua} "Plugin - LUA (Experimental)."
1000 !insertmacro MUI_DESCRIPTION_TEXT ${SecMIBs} "SNMP MIBs for better SNMP dissection."
1001 !insertmacro MUI_DESCRIPTION_TEXT ${SecToolsGroup} "Additional command line based tools."
1002 !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."
1003 !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."
1004 !insertmacro MUI_DESCRIPTION_TEXT ${SecMergecap} "Mergecap is a program that combines multiple saved capture files into a single output file"
1005 !insertmacro MUI_DESCRIPTION_TEXT ${SecCapinfos} "Capinfos is a program that provides information on capture files."
1006 !insertmacro MUI_FUNCTION_DESCRIPTION_END
1008 !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
1009 !insertmacro MUI_DESCRIPTION_TEXT ${un.SecUinstall} "Uninstall all Ethereal components."
1010 !insertmacro MUI_DESCRIPTION_TEXT ${un.SecPlugins} "Uninstall all Plugins (even from previous Ethereal versions)."
1011 !insertmacro MUI_DESCRIPTION_TEXT ${un.SecGlobalSettings} "Uninstall global settings like: $INSTDIR\cfilters"
1012 !insertmacro MUI_DESCRIPTION_TEXT ${un.SecPersonalSettings} "Uninstall personal settings like your preferences file from your profile: $PROFILE."
1013 !insertmacro MUI_DESCRIPTION_TEXT ${un.SecWinPcap} "Call WinPcap's uninstall program."
1014 !insertmacro MUI_UNFUNCTION_DESCRIPTION_END
1016 !endif ; MAKENSIS_MODERN_UI
1018 ; ============================================================================
1019 ; Callback functions
1020 ; ============================================================================
1021 !ifdef GTK1_DIR & GTK2_DIR
1022 ;Disable GTK-Wimp for GTK1
1024 Function .onSelChange
1026 SectionGetFlags ${SecEtherealGTK1} $0
1028 IntCmp $0 1 onSelChange.disableGTK2Sections
1029 ;enable GTK2Sections
1030 !insertmacro EnableSection ${SecGTKWimp}
1031 Goto onSelChange.end
1032 onSelChange.disableGTK2Sections:
1033 !insertmacro DisableSection ${SecGTKWimp}
1034 Goto onSelChange.end
1040 !ifdef GTK1_DIR | GTK2_DIR
1041 ; Disable FileExtension if Ethereal isn't selected
1042 Function .onSelChange
1045 SectionGetFlags ${SecEtherealGTK1} $0
1047 IntCmp $0 0 onSelChange.unselect
1048 SectionGetFlags ${SecFileExtensions} $0
1050 IntCmp $0 16 onSelChange.unreadonly
1051 Goto onSelChange.end
1053 SectionGetFlags ${SecEtherealGTK2} $0
1055 IntCmp $0 0 onSelChange.unselect
1056 SectionGetFlags ${SecFileExtensions} $0
1058 IntCmp $0 16 onSelChange.unreadonly
1059 Goto onSelChange.end
1061 onSelChange.unselect:
1062 SectionGetFlags ${SecFileExtensions} $0
1063 IntOp $0 $0 & 0xFFFFFFFE
1065 SectionSetFlags ${SecFileExtensions} $0
1066 Goto onSelChange.end
1067 onSelChange.unreadonly:
1068 SectionGetFlags ${SecFileExtensions} $0
1069 IntOp $0 $0 & 0xFFFFFFEF
1070 SectionSetFlags ${SecFileExtensions} $0
1071 Goto onSelChange.end
1079 !include "GetWindowsVersion.nsh"
1080 !include WinMessages.nsh
1082 Var NPF_START ;declare variable for holding the value of a registry key
1083 Var WINPCAP_VERSION ;declare variable for holding the value of a registry key
1085 Function myShowCallback
1087 ; Uinstall old Ethereal first
1088 ; XXX - doesn't work, but kept here for further experiments
1089 ;ReadRegStr $ETHEREAL_UNINSTALL HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Ethereal" "UninstallString"
1090 ;IfErrors lbl_ethereal_notinstalled ;if RegKey is unavailable, WinPcap is not installed
1091 ;MessageBox MB_YESNO|MB_ICONQUESTION "Uninstall the old Ethereal version first (recommended)?"
1092 ; Hide the installer while uninstalling
1093 ;GetDlgItem $0 $HWNDPARENT 1
1094 ;FindWindow $0 "#32770" "" $HWNDPARENT
1095 ;MessageBox MB_OK "Window $0"
1096 ;ShowWindow $0 ${SW_HIDE}
1098 ;ExecWait '$ETHEREAL_UNINSTALL' $0
1099 ;DetailPrint "WinPcap uninstaller returned $0"
1100 ;GetDlgItem $0 $HWNDPARENT 1
1101 ;ShowWindow $0 ${SW_SHOW}
1102 ;MessageBox MB_OK "Uninstalled"
1103 ;lbl_ethereal_notinstalled:
1106 ; Get the Windows version
1107 Call GetWindowsVersion
1108 Pop $R0 ; Windows Version
1110 ; Enable GTK-Wimp only for Windows 2000/XP/2003
1111 ; ...as Win9x/ME/NT known to have problems with it!
1113 ;DetailPrint 'Windows Version: $R0'
1114 StrCmp $R0 '2000' lbl_select_wimp
1115 StrCmp $R0 'XP' lbl_select_wimp
1116 StrCmp $R0 '2003' lbl_select_wimp
1117 DetailPrint "Windows $R0 doesn't support GTK-Wimp!"
1119 Goto lbl_ignore_wimp
1121 !insertmacro SelectSection ${SecGTKWimp}
1127 ; detect if WinPcap should be installed
1128 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "Text" "Install WinPcap 3.1"
1129 ReadRegStr $WINPCAP_VERSION HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinPcapInst" "DisplayName"
1130 IfErrors 0 lbl_winpcap_installed ;if RegKey is available, WinPcap is already installed
1131 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 2" "Text" "WinPcap is currently not installed"
1132 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 2" "Flags" "DISABLED"
1133 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Text" "(Use Add/Remove Programs first to uninstall any undetected old WinPcap versions)"
1134 Goto lbl_winpcap_done
1136 lbl_winpcap_installed:
1137 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 2" "Text" "$WINPCAP_VERSION"
1138 ; WinPcap 2.x (including betas): the version string starts with "WinPcap 2."
1139 StrCpy $1 "$WINPCAP_VERSION" 10
1140 StrCmp $1 "WinPcap 2." lbl_winpcap_do_install
1141 ; WinPcap 3.0 (including betas): the version string starts with "WinPcap 3.0"
1142 StrCpy $1 "$WINPCAP_VERSION" 11
1143 StrCmp $1 "WinPcap 3.0" lbl_winpcap_do_install
1144 ; WinPcap 3.1 previous beta's; exact string match
1145 StrCmp "$WINPCAP_VERSION" "WinPcap 3.1 beta" lbl_winpcap_do_install
1146 StrCmp "$WINPCAP_VERSION" "WinPcap 3.1 beta2" lbl_winpcap_do_install
1147 StrCmp "$WINPCAP_VERSION" "WinPcap 3.1 beta3" lbl_winpcap_do_install
1148 StrCmp "$WINPCAP_VERSION" "WinPcap 3.1 beta4" lbl_winpcap_do_install
1150 ;lbl_winpcap_dont_install:
1151 ; seems to be the current or even a newer version, so don't install
1152 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "State" "0"
1153 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Text" "If selected, the currently installed $WINPCAP_VERSION will be uninstalled first."
1154 Goto lbl_winpcap_done
1156 lbl_winpcap_do_install:
1157 ; seems to be an old version, install newer one
1158 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "State" "1"
1159 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Text" "The currently installed $WINPCAP_VERSION will be uninstalled first."
1163 ; Disable NPF service setting for Win OT
1164 StrCmp $R0 '95' lbl_npf_disable
1165 StrCmp $R0 '98' lbl_npf_disable
1166 StrCmp $R0 'ME' lbl_npf_disable
1167 ReadRegDWORD $NPF_START HKEY_LOCAL_MACHINE "SYSTEM\CurrentControlSet\Services\NPF" "Start"
1168 ; (Winpcap may not be installed already, so no regKey is no error here)
1169 IfErrors lbl_npf_done ;RegKey not available, so do not set it
1170 IntCmp $NPF_START 2 0 lbl_npf_done lbl_npf_done
1171 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 8" "State" "1"
1175 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 8" "State" "0"
1176 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 8" "Flags" "DISABLED"
1177 WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 9" "Flags" "DISABLED"
1181 ; if Ethereal was previously installed, unselect previously not installed icons etc.
1182 ; detect if Ethereal is already installed ->
1183 ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Ethereal" "UninstallString"
1184 IfErrors lbl_ethereal_notinstalled ;if RegKey is unavailable, Ethereal is not installed
1186 ; only select Start Menu Group, if previously installed
1187 ; (we use the "all users" start menu, so select it first)
1188 SetShellVarContext all
1189 IfFileExists "$SMPROGRAMS\Ethereal\Ethereal.lnk" lbl_have_startmenu
1190 WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 2" "State" "0"
1193 ; only select Desktop Icon, if previously installed
1194 IfFileExists "$DESKTOP\Ethereal.lnk" lbl_have_desktopicon
1195 WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 3" "State" "0"
1196 lbl_have_desktopicon:
1198 ; only select Quick Launch Icon, if previously installed
1199 IfFileExists "$QUICKLAUNCH\Ethereal.lnk" lbl_have_quicklaunchicon
1200 WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 4" "State" "0"
1201 lbl_have_quicklaunchicon:
1203 lbl_ethereal_notinstalled: