From Matt Poduska via bug 1957 (with minor changes):
[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 ${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}\bin\libcares-2.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_PATH}\comerr32.dll"
386 File "${KFW_PATH}\krb5_32.dll"
387 File "${KFW_PATH}\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 "..\..\wireshark-gtk2\COPYING.txt"
407 File "..\..\wireshark-gtk2\NEWS.txt"
408 File "..\..\wireshark-gtk2\README.txt"
409 File "..\..\wireshark-gtk2\README.windows.txt"
410 File "..\..\doc\AUTHORS-SHORT"
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\mobileipv6.xml"
477 File "..\..\diameter\nasreq.xml"
478 File "..\..\diameter\sip.xml"
479 File "..\..\diameter\sunping.xml"
480 File "..\..\diameter\TGPPGmb.xml"
481 File "..\..\diameter\TGPPRx.xml"
482 File "..\..\diameter\TGPPSh.xml"
483 SetOutPath $INSTDIR
484
485
486
487 ;
488 ; Install the RADIUS directory files in the "radius" subdirectory
489 ; of the installation directory.
490 ;
491 SetOutPath $INSTDIR\radius
492 File "..\..\radius\README.radius_dictionary"
493 File "..\..\radius\dictionary"
494 File "..\..\radius\dictionary.3com"
495 File "..\..\radius\dictionary.3gpp"
496 File "..\..\radius\dictionary.3gpp2"
497 File "..\..\radius\dictionary.acc"
498 File "..\..\radius\dictionary.airespace"
499 File "..\..\radius\dictionary.alcatel"
500 File "..\..\radius\dictionary.alteon"
501 File "..\..\radius\dictionary.altiga"
502 File "..\..\radius\dictionary.alvarion"
503 File "..\..\radius\dictionary.apc"
504 File "..\..\radius\dictionary.aptis"
505 File "..\..\radius\dictionary.aruba"
506 File "..\..\radius\dictionary.ascend"
507 File "..\..\radius\dictionary.asn"
508 File "..\..\radius\dictionary.avaya"
509 File "..\..\radius\dictionary.azaire"
510 File "..\..\radius\dictionary.bay"
511 File "..\..\radius\dictionary.bintec"
512 File "..\..\radius\dictionary.bristol"
513 File "..\..\radius\dictionary.cablelabs"
514 File "..\..\radius\dictionary.cabletron"
515 File "..\..\radius\dictionary.chillispot"
516 File "..\..\radius\dictionary.cisco"
517 File "..\..\radius\dictionary.cisco.bbsm"
518 File "..\..\radius\dictionary.cisco.vpn3000"
519 File "..\..\radius\dictionary.cisco.vpn5000"
520 File "..\..\radius\dictionary.clavister"
521 File "..\..\radius\dictionary.colubris"
522 File "..\..\radius\dictionary.columbia_university"
523 File "..\..\radius\dictionary.compat"
524 File "..\..\radius\dictionary.cosine"
525 File "..\..\radius\dictionary.dhcp"
526 File "..\..\radius\dictionary.digium"
527 File "..\..\radius\dictionary.epygi"
528 File "..\..\radius\dictionary.ericsson"
529 File "..\..\radius\dictionary.erx"
530 File "..\..\radius\dictionary.extreme"
531 File "..\..\radius\dictionary.fortinet"
532 File "..\..\radius\dictionary.foundry"
533 File "..\..\radius\dictionary.freeradius"
534 File "..\..\radius\dictionary.freeradius.internal"
535 File "..\..\radius\dictionary.freeswitch"
536 File "..\..\radius\dictionary.gandalf"
537 File "..\..\radius\dictionary.garderos"
538 File "..\..\radius\dictionary.gemtek"
539 File "..\..\radius\dictionary.h3c"
540 File "..\..\radius\dictionary.hp"
541 File "..\..\radius\dictionary.huawei"
542 File "..\..\radius\dictionary.infonet"
543 File "..\..\radius\dictionary.ipunplugged"
544 File "..\..\radius\dictionary.issanni"
545 File "..\..\radius\dictionary.itk"
546 File "..\..\radius\dictionary.jradius"
547 File "..\..\radius\dictionary.juniper"
548 File "..\..\radius\dictionary.karlnet"
549 File "..\..\radius\dictionary.lancom"
550 File "..\..\radius\dictionary.livingston"
551 File "..\..\radius\dictionary.localweb"
552 File "..\..\radius\dictionary.lucent"
553 File "..\..\radius\dictionary.manzara"
554 File "..\..\radius\dictionary.merit"
555 File "..\..\radius\dictionary.microsoft"
556 File "..\..\radius\dictionary.mikrotik"
557 File "..\..\radius\dictionary.motorola"
558 File "..\..\radius\dictionary.navini"
559 File "..\..\radius\dictionary.netscreen"
560 File "..\..\radius\dictionary.networkphysics"
561 File "..\..\radius\dictionary.nexans"
562 File "..\..\radius\dictionary.nokia"
563 File "..\..\radius\dictionary.nokia.conflict"
564 File "..\..\radius\dictionary.nomadix"
565 File "..\..\radius\dictionary.nortel"
566 File "..\..\radius\dictionary.ntua"
567 File "..\..\radius\dictionary.openser"
568 File "..\..\radius\dictionary.packeteer"
569 File "..\..\radius\dictionary.patton"
570 File "..\..\radius\dictionary.propel"
571 File "..\..\radius\dictionary.prosoft"
572 File "..\..\radius\dictionary.quiconnect"
573 File "..\..\radius\dictionary.quintum"
574 File "..\..\radius\dictionary.redback"
575 File "..\..\radius\dictionary.redcreek"
576 File "..\..\radius\dictionary.rfc2865"
577 File "..\..\radius\dictionary.rfc2866"
578 File "..\..\radius\dictionary.rfc2867"
579 File "..\..\radius\dictionary.rfc2868"
580 File "..\..\radius\dictionary.rfc2869"
581 File "..\..\radius\dictionary.rfc3162"
582 File "..\..\radius\dictionary.rfc3576"
583 File "..\..\radius\dictionary.rfc3580"
584 File "..\..\radius\dictionary.rfc4072"
585 File "..\..\radius\dictionary.rfc4372"
586 File "..\..\radius\dictionary.rfc4675"
587 File "..\..\radius\dictionary.rfc4679"
588 File "..\..\radius\dictionary.rfc4818"
589 File "..\..\radius\dictionary.rfc4849"
590 File "..\..\radius\dictionary.rfc5090"
591 File "..\..\radius\dictionary.rfc5176"
592 File "..\..\radius\dictionary.riverstone"
593 File "..\..\radius\dictionary.roaringpenguin"
594 File "..\..\radius\dictionary.shasta"
595 File "..\..\radius\dictionary.shiva"
596 File "..\..\radius\dictionary.slipstream"
597 File "..\..\radius\dictionary.sofaware"
598 File "..\..\radius\dictionary.sonicwall"
599 File "..\..\radius\dictionary.springtide"
600 File "..\..\radius\dictionary.starent"
601 File "..\..\radius\dictionary.t_systems_nova"
602 File "..\..\radius\dictionary.telebit"
603 File "..\..\radius\dictionary.telkom"
604 File "..\..\radius\dictionary.trapeze"
605 File "..\..\radius\dictionary.tropos"
606 File "..\..\radius\dictionary.tunnel"
607 File "..\..\radius\dictionary.unisphere"
608 File "..\..\radius\dictionary.unix"
609 File "..\..\radius\dictionary.usr"
610 File "..\..\radius\dictionary.utstarcom"
611 File "..\..\radius\dictionary.valemount"
612 File "..\..\radius\dictionary.versanet"
613 File "..\..\radius\dictionary.vqp"
614 File "..\..\radius\dictionary.walabi"
615 File "..\..\radius\dictionary.waverider"
616 File "..\..\radius\dictionary.wimax"
617 File "..\..\radius\dictionary.wispr"
618 File "..\..\radius\dictionary.xedia"
619 File "..\..\radius\dictionary.xylan"
620 File "..\..\radius\dictionary.zyxel"
621 SetOutPath $INSTDIR
622
623 ;
624 ; install the dtds in the dtds subdirectory
625 ;
626 SetOutPath $INSTDIR\dtds
627 File "..\..\dtds\dc.dtd"
628 File "..\..\dtds\itunes.dtd"
629 File "..\..\dtds\mscml.dtd"
630 File "..\..\dtds\pocsettings.dtd"
631 File "..\..\dtds\presence.dtd"
632 File "..\..\dtds\reginfo.dtd"
633 File "..\..\dtds\rlmi.dtd"
634 File "..\..\dtds\rss.dtd"
635 File "..\..\dtds\smil.dtd"
636 File "..\..\dtds\xcap-caps.dtd"
637 File "..\..\dtds\xcap-error.dtd"
638 File "..\..\dtds\watcherinfo.dtd"
639 SetOutPath $INSTDIR
640
641 ; Install the TPNCP DAT file in the "tpncp" subdirectory
642 ; of the installation directory.
643 SetOutPath $INSTDIR\tpncp
644 File "..\..\tpncp\tpncp.dat"
645
646 ;
647 ; install the wimaxasncp TLV definitions in the wimaxasncp subdirectory
648 ;
649 SetOutPath $INSTDIR\wimaxasncp
650 File "..\..\wimaxasncp\dictionary.xml"
651 File "..\..\wimaxasncp\dictionary.dtd"
652 SetOutPath $INSTDIR
653
654 SetOutPath $INSTDIR\help
655 File "..\..\wireshark-gtk2\help\toc"
656 File "..\..\wireshark-gtk2\help\overview.txt"
657 File "..\..\wireshark-gtk2\help\getting_started.txt"
658 File "..\..\wireshark-gtk2\help\capturing.txt"
659 File "..\..\wireshark-gtk2\help\capture_filters.txt"
660 File "..\..\wireshark-gtk2\help\display_filters.txt"
661 File "..\..\wireshark-gtk2\help\faq.txt"
662
663 ; Write the uninstall keys for Windows
664 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "DisplayVersion" "${VERSION}"
665 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "DisplayName" "Wireshark ${VERSION}"
666 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "UninstallString" '"$INSTDIR\uninstall.exe"'
667 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "Publisher" "The Wireshark developer community, http://www.wireshark.org"
668 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "HelpLink" "mailto:wireshark-users@wireshark.org"
669 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "URLInfoAbout" "http://www.wireshark.org"
670 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "URLUpdateInfo" "http://www.wireshark.org/download/win32/"
671 WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "NoModify" 1
672 WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "NoRepair" 1
673 WriteUninstaller "uninstall.exe"
674
675 ; Write an entry for ShellExecute
676 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\wireshark.exe" "" '$INSTDIR\wireshark.exe'
677 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\wireshark.exe" "Path" '$INSTDIR'
678
679 ; Create start menu entries (depending on additional tasks page)
680 ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 2" "State"
681 StrCmp $0 "0" SecRequired_skip_StartMenu
682 SetOutPath $PROFILE
683 ;CreateDirectory "$SMPROGRAMS\Wireshark"
684 ; To qoute "http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwue/html/ch11d.asp":
685 ; "Do not include Readme, Help, or Uninstall entries on the Programs menu."
686 Delete "$SMPROGRAMS\Wireshark\Wireshark Web Site.lnk"
687 ;WriteINIStr "$SMPROGRAMS\Wireshark\Wireshark Web Site.url" "InternetShortcut" "URL" "http://www.wireshark.org/"
688 CreateShortCut "$SMPROGRAMS\Wireshark.lnk" "$INSTDIR\wireshark.exe" "" "$INSTDIR\wireshark.exe" 0 "" "" "The Wireshark Network Protocol Analyzer"
689 ;CreateShortCut "$SMPROGRAMS\Wireshark\Wireshark Manual.lnk" "$INSTDIR\wireshark.html"
690 ;CreateShortCut "$SMPROGRAMS\Wireshark\Display Filters Manual.lnk" "$INSTDIR\wireshark-filter.html"
691 ;CreateShortCut "$SMPROGRAMS\Wireshark\Wireshark Program Directory.lnk" "$INSTDIR"
692 ;CreateShortCut "$SMPROGRAMS\Wireshark\Uninstall Wireshark.lnk" "$INSTDIR\uninstall.exe"
693 SecRequired_skip_StartMenu:
694
695 ; is command line option "/desktopicon" set?
696 ${GetParameters} $R0
697 ${GetOptions} $R0 "/desktopicon=" $R1
698 StrCmp $R1 "no" SecRequired_skip_DesktopIcon
699 StrCmp $R1 "yes" SecRequired_install_DesktopIcon
700
701 ; Create desktop icon (depending on additional tasks page and command line option)
702 ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 3" "State"
703 StrCmp $0 "0" SecRequired_skip_DesktopIcon
704 SecRequired_install_DesktopIcon:
705 CreateShortCut "$DESKTOP\Wireshark.lnk" "$INSTDIR\wireshark.exe" "" "$INSTDIR\wireshark.exe" 0 "" "" "The Wireshark Network Protocol Analyzer"
706 SecRequired_skip_DesktopIcon:
707
708 ; is command line option "/quicklaunchicon" set?
709 ${GetParameters} $R0
710 ${GetOptions} $R0 "/quicklaunchicon=" $R1
711 StrCmp $R1 "no" SecRequired_skip_QuickLaunchIcon
712 StrCmp $R1 "yes" SecRequired_install_QuickLaunchIcon
713
714 ; Create quick launch icon (depending on additional tasks page and command line option)
715 ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 4" "State"
716 StrCmp $0 "0" SecRequired_skip_QuickLaunchIcon
717 SecRequired_install_QuickLaunchIcon:
718 CreateShortCut "$QUICKLAUNCH\Wireshark.lnk" "$INSTDIR\wireshark.exe" "" "$INSTDIR\wireshark.exe" 0 "" "" "The Wireshark Network Protocol Analyzer"
719 SecRequired_skip_QuickLaunchIcon:
720
721 ; Create File Extensions (depending on additional tasks page)
722 ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 6" "State"
723 StrCmp $0 "0" SecRequired_skip_FileExtensions
724 WriteRegStr HKCR ${WIRESHARK_ASSOC} "" "Wireshark capture file"
725 WriteRegStr HKCR "${WIRESHARK_ASSOC}\Shell\open\command" "" '"$INSTDIR\wireshark.exe" "%1"'
726 WriteRegStr HKCR "${WIRESHARK_ASSOC}\DefaultIcon" "" '"$INSTDIR\wireshark.exe",1'
727 push $R0
728         StrCpy $R0 ".5vw"
729         Call Associate
730         StrCpy $R0 ".acp"
731         Call Associate
732         StrCpy $R0 ".apc"
733         Call Associate
734         StrCpy $R0 ".atc"
735         Call Associate
736         StrCpy $R0 ".bfr"
737         Call Associate
738         StrCpy $R0 ".cap"
739         Call Associate
740         StrCpy $R0 ".enc"
741         Call Associate
742         StrCpy $R0 ".erf"
743         Call Associate
744         StrCpy $R0 ".fdc"
745         Call Associate
746         StrCpy $R0 ".pcap"
747         Call Associate
748         StrCpy $R0 ".pcapng"
749         Call Associate
750         StrCpy $R0 ".pkt"
751         Call Associate
752         StrCpy $R0 ".snoop"
753         Call Associate
754         StrCpy $R0 ".syc"
755         Call Associate
756         StrCpy $R0 ".tpc"
757         Call Associate
758         StrCpy $R0 ".tr1"
759         Call Associate
760         StrCpy $R0 ".trace"
761         Call Associate
762         StrCpy $R0 ".trc"
763         Call Associate
764         StrCpy $R0 ".wpc"
765         Call Associate
766         StrCpy $R0 ".wpz"
767         Call Associate
768         StrCpy $R0 ".rf5"
769         Call Associate
770 ; if somethings added here, add it also to the uninstall section and the AdditionalTask page
771 pop $R0
772 !insertmacro UpdateIcons
773 SecRequired_skip_FileExtensions:
774
775 ; if running as a silent installer, don't try to install winpcap
776 IfSilent SecRequired_skip_Winpcap
777
778 ; Install WinPcap (depending on winpcap page setting)
779 ReadINIStr $0 "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "State"
780 StrCmp $0 "0" SecRequired_skip_Winpcap
781 ; Uinstall old WinPcap first
782 ReadRegStr $WINPCAP_UNINSTALL HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinPcapInst" "UninstallString"
783 IfErrors lbl_winpcap_notinstalled ;if RegKey is unavailable, WinPcap is not installed
784 ; from released version 3.1, WinPcap will uninstall an old version by itself
785 ;ExecWait '$WINPCAP_UNINSTALL' $0
786 ;DetailPrint "WinPcap uninstaller returned $0"
787 lbl_winpcap_notinstalled:
788 SetOutPath $INSTDIR
789 File "WinPcap_4_1_1.exe"
790 ExecWait '"$INSTDIR\WinPcap_4_1_1.exe"' $0
791 DetailPrint "WinPcap installer returned $0"
792 SecRequired_skip_Winpcap:
793
794 ; If no user profile exists for Wireshark but for Ethereal, copy it over
795 SetShellVarContext current
796 IfFileExists $APPDATA\Wireshark profile_done
797 IfFileExists $APPDATA\Ethereal 0 profile_done
798 ;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
799 CreateDirectory $APPDATA\Wireshark
800 CopyFiles $APPDATA\Ethereal\*.* $APPDATA\Wireshark
801 profile_done:
802 SetShellVarContext all
803
804 SectionEnd ; "Required"
805
806 !ifdef GTK_DIR
807 Section "Wireshark" SecWireshark
808 ;-------------------------------------------
809 SetOutPath $INSTDIR
810 File "..\..\wireshark.exe"
811 File "${GTK_DIR}\bin\libgdk-win32-2.0-0.dll"
812 File "${GTK_DIR}\bin\libgdk_pixbuf-2.0-0.dll"
813 File "${GTK_DIR}\bin\libgtk-win32-2.0-0.dll"
814 File "${GTK_DIR}\bin\libatk-1.0-0.dll"
815 File "${GTK_DIR}\bin\libpango-1.0-0.dll"
816 File "${GTK_DIR}\bin\libpangowin32-1.0-0.dll"
817 !ifdef NEED_CAIRO_DLL
818 File "${GTK_DIR}\bin\libcairo-2.dll"
819 File "${GTK_DIR}\bin\libpangocairo-1.0-0.dll"
820 !endif
821 !ifdef NEED_LIBPNG_DLL
822 File "${GTK_DIR}\bin\${PNG_DLL}"
823 !endif
824 !ifdef NEED_LIBTIFF_DLL
825 File "${GTK_DIR}\bin\${TIFF_DLL}"
826 !endif
827 !ifdef NEED_LIBJPEG_DLL
828 File "${GTK_DIR}\bin\${JPEG_DLL}"
829 !endif
830 !ifdef NEED_FREETYPE_DLL
831 File "${GTK_DIR}\bin\libpangoft2-1.0-0.dll"
832 File "${GTK_DIR}\bin\${FREETYPE_DLL}"
833 !endif
834 !ifdef NEED_FONTCONFIG_DLL
835 File "${GTK_DIR}\bin\${FONTCONFIG_DLL}"
836 !endif
837 !ifdef NEED_EXPAT_DLL
838 File "${GTK_DIR}\bin\${EXPAT_DLL}"
839 !endif
840 SetOutPath $INSTDIR\etc\gtk-2.0
841 File "${GTK_DIR}\etc\gtk-2.0\*.*"
842
843 !if ${WIRESHARK_TARGET_PLATFORM} == "win32"
844 SetOutPath $INSTDIR\etc\pango
845 File "${GTK_DIR}\etc\pango\pango.*"
846 ; Not needed for GTK+ >= 2.18
847 ;SetOutPath $INSTDIR\lib\gtk-2.0\${GTK_LIB_DIR}\loaders
848 ;File "${GTK_DIR}\lib\gtk-2.0\${GTK_LIB_DIR}\loaders\libpixbufloader-*.dll"
849 !endif
850
851 SetOutPath $INSTDIR\lib\gtk-2.0\${GTK_LIB_DIR}\engines
852 File "${GTK_DIR}\lib\gtk-2.0\${GTK_LIB_DIR}\engines\libpixmap.dll"
853 SetOutPath $INSTDIR\lib\gtk-2.0\modules
854 File "${GTK_DIR}\lib\gtk-2.0\modules\libgail.dll"
855
856 ; GTK MS-Windows Engine (GTK-Wimp)
857 SetOutPath $INSTDIR\${GTK_WIMP_DLLDST_DIR}
858 File "${GTK_WIMP_DLLSRC_DIR}\libwimp.dll"
859 SetOutPath $INSTDIR\${GTK_WIMP_RCDST_DIR}
860 File "${GTK_WIMP_RCSRC_DIR}\gtkrc"
861
862 SectionEnd ; "Wireshark"
863 !endif
864
865
866 Section "TShark" SecTShark
867 ;-------------------------------------------
868 SetOutPath $INSTDIR
869 File "..\..\tshark.exe"
870 File "..\..\doc\tshark.html"
871 SectionEnd
872
873 SectionGroup "Plugins / Extensions" SecPluginsGroup
874
875 Section "Dissector Plugins" SecPlugins
876 ;-------------------------------------------
877 SetOutPath '$INSTDIR\plugins\${VERSION}'
878 File "..\..\plugins\asn1\asn1.dll"
879 File "..\..\plugins\docsis\docsis.dll"
880 File "..\..\plugins\ethercat\ethercat.dll"
881 File "..\..\plugins\giop\coseventcomm.dll"
882 File "..\..\plugins\giop\cosnaming.dll"
883 File "..\..\plugins\giop\parlay.dll"
884 File "..\..\plugins\giop\tango.dll"
885 File "..\..\plugins\gryphon\gryphon.dll"
886 File "..\..\plugins\interlink\interlink.dll"
887 File "..\..\plugins\irda\irda.dll"
888 File "..\..\plugins\llrp\llrp.dll"
889 File "..\..\plugins\m2m\m2m.dll"
890 File "..\..\plugins\opcua\opcua.dll"
891 File "..\..\plugins\profinet\profinet.dll"
892 File "..\..\plugins\sercosiii\sercosiii.dll"
893 File "..\..\plugins\unistim\unistim.dll"
894 File "..\..\plugins\wimax\wimax.dll"
895 File "..\..\plugins\wimaxasncp\wimaxasncp.dll"
896 !include "custom_plugins.txt"
897 SectionEnd
898
899 Section "Tree Statistics Plugin" SecStatsTree
900 ;-------------------------------------------
901 SetOutPath '$INSTDIR\plugins\${VERSION}'
902 File "..\..\plugins\stats_tree\stats_tree.dll"
903 SectionEnd
904
905 Section "Mate - Meta Analysis and Tracing Engine" SecMate
906 ;-------------------------------------------
907 SetOutPath '$INSTDIR\plugins\${VERSION}'
908 File "..\..\plugins\mate\mate.dll"
909 SectionEnd
910
911
912 !ifdef NET_SNMP_DIR
913 Section "SNMP MIBs" SecMIBs
914 ;-------------------------------------------
915 SetOutPath $INSTDIR\snmp\mibs
916 File "${NET_SNMP_DIR}\mibs\*.txt"
917 SectionEnd
918 !endif
919
920 !ifdef SMI_DIR
921 Section "SNMP MIBs" SecMIBs
922 ;-------------------------------------------
923 SetOutPath $INSTDIR\snmp\mibs
924 File "${SMI_DIR}\mibs\*"
925 SectionEnd
926 !endif
927
928 SectionGroupEnd ; "Plugins / Extensions"
929
930
931 SectionGroup "Tools" SecToolsGroup
932
933 Section "Editcap" SecEditcap
934 ;-------------------------------------------
935 SetOutPath $INSTDIR
936 File "..\..\editcap.exe"
937 File "..\..\doc\editcap.html"
938 SectionEnd
939
940 Section "Text2Pcap" SecText2Pcap
941 ;-------------------------------------------
942 SetOutPath $INSTDIR
943 File "..\..\text2pcap.exe"
944 File "..\..\doc\text2pcap.html"
945 SectionEnd
946
947 Section "Mergecap" SecMergecap
948 ;-------------------------------------------
949 SetOutPath $INSTDIR
950 File "..\..\mergecap.exe"
951 File "..\..\doc\mergecap.html"
952 SectionEnd
953
954 Section "Capinfos" SecCapinfos
955 ;-------------------------------------------
956 SetOutPath $INSTDIR
957 File "..\..\capinfos.exe"
958 File "..\..\doc\capinfos.html"
959 SectionEnd
960
961 Section "Rawshark" SecRawshark
962 ;-------------------------------------------
963 SetOutPath $INSTDIR
964 File "..\..\rawshark.exe"
965 File "..\..\doc\rawshark.html"
966 SectionEnd
967
968 SectionGroupEnd ; "Tools"
969
970 !ifdef HHC_DIR
971 Section "User's Guide" SecUsersGuide
972 ;-------------------------------------------
973 SetOutPath $INSTDIR
974 File "user-guide.chm"
975 SectionEnd
976 !endif
977
978 Section "Uninstall" un.SecUinstall
979 ;-------------------------------------------
980
981 ;
982 ; UnInstall for every user
983 ;
984 SectionIn 1 2
985 SetShellVarContext all
986
987 Delete "$INSTDIR\rawshark.exe"
988 IfErrors 0 NoRawsharkErrorMsg
989         MessageBox MB_OK "Please note: rawshark.exe could not be removed, it's probably in use!" IDOK 0 ;skipped if rawshark.exe removed
990         Abort "Please note: rawshark.exe could not be removed, it's probably in use! Abort uninstall process!"
991 NoRawsharkErrorMsg:
992
993 Delete "$INSTDIR\tshark.exe"
994 IfErrors 0 NoTSharkErrorMsg
995         MessageBox MB_OK "Please note: tshark.exe could not be removed, it's probably in use!" IDOK 0 ;skipped if tshark.exe removed
996         Abort "Please note: tshark.exe could not be removed, it's probably in use! Abort uninstall process!"
997 NoTSharkErrorMsg:
998
999 Delete "$INSTDIR\wireshark.exe"
1000 IfErrors 0 NoWiresharkErrorMsg
1001         MessageBox MB_OK "Please note: wireshark.exe could not be removed, it's probably in use!" IDOK 0 ;skipped if wireshark.exe removed
1002         Abort "Please note: wireshark.exe could not be removed, it's probably in use! Abort uninstall process!"
1003 NoWiresharkErrorMsg:
1004
1005 DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark"
1006 DeleteRegKey HKEY_LOCAL_MACHINE "Software\Wireshark"
1007 DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\wireshark.exe"
1008
1009 push $R0
1010         StrCpy $R0 ".5vw"
1011         Call un.unlink
1012         StrCpy $R0 ".acp"
1013         Call un.unlink
1014         StrCpy $R0 ".apc"
1015         Call un.unlink
1016         StrCpy $R0 ".atc"
1017         Call un.unlink
1018         StrCpy $R0 ".bfr"
1019         Call un.unlink
1020         StrCpy $R0 ".cap"
1021         Call un.unlink
1022         StrCpy $R0 ".enc"
1023         Call un.unlink
1024         StrCpy $R0 ".erf"
1025         Call un.unlink
1026         StrCpy $R0 ".fdc"
1027         Call un.unlink
1028         StrCpy $R0 ".pcap"
1029         Call un.unlink
1030         StrCpy $R0 ".pkt"
1031         Call un.unlink
1032         StrCpy $R0 ".snoop"
1033         Call un.unlink
1034         StrCpy $R0 ".syc"
1035         Call un.unlink
1036         StrCpy $R0 ".tpc"
1037         Call un.unlink
1038         StrCpy $R0 ".tr1"
1039         Call un.unlink
1040         StrCpy $R0 ".trace"
1041         Call un.unlink
1042         StrCpy $R0 ".trc"
1043         Call un.unlink
1044         StrCpy $R0 ".wpc"
1045         Call un.unlink
1046         StrCpy $R0 ".wpz"
1047         Call un.unlink
1048         StrCpy $R0 ".rf5"
1049         Call un.unlink
1050 pop $R0
1051
1052 DeleteRegKey HKCR ${WIRESHARK_ASSOC}
1053 DeleteRegKey HKCR "${WIRESHARK_ASSOC}\Shell\open\command"
1054 DeleteRegKey HKCR "${WIRESHARK_ASSOC}\DefaultIcon"
1055 !insertmacro UpdateIcons
1056
1057 Delete "$INSTDIR\etc\gtk-2.0\*.*"
1058 Delete "$INSTDIR\etc\pango\*.*"
1059 Delete "$INSTDIR\lib\gtk-2.0\2.2.0\engines\*.*"
1060 Delete "$INSTDIR\lib\gtk-2.0\2.2.0\loaders\*.*"
1061 Delete "$INSTDIR\lib\gtk-2.0\2.2.0\immodules\*.*"
1062 Delete "$INSTDIR\lib\gtk-2.0\2.4.0\engines\*.*"
1063 Delete "$INSTDIR\lib\gtk-2.0\2.4.0\loaders\*.*"
1064 Delete "$INSTDIR\lib\gtk-2.0\2.4.0\immodules\*.*"
1065 Delete "$INSTDIR\lib\gtk-2.0\2.10.0\engines\*.*"
1066 Delete "$INSTDIR\lib\gtk-2.0\2.10.0\loaders\*.*"
1067 Delete "$INSTDIR\lib\gtk-2.0\2.10.0\immodules\*.*"
1068 Delete "$INSTDIR\lib\gtk-2.0\modules\*.*"
1069 Delete "$INSTDIR\lib\pango\1.2.0\modules\*.*"
1070 Delete "$INSTDIR\lib\pango\1.4.0\modules\*.*"
1071 Delete "$INSTDIR\lib\pango\1.5.0\modules\*.*"
1072 Delete "$INSTDIR\share\themes\Default\gtk-2.0\*.*"
1073 Delete "$INSTDIR\help\*.*"
1074 Delete "$INSTDIR\diameter\*.*"
1075 Delete "$INSTDIR\snmp\mibs\*.*"
1076 Delete "$INSTDIR\snmp\*.*"
1077 Delete "$INSTDIR\tpncp\*.*"
1078 Delete "$INSTDIR\wimaxasncp\*.*"
1079 Delete "$INSTDIR\*.exe"
1080 Delete "$INSTDIR\*.dll"
1081 Delete "$INSTDIR\*.html"
1082 Delete "$INSTDIR\ws.css"
1083 Delete "$INSTDIR\COPYING*"
1084 Delete "$INSTDIR\AUTHORS-SHORT"
1085 ; previous versions installed these files
1086 Delete "$INSTDIR\*.manifest"
1087 ; previous versions installed this file
1088 Delete "$INSTDIR\AUTHORS-SHORT-FORMAT"
1089 Delete "$INSTDIR\README*"
1090 Delete "$INSTDIR\NEWS.txt"
1091 Delete "$INSTDIR\manuf"
1092 Delete "$INSTDIR\services"
1093 Delete "$INSTDIR\pcrepattern.3.txt"
1094 Delete "$INSTDIR\user-guide.chm"
1095 Delete "$INSTDIR\example_snmp_users_file"
1096 Delete "$INSTDIR\ipmap.html"
1097 Delete "$INSTDIR\radius\*.*"
1098 Delete "$INSTDIR\dtds\*.*"
1099 Delete "$SMPROGRAMS\Wireshark\*.*"
1100 Delete "$SMPROGRAMS\Wireshark.lnk"
1101 Delete "$DESKTOP\Wireshark.lnk"
1102 Delete "$QUICKLAUNCH\Wireshark.lnk"
1103
1104 RMDir "$INSTDIR\etc\gtk-2.0"
1105 RMDir "$INSTDIR\etc\pango"
1106 RMDir "$INSTDIR\etc"
1107 RMDir "$INSTDIR\lib\gtk-2.0\2.2.0\engines"
1108 RMDir "$INSTDIR\lib\gtk-2.0\2.2.0\loaders"
1109 RMDir "$INSTDIR\lib\gtk-2.0\2.2.0\immodules"
1110 RMDir "$INSTDIR\lib\gtk-2.0\2.2.0"
1111 RMDir "$INSTDIR\lib\gtk-2.0\2.4.0\engines"
1112 RMDir "$INSTDIR\lib\gtk-2.0\2.4.0\loaders"
1113 RMDir "$INSTDIR\lib\gtk-2.0\2.4.0\immodules"
1114 RMDir "$INSTDIR\lib\gtk-2.0\2.4.0"
1115 RMDir "$INSTDIR\lib\gtk-2.0\2.10.0\engines"
1116 RMDir "$INSTDIR\lib\gtk-2.0\2.10.0\loaders"
1117 RMDir "$INSTDIR\lib\gtk-2.0\2.10.0\immodules"
1118 RMDir "$INSTDIR\lib\gtk-2.0\2.10.0"
1119 RMDir "$INSTDIR\lib\gtk-2.0\modules"
1120 RMDir "$INSTDIR\lib\gtk-2.0"
1121 RMDir "$INSTDIR\lib\pango\1.2.0\modules"
1122 RMDir "$INSTDIR\lib\pango\1.2.0"
1123 RMDir "$INSTDIR\lib\pango\1.4.0\modules"
1124 RMDir "$INSTDIR\lib\pango\1.4.0"
1125 RMDir "$INSTDIR\lib\pango\1.5.0\modules"
1126 RMDir "$INSTDIR\lib\pango\1.5.0"
1127 RMDir "$INSTDIR\lib\pango"
1128 RMDir "$INSTDIR\lib"
1129 RMDir "$INSTDIR\share\themes\Default\gtk-2.0"
1130 RMDir "$INSTDIR\share\themes\Default"
1131 RMDir "$INSTDIR\share\themes"
1132 RMDir "$INSTDIR\share"
1133 RMDir "$SMPROGRAMS\Wireshark"
1134 RMDir "$INSTDIR\help"
1135 RMDir "$INSTDIR\diameter"
1136 RMDir "$INSTDIR\snmp\mibs"
1137 RMDir "$INSTDIR\snmp"
1138 RMDir "$INSTDIR\radius"
1139 RMDir "$INSTDIR\dtds"
1140 RMDir "$INSTDIR\tpncp"
1141 RMDir "$INSTDIR\wimaxasncp"
1142 RMDir "$INSTDIR"
1143
1144 SectionEnd ; "Uinstall"
1145
1146 Section "Un.Plugins" un.SecPlugins
1147 ;-------------------------------------------
1148 SectionIn 1 2
1149 ;Delete "$INSTDIR\plugins\${VERSION}\*.*"
1150 ;Delete "$INSTDIR\plugins\*.*"
1151 ;RMDir "$INSTDIR\plugins\${VERSION}"
1152 ;RMDir "$INSTDIR\plugins"
1153 RMDir /r "$INSTDIR\plugins"
1154 SectionEnd
1155
1156 Section "Un.Global Settings" un.SecGlobalSettings
1157 ;-------------------------------------------
1158 SectionIn 1 2
1159 Delete "$INSTDIR\cfilters"
1160 Delete "$INSTDIR\colorfilters"
1161 Delete "$INSTDIR\dfilters"
1162 Delete "$INSTDIR\init.lua"
1163 Delete "$INSTDIR\console.lua"
1164 Delete "$INSTDIR\dtd_gen.lua"
1165 Delete "$INSTDIR\smi_modules"
1166 RMDir "$INSTDIR"
1167 SectionEnd
1168
1169 Section /o "Un.Personal Settings" un.SecPersonalSettings
1170 ;-------------------------------------------
1171 SectionIn 2
1172 SetShellVarContext current
1173 Delete "$APPDATA\Wireshark\*.*"
1174 RMDir "$APPDATA\Wireshark"
1175 SectionEnd
1176
1177 ;VAR un.WINPCAP_UNINSTALL
1178
1179 Section /o "Un.WinPcap" un.SecWinPcap
1180 ;-------------------------------------------
1181 SectionIn 2
1182 ReadRegStr $1 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinPcapInst" "UninstallString"
1183 ;IfErrors un.lbl_winpcap_notinstalled ;if RegKey is unavailable, WinPcap is not installed
1184 ;MessageBox MB_OK "WinPcap $1"
1185 ExecWait '$1' $0
1186 DetailPrint "WinPcap uninstaller returned $0"
1187 ;SetRebootFlag true
1188 ;un.lbl_winpcap_notinstalled:
1189 SectionEnd
1190
1191 Section "-Un.Finally"
1192 ;-------------------------------------------
1193 SectionIn 1 2
1194 ; this test must be done after all other things uninstalled (e.g. Global Settings)
1195 IfFileExists "$INSTDIR" 0 NoFinalErrorMsg
1196     MessageBox MB_OK "Please note: The directory $INSTDIR could not be removed!" IDOK 0 ; skipped if dir doesn't exist
1197 NoFinalErrorMsg:
1198 SectionEnd
1199
1200
1201 ; ============================================================================
1202 ; PLEASE MAKE SURE, THAT THE DESCRIPTIVE TEXT FITS INTO THE DESCRIPTION FIELD!
1203 ; ============================================================================
1204 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
1205 !ifdef GTK_DIR
1206   !insertmacro MUI_DESCRIPTION_TEXT ${SecWireshark} "${PROGRAM_NAME} is a GUI network protocol analyzer."
1207 !endif
1208   !insertmacro MUI_DESCRIPTION_TEXT ${SecTShark} "TShark is a text based network protocol analyzer."
1209   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsGroup} "Some plugins and extensions for both Wireshark and TShark."
1210   !insertmacro MUI_DESCRIPTION_TEXT ${SecPlugins} "Plugins with some extended dissections."
1211   !insertmacro MUI_DESCRIPTION_TEXT ${SecStatsTree} "Plugin for some extended statistics."
1212   !insertmacro MUI_DESCRIPTION_TEXT ${SecMate} "Plugin - Meta Analysis and Tracing Engine (Experimental)."
1213 !ifdef NET_SNMP_DIR
1214   !insertmacro MUI_DESCRIPTION_TEXT ${SecMIBs} "SNMP MIBs for better SNMP dissection."
1215 !endif
1216 !ifdef SMI_DIR
1217   !insertmacro MUI_DESCRIPTION_TEXT ${SecMIBs} "SNMP MIBs for better SNMP dissection."
1218 !endif
1219   !insertmacro MUI_DESCRIPTION_TEXT ${SecToolsGroup} "Additional command line based tools."
1220   !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."
1221   !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."
1222   !insertmacro MUI_DESCRIPTION_TEXT ${SecMergecap} "Mergecap is a program that combines multiple saved capture files into a single output file"
1223   !insertmacro MUI_DESCRIPTION_TEXT ${SecCapinfos} "Capinfos is a program that provides information on capture files."
1224   !insertmacro MUI_DESCRIPTION_TEXT ${SecRawshark} "Rawshark is a raw packet filter."
1225 !ifdef HHC_DIR
1226   !insertmacro MUI_DESCRIPTION_TEXT ${SecUsersGuide} "Install the user's guide, so an internet connection is not required to read the help pages."
1227 !endif
1228 !insertmacro MUI_FUNCTION_DESCRIPTION_END
1229
1230 !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
1231   !insertmacro MUI_DESCRIPTION_TEXT ${un.SecUinstall} "Uninstall all Wireshark components."
1232   !insertmacro MUI_DESCRIPTION_TEXT ${un.SecPlugins} "Uninstall all Plugins (even from previous Wireshark versions)."
1233   !insertmacro MUI_DESCRIPTION_TEXT ${un.SecGlobalSettings} "Uninstall global settings like: $INSTDIR\cfilters"
1234   !insertmacro MUI_DESCRIPTION_TEXT ${un.SecPersonalSettings} "Uninstall personal settings like your preferences file from your profile: $PROFILE."
1235   !insertmacro MUI_DESCRIPTION_TEXT ${un.SecWinPcap} "Call WinPcap's uninstall program."
1236 !insertmacro MUI_UNFUNCTION_DESCRIPTION_END
1237
1238 ; ============================================================================
1239 ; Callback functions
1240 ; ============================================================================
1241 !ifdef GTK_DIR
1242 ; Disable File extensions if Wireshark isn't selected
1243 Function .onSelChange
1244         Push $0
1245         SectionGetFlags ${SecWireshark} $0
1246         IntOp  $0 $0 & 1
1247         IntCmp $0 0 onSelChange.unselect
1248         WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 6" "State" 1
1249         WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 6" "Flags" ""
1250         WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 7" "Flags" ""
1251         Goto onSelChange.end
1252
1253 onSelChange.unselect:
1254         WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 6" "State" 0
1255         WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 6" "Flags" "DISABLED"
1256         WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 7" "Flags" "DISABLED"
1257         Goto onSelChange.end
1258
1259 onSelChange.end:
1260         Pop $0
1261 FunctionEnd
1262 !endif
1263
1264
1265 !include "GetWindowsVersion.nsh"
1266 !include WinMessages.nsh
1267 !include "VersionCompare.nsh"
1268
1269 Var WINPCAP_NAME ; DisplayName from WinPcap installation
1270 Var WINPCAP_VERSION ; DisplayVersion from WinPcap installation
1271
1272 Function myShowCallback
1273
1274         ; Get the Windows version
1275         Call GetWindowsVersion
1276         Pop $R0 ; Windows Version
1277
1278         ; Check if we're able to run with this version
1279         StrCmp $R0 '95' lbl_winversion_unsupported
1280         StrCmp $R0 '98' lbl_winversion_unsupported
1281         StrCmp $R0 'ME' lbl_winversion_unsupported
1282         StrCmp $R0 'NT 4.0' lbl_winversion_unsupported_nt4
1283         StrCmp $R0 '2000' lbl_winversion_unsupported_2000
1284         Goto lbl_winversion_supported
1285 lbl_winversion_unsupported:
1286         MessageBox MB_OK \
1287             "Windows $R0 is no longer supported. The last known version working with 98/ME was Ethereal 0.99.0." \
1288             /SD IDOK
1289         Quit
1290
1291 lbl_winversion_unsupported_nt4:
1292         MessageBox MB_OK \
1293             "Windows $R0 is no longer supported. The last known version working with NT 4.0 was Wireshark 0.99.4." \
1294             /SD IDOK
1295         Quit
1296
1297 lbl_winversion_unsupported_2000:
1298         MessageBox MB_OK \
1299             "Windows $R0 is no longer supported. Please install Wireshark 1.2 or 1.0." \
1300             /SD IDOK
1301         Quit
1302
1303 lbl_winversion_supported:
1304         ; detect if WinPcap should be installed
1305         WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "Text" "Install WinPcap 4.1.1"
1306         ReadRegStr $WINPCAP_NAME HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinPcapInst" "DisplayName"
1307         IfErrors 0 lbl_winpcap_installed ;if RegKey is available, WinPcap is already installed
1308         WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 2" "Text" "WinPcap is currently not installed"
1309         WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 2" "Flags" "DISABLED"
1310         WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Text" "(Use Add/Remove Programs first to uninstall any undetected old WinPcap versions)"
1311         Goto lbl_winpcap_done
1312
1313 lbl_winpcap_installed:
1314         WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 2" "Text" "$WINPCAP_NAME"
1315         ; Compare the installed build against the one we have.
1316         ReadRegStr $WINPCAP_VERSION HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinPcapInst" "DisplayVersion"
1317         StrCmp $WINPCAP_VERSION "" lbl_winpcap_do_install ; WinPcap is really old(?) or installed improperly.
1318         ${VersionCompare} $WINPCAP_VERSION "4.1.0.1753" $1 ; WinPcap 4.1.1
1319         StrCmp $1 "2" lbl_winpcap_do_install
1320
1321 ;lbl_winpcap_dont_install:
1322         ; The installed version is >= to what we have, so don't install
1323         WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "State" "0"
1324         WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Text" "If selected, the currently installed $WINPCAP_NAME will be uninstalled first."
1325         Goto lbl_winpcap_done
1326
1327 ;lbl_winpcap_dont_upgrade:
1328         ; force the user to upgrade by hand
1329         WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "State" "0"
1330         WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "Flags" "DISABLED"
1331         WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Text" "If you wish to install WinPcap 4.1.1, please uninstall $WINPCAP_NAME manually first."
1332         WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Flags" "DISABLED"
1333         Goto lbl_winpcap_done
1334
1335 lbl_winpcap_do_install:
1336         ; seems to be an old version, install newer one
1337         WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "State" "1"
1338         WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Text" "The currently installed $WINPCAP_NAME will be uninstalled first."
1339
1340 lbl_winpcap_done:
1341
1342         ; if Wireshark was previously installed, unselect previously not installed icons etc.
1343         ; detect if Wireshark is already installed ->
1344         ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "UninstallString"
1345         IfErrors lbl_wireshark_notinstalled ;if RegKey is unavailable, Wireshark is not installed
1346
1347         ; only select Start Menu Group, if previously installed
1348         ; (we use the "all users" start menu, so select it first)
1349         SetShellVarContext all
1350         IfFileExists "$SMPROGRAMS\Wireshark\Wireshark.lnk" lbl_have_startmenu
1351         IfFileExists "$SMPROGRAMS\Wireshark.lnk" lbl_have_startmenu
1352         WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 2" "State" "0"
1353 lbl_have_startmenu:
1354
1355         ; only select Desktop Icon, if previously installed
1356         IfFileExists "$DESKTOP\Wireshark.lnk" lbl_have_desktopicon
1357         WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 3" "State" "0"
1358 lbl_have_desktopicon:
1359
1360         ; only select Quick Launch Icon, if previously installed
1361         IfFileExists "$QUICKLAUNCH\Wireshark.lnk" lbl_have_quicklaunchicon
1362         WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 4" "State" "0"
1363 lbl_have_quicklaunchicon:
1364
1365 lbl_wireshark_notinstalled:
1366
1367
1368 FunctionEnd