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