Incorporate plugin dissector into build in collection.
[metze/wireshark/wip.git] / packaging / nsis / wireshark.nsi
1 ;
2 ; wireshark.nsi
3 ;
4 ; $Id$
5
6
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
13
14 InstType "un.Default (keep Personal Settings and WinPcap)"
15 InstType "un.All (remove all)"
16
17 ; Used to refresh the display of file association
18 !define SHCNE_ASSOCCHANGED 0x08000000
19 !define SHCNF_IDLIST 0
20
21 ; Used to add associations between file extensions and Wireshark
22 !define WIRESHARK_ASSOC "wireshark-capture-file"
23
24 ; ============================================================================
25 ; Header configuration
26 ; ============================================================================
27 ; The name of the installer
28 !define PROGRAM_NAME "Wireshark"
29 !if ${PLATFORM} == "win32"
30 !define BITS 32
31 !else
32 !define BITS 64
33 !endif
34
35 Name "${PROGRAM_NAME} ${VERSION} (${BITS}-bit)"
36
37 ; The file to write
38 OutFile "wireshark-${PLATFORM}-${VERSION}.exe"
39
40 ; Icon of installer and uninstaller
41 Icon "..\..\image\wiresharkinst.ico"
42 UninstallIcon "..\..\image\wiresharkinst.ico"
43
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."
48
49 XPStyle on
50
51
52
53 ; ============================================================================
54 ; Modern UI
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.
61
62 !include "MUI.nsh"
63 ;!addplugindir ".\Plugins"
64
65 !define MUI_ICON "..\..\image\wiresharkinst.ico"
66 !define MUI_UNICON "..\..\image\wiresharkinst.ico"
67
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"
74
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
84
85
86
87 !define MUI_PAGE_CUSTOMFUNCTION_SHOW myShowCallback
88
89 ; ============================================================================
90 ; MUI Pages
91 ; ============================================================================
92
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
101
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
107
108 ; ============================================================================
109 ; MUI Languages
110 ; ============================================================================
111
112 !insertmacro MUI_LANGUAGE "English"
113
114 ; ============================================================================
115 ; Reserve Files
116 ; ============================================================================
117
118   ;Things that need to be extracted on first (keep these lines before any File command!)
119   ;Only useful for BZIP2 compression
120
121   ReserveFile "AdditionalTasksPage.ini"
122   ReserveFile "WinPcapPage.ini"
123   !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
124
125 ; ============================================================================
126 ; Section macros
127 ; ============================================================================
128 !include "Sections.nsh"
129
130 ; ========= Macro to unselect and disable a section =========
131
132 !macro DisableSection SECTION
133
134   Push $0
135     SectionGetFlags "${SECTION}" $0
136     IntOp $0 $0 & ${SECTION_OFF}
137     IntOp $0 $0 | ${SF_RO}
138     SectionSetFlags "${SECTION}" $0
139   Pop $0
140
141 !macroend
142
143 ; ========= Macro to enable (unreadonly) a section =========
144 !define SECTION_ENABLE   0xFFFFFFEF
145 !macro EnableSection SECTION
146
147   Push $0
148     SectionGetFlags "${SECTION}" $0
149     IntOp $0 $0 & ${SECTION_ENABLE}
150     SectionSetFlags "${SECTION}" $0
151   Pop $0
152
153 !macroend
154
155 ; ============================================================================
156 ; Services
157 ; ============================================================================
158 !include "servicelib.nsh"
159
160 ; ============================================================================
161 ; Command Line
162 ; ============================================================================
163 !include "FileFunc.nsh"
164
165 !insertmacro GetParameters
166 !insertmacro GetOptions
167
168 ; ============================================================================
169 ; License page configuration
170 ; ============================================================================
171 LicenseText "Wireshark is distributed under the GNU General Public License."
172 LicenseData "..\..\COPYING"
173
174 ; ============================================================================
175 ; Component page configuration
176 ; ============================================================================
177 ComponentText "The following components are available for installation."
178
179 ; Component check boxes
180 ; Commented out for NSIS v 2.0
181 ; EnabledBitmap "..\..\image\nsis-checked.bmp"
182 ; DisabledBitmap "..\..\image\nsis-unchecked.bmp"
183
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."
189
190 ; The default installation directory
191 InstallDir $PROGRAMFILES\Wireshark\
192
193 ; See if this is an upgrade; if so, use the old InstallDir as default
194 InstallDirRegKey HKEY_LOCAL_MACHINE SOFTWARE\Wireshark "InstallDir"
195
196
197 ; ============================================================================
198 ; Install page configuration
199 ; ============================================================================
200 ShowInstDetails show
201 ShowUninstDetails show
202
203 ; ============================================================================
204 ; Functions and macros
205 ; ============================================================================
206 !macro UpdateIcons
207         Push $R0
208         Push $R1
209         Push $R2
210
211         !define UPDATEICONS_UNIQUE ${__LINE__}
212
213         IfFileExists "$SYSDIR\shell32.dll" UpdateIcons.ok_shell32_${UPDATEICONS_UNIQUE} UpdateIcons.error_shell32_${UPDATEICONS_UNIQUE}
214 UpdateIcons.ok_shell32_${UPDATEICONS_UNIQUE}:
215         System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (${SHCNE_ASSOCCHANGED}, ${SHCNF_IDLIST}, 0, 0)'
216         Goto UpdateIcons.quit_${UPDATEICONS_UNIQUE}
217
218 UpdateIcons.error_shell32_${UPDATEICONS_UNIQUE}:
219         MessageBox MB_OK|MB_ICONSTOP  \
220             "Can't find 'shell32.dll' library. Impossible to update icons" \
221             /SD IDOK
222         Goto UpdateIcons.quit_${UPDATEICONS_UNIQUE}
223
224 UpdateIcons.quit_${UPDATEICONS_UNIQUE}:
225         !undef UPDATEICONS_UNIQUE
226         Pop $R2
227         Pop $R1
228         Pop $R0
229
230 !macroend
231
232 Function Associate
233         ; $R0 should contain the prefix to associate to Wireshark
234         Push $R1
235
236         ReadRegStr $R1 HKCR $R0 ""
237         StrCmp $R1 "" Associate.doRegister
238         Goto Associate.end
239 Associate.doRegister:
240         ;The extension is not associated to any program, we can do the link
241         WriteRegStr HKCR $R0 "" ${WIRESHARK_ASSOC}
242 Associate.end:
243         pop $R1
244 FunctionEnd
245
246 Function un.unlink
247         ; $R0 should contain the prefix to unlink
248         Push $R1
249
250         ReadRegStr $R1 HKCR $R0 ""
251         StrCmp $R1 ${WIRESHARK_ASSOC} un.unlink.doUnlink
252         Goto un.unlink.end
253 un.unlink.doUnlink:
254         ; The extension is associated with Wireshark so, we must destroy this!
255         DeleteRegKey HKCR $R0
256 un.unlink.end:
257         pop $R1
258 FunctionEnd
259
260 Var OLD_UNINSTALLER
261 Var OLD_INSTDIR
262 Var OLD_DISPLAYNAME
263 Var TMP_UNINSTALLER
264
265 Function .onInit
266   ; Copied from http://nsis.sourceforge.net/Auto-uninstall_old_before_installing_new
267   ReadRegStr $OLD_UNINSTALLER HKLM \
268     "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" \
269     "UninstallString"
270   StrCmp $OLD_UNINSTALLER "" done
271
272   ReadRegStr $OLD_INSTDIR HKLM \
273     "Software\Microsoft\Windows\CurrentVersion\App Paths\wireshark.exe" \
274     "Path"
275   StrCmp $OLD_INSTDIR "" done
276
277   ReadRegStr $OLD_DISPLAYNAME HKLM \
278     "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" \
279     "DisplayName"
280   StrCmp $OLD_DISPLAYNAME "" done
281
282   MessageBox MB_YESNOCANCEL|MB_ICONQUESTION \
283     "$OLD_DISPLAYNAME is already installed.\
284     $\n$\nWould you like to uninstall it first?" \
285       /SD IDYES \
286       IDYES prep_uninstaller \
287       IDNO done
288   Abort
289  
290 ; Copy the uninstaller to $TEMP and run it.
291 ; The uninstaller normally does this by itself, but doesn't wait around
292 ; for the executable to finish, which means ExecWait won't work correctly.
293 prep_uninstaller:
294   ClearErrors
295   StrCpy $TMP_UNINSTALLER "$TEMP\wireshark_uninstaller.exe"
296   ; ...because we surround UninstallString in quotes.
297   StrCpy $0 $OLD_UNINSTALLER -1 1
298   StrCpy $1 "$TEMP\wireshark_uninstaller.exe"
299   StrCpy $2 1
300   System::Call 'kernel32::CopyFile(t r0, t r1, b r2) 1'
301   IfSilent silent_uninstall
302   ExecWait "$TMP_UNINSTALLER _?=$OLD_INSTDIR"
303   Goto cleanup
304
305 silent_uninstall:
306   ExecWait "$TMP_UNINSTALLER /S _?=$OLD_INSTDIR"
307
308 cleanup:
309   Delete "$TMP_UNINSTALLER"
310   
311 done:
312   ;Extract InstallOptions INI files
313   !insertmacro MUI_INSTALLOPTIONS_EXTRACT "AdditionalTasksPage.ini"
314   !insertmacro MUI_INSTALLOPTIONS_EXTRACT "WinpcapPage.ini"
315 FunctionEnd
316
317 Function DisplayAdditionalTasksPage
318   !insertmacro MUI_HEADER_TEXT "Select Additional Tasks" "Which additional tasks should be done?"
319   !insertmacro MUI_INSTALLOPTIONS_DISPLAY "AdditionalTasksPage.ini"
320 FunctionEnd
321
322 Function DisplayWinPcapPage
323   !insertmacro MUI_HEADER_TEXT "Install WinPcap?" "WinPcap is required to capture live network data. Should WinPcap be installed?"
324   !insertmacro MUI_INSTALLOPTIONS_DISPLAY "WinPcapPage.ini"
325 FunctionEnd
326
327 ; ============================================================================
328 ; Installation execution commands
329 ; ============================================================================
330
331 Var WINPCAP_UNINSTALL ;declare variable for holding the value of a registry key
332 ;Var WIRESHARK_UNINSTALL ;declare variable for holding the value of a registry key
333
334 Section "-Required"
335 ;-------------------------------------------
336
337 ;
338 ; Install for every user
339 ;
340 SetShellVarContext all
341
342
343
344 SetOutPath $INSTDIR
345 File "..\..\wiretap\wiretap-${WTAP_VERSION}.dll"
346 !ifdef ENABLE_LIBWIRESHARK
347 File "..\..\epan\libwireshark.dll"
348 !endif
349 File "..\..\wsutil\libwsutil.dll"
350 File "${GLIB_DIR}\bin\libgio-2.0-0.dll"
351 File "${GLIB_DIR}\bin\libglib-2.0-0.dll"
352 File "${GLIB_DIR}\bin\libgobject-2.0-0.dll"
353 File "${GLIB_DIR}\bin\libgmodule-2.0-0.dll"
354 !ifdef ICONV_DIR
355 File "${ICONV_DIR}\bin\iconv.dll"
356 !endif
357 File "${GETTEXT_DIR}\bin\intl.dll"
358 !ifdef ZLIB_DIR
359 File "${ZLIB_DIR}\zlib1.dll"
360 !endif
361 !ifdef C_ARES_DIR
362 File "${C_ARES_DIR}\cares.dll"
363 !endif
364 !ifdef ADNS_DIR
365 File "${ADNS_DIR}\..\${MSVC_VARIANT}\adns\adns_dll.dll"
366 !endif
367 !ifdef PCRE_DIR
368 File "${PCRE_DIR}\bin\pcre3.dll"
369 File "${PCRE_DIR}\man\cat3\pcrepattern.3.txt"
370 !endif
371 !ifdef KFW_DIR
372 File "${KFW_DIR}\bin\comerr32.dll"
373 File "${KFW_DIR}\bin\krb5_32.dll"
374 !endif
375 !ifdef GNUTLS_DIR
376 File "${GNUTLS_DIR}\bin\libgcrypt-11.dll"
377 File "${GNUTLS_DIR}\bin\libgnutls-26.dll"
378 File "${GNUTLS_DIR}\bin\libgnutls-extra-26.dll"
379 File "${GNUTLS_DIR}\bin\libgnutls-openssl-26.dll"
380 File "${GNUTLS_DIR}\bin\libgpg-error-0.dll"
381 File "${GNUTLS_DIR}\bin\libtasn1-3.dll"
382 !endif
383 !ifdef LUA_DIR
384 File "${LUA_DIR}\lua5.1.dll"
385 File "..\..\epan\wslua\init.lua"
386 File "..\..\epan\wslua\console.lua"
387 File "..\..\epan\wslua\dtd_gen.lua"
388 !endif
389 !ifdef SMI_DIR
390 File "${SMI_DIR}\lib\smi.dll"
391 !endif
392 File "..\..\README"
393 File "..\..\README.win32"
394 File "..\..\AUTHORS-SHORT"
395 File "..\..\COPYING"
396 File "NEWS.txt"
397 File "..\..\manuf"
398 File "..\..\services"
399 File "..\..\doc\ws.css"
400 File "..\..\doc\wireshark.html"
401 File "..\..\doc\wireshark-filter.html"
402 File "..\..\dumpcap.exe"
403 File "..\..\doc\dumpcap.html"
404 File "..\..\ipmap.html"
405
406 ; C-runtime redistributable
407 !ifdef VCREDIST_EXE
408 ; vcredist_x86.exe (MSVC V8) - copy and execute the redistributable installer
409 File "${VCREDIST_EXE}"
410 ExecWait '"$INSTDIR\vcredist_x86.exe"' $0
411 DetailPrint "vcredist_x86 returned $0"
412 !else
413 !ifdef MSVCR_DLL
414 ; msvcr*.dll (MSVC V7 or V7.1) - simply copy the dll file
415 !echo "IF YOU GET AN ERROR HERE, check the MSVC_VARIANT setting in config.nmake: MSVC2005 vs. MSVC2005EE!"
416 File "${MSVCR_DLL}"
417 !else
418 !if ${MSVC_VARIANT} != "MSVC6"
419 !error "C-Runtime redistributable for this package not available / not redistributable!"
420 !endif
421 !endif  ; MSVCR_DLL
422 !endif  ; VCREDIST_EXE
423
424
425 ; global config files - don't overwrite if already existing
426 ;IfFileExists cfilters dont_overwrite_cfilters
427 File "..\..\cfilters"
428 ;dont_overwrite_cfilters:
429 ;IfFileExists colorfilters dont_overwrite_colorfilters
430 File "..\..\colorfilters"
431 ;dont_overwrite_colorfilters:
432 ;IfFileExists dfilters dont_overwrite_dfilters
433 File "..\..\dfilters"
434 ;dont_overwrite_dfilters:
435 ;IfFileExists smi_modules dont_overwrite_smi_modules
436 File "..\..\smi_modules"
437 ;dont_overwrite_smi_modules:
438
439
440 ;
441 ; Install the Diameter DTD and XML files in the "diameter" subdirectory
442 ; of the installation directory.
443 ;
444 SetOutPath $INSTDIR\diameter
445 File "..\..\diameter\chargecontrol.xml"
446 File "..\..\diameter\dictionary.dtd"
447 File "..\..\diameter\dictionary.xml"
448 File "..\..\diameter\Ericsson.xml"
449 File "..\..\diameter\etsie2e4.xml"
450 File "..\..\diameter\gqpolicy.xml"
451 File "..\..\diameter\imscxdx.xml"
452 File "..\..\diameter\mobileipv4.xml"
453 File "..\..\diameter\nasreq.xml"
454 File "..\..\diameter\sip.xml"
455 File "..\..\diameter\sunping.xml"
456 File "..\..\diameter\TGPPGmb.xml"
457 File "..\..\diameter\TGPPRx.xml"
458 File "..\..\diameter\TGPPSh.xml"
459 SetOutPath $INSTDIR
460
461
462
463 ;
464 ; Install the RADIUS directory files in the "radius" subdirectory
465 ; of the installation directory.
466 ;
467 SetOutPath $INSTDIR\radius
468 File "..\..\radius\dictionary"
469 File "..\..\radius\dictionary.3com"
470 File "..\..\radius\dictionary.3gpp"
471 File "..\..\radius\dictionary.3gpp2"
472 File "..\..\radius\dictionary.acc"
473 File "..\..\radius\dictionary.alcatel"
474 File "..\..\radius\dictionary.alteon"
475 File "..\..\radius\dictionary.altiga"
476 File "..\..\radius\dictionary.aptis"
477 File "..\..\radius\dictionary.ascend"
478 File "..\..\radius\dictionary.aruba"
479 File "..\..\radius\dictionary.bay"
480 File "..\..\radius\dictionary.bintec"
481 File "..\..\radius\dictionary.bristol"
482 File "..\..\radius\dictionary.cablelabs"
483 File "..\..\radius\dictionary.cabletron"
484 File "..\..\radius\dictionary.cisco"
485 File "..\..\radius\dictionary.cisco.bbsm"
486 File "..\..\radius\dictionary.cisco.vpn3000"
487 File "..\..\radius\dictionary.cisco.vpn5000"
488 File "..\..\radius\dictionary.colubris"
489 File "..\..\radius\dictionary.columbia_university"
490 File "..\..\radius\dictionary.compat"
491 File "..\..\radius\dictionary.cosine"
492 File "..\..\radius\dictionary.ericsson"
493 File "..\..\radius\dictionary.erx"
494 File "..\..\radius\dictionary.extreme"
495 File "..\..\radius\dictionary.foundry"
496 File "..\..\radius\dictionary.freeradius"
497 File "..\..\radius\dictionary.gandalf"
498 File "..\..\radius\dictionary.garderos"
499 File "..\..\radius\dictionary.gemtek"
500 File "..\..\radius\dictionary.itk"
501 File "..\..\radius\dictionary.juniper"
502 File "..\..\radius\dictionary.karlnet"
503 File "..\..\radius\dictionary.livingston"
504 File "..\..\radius\dictionary.localweb"
505 File "..\..\radius\dictionary.merit"
506 File "..\..\radius\dictionary.microsoft"
507 File "..\..\radius\dictionary.mikrotik"
508 File "..\..\radius\dictionary.navini"
509 File "..\..\radius\dictionary.netscreen"
510 File "..\..\radius\dictionary.nokia"
511 File "..\..\radius\dictionary.nomadix"
512 File "..\..\radius\dictionary.propel"
513 File "..\..\radius\dictionary.quintum"
514 File "..\..\radius\dictionary.redback"
515 File "..\..\radius\dictionary.redcreek"
516 File "..\..\radius\dictionary.shasta"
517 File "..\..\radius\dictionary.shiva"
518 File "..\..\radius\dictionary.sonicwall"
519 File "..\..\radius\dictionary.springtide"
520 File "..\..\radius\dictionary.t_systems_nova"
521 File "..\..\radius\dictionary.telebit"
522 File "..\..\radius\dictionary.trapeze"
523 File "..\..\radius\dictionary.tunnel"
524 File "..\..\radius\dictionary.unisphere"
525 File "..\..\radius\dictionary.unix"
526 File "..\..\radius\dictionary.usr"
527 File "..\..\radius\dictionary.valemount"
528 File "..\..\radius\dictionary.versanet"
529 File "..\..\radius\dictionary.wispr"
530 File "..\..\radius\dictionary.xedia"
531 SetOutPath $INSTDIR
532
533 ;
534 ; install the dtds in the dtds subdirectory
535 ;
536 SetOutPath $INSTDIR\dtds
537 File "..\..\dtds\dc.dtd"
538 File "..\..\dtds\itunes.dtd"
539 File "..\..\dtds\mscml.dtd"
540 File "..\..\dtds\pocsettings.dtd"
541 File "..\..\dtds\presence.dtd"
542 File "..\..\dtds\reginfo.dtd"
543 File "..\..\dtds\rlmi.dtd"
544 File "..\..\dtds\rss.dtd"
545 File "..\..\dtds\smil.dtd"
546 File "..\..\dtds\xcap-caps.dtd"
547 File "..\..\dtds\xcap-error.dtd"
548 File "..\..\dtds\watcherinfo.dtd"
549 SetOutPath $INSTDIR
550
551 ; Install the TPNCP DAT file in the "tpncp" subdirectory
552 ; of the installation directory.
553 SetOutPath $INSTDIR\tpncp
554 File "..\..\tpncp\tpncp.dat"
555
556 ;
557 ; install the wimaxasncp TLV definitions in the wimaxasncp subdirectory
558 ;
559 SetOutPath $INSTDIR\wimaxasncp
560 File "..\..\wimaxasncp\dictionary.xml"
561 File "..\..\wimaxasncp\dictionary.dtd"
562 SetOutPath $INSTDIR
563
564 SetOutPath $INSTDIR\help
565 File "..\..\help\toc"
566 File "..\..\help\overview.txt"
567 File "..\..\help\getting_started.txt"
568 File "..\..\help\capturing.txt"
569 File "..\..\help\capture_filters.txt"
570 File "..\..\help\display_filters.txt"
571 File "..\..\help\faq.txt"
572
573 ; Write the uninstall keys for Windows
574 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "DisplayVersion" "${VERSION}"
575 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "DisplayName" "Wireshark ${VERSION}"
576 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "UninstallString" '"$INSTDIR\uninstall.exe"'
577 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "Publisher" "The Wireshark developer community, http://www.wireshark.org"
578 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "HelpLink" "mailto:wireshark-users@wireshark.org"
579 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "URLInfoAbout" "http://www.wireshark.org"
580 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "URLUpdateInfo" "http://www.wireshark.org/download/win32/"
581 WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "NoModify" 1
582 WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "NoRepair" 1
583 WriteUninstaller "uninstall.exe"
584
585 ; Write an entry for ShellExecute
586 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\wireshark.exe" "" '$INSTDIR\wireshark.exe'
587 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\wireshark.exe" "Path" '$INSTDIR'
588
589 ; Create start menu entries (depending on additional tasks page)
590 ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 2" "State"
591 StrCmp $0 "0" SecRequired_skip_StartMenu
592 SetOutPath $PROFILE
593 ;CreateDirectory "$SMPROGRAMS\Wireshark"
594 ; To qoute "http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwue/html/ch11d.asp":
595 ; "Do not include Readme, Help, or Uninstall entries on the Programs menu."
596 Delete "$SMPROGRAMS\Wireshark\Wireshark Web Site.lnk"
597 ;WriteINIStr "$SMPROGRAMS\Wireshark\Wireshark Web Site.url" "InternetShortcut" "URL" "http://www.wireshark.org/"
598 CreateShortCut "$SMPROGRAMS\Wireshark.lnk" "$INSTDIR\wireshark.exe" "" "$INSTDIR\wireshark.exe" 0 "" "" "The Wireshark Network Protocol Analyzer"
599 ;CreateShortCut "$SMPROGRAMS\Wireshark\Wireshark Manual.lnk" "$INSTDIR\wireshark.html"
600 ;CreateShortCut "$SMPROGRAMS\Wireshark\Display Filters Manual.lnk" "$INSTDIR\wireshark-filter.html"
601 ;CreateShortCut "$SMPROGRAMS\Wireshark\Wireshark Program Directory.lnk" "$INSTDIR"
602 ;CreateShortCut "$SMPROGRAMS\Wireshark\Uninstall Wireshark.lnk" "$INSTDIR\uninstall.exe"
603 SecRequired_skip_StartMenu:
604
605 ; is command line option "/desktopicon" set?
606 ${GetParameters} $R0
607 ${GetOptions} $R0 "/desktopicon=" $R1
608 StrCmp $R1 "no" SecRequired_skip_DesktopIcon
609 StrCmp $R1 "yes" SecRequired_install_DesktopIcon
610
611 ; Create desktop icon (depending on additional tasks page and command line option)
612 ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 3" "State"
613 StrCmp $0 "0" SecRequired_skip_DesktopIcon
614 SecRequired_install_DesktopIcon:
615 CreateShortCut "$DESKTOP\Wireshark.lnk" "$INSTDIR\wireshark.exe" "" "$INSTDIR\wireshark.exe" 0 "" "" "The Wireshark Network Protocol Analyzer"
616 SecRequired_skip_DesktopIcon:
617
618 ; is command line option "/quicklaunchicon" set?
619 ${GetParameters} $R0
620 ${GetOptions} $R0 "/quicklaunchicon=" $R1
621 StrCmp $R1 "no" SecRequired_skip_QuickLaunchIcon
622 StrCmp $R1 "yes" SecRequired_install_QuickLaunchIcon
623
624 ; Create quick launch icon (depending on additional tasks page and command line option)
625 ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 4" "State"
626 StrCmp $0 "0" SecRequired_skip_QuickLaunchIcon
627 SecRequired_install_QuickLaunchIcon:
628 CreateShortCut "$QUICKLAUNCH\Wireshark.lnk" "$INSTDIR\wireshark.exe" "" "$INSTDIR\wireshark.exe" 0 "" "" "The Wireshark Network Protocol Analyzer"
629 SecRequired_skip_QuickLaunchIcon:
630
631 ; Create File Extensions (depending on additional tasks page)
632 ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 6" "State"
633 StrCmp $0 "0" SecRequired_skip_FileExtensions
634 WriteRegStr HKCR ${WIRESHARK_ASSOC} "" "Wireshark capture file"
635 WriteRegStr HKCR "${WIRESHARK_ASSOC}\Shell\open\command" "" '"$INSTDIR\wireshark.exe" "%1"'
636 WriteRegStr HKCR "${WIRESHARK_ASSOC}\DefaultIcon" "" '"$INSTDIR\wireshark.exe",1'
637 push $R0
638         StrCpy $R0 ".5vw"
639         Call Associate
640         StrCpy $R0 ".acp"
641         Call Associate
642         StrCpy $R0 ".apc"
643         Call Associate
644         StrCpy $R0 ".atc"
645         Call Associate
646         StrCpy $R0 ".bfr"
647         Call Associate
648         StrCpy $R0 ".cap"
649         Call Associate
650         StrCpy $R0 ".enc"
651         Call Associate
652         StrCpy $R0 ".erf"
653         Call Associate
654         StrCpy $R0 ".fdc"
655         Call Associate
656         StrCpy $R0 ".pcap"
657         Call Associate
658         StrCpy $R0 ".pkt"
659         Call Associate
660         StrCpy $R0 ".snoop"
661         Call Associate
662         StrCpy $R0 ".syc"
663         Call Associate
664         StrCpy $R0 ".tpc"
665         Call Associate
666         StrCpy $R0 ".tr1"
667         Call Associate
668         StrCpy $R0 ".trace"
669         Call Associate
670         StrCpy $R0 ".trc"
671         Call Associate
672         StrCpy $R0 ".wpc"
673         Call Associate
674         StrCpy $R0 ".wpz"
675         Call Associate
676         StrCpy $R0 ".rf5"
677         Call Associate
678 ; if somethings added here, add it also to the uninstall section and the AdditionalTask page
679 pop $R0
680 !insertmacro UpdateIcons
681 SecRequired_skip_FileExtensions:
682
683 ; if running as a silent installer, don't try to install winpcap
684 IfSilent SecRequired_skip_Winpcap
685
686 ; Install WinPcap (depending on winpcap page setting)
687 ReadINIStr $0 "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "State"
688 StrCmp $0 "0" SecRequired_skip_Winpcap
689 ; Uinstall old WinPcap first
690 ReadRegStr $WINPCAP_UNINSTALL HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinPcapInst" "UninstallString"
691 IfErrors lbl_winpcap_notinstalled ;if RegKey is unavailable, WinPcap is not installed
692 ; from released version 3.1, WinPcap will uninstall an old version by itself
693 ;ExecWait '$WINPCAP_UNINSTALL' $0
694 ;DetailPrint "WinPcap uninstaller returned $0"
695 lbl_winpcap_notinstalled:
696 SetOutPath $INSTDIR
697 File "WinPcap_4_0_2.exe"
698 ExecWait '"$INSTDIR\WinPcap_4_0_2.exe"' $0
699 DetailPrint "WinPcap installer returned $0"
700 SecRequired_skip_Winpcap:
701
702 ; Load Winpcap NPF service at startup (depending on winpcap page)
703 ReadINIStr $0 "$PLUGINSDIR\WinPcapPage.ini" "Field 8" "State"
704 StrCmp $0 "0" SecRequired_no_WinpcapService
705 WriteRegDWORD HKEY_LOCAL_MACHINE "SYSTEM\CurrentControlSet\Services\NPF" "Start" 2 ;set NPF to (SERVICE_AUTO_START)
706 !insertmacro SERVICE "start" "NPF" ""
707 Goto SecRequired_done_WinpcapService
708 SecRequired_no_WinpcapService:
709 WriteRegDWORD HKEY_LOCAL_MACHINE "SYSTEM\CurrentControlSet\Services\NPF" "Start" 3 ;set NPF to (SERVICE_DEMAND_START)
710 !insertmacro SERVICE "stop" "NPF" ""
711 SecRequired_done_WinpcapService:
712
713 ; If no user profile exists for Wireshark but for Ethereal, copy it over
714 SetShellVarContext current
715 IfFileExists $APPDATA\Wireshark profile_done
716 IfFileExists $APPDATA\Ethereal 0 profile_done
717 ;MessageBox MB_YESNO "This seems to be the first time you use Wireshark. Copy over the personal settings from Ethereal?" /SD IDYES IDNO profile_done
718 CreateDirectory $APPDATA\Wireshark
719 CopyFiles $APPDATA\Ethereal\*.* $APPDATA\Wireshark
720 profile_done:
721 SetShellVarContext all
722
723 SectionEnd ; "Required"
724
725 !ifdef GTK_DIR
726 Section "Wireshark" SecWireshark
727 ;-------------------------------------------
728 SetOutPath $INSTDIR
729 File "..\..\wireshark.exe"
730 File "${GTK_DIR}\bin\libgdk-win32-2.0-0.dll"
731 File "${GTK_DIR}\bin\libgdk_pixbuf-2.0-0.dll"
732 File "${GTK_DIR}\bin\libgtk-win32-2.0-0.dll"
733 File "${GTK_DIR}\bin\libatk-1.0-0.dll"
734 File "${GTK_DIR}\bin\libpango-1.0-0.dll"
735 File "${GTK_DIR}\bin\libpangowin32-1.0-0.dll"
736 !ifdef NEED_CAIRO_DLL
737 File "${GTK_DIR}\bin\libcairo-2.dll"
738 File "${GTK_DIR}\bin\libpangocairo-1.0-0.dll"
739 !endif
740 !ifdef NEED_LIBPNG_DLL
741 File "${GTK_DIR}\bin\libpng12-0.dll"
742 !endif
743 !ifdef NEED_LIBTIFF_DLL
744 File "${GTK_DIR}\bin\libtiff3.dll"
745 !endif
746 !ifdef NEED_LIBJPEG_DLL
747 File "${GTK_DIR}\bin\jpeg62.dll"
748 !endif
749 SetOutPath $INSTDIR\etc\gtk-2.0
750 File "${GTK_DIR}\etc\gtk-2.0\*.*"
751 SetOutPath $INSTDIR\etc\pango
752 File "${GTK_DIR}\etc\pango\pango.*"
753 SetOutPath $INSTDIR\lib\gtk-2.0\${GTK_LIB_DIR}\loaders
754 File "${GTK_DIR}\lib\gtk-2.0\${GTK_LIB_DIR}\loaders\libpixbufloader-*.dll"
755 SetOutPath $INSTDIR\lib\gtk-2.0\${GTK_LIB_DIR}\engines
756 File "${GTK_DIR}\lib\gtk-2.0\${GTK_LIB_DIR}\engines\libpixmap.dll"
757 SetOutPath $INSTDIR\lib\gtk-2.0\modules
758 File "${GTK_DIR}\lib\gtk-2.0\modules\libgail.dll"
759 # Not needed with pango 1.14.5
760 #SetOutPath $INSTDIR\lib\pango\${PANGO_LIB_DIR}\modules
761 #File "${GTK_DIR}\lib\pango\${PANGO_LIB_DIR}\modules\pango-*.dll"
762
763 ; GTK MS-Windows Engine (GTK-Wimp)
764 SetOutPath $INSTDIR\${GTK_WIMP_DLLDST_DIR}
765 File "${GTK_WIMP_DLLSRC_DIR}\libwimp.dll"
766 SetOutPath $INSTDIR\${GTK_WIMP_RCDST_DIR}
767 File "${GTK_WIMP_RCSRC_DIR}\gtkrc"
768
769 SectionEnd ; "Wireshark"
770 !endif
771
772
773 Section "TShark" SecTShark
774 ;-------------------------------------------
775 SetOutPath $INSTDIR
776 File "..\..\tshark.exe"
777 File "..\..\doc\tshark.html"
778 SectionEnd
779
780 SectionGroup "Plugins / Extensions" SecPluginsGroup
781
782 Section "Dissector Plugins" SecPlugins
783 ;-------------------------------------------
784 SetOutPath $INSTDIR\plugins\${VERSION}
785 File "..\..\plugins\agentx\agentx.dll"
786 File "..\..\plugins\artnet\artnet.dll"
787 File "..\..\plugins\asn1\asn1.dll"
788 File "..\..\plugins\ciscosm\ciscosm.dll"
789 File "..\..\plugins\docsis\docsis.dll"
790 File "..\..\plugins\enttec\enttec.dll"
791 File "..\..\plugins\ethercat\ethercat.dll"
792 File "..\..\plugins\giop\coseventcomm.dll"
793 File "..\..\plugins\giop\cosnaming.dll"
794 File "..\..\plugins\giop\parlay.dll"
795 File "..\..\plugins\giop\tango.dll"
796 File "..\..\plugins\gryphon\gryphon.dll"
797 File "..\..\plugins\infiniband\infiniband.dll"
798 File "..\..\plugins\irda\irda.dll"
799 File "..\..\plugins\lwres\lwres.dll"
800 File "..\..\plugins\m2m\m2m.dll"
801 File "..\..\plugins\opsi\opsi.dll"
802 File "..\..\plugins\profinet\profinet.dll"
803 File "..\..\plugins\sercosiii\sercosiii.dll"
804 File "..\..\plugins\unistim\unistim.dll"
805 File "..\..\plugins\wimax\wimax.dll"
806 File "..\..\plugins\wimaxasncp\wimaxasncp.dll"
807 SectionEnd
808
809 Section "Tree Statistics Plugin" SecStatsTree
810 ;-------------------------------------------
811 SetOutPath $INSTDIR\plugins\${VERSION}
812 File "..\..\plugins\stats_tree\stats_tree.dll"
813 SectionEnd
814
815 Section "Mate - Meta Analysis and Tracing Engine" SecMate
816 ;-------------------------------------------
817 SetOutPath $INSTDIR\plugins\${VERSION}
818 File "..\..\plugins\mate\mate.dll"
819 SectionEnd
820
821
822 !ifdef NET_SNMP_DIR
823 Section "SNMP MIBs" SecMIBs
824 ;-------------------------------------------
825 SetOutPath $INSTDIR\snmp\mibs
826 File "${NET_SNMP_DIR}\mibs\*.txt"
827 SectionEnd
828 !endif
829
830 !ifdef SMI_DIR
831 Section "SNMP MIBs" SecMIBs
832 ;-------------------------------------------
833 SetOutPath $INSTDIR\snmp\mibs
834 File "${SMI_DIR}\mibs\*"
835 SectionEnd
836 !endif
837
838 SectionGroupEnd ; "Plugins / Extensions"
839
840
841 SectionGroup "Tools" SecToolsGroup
842
843 Section "Editcap" SecEditcap
844 ;-------------------------------------------
845 SetOutPath $INSTDIR
846 File "..\..\editcap.exe"
847 File "..\..\doc\editcap.html"
848 SectionEnd
849
850 Section "Text2Pcap" SecText2Pcap
851 ;-------------------------------------------
852 SetOutPath $INSTDIR
853 File "..\..\text2pcap.exe"
854 File "..\..\doc\text2pcap.html"
855 SectionEnd
856
857 Section "Mergecap" SecMergecap
858 ;-------------------------------------------
859 SetOutPath $INSTDIR
860 File "..\..\mergecap.exe"
861 File "..\..\doc\mergecap.html"
862 SectionEnd
863
864 Section "Capinfos" SecCapinfos
865 ;-------------------------------------------
866 SetOutPath $INSTDIR
867 File "..\..\capinfos.exe"
868 File "..\..\doc\capinfos.html"
869 SectionEnd
870
871 Section "Rawshark" SecRawshark
872 ;-------------------------------------------
873 SetOutPath $INSTDIR
874 File "..\..\rawshark.exe"
875 File "..\..\doc\rawshark.html"
876 SectionEnd
877
878 SectionGroupEnd ; "Tools"
879
880 !ifdef HHC_DIR
881 Section "User's Guide" SecUsersGuide
882 ;-------------------------------------------
883 SetOutPath $INSTDIR
884 File "user-guide.chm"
885 SectionEnd
886 !endif
887
888 Section "Uninstall" un.SecUinstall
889 ;-------------------------------------------
890
891 ;
892 ; UnInstall for every user
893 ;
894 SectionIn 1 2
895 SetShellVarContext all
896
897 Delete "$INSTDIR\rawshark.exe"
898 IfErrors 0 NoRawsharkErrorMsg
899         MessageBox MB_OK "Please note: rawshark.exe could not be removed, it's probably in use!" IDOK 0 ;skipped if rawshark.exe removed
900         Abort "Please note: rawshark.exe could not be removed, it's probably in use! Abort uninstall process!"
901 NoRawsharkErrorMsg:
902
903 Delete "$INSTDIR\tshark.exe"
904 IfErrors 0 NoTSharkErrorMsg
905         MessageBox MB_OK "Please note: tshark.exe could not be removed, it's probably in use!" IDOK 0 ;skipped if tshark.exe removed
906         Abort "Please note: tshark.exe could not be removed, it's probably in use! Abort uninstall process!"
907 NoTSharkErrorMsg:
908
909 Delete "$INSTDIR\wireshark.exe"
910 IfErrors 0 NoWiresharkErrorMsg
911         MessageBox MB_OK "Please note: wireshark.exe could not be removed, it's probably in use!" IDOK 0 ;skipped if wireshark.exe removed
912         Abort "Please note: wireshark.exe could not be removed, it's probably in use! Abort uninstall process!"
913 NoWiresharkErrorMsg:
914
915 DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark"
916 DeleteRegKey HKEY_LOCAL_MACHINE "Software\Wireshark"
917 DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\wireshark.exe"
918
919 push $R0
920         StrCpy $R0 ".5vw"
921         Call un.unlink
922         StrCpy $R0 ".acp"
923         Call un.unlink
924         StrCpy $R0 ".apc"
925         Call un.unlink
926         StrCpy $R0 ".atc"
927         Call un.unlink
928         StrCpy $R0 ".bfr"
929         Call un.unlink
930         StrCpy $R0 ".cap"
931         Call un.unlink
932         StrCpy $R0 ".enc"
933         Call un.unlink
934         StrCpy $R0 ".erf"
935         Call un.unlink
936         StrCpy $R0 ".fdc"
937         Call un.unlink
938         StrCpy $R0 ".pcap"
939         Call un.unlink
940         StrCpy $R0 ".pkt"
941         Call un.unlink
942         StrCpy $R0 ".snoop"
943         Call un.unlink
944         StrCpy $R0 ".syc"
945         Call un.unlink
946         StrCpy $R0 ".tpc"
947         Call un.unlink
948         StrCpy $R0 ".tr1"
949         Call un.unlink
950         StrCpy $R0 ".trace"
951         Call un.unlink
952         StrCpy $R0 ".trc"
953         Call un.unlink
954         StrCpy $R0 ".wpc"
955         Call un.unlink
956         StrCpy $R0 ".wpz"
957         Call un.unlink
958         StrCpy $R0 ".rf5"
959         Call un.unlink
960 pop $R0
961
962 DeleteRegKey HKCR ${WIRESHARK_ASSOC}
963 DeleteRegKey HKCR "${WIRESHARK_ASSOC}\Shell\open\command"
964 DeleteRegKey HKCR "${WIRESHARK_ASSOC}\DefaultIcon"
965 !insertmacro UpdateIcons
966
967 Delete "$INSTDIR\etc\gtk-2.0\*.*"
968 Delete "$INSTDIR\etc\pango\*.*"
969 Delete "$INSTDIR\lib\gtk-2.0\2.2.0\engines\*.*"
970 Delete "$INSTDIR\lib\gtk-2.0\2.2.0\loaders\*.*"
971 Delete "$INSTDIR\lib\gtk-2.0\2.2.0\immodules\*.*"
972 Delete "$INSTDIR\lib\gtk-2.0\2.4.0\engines\*.*"
973 Delete "$INSTDIR\lib\gtk-2.0\2.4.0\loaders\*.*"
974 Delete "$INSTDIR\lib\gtk-2.0\2.4.0\immodules\*.*"
975 Delete "$INSTDIR\lib\gtk-2.0\2.10.0\engines\*.*"
976 Delete "$INSTDIR\lib\gtk-2.0\2.10.0\loaders\*.*"
977 Delete "$INSTDIR\lib\gtk-2.0\2.10.0\immodules\*.*"
978 Delete "$INSTDIR\lib\gtk-2.0\modules\*.*"
979 Delete "$INSTDIR\lib\pango\1.2.0\modules\*.*"
980 Delete "$INSTDIR\lib\pango\1.4.0\modules\*.*"
981 Delete "$INSTDIR\lib\pango\1.5.0\modules\*.*"
982 Delete "$INSTDIR\share\themes\Default\gtk-2.0\*.*"
983 Delete "$INSTDIR\help\*.*"
984 Delete "$INSTDIR\diameter\*.*"
985 Delete "$INSTDIR\snmp\mibs\*.*"
986 Delete "$INSTDIR\snmp\*.*"
987 Delete "$INSTDIR\tpncp\*.*"
988 Delete "$INSTDIR\wimaxasncp\*.*"
989 Delete "$INSTDIR\*.exe"
990 Delete "$INSTDIR\*.dll"
991 Delete "$INSTDIR\*.html"
992 Delete "$INSTDIR\ws.css"
993 Delete "$INSTDIR\COPYING"
994 Delete "$INSTDIR\AUTHORS-SHORT"
995 ; previous versions installed these files
996 Delete "$INSTDIR\*.manifest"
997 ; previous versions installed this file
998 Delete "$INSTDIR\AUTHORS-SHORT-FORMAT"
999 Delete "$INSTDIR\README*"
1000 Delete "$INSTDIR\NEWS.txt"
1001 Delete "$INSTDIR\manuf"
1002 Delete "$INSTDIR\services"
1003 Delete "$INSTDIR\pcrepattern.3.txt"
1004 Delete "$INSTDIR\user-guide.chm"
1005 Delete "$INSTDIR\example_snmp_users_file"
1006 Delete "$INSTDIR\ipmap.html"
1007 Delete "$INSTDIR\radius\*.*"
1008 Delete "$INSTDIR\dtds\*.*"
1009 Delete "$SMPROGRAMS\Wireshark\*.*"
1010 Delete "$SMPROGRAMS\Wireshark.lnk"
1011 Delete "$DESKTOP\Wireshark.lnk"
1012 Delete "$QUICKLAUNCH\Wireshark.lnk"
1013
1014 RMDir "$INSTDIR\etc\gtk-2.0"
1015 RMDir "$INSTDIR\etc\pango"
1016 RMDir "$INSTDIR\etc"
1017 RMDir "$INSTDIR\lib\gtk-2.0\2.2.0\engines"
1018 RMDir "$INSTDIR\lib\gtk-2.0\2.2.0\loaders"
1019 RMDir "$INSTDIR\lib\gtk-2.0\2.2.0\immodules"
1020 RMDir "$INSTDIR\lib\gtk-2.0\2.2.0"
1021 RMDir "$INSTDIR\lib\gtk-2.0\2.4.0\engines"
1022 RMDir "$INSTDIR\lib\gtk-2.0\2.4.0\loaders"
1023 RMDir "$INSTDIR\lib\gtk-2.0\2.4.0\immodules"
1024 RMDir "$INSTDIR\lib\gtk-2.0\2.4.0"
1025 RMDir "$INSTDIR\lib\gtk-2.0\2.10.0\engines"
1026 RMDir "$INSTDIR\lib\gtk-2.0\2.10.0\loaders"
1027 RMDir "$INSTDIR\lib\gtk-2.0\2.10.0\immodules"
1028 RMDir "$INSTDIR\lib\gtk-2.0\2.10.0"
1029 RMDir "$INSTDIR\lib\gtk-2.0\modules"
1030 RMDir "$INSTDIR\lib\gtk-2.0"
1031 RMDir "$INSTDIR\lib\pango\1.2.0\modules"
1032 RMDir "$INSTDIR\lib\pango\1.2.0"
1033 RMDir "$INSTDIR\lib\pango\1.4.0\modules"
1034 RMDir "$INSTDIR\lib\pango\1.4.0"
1035 RMDir "$INSTDIR\lib\pango\1.5.0\modules"
1036 RMDir "$INSTDIR\lib\pango\1.5.0"
1037 RMDir "$INSTDIR\lib\pango"
1038 RMDir "$INSTDIR\lib"
1039 RMDir "$INSTDIR\share\themes\Default\gtk-2.0"
1040 RMDir "$INSTDIR\share\themes\Default"
1041 RMDir "$INSTDIR\share\themes"
1042 RMDir "$INSTDIR\share"
1043 RMDir "$SMPROGRAMS\Wireshark"
1044 RMDir "$INSTDIR\help"
1045 RMDir "$INSTDIR\diameter"
1046 RMDir "$INSTDIR\snmp\mibs"
1047 RMDir "$INSTDIR\snmp"
1048 RMDir "$INSTDIR\radius"
1049 RMDir "$INSTDIR\dtds"
1050 RMDir "$INSTDIR\tpncp"
1051 RMDir "$INSTDIR\wimaxasncp"
1052 RMDir "$INSTDIR"
1053
1054 SectionEnd ; "Uinstall"
1055
1056 Section "Un.Plugins" un.SecPlugins
1057 ;-------------------------------------------
1058 SectionIn 1 2
1059 ;Delete "$INSTDIR\plugins\${VERSION}\*.*"
1060 ;Delete "$INSTDIR\plugins\*.*"
1061 ;RMDir "$INSTDIR\plugins\${VERSION}"
1062 ;RMDir "$INSTDIR\plugins"
1063 RMDir /r "$INSTDIR\plugins"
1064 SectionEnd
1065
1066 Section "Un.Global Settings" un.SecGlobalSettings
1067 ;-------------------------------------------
1068 SectionIn 1 2
1069 Delete "$INSTDIR\cfilters"
1070 Delete "$INSTDIR\colorfilters"
1071 Delete "$INSTDIR\dfilters"
1072 Delete "$INSTDIR\init.lua"
1073 Delete "$INSTDIR\console.lua"
1074 Delete "$INSTDIR\dtd_gen.lua"
1075 Delete "$INSTDIR\smi_modules"
1076 RMDir "$INSTDIR"
1077 SectionEnd
1078
1079 Section /o "Un.Personal Settings" un.SecPersonalSettings
1080 ;-------------------------------------------
1081 SectionIn 2
1082 SetShellVarContext current
1083 Delete "$APPDATA\Wireshark\*.*"
1084 RMDir "$APPDATA\Wireshark"
1085 SectionEnd
1086
1087 ;VAR un.WINPCAP_UNINSTALL
1088
1089 Section /o "Un.WinPcap" un.SecWinPcap
1090 ;-------------------------------------------
1091 SectionIn 2
1092 ReadRegStr $1 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinPcapInst" "UninstallString"
1093 ;IfErrors un.lbl_winpcap_notinstalled ;if RegKey is unavailable, WinPcap is not installed
1094 ;MessageBox MB_OK "WinPcap $1"
1095 ExecWait '$1' $0
1096 DetailPrint "WinPcap uninstaller returned $0"
1097 ;SetRebootFlag true
1098 ;un.lbl_winpcap_notinstalled:
1099 SectionEnd
1100
1101 Section "-Un.Finally"
1102 ;-------------------------------------------
1103 SectionIn 1 2
1104 ; this test must be done after all other things uninstalled (e.g. Global Settings)
1105 IfFileExists "$INSTDIR" 0 NoFinalErrorMsg
1106     MessageBox MB_OK "Please note: The directory $INSTDIR could not be removed!" IDOK 0 ; skipped if dir doesn't exist
1107 NoFinalErrorMsg:
1108 SectionEnd
1109
1110
1111 ; ============================================================================
1112 ; PLEASE MAKE SURE, THAT THE DESCRIPTIVE TEXT FITS INTO THE DESCRIPTION FIELD!
1113 ; ============================================================================
1114 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
1115 !ifdef GTK_DIR
1116   !insertmacro MUI_DESCRIPTION_TEXT ${SecWireshark} "${PROGRAM_NAME} is a GUI network protocol analyzer."
1117 !endif
1118   !insertmacro MUI_DESCRIPTION_TEXT ${SecTShark} "TShark is a text based network protocol analyzer."
1119   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsGroup} "Some plugins and extensions for both Wireshark and TShark."
1120   !insertmacro MUI_DESCRIPTION_TEXT ${SecPlugins} "Plugins with some extended dissections."
1121   !insertmacro MUI_DESCRIPTION_TEXT ${SecStatsTree} "Plugin for some extended statistics."
1122   !insertmacro MUI_DESCRIPTION_TEXT ${SecMate} "Plugin - Meta Analysis and Tracing Engine (Experimental)."
1123 !ifdef NET_SNMP_DIR
1124   !insertmacro MUI_DESCRIPTION_TEXT ${SecMIBs} "SNMP MIBs for better SNMP dissection."
1125 !endif
1126 !ifdef SMI_DIR
1127   !insertmacro MUI_DESCRIPTION_TEXT ${SecMIBs} "SNMP MIBs for better SNMP dissection."
1128 !endif
1129   !insertmacro MUI_DESCRIPTION_TEXT ${SecToolsGroup} "Additional command line based tools."
1130   !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."
1131   !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."
1132   !insertmacro MUI_DESCRIPTION_TEXT ${SecMergecap} "Mergecap is a program that combines multiple saved capture files into a single output file"
1133   !insertmacro MUI_DESCRIPTION_TEXT ${SecCapinfos} "Capinfos is a program that provides information on capture files."
1134   !insertmacro MUI_DESCRIPTION_TEXT ${SecRawshark} "Rawshark is a raw packet filter."
1135 !ifdef HHC_DIR
1136   !insertmacro MUI_DESCRIPTION_TEXT ${SecUsersGuide} "Install the user's guide, so an internet connection is not required to read the help pages."
1137 !endif
1138 !insertmacro MUI_FUNCTION_DESCRIPTION_END
1139
1140 !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
1141   !insertmacro MUI_DESCRIPTION_TEXT ${un.SecUinstall} "Uninstall all Wireshark components."
1142   !insertmacro MUI_DESCRIPTION_TEXT ${un.SecPlugins} "Uninstall all Plugins (even from previous Wireshark versions)."
1143   !insertmacro MUI_DESCRIPTION_TEXT ${un.SecGlobalSettings} "Uninstall global settings like: $INSTDIR\cfilters"
1144   !insertmacro MUI_DESCRIPTION_TEXT ${un.SecPersonalSettings} "Uninstall personal settings like your preferences file from your profile: $PROFILE."
1145   !insertmacro MUI_DESCRIPTION_TEXT ${un.SecWinPcap} "Call WinPcap's uninstall program."
1146 !insertmacro MUI_UNFUNCTION_DESCRIPTION_END
1147
1148 ; ============================================================================
1149 ; Callback functions
1150 ; ============================================================================
1151 !ifdef GTK_DIR
1152 ; Disable File extensions if Wireshark isn't selected
1153 Function .onSelChange
1154         Push $0
1155         SectionGetFlags ${SecWireshark} $0
1156         IntOp  $0 $0 & 1
1157         IntCmp $0 0 onSelChange.unselect
1158         WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 6" "State" 1
1159         WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 6" "Flags" ""
1160         WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 7" "Flags" ""
1161         Goto onSelChange.end
1162
1163 onSelChange.unselect:
1164         WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 6" "State" 0
1165         WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 6" "Flags" "DISABLED"
1166         WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 7" "Flags" "DISABLED"
1167         Goto onSelChange.end
1168
1169 onSelChange.end:
1170         Pop $0
1171 FunctionEnd
1172 !endif
1173
1174
1175 !include "GetWindowsVersion.nsh"
1176 !include WinMessages.nsh
1177 !include "VersionCompare.nsh"
1178
1179 Var NPF_START ; NPF service registry key
1180 Var WINPCAP_NAME ; DisplayName from WinPcap installation
1181 Var WINPCAP_VERSION ; DisplayVersion from WinPcap installation
1182
1183 Function myShowCallback
1184
1185         ; Get the Windows version
1186         Call GetWindowsVersion
1187         Pop $R0 ; Windows Version
1188
1189         ; Check if we're able to run with this version
1190         StrCmp $R0 '95' lbl_winversion_unsupported
1191         StrCmp $R0 '98' lbl_winversion_unsupported
1192         StrCmp $R0 'ME' lbl_winversion_unsupported
1193         StrCmp $R0 'NT 4.0' lbl_winversion_unsupported_nt4
1194         Goto lbl_winversion_supported
1195 lbl_winversion_unsupported:
1196         MessageBox MB_OK \
1197             "Windows $R0 is no longer supported. The last known version working with 98/ME was Ethereal 0.99.0!" \
1198             /SD IDOK
1199             
1200         Quit
1201
1202 lbl_winversion_unsupported_nt4:
1203         MessageBox MB_OK \
1204             "Windows $R0 is no longer supported. The last known version working with NT 4.0 was Wireshark 0.99.4!" \
1205             /SD IDOK
1206         Quit
1207
1208 lbl_winversion_supported:
1209
1210         ; detect if WinPcap should be installed
1211         WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "Text" "Install WinPcap 4.0.2"
1212         ReadRegStr $WINPCAP_NAME HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinPcapInst" "DisplayName"
1213         IfErrors 0 lbl_winpcap_installed ;if RegKey is available, WinPcap is already installed
1214         WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 2" "Text" "WinPcap is currently not installed"
1215         WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 2" "Flags" "DISABLED"
1216         WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Text" "(Use Add/Remove Programs first to uninstall any undetected old WinPcap versions)"
1217         Goto lbl_winpcap_done
1218
1219 lbl_winpcap_installed:
1220         WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 2" "Text" "$WINPCAP_NAME"
1221         ; Compare the installed build against the one we have.
1222         ReadRegStr $WINPCAP_VERSION HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinPcapInst" "DisplayVersion"
1223         StrCmp $WINPCAP_VERSION "" lbl_winpcap_do_install ; WinPcap is really old(?) or installed improperly.
1224         ${VersionCompare} $WINPCAP_VERSION "4.0.0.1040" $1 ; WinPcap 4.0.2
1225         StrCmp $1 "2" lbl_winpcap_do_install
1226
1227 ;lbl_winpcap_dont_install:
1228         ; The installed version is >= to what we have, so don't install
1229         WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "State" "0"
1230         WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Text" "If selected, the currently installed $WINPCAP_NAME will be uninstalled first."
1231         Goto lbl_winpcap_done
1232
1233 ;lbl_winpcap_dont_upgrade:
1234         ; force the user to upgrade by hand
1235         WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "State" "0"
1236         WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "Flags" "DISABLED"
1237         WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Text" "If you wish to install WinPcap 4.0.2, please uninstall $WINPCAP_NAME manually first."
1238         WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Flags" "DISABLED"
1239         Goto lbl_winpcap_done
1240
1241 lbl_winpcap_do_install:
1242         ; seems to be an old version, install newer one
1243         WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "State" "1"
1244         WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Text" "The currently installed $WINPCAP_NAME will be uninstalled first."
1245
1246 lbl_winpcap_done:
1247
1248         ; Disable NPF service setting for Win OT
1249         StrCmp $R0 '95' lbl_npf_disable
1250         StrCmp $R0 '98' lbl_npf_disable
1251         StrCmp $R0 'ME' lbl_npf_disable
1252         ; Enable NPF by default under Vista.
1253         StrCmp $R0 'Vista' lbl_npf_enable
1254         ReadRegDWORD $NPF_START HKEY_LOCAL_MACHINE "SYSTEM\CurrentControlSet\Services\NPF" "Start"
1255         ; (Winpcap may not be installed already, so no regKey is no error here)
1256         IfErrors lbl_npf_done ;RegKey not available, so do not set it
1257         IntCmp $NPF_START 2 0 lbl_npf_done lbl_npf_done
1258 lbl_npf_enable:
1259         WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 8" "State" "1"
1260         Goto lbl_npf_done
1261         ;disable
1262 lbl_npf_disable:
1263         WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 8" "State" "0"
1264         WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 8" "Flags" "DISABLED"
1265         WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 9" "Flags" "DISABLED"
1266 lbl_npf_done:
1267
1268
1269         ; if Wireshark was previously installed, unselect previously not installed icons etc.
1270         ; detect if Wireshark is already installed ->
1271         ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "UninstallString"
1272         IfErrors lbl_wireshark_notinstalled ;if RegKey is unavailable, Wireshark is not installed
1273
1274         ; only select Start Menu Group, if previously installed
1275         ; (we use the "all users" start menu, so select it first)
1276         SetShellVarContext all
1277         IfFileExists "$SMPROGRAMS\Wireshark\Wireshark.lnk" lbl_have_startmenu
1278         IfFileExists "$SMPROGRAMS\Wireshark.lnk" lbl_have_startmenu
1279         WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 2" "State" "0"
1280 lbl_have_startmenu:
1281
1282         ; only select Desktop Icon, if previously installed
1283         IfFileExists "$DESKTOP\Wireshark.lnk" lbl_have_desktopicon
1284         WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 3" "State" "0"
1285 lbl_have_desktopicon:
1286
1287         ; only select Quick Launch Icon, if previously installed
1288         IfFileExists "$QUICKLAUNCH\Wireshark.lnk" lbl_have_quicklaunchicon
1289         WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 4" "State" "0"
1290 lbl_have_quicklaunchicon:
1291
1292 lbl_wireshark_notinstalled:
1293
1294
1295 FunctionEnd