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