If you hand
[obnox/wireshark/wip.git] / packaging / nsis / wireshark.nsi
index 307996b7673a70fa07508e8ca34c8989a7a37e29..91eb59f2e8cc6e88c82f14a46b9d8337c75f36ab 100644 (file)
 ; So if you get an error here, please update to at least NSIS 2.07!
 SetCompressor /SOLID lzma
 
-!ifdef GTK1_DIR & GTK2_DIR
-InstType "Wireshark (GTK2 user interface)"
-InstType "Wireshark (legacy GTK1 user interface)"
-!endif
-
 InstType "un.Default (keep Personal Settings and WinPcap)"
 InstType "un.All (remove all)"
 
@@ -24,18 +19,23 @@ InstType "un.All (remove all)"
 !define SHCNF_IDLIST 0
 
 ; Used to add associations between file extensions and Wireshark
-!define WIRESHARK_ASSOC "wireshark-file"
+!define WIRESHARK_ASSOC "wireshark-capture-file"
 
 ; ============================================================================
 ; Header configuration
 ; ============================================================================
 ; The name of the installer
 !define PROGRAM_NAME "Wireshark"
+!if ${PLATFORM} == "win32"
+!define BITS 32
+!else
+!define BITS 64
+!endif
 
-Name "${PROGRAM_NAME} ${VERSION}"
+Name "${PROGRAM_NAME} ${VERSION} (${BITS}-bit)"
 
 ; The file to write
-OutFile "${DEST}-setup-${VERSION}.exe"
+OutFile "wireshark-${PLATFORM}-${VERSION}.exe"
 
 ; Icon of installer and uninstaller
 Icon "..\..\image\wireshark.ico"
@@ -261,7 +261,50 @@ un.unlink.end:
        pop $R1
 FunctionEnd
 
+Var OLD_UNINSTALLER
+Var OLD_INSTDIR
+Var OLD_DISPLAYNAME
+Var TMP_UNINSTALLER
+
 Function .onInit
+  ; Copied from http://nsis.sourceforge.net/Auto-uninstall_old_before_installing_new
+  ReadRegStr $OLD_UNINSTALLER HKLM \
+    "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" \
+    "UninstallString"
+  StrCmp $OLD_UNINSTALLER "" done
+
+  ReadRegStr $OLD_INSTDIR HKLM \
+    "Software\Microsoft\Windows\CurrentVersion\App Paths\wireshark.exe" \
+    "Path"
+  StrCmp $OLD_INSTDIR "" done
+
+  ReadRegStr $OLD_DISPLAYNAME HKLM \
+    "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" \
+    "DisplayName"
+  StrCmp $OLD_DISPLAYNAME "" done
+
+  MessageBox MB_YESNOCANCEL|MB_ICONQUESTION \
+    "$OLD_DISPLAYNAME is already installed.\
+    $\n$\nWould you like to uninstall it first?" \
+      IDYES uninst \
+      IDNO done
+  Abort
+; Copy the uninstaller to $TEMP and run it.
+; The uninstaller normally does this by itself, but doesn't wait around
+; for the executable to finish, which means ExecWait won't work correctly.
+uninst:
+  ClearErrors
+  StrCpy $TMP_UNINSTALLER "$TEMP\wireshark_uninstaller.exe"
+  ; ...because we surround UninstallString in quotes.
+  StrCpy $0 $OLD_UNINSTALLER -1 1
+  StrCpy $1 "$TEMP\wireshark_uninstaller.exe"
+  StrCpy $2 1
+  System::Call 'kernel32::CopyFile(t r0, t r1, b r2) 1'
+  ExecWait "$TMP_UNINSTALLER _?=$OLD_INSTDIR"
+  Delete "$TMP_UNINSTALLER"
+  
+done:
   ;Extract InstallOptions INI files
   !insertmacro MUI_INSTALLOPTIONS_EXTRACT "AdditionalTasksPage.ini"
   !insertmacro MUI_INSTALLOPTIONS_EXTRACT "WinpcapPage.ini"
@@ -290,9 +333,6 @@ Section "-Required"
 ;
 ; Install for every user
 ;
-!ifdef GTK1_DIR & GTK2_DIR
-SectionIn 1 2 RO
-!endif
 SetShellVarContext all
 
 
@@ -302,19 +342,26 @@ File "..\..\wiretap\wiretap-${WTAP_VERSION}.dll"
 !ifdef ENABLE_LIBWIRESHARK
 File "..\..\epan\libwireshark.dll"
 !endif
+File "..\..\wsutil\libwsutil.dll"
+File "${GLIB_DIR}\bin\libgio-2.0-0.dll"
 File "${GLIB_DIR}\bin\libglib-2.0-0.dll"
-File "${GLIB_DIR}\bin\libgmodule-2.0-0.dll"
 File "${GLIB_DIR}\bin\libgobject-2.0-0.dll"
+File "${GLIB_DIR}\bin\libgmodule-2.0-0.dll"
+!ifdef ICONV_DIR
 File "${ICONV_DIR}\bin\iconv.dll"
+!endif
 File "${GETTEXT_DIR}\bin\intl.dll"
 !ifdef ZLIB_DIR
 File "${ZLIB_DIR}\zlib1.dll"
 !endif
+!ifdef C_ARES_DIR
+File "${C_ARES_DIR}\cares.dll"
+!endif
 !ifdef ADNS_DIR
-File "${ADNS_DIR}\adns_win32\LIB\adns_dll.dll"
+File "${ADNS_DIR}\..\${MSVC_VARIANT}\adns\adns_dll.dll"
 !endif
 !ifdef PCRE_DIR
-File "${PCRE_DIR}\bin\pcre.dll"
+File "${PCRE_DIR}\bin\pcre3.dll"
 File "${PCRE_DIR}\man\cat3\pcrepattern.3.txt"
 !endif
 !ifdef KFW_DIR
@@ -323,14 +370,14 @@ File "${KFW_DIR}\bin\krb5_32.dll"
 !endif
 !ifdef GNUTLS_DIR
 File "${GNUTLS_DIR}\bin\libgcrypt-11.dll"
-File "${GNUTLS_DIR}\bin\libgnutls-13.dll"
-File "${GNUTLS_DIR}\bin\libgnutls-extra-13.dll"
-File "${GNUTLS_DIR}\bin\libgnutls-openssl-13.dll"
+File "${GNUTLS_DIR}\bin\libgnutls-26.dll"
+File "${GNUTLS_DIR}\bin\libgnutls-extra-26.dll"
+File "${GNUTLS_DIR}\bin\libgnutls-openssl-26.dll"
 File "${GNUTLS_DIR}\bin\libgpg-error-0.dll"
 File "${GNUTLS_DIR}\bin\libtasn1-3.dll"
 !endif
 !ifdef LUA_DIR
-File "${LUA_DIR}\lib\dll\lua5.1.dll"
+File "${LUA_DIR}\lua5.1.dll"
 File "..\..\epan\wslua\init.lua"
 File "..\..\epan\wslua\console.lua"
 File "..\..\epan\wslua\dtd_gen.lua"
@@ -338,7 +385,6 @@ File "..\..\epan\wslua\dtd_gen.lua"
 !ifdef SMI_DIR
 File "${SMI_DIR}\lib\smi.dll"
 !endif
-File "..\..\FAQ"
 File "..\..\README"
 File "..\..\README.win32"
 File "..\..\AUTHORS-SHORT"
@@ -346,11 +392,11 @@ File "..\..\COPYING"
 File "NEWS.txt"
 File "..\..\manuf"
 File "..\..\services"
+File "..\..\doc\ws.css"
 File "..\..\doc\wireshark.html"
 File "..\..\doc\wireshark-filter.html"
 File "..\..\dumpcap.exe"
 File "..\..\doc\dumpcap.html"
-File "..\..\example_snmp_users_file"
 
 ; C-runtime redistributable
 !ifdef VCREDIST_EXE
@@ -361,6 +407,7 @@ DetailPrint "vcredist_x86 returned $0"
 !else
 !ifdef MSVCR_DLL
 ; msvcr*.dll (MSVC V7 or V7.1) - simply copy the dll file
+!echo "IF YOU GET AN ERROR HERE, check the MSVC_VARIANT setting in config.nmake: MSVC2005 vs. MSVC2005EE!"
 File "${MSVCR_DLL}"
 !else
 !if ${MSVC_VARIANT} != "MSVC6"
@@ -380,6 +427,9 @@ File "..\..\colorfilters"
 ;IfFileExists dfilters dont_overwrite_dfilters
 File "..\..\dfilters"
 ;dont_overwrite_dfilters:
+;IfFileExists smi_modules dont_overwrite_smi_modules
+File "..\..\smi_modules"
+;dont_overwrite_smi_modules:
 
 
 ;
@@ -390,6 +440,7 @@ SetOutPath $INSTDIR\diameter
 File "..\..\diameter\chargecontrol.xml"
 File "..\..\diameter\dictionary.dtd"
 File "..\..\diameter\dictionary.xml"
+File "..\..\diameter\Ericsson.xml"
 File "..\..\diameter\etsie2e4.xml"
 File "..\..\diameter\gqpolicy.xml"
 File "..\..\diameter\imscxdx.xml"
@@ -397,6 +448,8 @@ File "..\..\diameter\mobileipv4.xml"
 File "..\..\diameter\nasreq.xml"
 File "..\..\diameter\sip.xml"
 File "..\..\diameter\sunping.xml"
+File "..\..\diameter\TGPPGmb.xml"
+File "..\..\diameter\TGPPRx.xml"
 File "..\..\diameter\TGPPSh.xml"
 SetOutPath $INSTDIR
 
@@ -417,6 +470,7 @@ File "..\..\radius\dictionary.alteon"
 File "..\..\radius\dictionary.altiga"
 File "..\..\radius\dictionary.aptis"
 File "..\..\radius\dictionary.ascend"
+File "..\..\radius\dictionary.aruba"
 File "..\..\radius\dictionary.bay"
 File "..\..\radius\dictionary.bintec"
 File "..\..\radius\dictionary.bristol"
@@ -489,6 +543,19 @@ File "..\..\dtds\xcap-error.dtd"
 File "..\..\dtds\watcherinfo.dtd"
 SetOutPath $INSTDIR
 
+; Install the TPNCP DAT file in the "tpncp" subdirectory
+; of the installation directory.
+SetOutPath $INSTDIR\tpncp
+File "..\..\tpncp\tpncp.dat"
+
+;
+; install the wimaxasncp TLV definitions in the wimaxasncp subdirectory
+;
+SetOutPath $INSTDIR\wimaxasncp
+File "..\..\wimaxasncp\dictionary.xml"
+File "..\..\wimaxasncp\dictionary.dtd"
+SetOutPath $INSTDIR
+
 SetOutPath $INSTDIR\help
 File "..\..\help\toc"
 File "..\..\help\overview.txt"
@@ -518,16 +585,15 @@ WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Pa
 ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 2" "State"
 StrCmp $0 "0" SecRequired_skip_StartMenu
 SetOutPath $PROFILE
-CreateDirectory "$SMPROGRAMS\Wireshark"
+;CreateDirectory "$SMPROGRAMS\Wireshark"
 ; To qoute "http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwue/html/ch11d.asp":
 ; "Do not include Readme, Help, or Uninstall entries on the Programs menu."
 Delete "$SMPROGRAMS\Wireshark\Wireshark Web Site.lnk"
 ;WriteINIStr "$SMPROGRAMS\Wireshark\Wireshark Web Site.url" "InternetShortcut" "URL" "http://www.wireshark.org/"
-CreateShortCut "$SMPROGRAMS\Wireshark\Wireshark.lnk" "$INSTDIR\wireshark.exe" "" "$INSTDIR\wireshark.exe" 0 "" "" "The Wireshark Network Protocol Analyzer"
+CreateShortCut "$SMPROGRAMS\Wireshark.lnk" "$INSTDIR\wireshark.exe" "" "$INSTDIR\wireshark.exe" 0 "" "" "The Wireshark Network Protocol Analyzer"
 ;CreateShortCut "$SMPROGRAMS\Wireshark\Wireshark Manual.lnk" "$INSTDIR\wireshark.html"
 ;CreateShortCut "$SMPROGRAMS\Wireshark\Display Filters Manual.lnk" "$INSTDIR\wireshark-filter.html"
-CreateShortCut "$SMPROGRAMS\Wireshark\Wireshark Program Directory.lnk" \
-          "$INSTDIR"
+;CreateShortCut "$SMPROGRAMS\Wireshark\Wireshark Program Directory.lnk" "$INSTDIR"
 ;CreateShortCut "$SMPROGRAMS\Wireshark\Uninstall Wireshark.lnk" "$INSTDIR\uninstall.exe"
 SecRequired_skip_StartMenu:
 
@@ -560,7 +626,7 @@ SecRequired_skip_QuickLaunchIcon:
 ; Create File Extensions (depending on additional tasks page)
 ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 6" "State"
 StrCmp $0 "0" SecRequired_skip_FileExtensions
-WriteRegStr HKCR ${WIRESHARK_ASSOC} "" "Wireshark file"
+WriteRegStr HKCR ${WIRESHARK_ASSOC} "" "Wireshark capture file"
 WriteRegStr HKCR "${WIRESHARK_ASSOC}\Shell\open\command" "" '"$INSTDIR\wireshark.exe" "%1"'
 WriteRegStr HKCR "${WIRESHARK_ASSOC}\DefaultIcon" "" '"$INSTDIR\wireshark.exe",1'
 push $R0
@@ -602,6 +668,8 @@ push $R0
        Call Associate
        StrCpy $R0 ".wpz"
        Call Associate
+       StrCpy $R0 ".rf5"
+       Call Associate
 ; if somethings added here, add it also to the uninstall section and the AdditionalTask page
 pop $R0
 !insertmacro UpdateIcons
@@ -621,8 +689,8 @@ IfErrors lbl_winpcap_notinstalled ;if RegKey is unavailable, WinPcap is not inst
 ;DetailPrint "WinPcap uninstaller returned $0"
 lbl_winpcap_notinstalled:
 SetOutPath $INSTDIR
-File "WinPcap_4_0_1.exe"
-ExecWait '"$INSTDIR\WinPcap_4_0_1.exe"' $0
+File "WinPcap_4_0_2.exe"
+ExecWait '"$INSTDIR\WinPcap_4_0_2.exe"' $0
 DetailPrint "WinPcap installer returned $0"
 SecRequired_skip_Winpcap:
 
@@ -649,79 +717,56 @@ SetShellVarContext all
 
 SectionEnd ; "Required"
 
-
-SectionGroup "!Wireshark" SecWiresharkGroup
-
-!ifdef GTK1_DIR
-Section "Wireshark GTK1" SecWiresharkGTK1
+!ifdef GTK_DIR
+Section "Wireshark" SecWireshark
 ;-------------------------------------------
-!ifdef GTK1_DIR & GTK2_DIR
-SectionIn 2 RO
-!endif
 SetOutPath $INSTDIR
 File "..\..\wireshark.exe"
-File "${GTK1_DIR}\lib\libgtk-0.dll"
-File "${GTK1_DIR}\lib\libgdk-0.dll"
-SectionEnd
-!endif
-
-!ifdef GTK2_DIR
-Section "Wireshark GTK2" SecWiresharkGTK2
-;-------------------------------------------
-!ifdef GTK1_DIR & GTK2_DIR
-SectionIn 1 RO
-!endif
-SetOutPath $INSTDIR
-File /oname=wireshark.exe "..\..\wireshark-gtk2.exe"
-IfFileExists $INSTDIR\wireshark-gtk2.exe.manifest 0 +2
-Rename $INSTDIR\wireshark-gtk2.exe.manifest $INSTDIR\wireshark.exe.manifest
-File "${GTK2_DIR}\bin\libgdk-win32-2.0-0.dll"
-File "${GTK2_DIR}\bin\libgdk_pixbuf-2.0-0.dll"
-File "${GTK2_DIR}\bin\libgtk-win32-2.0-0.dll"
-File "${GTK2_DIR}\bin\libatk-1.0-0.dll"
-File "${GTK2_DIR}\bin\libpango-1.0-0.dll"
-File "${GTK2_DIR}\bin\libpangowin32-1.0-0.dll"
+File "${GTK_DIR}\bin\libgdk-win32-2.0-0.dll"
+File "${GTK_DIR}\bin\libgdk_pixbuf-2.0-0.dll"
+File "${GTK_DIR}\bin\libgtk-win32-2.0-0.dll"
+File "${GTK_DIR}\bin\libatk-1.0-0.dll"
+File "${GTK_DIR}\bin\libpango-1.0-0.dll"
+File "${GTK_DIR}\bin\libpangowin32-1.0-0.dll"
 !ifdef NEED_CAIRO_DLL
-File "${GTK2_DIR}\bin\libcairo-2.dll"
-File "${GTK2_DIR}\bin\libpangocairo-1.0-0.dll"
+File "${GTK_DIR}\bin\libcairo-2.dll"
+File "${GTK_DIR}\bin\libpangocairo-1.0-0.dll"
 !endif
 !ifdef NEED_LIBPNG_DLL
-File "${GTK2_DIR}\bin\libpng13.dll"
+File "${GTK_DIR}\bin\libpng12-0.dll"
+!endif
+!ifdef NEED_LIBTIFF_DLL
+File "${GTK_DIR}\bin\libtiff3.dll"
+!endif
+!ifdef NEED_LIBJPEG_DLL
+File "${GTK_DIR}\bin\jpeg62.dll"
 !endif
 SetOutPath $INSTDIR\etc\gtk-2.0
-File "${GTK2_DIR}\etc\gtk-2.0\*.*"
+File "${GTK_DIR}\etc\gtk-2.0\*.*"
 SetOutPath $INSTDIR\etc\pango
-File "${GTK2_DIR}\etc\pango\pango.*"
-SetOutPath $INSTDIR\lib\gtk-2.0\${GTK2_LIB_DIR}\loaders
-File "${GTK2_DIR}\lib\gtk-2.0\${GTK2_LIB_DIR}\loaders\libpixbufloader-*.dll"
-SetOutPath $INSTDIR\lib\gtk-2.0\${GTK2_LIB_DIR}\immodules
-File "${GTK2_DIR}\lib\gtk-2.0\${GTK2_LIB_DIR}\immodules\im-*.dll"
+File "${GTK_DIR}\etc\pango\pango.*"
+SetOutPath $INSTDIR\lib\gtk-2.0\${GTK_LIB_DIR}\loaders
+File "${GTK_DIR}\lib\gtk-2.0\${GTK_LIB_DIR}\loaders\libpixbufloader-*.dll"
+SetOutPath $INSTDIR\lib\gtk-2.0\${GTK_LIB_DIR}\engines
+File "${GTK_DIR}\lib\gtk-2.0\${GTK_LIB_DIR}\engines\libpixmap.dll"
+SetOutPath $INSTDIR\lib\gtk-2.0\modules
+File "${GTK_DIR}\lib\gtk-2.0\modules\libgail.dll"
 # Not needed with pango 1.14.5
 #SetOutPath $INSTDIR\lib\pango\${PANGO_LIB_DIR}\modules
-#File "${GTK2_DIR}\lib\pango\${PANGO_LIB_DIR}\modules\pango-*.dll"
-
-SectionEnd
+#File "${GTK_DIR}\lib\pango\${PANGO_LIB_DIR}\modules\pango-*.dll"
 
-!ifdef GTK_WIMP_DIR
-Section "GTK MS Windows Engine" SecGTKWimp
-;-------------------------------------------
-SectionIn 1
+; GTK MS-Windows Engine (GTK-Wimp)
 SetOutPath $INSTDIR\${GTK_WIMP_DLLDST_DIR}
 File "${GTK_WIMP_DLLSRC_DIR}\libwimp.dll"
 SetOutPath $INSTDIR\${GTK_WIMP_RCDST_DIR}
 File "${GTK_WIMP_RCSRC_DIR}\gtkrc"
-SectionEnd
-!endif
-!endif
 
-SectionGroupEnd        ; "Wireshark"
+SectionEnd ; "Wireshark"
+!endif
 
 
 Section "TShark" SecTShark
 ;-------------------------------------------
-!ifdef GTK1_DIR & GTK2_DIR
-SectionIn 1 2
-!endif
 SetOutPath $INSTDIR
 File "..\..\tshark.exe"
 File "..\..\doc\tshark.html"
@@ -731,9 +776,6 @@ SectionGroup "Plugins / Extensions" SecPluginsGroup
 
 Section "Dissector Plugins" SecPlugins
 ;-------------------------------------------
-!ifdef GTK1_DIR & GTK2_DIR
-SectionIn 1 2
-!endif
 SetOutPath $INSTDIR\plugins\${VERSION}
 File "..\..\plugins\agentx\agentx.dll"
 File "..\..\plugins\artnet\artnet.dll"
@@ -741,15 +783,16 @@ File "..\..\plugins\asn1\asn1.dll"
 File "..\..\plugins\ciscosm\ciscosm.dll"
 File "..\..\plugins\docsis\docsis.dll"
 File "..\..\plugins\enttec\enttec.dll"
+File "..\..\plugins\ethercat\ethercat.dll"
 File "..\..\plugins\giop\coseventcomm.dll"
 File "..\..\plugins\giop\cosnaming.dll"
 File "..\..\plugins\giop\parlay.dll"
 File "..\..\plugins\giop\tango.dll"
 File "..\..\plugins\gryphon\gryphon.dll"
+File "..\..\plugins\infiniband\infiniband.dll"
 File "..\..\plugins\irda\irda.dll"
 File "..\..\plugins\lwres\lwres.dll"
 File "..\..\plugins\m2m\m2m.dll"
-File "..\..\plugins\mgcp\mgcp.dll"
 File "..\..\plugins\opsi\opsi.dll"
 File "..\..\plugins\pcli\pcli.dll"
 File "..\..\plugins\profinet\profinet.dll"
@@ -757,16 +800,15 @@ File "..\..\plugins\rlm\rlm.dll"
 File "..\..\plugins\rtnet\rtnet.dll"
 File "..\..\plugins\rudp\rudp.dll"
 File "..\..\plugins\sbus\sbus.dll"
+File "..\..\plugins\sercosiii\sercosiii.dll"
 File "..\..\plugins\unistim\unistim.dll"
 File "..\..\plugins\v5ua\v5ua.dll"
 File "..\..\plugins\wimax\wimax.dll"
+File "..\..\plugins\wimaxasncp\wimaxasncp.dll"
 SectionEnd
 
 Section "Tree Statistics Plugin" SecStatsTree
 ;-------------------------------------------
-!ifdef GTK1_DIR & GTK2_DIR
-SectionIn 1 2
-!endif
 SetOutPath $INSTDIR\plugins\${VERSION}
 File "..\..\plugins\stats_tree\stats_tree.dll"
 SectionEnd
@@ -781,9 +823,6 @@ SectionEnd
 !ifdef NET_SNMP_DIR
 Section "SNMP MIBs" SecMIBs
 ;-------------------------------------------
-!ifdef GTK1_DIR & GTK2_DIR
-SectionIn 1 2
-!endif
 SetOutPath $INSTDIR\snmp\mibs
 File "${NET_SNMP_DIR}\mibs\*.txt"
 SectionEnd
@@ -792,9 +831,6 @@ SectionEnd
 !ifdef SMI_DIR
 Section "SNMP MIBs" SecMIBs
 ;-------------------------------------------
-!ifdef GTK1_DIR & GTK2_DIR
-SectionIn 1 2
-!endif
 SetOutPath $INSTDIR\snmp\mibs
 File "${SMI_DIR}\mibs\*"
 SectionEnd
@@ -807,9 +843,6 @@ SectionGroup "Tools" SecToolsGroup
 
 Section "Editcap" SecEditcap
 ;-------------------------------------------
-!ifdef GTK1_DIR & GTK2_DIR
-SectionIn 1 2
-!endif
 SetOutPath $INSTDIR
 File "..\..\editcap.exe"
 File "..\..\doc\editcap.html"
@@ -817,9 +850,6 @@ SectionEnd
 
 Section "Text2Pcap" SecText2Pcap
 ;-------------------------------------------
-!ifdef GTK1_DIR & GTK2_DIR
-SectionIn 1 2
-!endif
 SetOutPath $INSTDIR
 File "..\..\text2pcap.exe"
 File "..\..\doc\text2pcap.html"
@@ -827,9 +857,6 @@ SectionEnd
 
 Section "Mergecap" SecMergecap
 ;-------------------------------------------
-!ifdef GTK1_DIR & GTK2_DIR
-SectionIn 1 2
-!endif
 SetOutPath $INSTDIR
 File "..\..\mergecap.exe"
 File "..\..\doc\mergecap.html"
@@ -837,22 +864,23 @@ SectionEnd
 
 Section "Capinfos" SecCapinfos
 ;-------------------------------------------
-!ifdef GTK1_DIR & GTK2_DIR
-SectionIn 1 2
-!endif
 SetOutPath $INSTDIR
 File "..\..\capinfos.exe"
 File "..\..\doc\capinfos.html"
 SectionEnd
 
+Section "Rawshark" SecRawshark
+;-------------------------------------------
+SetOutPath $INSTDIR
+File "..\..\rawshark.exe"
+File "..\..\doc\rawshark.html"
+SectionEnd
+
 SectionGroupEnd        ; "Tools"
 
 !ifdef HHC_DIR
 Section "User's Guide" SecUsersGuide
 ;-------------------------------------------
-!ifdef GTK1_DIR & GTK2_DIR
-SectionIn 1 2
-!endif
 SetOutPath $INSTDIR
 File "user-guide.chm"
 SectionEnd
@@ -867,6 +895,12 @@ Section "Uninstall" un.SecUinstall
 SectionIn 1 2
 SetShellVarContext all
 
+Delete "$INSTDIR\rawshark.exe"
+IfErrors 0 NoRawsharkErrorMsg
+       MessageBox MB_OK "Please note: rawshark.exe could not be removed, it's probably in use!" IDOK 0 ;skipped if rawshark.exe removed
+       Abort "Please note: rawshark.exe could not be removed, it's probably in use! Abort uninstall process!"
+NoRawsharkErrorMsg:
+
 Delete "$INSTDIR\tshark.exe"
 IfErrors 0 NoTSharkErrorMsg
        MessageBox MB_OK "Please note: tshark.exe could not be removed, it's probably in use!" IDOK 0 ;skipped if tshark.exe removed
@@ -922,6 +956,8 @@ push $R0
        Call un.unlink
        StrCpy $R0 ".wpz"
        Call un.unlink
+       StrCpy $R0 ".rf5"
+       Call un.unlink
 pop $R0
 
 DeleteRegKey HKCR ${WIRESHARK_ASSOC}
@@ -929,7 +965,6 @@ DeleteRegKey HKCR "${WIRESHARK_ASSOC}\Shell\open\command"
 DeleteRegKey HKCR "${WIRESHARK_ASSOC}\DefaultIcon"
 !insertmacro UpdateIcons
 
-; regardless if we currently installed GTK1 or 2, try to uninstall GTK2 files too
 Delete "$INSTDIR\etc\gtk-2.0\*.*"
 Delete "$INSTDIR\etc\pango\*.*"
 Delete "$INSTDIR\lib\gtk-2.0\2.2.0\engines\*.*"
@@ -941,6 +976,7 @@ Delete "$INSTDIR\lib\gtk-2.0\2.4.0\immodules\*.*"
 Delete "$INSTDIR\lib\gtk-2.0\2.10.0\engines\*.*"
 Delete "$INSTDIR\lib\gtk-2.0\2.10.0\loaders\*.*"
 Delete "$INSTDIR\lib\gtk-2.0\2.10.0\immodules\*.*"
+Delete "$INSTDIR\lib\gtk-2.0\modules\*.*"
 Delete "$INSTDIR\lib\pango\1.2.0\modules\*.*"
 Delete "$INSTDIR\lib\pango\1.4.0\modules\*.*"
 Delete "$INSTDIR\lib\pango\1.5.0\modules\*.*"
@@ -949,16 +985,19 @@ Delete "$INSTDIR\help\*.*"
 Delete "$INSTDIR\diameter\*.*"
 Delete "$INSTDIR\snmp\mibs\*.*"
 Delete "$INSTDIR\snmp\*.*"
+Delete "$INSTDIR\tpncp\*.*"
+Delete "$INSTDIR\wimaxasncp\*.*"
 Delete "$INSTDIR\*.exe"
 Delete "$INSTDIR\*.dll"
 Delete "$INSTDIR\*.html"
+Delete "$INSTDIR\ws.css"
 Delete "$INSTDIR\COPYING"
 Delete "$INSTDIR\AUTHORS-SHORT"
+; previous versions installed these files
 Delete "$INSTDIR\*.manifest"
 ; previous versions installed this file
 Delete "$INSTDIR\AUTHORS-SHORT-FORMAT"
 Delete "$INSTDIR\README*"
-Delete "$INSTDIR\FAQ"
 Delete "$INSTDIR\NEWS.txt"
 Delete "$INSTDIR\manuf"
 Delete "$INSTDIR\services"
@@ -968,6 +1007,7 @@ Delete "$INSTDIR\example_snmp_users_file"
 Delete "$INSTDIR\radius\*.*"
 Delete "$INSTDIR\dtds\*.*"
 Delete "$SMPROGRAMS\Wireshark\*.*"
+Delete "$SMPROGRAMS\Wireshark.lnk"
 Delete "$DESKTOP\Wireshark.lnk"
 Delete "$QUICKLAUNCH\Wireshark.lnk"
 
@@ -986,6 +1026,7 @@ RMDir "$INSTDIR\lib\gtk-2.0\2.10.0\engines"
 RMDir "$INSTDIR\lib\gtk-2.0\2.10.0\loaders"
 RMDir "$INSTDIR\lib\gtk-2.0\2.10.0\immodules"
 RMDir "$INSTDIR\lib\gtk-2.0\2.10.0"
+RMDir "$INSTDIR\lib\gtk-2.0\modules"
 RMDir "$INSTDIR\lib\gtk-2.0"
 RMDir "$INSTDIR\lib\pango\1.2.0\modules"
 RMDir "$INSTDIR\lib\pango\1.2.0"
@@ -1006,6 +1047,8 @@ RMDir "$INSTDIR\snmp\mibs"
 RMDir "$INSTDIR\snmp"
 RMDir "$INSTDIR\radius"
 RMDir "$INSTDIR\dtds"
+RMDir "$INSTDIR\tpncp"
+RMDir "$INSTDIR\wimaxasncp"
 RMDir "$INSTDIR"
 
 SectionEnd ; "Uinstall"
@@ -1029,6 +1072,7 @@ Delete "$INSTDIR\dfilters"
 Delete "$INSTDIR\init.lua"
 Delete "$INSTDIR\console.lua"
 Delete "$INSTDIR\dtd_gen.lua"
+Delete "$INSTDIR\smi_modules"
 RMDir "$INSTDIR"
 SectionEnd
 
@@ -1068,15 +1112,8 @@ SectionEnd
 ; PLEASE MAKE SURE, THAT THE DESCRIPTIVE TEXT FITS INTO THE DESCRIPTION FIELD!
 ; ============================================================================
 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
-  !insertmacro MUI_DESCRIPTION_TEXT ${SecWiresharkGroup} "${PROGRAM_NAME} is a GUI network protocol analyzer."
-!ifdef GTK1_DIR
-  !insertmacro MUI_DESCRIPTION_TEXT ${SecWiresharkGTK1} "${PROGRAM_NAME} using the classical GTK1 user interface."
-!endif
-!ifdef GTK2_DIR
-  !insertmacro MUI_DESCRIPTION_TEXT ${SecWiresharkGTK2} "${PROGRAM_NAME} using the modern GTK2 user interface."
-!ifdef GTK_WIMP_DIR
-  !insertmacro MUI_DESCRIPTION_TEXT ${SecGTKWimp} "GTK MS Windows Engine - native Win32 look and feel, for Win2000 and up."
-!endif
+!ifdef GTK_DIR
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecWireshark} "${PROGRAM_NAME} is a GUI network protocol analyzer."
 !endif
   !insertmacro MUI_DESCRIPTION_TEXT ${SecTShark} "TShark is a text based network protocol analyzer."
   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsGroup} "Some plugins and extensions for both Wireshark and TShark."
@@ -1094,6 +1131,7 @@ SectionEnd
   !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."
   !insertmacro MUI_DESCRIPTION_TEXT ${SecMergecap} "Mergecap is a program that combines multiple saved capture files into a single output file"
   !insertmacro MUI_DESCRIPTION_TEXT ${SecCapinfos} "Capinfos is a program that provides information on capture files."
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecRawshark} "Rawshark is a raw packet filter."
 !ifdef HHC_DIR
   !insertmacro MUI_DESCRIPTION_TEXT ${SecUsersGuide} "Install the user's guide, so an internet connection is not required to read the help pages."
 !endif
@@ -1110,91 +1148,40 @@ SectionEnd
 ; ============================================================================
 ; Callback functions
 ; ============================================================================
-!ifdef GTK1_DIR & GTK2_DIR
-;Disable GTK-Wimp for GTK1
-
+!ifdef GTK_DIR
+; Disable File extensions if Wireshark isn't selected
 Function .onSelChange
        Push $0
-       SectionGetFlags ${SecWiresharkGTK1} $0
-       IntOp  $0 $0 & 1
-       IntCmp $0 1 onSelChange.disableGTK2Sections
-       ;enable GTK2Sections
-       !insertmacro EnableSection ${SecGTKWimp}
-       Goto onSelChange.end
-onSelChange.disableGTK2Sections:
-       !insertmacro DisableSection ${SecGTKWimp}
-       Goto onSelChange.end
-onSelChange.end:
-       Pop $0
-FunctionEnd
-
-!else
-!ifdef GTK1_DIR | GTK2_DIR
-; Disable FileExtension if Wireshark isn't selected
-Function .onSelChange
-       Push $0
-!ifdef GTK1_DIR
-       SectionGetFlags ${SecWiresharkGTK1} $0
+       SectionGetFlags ${SecWireshark} $0
        IntOp  $0 $0 & 1
        IntCmp $0 0 onSelChange.unselect
-       SectionGetFlags ${SecFileExtensions} $0
-       IntOp  $0 $0 & 16
-       IntCmp $0 16 onSelChange.unreadonly
+       WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 6" "State" 1
+       WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 6" "Flags" ""
+       WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 7" "Flags" ""
        Goto onSelChange.end
-!else
-       SectionGetFlags ${SecWiresharkGTK2} $0
-       IntOp  $0 $0 & 1
-       IntCmp $0 0 onSelChange.unselect
-       SectionGetFlags ${SecFileExtensions} $0
-       IntOp  $0 $0 & 16
-       IntCmp $0 16 onSelChange.unreadonly
-       Goto onSelChange.end
-!endif
+
 onSelChange.unselect:
-       SectionGetFlags ${SecFileExtensions} $0
-       IntOp $0 $0 & 0xFFFFFFFE
-       IntOp $0 $0 | 0x10
-       SectionSetFlags ${SecFileExtensions} $0
-       Goto onSelChange.end
-onSelChange.unreadonly:
-       SectionGetFlags ${SecFileExtensions} $0
-       IntOp $0 $0 & 0xFFFFFFEF
-       SectionSetFlags ${SecFileExtensions} $0
+       WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 6" "State" 0
+       WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 6" "Flags" "DISABLED"
+       WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 7" "Flags" "DISABLED"
        Goto onSelChange.end
+
 onSelChange.end:
        Pop $0
 FunctionEnd
 !endif
-!endif
 
 
 !include "GetWindowsVersion.nsh"
 !include WinMessages.nsh
+!include "VersionCompare.nsh"
 
-Var NPF_START ;declare variable for holding the value of a registry key
-Var WINPCAP_VERSION ;declare variable for holding the value of a registry key
+Var NPF_START ; NPF service registry key
+Var WINPCAP_NAME ; DisplayName from WinPcap installation
+Var WINPCAP_VERSION ; DisplayVersion from WinPcap installation
 
 Function myShowCallback
 
-; Uinstall old Wireshark first
-; XXX - doesn't work, but kept here for further experiments
-;ReadRegStr $WIRESHARK_UNINSTALL HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "UninstallString"
-;IfErrors lbl_wireshark_notinstalled ;if RegKey is unavailable, WinPcap is not installed
-;MessageBox MB_YESNO|MB_ICONQUESTION "Uninstall the old Wireshark version first (recommended)?"
-; Hide the installer while uninstalling
-;GetDlgItem $0 $HWNDPARENT 1
-;FindWindow $0 "#32770" "" $HWNDPARENT
-;MessageBox MB_OK "Window $0"
-;ShowWindow $0 ${SW_HIDE}
-;HideWindow
-;ExecWait '$WIRESHARK_UNINSTALL' $0
-;DetailPrint "WinPcap uninstaller returned $0"
-;GetDlgItem $0 $HWNDPARENT 1
-;ShowWindow $0 ${SW_SHOW}
-;MessageBox MB_OK "Uninstalled"
-;lbl_wireshark_notinstalled:
-
-
        ; Get the Windows version
        Call GetWindowsVersion
        Pop $R0 ; Windows Version
@@ -1214,27 +1201,10 @@ lbl_winversion_unsupported_nt4:
        Quit
 
 lbl_winversion_supported:
-!ifdef GTK2_DIR
-       ; Enable GTK-Wimp only for Windows 2000/XP/2003
-       ; ...as Win9x/ME/NT known to have problems with it!
-
-       ;DetailPrint 'Windows Version: $R0'
-       StrCmp $R0 '2000' lbl_select_wimp
-       StrCmp $R0 'XP' lbl_select_wimp
-       StrCmp $R0 '2003' lbl_select_wimp
-       DetailPrint "Windows $R0 doesn't support the GTK MS Windows Engine!"
-
-       Goto lbl_ignore_wimp
-lbl_select_wimp:
-       !insertmacro SelectSection ${SecGTKWimp}
-
-lbl_ignore_wimp:
-!endif
-
 
        ; detect if WinPcap should be installed
-       WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "Text" "Install WinPcap 4.0.1"
-       ReadRegStr $WINPCAP_VERSION HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinPcapInst" "DisplayName"
+       WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "Text" "Install WinPcap 4.0.2"
+       ReadRegStr $WINPCAP_NAME HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinPcapInst" "DisplayName"
        IfErrors 0 lbl_winpcap_installed ;if RegKey is available, WinPcap is already installed
        WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 2" "Text" "WinPcap is currently not installed"
        WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 2" "Flags" "DISABLED"
@@ -1242,42 +1212,31 @@ lbl_ignore_wimp:
        Goto lbl_winpcap_done
 
 lbl_winpcap_installed:
-       WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 2" "Text" "$WINPCAP_VERSION"
-       ; WinPcap 2.x (including betas): the version string starts with "WinPcap 2."
-       StrCpy $1 "$WINPCAP_VERSION" 10
-       StrCmp $1 "WinPcap 2." lbl_winpcap_do_install
-       ; WinPcap 3.0 (including betas): the version string starts with "WinPcap 3.0"
-       ; WinPcap 3.x (all versions): the version string starts with "WinPcap 3."
-       StrCpy $1 "$WINPCAP_VERSION" 10
-       StrCmp $1 "WinPcap 3." lbl_winpcap_do_install
-       ; WinPcap 4.0 alphas and betas: the version string starts with "WinPcap 4.0 {alpha|beta}"
-       StrCpy $1 "$WINPCAP_VERSION" 16
-       StrCmp $1 "WinPcap 4.0 alph" lbl_winpcap_do_install
-       StrCmp $1 "WinPcap 4.0 beta" lbl_winpcap_do_install
-       ; Look further at version string
+       WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 2" "Text" "$WINPCAP_NAME"
+       ; Compare the installed build against the one we have.
        ReadRegStr $WINPCAP_VERSION HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinPcapInst" "DisplayVersion"
-       ; WinPcap 4.0: the version string start with "4.0.0"
-       StrCpy $1 "$WINPCAP_VERSION" 5
-       StrCmp $1 "4.0.0" lbl_winpcap_do_install
+       StrCmp $WINPCAP_VERSION "" lbl_winpcap_do_install ; WinPcap is really old(?) or installed improperly.
+       ${VersionCompare} $WINPCAP_VERSION "4.0.0.1040" $1 ; WinPcap 4.0.2
+       StrCmp $1 "2" lbl_winpcap_do_install
 
 ;lbl_winpcap_dont_install:
-       ; seems to be the current version, so don't install
+       ; The installed version is >= to what we have, so don't install
        WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "State" "0"
-       WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Text" "If selected, the currently installed $WINPCAP_VERSION will be uninstalled first."
+       WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Text" "If selected, the currently installed $WINPCAP_NAME will be uninstalled first."
        Goto lbl_winpcap_done
 
 ;lbl_winpcap_dont_upgrade:
        ; force the user to upgrade by hand
        WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "State" "0"
        WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "Flags" "DISABLED"
-       WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Text" "If you wish to install WinPcap 4.0.1, please uninstall $WINPCAP_VERSION manually first."
+       WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Text" "If you wish to install WinPcap 4.0.2, please uninstall $WINPCAP_NAME manually first."
        WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Flags" "DISABLED"
        Goto lbl_winpcap_done
 
 lbl_winpcap_do_install:
        ; seems to be an old version, install newer one
        WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "State" "1"
-       WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Text" "The currently installed $WINPCAP_VERSION will be uninstalled first."
+       WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Text" "The currently installed $WINPCAP_NAME will be uninstalled first."
 
 lbl_winpcap_done:
 
@@ -1285,10 +1244,13 @@ lbl_winpcap_done:
        StrCmp $R0 '95' lbl_npf_disable
        StrCmp $R0 '98' lbl_npf_disable
        StrCmp $R0 'ME' lbl_npf_disable
+       ; Enable NPF by default under Vista.
+       StrCmp $R0 'Vista' lbl_npf_enable
        ReadRegDWORD $NPF_START HKEY_LOCAL_MACHINE "SYSTEM\CurrentControlSet\Services\NPF" "Start"
        ; (Winpcap may not be installed already, so no regKey is no error here)
        IfErrors lbl_npf_done ;RegKey not available, so do not set it
        IntCmp $NPF_START 2 0 lbl_npf_done lbl_npf_done
+lbl_npf_enable:
        WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 8" "State" "1"
        Goto lbl_npf_done
        ;disable
@@ -1308,6 +1270,7 @@ lbl_npf_done:
        ; (we use the "all users" start menu, so select it first)
        SetShellVarContext all
        IfFileExists "$SMPROGRAMS\Wireshark\Wireshark.lnk" lbl_have_startmenu
+       IfFileExists "$SMPROGRAMS\Wireshark.lnk" lbl_have_startmenu
        WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 2" "State" "0"
 lbl_have_startmenu: