If you hand
[obnox/wireshark/wip.git] / packaging / nsis / wireshark.nsi
index 88ae8bb8b3d8bf1c01b7c9c70389619c8b6be07a..91eb59f2e8cc6e88c82f14a46b9d8337c75f36ab 100644 (file)
@@ -3,19 +3,14 @@
 ;
 ; $Id$
 
+
 ; Set the compression mechanism first.
-; As of NSIS 2.07, solid compression which makes installer about 1MB smaller 
+; As of NSIS 2.07, solid compression which makes installer about 1MB smaller
 ; is no longer the default, so use the /SOLID switch.
 ; This unfortunately is unknown to NSIS prior to 2.07 and creates an error.
 ; 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"
@@ -73,9 +73,9 @@ XPStyle on
 ;!define MUI_FINISHPAGE_LINK_LOCATION "http://www.winpcap.org"
 
 ; NSIS shows Readme files by opening the Readme file with the default application for
-; the file's extension. "README.win32" won't work in most cases, because extension "win32" 
-; is usually not associated with an appropriate text editor. We should use extension "txt" 
-; for a text file or "html" for an html README file.  
+; the file's extension. "README.win32" won't work in most cases, because extension "win32"
+; is usually not associated with an appropriate text editor. We should use extension "txt"
+; for a text file or "html" for an html README file.
 !define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\NEWS.txt"
 !define MUI_FINISHPAGE_SHOWREADME_TEXT "Show News"
 !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
@@ -98,7 +98,7 @@ Page custom DisplayAdditionalTasksPage
 Page custom DisplayWinPcapPage
 !insertmacro MUI_PAGE_INSTFILES
 !insertmacro MUI_PAGE_FINISH
+
 !insertmacro MUI_UNPAGE_WELCOME
 !insertmacro MUI_UNPAGE_CONFIRM
 !insertmacro MUI_UNPAGE_COMPONENTS
@@ -108,16 +108,16 @@ Page custom DisplayWinPcapPage
 ; ============================================================================
 ; MUI Languages
 ; ============================================================================
+
 !insertmacro MUI_LANGUAGE "English"
 
 ; ============================================================================
 ; Reserve Files
 ; ============================================================================
-  
+
   ;Things that need to be extracted on first (keep these lines before any File command!)
   ;Only useful for BZIP2 compression
-  
+
   ReserveFile "AdditionalTasksPage.ini"
   ReserveFile "WinPcapPage.ini"
   !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
@@ -210,22 +210,22 @@ ShowUninstDetails show
 
        !define UPDATEICONS_UNIQUE ${__LINE__}
 
-       IfFileExists "$SYSDIR\shell32.dll" UpdateIcons.next1_${UPDATEICONS_UNIQUE} UpdateIcons.error1_${UPDATEICONS_UNIQUE} 
-UpdateIcons.next1_${UPDATEICONS_UNIQUE}:       
+       IfFileExists "$SYSDIR\shell32.dll" UpdateIcons.next1_${UPDATEICONS_UNIQUE} UpdateIcons.error1_${UPDATEICONS_UNIQUE}
+UpdateIcons.next1_${UPDATEICONS_UNIQUE}:
        GetDllVersion "$SYSDIR\shell32.dll" $R0 $R1
        IntOp $R2 $R0 / 0x00010000
        IntCmp $R2 4 UpdateIcons.next2_${UPDATEICONS_UNIQUE} UpdateIcons.error2_${UPDATEICONS_UNIQUE}
-UpdateIcons.next2_${UPDATEICONS_UNIQUE}:       
-       System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (${SHCNE_ASSOCCHANGED}, ${SHCNF_IDLIST}, 0, 0)' 
-       Goto UpdateIcons.quit_${UPDATEICONS_UNIQUE}     
-       
-UpdateIcons.error1_${UPDATEICONS_UNIQUE}: 
-       MessageBox MB_OK|MB_ICONSTOP  "Can't find 'shell32.dll' library. Impossible to update icons" 
+UpdateIcons.next2_${UPDATEICONS_UNIQUE}:
+       System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (${SHCNE_ASSOCCHANGED}, ${SHCNF_IDLIST}, 0, 0)'
+       Goto UpdateIcons.quit_${UPDATEICONS_UNIQUE}
+
+UpdateIcons.error1_${UPDATEICONS_UNIQUE}:
+       MessageBox MB_OK|MB_ICONSTOP  "Can't find 'shell32.dll' library. Impossible to update icons"
        Goto UpdateIcons.quit_${UPDATEICONS_UNIQUE}
-UpdateIcons.error2_${UPDATEICONS_UNIQUE}:      
-       MessageBox MB_OK|MB_ICONINFORMATION "You should install the free 'Microsoft Layer for Unicode' to update Wireshark capture file icons" 
+UpdateIcons.error2_${UPDATEICONS_UNIQUE}:
+       MessageBox MB_OK|MB_ICONINFORMATION "You should install the free 'Microsoft Layer for Unicode' to update Wireshark capture file icons"
        Goto UpdateIcons.quit_${UPDATEICONS_UNIQUE}
-UpdateIcons.quit_${UPDATEICONS_UNIQUE}:        
+UpdateIcons.quit_${UPDATEICONS_UNIQUE}:
        !undef UPDATEICONS_UNIQUE
        Pop $R2
        Pop $R1
@@ -236,7 +236,7 @@ UpdateIcons.quit_${UPDATEICONS_UNIQUE}:
 Function Associate
        ; $R0 should contain the prefix to associate to Wireshark
        Push $R1
-       
+
        ReadRegStr $R1 HKCR $R0 ""
        StrCmp $R1 "" Associate.doRegister
        Goto Associate.end
@@ -250,21 +250,64 @@ FunctionEnd
 Function un.unlink
        ; $R0 should contain the prefix to unlink
        Push $R1
-       
+
        ReadRegStr $R1 HKCR $R0 ""
        StrCmp $R1 ${WIRESHARK_ASSOC} un.unlink.doUnlink
        Goto un.unlink.end
 un.unlink.doUnlink:
        ; The extension is associated with Wireshark so, we must destroy this!
-       DeleteRegKey HKCR $R0   
-un.unlink.end: 
+       DeleteRegKey HKCR $R0
+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"  
+  !insertmacro MUI_INSTALLOPTIONS_EXTRACT "AdditionalTasksPage.ini"
+  !insertmacro MUI_INSTALLOPTIONS_EXTRACT "WinpcapPage.ini"
 FunctionEnd
 
 Function DisplayAdditionalTasksPage
@@ -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,49 +370,35 @@ 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"
 !endif
-File "..\..\FAQ"
+!ifdef SMI_DIR
+File "${SMI_DIR}\lib\smi.dll"
+!endif
 File "..\..\README"
 File "..\..\README.win32"
 File "..\..\AUTHORS-SHORT"
 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"
 
-; manifest files needed for MSVC2005 / MSVC2005EE / DOTNET20
-!if ${MSVC_VARIANT} == "MSVC2005"
-File "..\..\wiretap\wiretap-${WTAP_VERSION}.dll.manifest"
-File "..\..\*.manifest"
-File "${ZLIB_DIR}\zlib1.dll.manifest"
-!endif
-!if ${MSVC_VARIANT} == "MSVC2005EE"
-File "..\..\wiretap\wiretap-${WTAP_VERSION}.dll.manifest"
-File "..\..\*.manifest"
-File "${ZLIB_DIR}\zlib1.dll.manifest"
-!endif
-!if ${MSVC_VARIANT} == "DOTNET20"
-File "..\..\wiretap\wiretap-${WTAP_VERSION}.dll.manifest"
-File "..\..\*.manifest"
-File "${ZLIB_DIR}\zlib1.dll.manifest"
-!endif
-
-; C-runtime redistributable 
+; C-runtime redistributable
 !ifdef VCREDIST_EXE
 ; vcredist_x86.exe (MSVC V8) - copy and execute the redistributable installer
 File "${VCREDIST_EXE}"
@@ -374,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"
@@ -383,7 +417,7 @@ File "${MSVCR_DLL}"
 !endif ; VCREDIST_EXE
 
 
-; global config files - don't overwrite if already existing 
+; global config files - don't overwrite if already existing
 ;IfFileExists cfilters dont_overwrite_cfilters
 File "..\..\cfilters"
 ;dont_overwrite_cfilters:
@@ -393,21 +427,29 @@ 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:
 
 
 ;
 ; Install the Diameter DTD and XML files in the "diameter" subdirectory
 ; of the installation directory.
-; 
+;
 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"
 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
 
@@ -428,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"
@@ -496,9 +539,23 @@ File "..\..\dtds\rlmi.dtd"
 File "..\..\dtds\rss.dtd"
 File "..\..\dtds\smil.dtd"
 File "..\..\dtds\xcap-caps.dtd"
+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"
@@ -528,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:
 
@@ -570,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
@@ -607,11 +663,13 @@ push $R0
        StrCpy $R0 ".trace"
        Call Associate
        StrCpy $R0 ".trc"
-       Call Associate          
+       Call Associate
        StrCpy $R0 ".wpc"
        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
@@ -631,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.exe"
-ExecWait '"$INSTDIR\WinPcap_4_0.exe"' $0
+File "WinPcap_4_0_2.exe"
+ExecWait '"$INSTDIR\WinPcap_4_0_2.exe"' $0
 DetailPrint "WinPcap installer returned $0"
 SecRequired_skip_Winpcap:
 
@@ -659,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"
+#File "${GTK_DIR}\lib\pango\${PANGO_LIB_DIR}\modules\pango-*.dll"
 
-SectionEnd
-!ifdef GTK_WIMP_DIR
-Section "GTK-Wimp" 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"
@@ -741,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"
@@ -751,16 +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\h223\h223.dll"
+File "..\..\plugins\infiniband\infiniband.dll"
 File "..\..\plugins\irda\irda.dll"
 File "..\..\plugins\lwres\lwres.dll"
-File "..\..\plugins\megaco\megaco.dll"
-File "..\..\plugins\mgcp\mgcp.dll"
+File "..\..\plugins\m2m\m2m.dll"
 File "..\..\plugins\opsi\opsi.dll"
 File "..\..\plugins\pcli\pcli.dll"
 File "..\..\plugins\profinet\profinet.dll"
@@ -768,14 +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
@@ -790,14 +823,19 @@ 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
 !endif
 
+!ifdef SMI_DIR
+Section "SNMP MIBs" SecMIBs
+;-------------------------------------------
+SetOutPath $INSTDIR\snmp\mibs
+File "${SMI_DIR}\mibs\*"
+SectionEnd
+!endif
+
 SectionGroupEnd        ; "Plugins / Extensions"
 
 
@@ -805,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"
@@ -815,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"
@@ -825,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"
@@ -835,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
@@ -865,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
@@ -915,19 +951,20 @@ push $R0
        StrCpy $R0 ".trace"
        Call un.unlink
        StrCpy $R0 ".trc"
-       Call un.unlink          
+       Call un.unlink
        StrCpy $R0 ".wpc"
        Call un.unlink
        StrCpy $R0 ".wpz"
        Call un.unlink
+       StrCpy $R0 ".rf5"
+       Call un.unlink
 pop $R0
 
-DeleteRegKey HKCR ${WIRESHARK_ASSOC} 
+DeleteRegKey HKCR ${WIRESHARK_ASSOC}
 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\*.*"
@@ -939,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\*.*"
@@ -947,24 +985,29 @@ 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"
 Delete "$INSTDIR\pcrepattern.3.txt"
 Delete "$INSTDIR\user-guide.chm"
 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"
 
@@ -983,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"
@@ -1003,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"
@@ -1026,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
 
@@ -1057,7 +1104,7 @@ SectionIn 1 2
 ; this test must be done after all other things uninstalled (e.g. Global Settings)
 IfFileExists "$INSTDIR" 0 NoFinalErrorMsg
     MessageBox MB_OK "Please note: The directory $INSTDIR could not be removed!" IDOK 0 ; skipped if dir doesn't exist
-NoFinalErrorMsg: 
+NoFinalErrorMsg:
 SectionEnd
 
 
@@ -1065,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-Wimp is the GTK2 windows impersonator (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."
@@ -1082,113 +1122,66 @@ SectionEnd
   !insertmacro MUI_DESCRIPTION_TEXT ${SecMate} "Plugin - Meta Analysis and Tracing Engine (Experimental)."
 !ifdef NET_SNMP_DIR
   !insertmacro MUI_DESCRIPTION_TEXT ${SecMIBs} "SNMP MIBs for better SNMP dissection."
+!endif
+!ifdef SMI_DIR
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecMIBs} "SNMP MIBs for better SNMP dissection."
 !endif
   !insertmacro MUI_DESCRIPTION_TEXT ${SecToolsGroup} "Additional command line based tools."
   !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."
   !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
 !insertmacro MUI_FUNCTION_DESCRIPTION_END
 
-!insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN 
+!insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
   !insertmacro MUI_DESCRIPTION_TEXT ${un.SecUinstall} "Uninstall all Wireshark components."
   !insertmacro MUI_DESCRIPTION_TEXT ${un.SecPlugins} "Uninstall all Plugins (even from previous Wireshark versions)."
   !insertmacro MUI_DESCRIPTION_TEXT ${un.SecGlobalSettings} "Uninstall global settings like: $INSTDIR\cfilters"
   !insertmacro MUI_DESCRIPTION_TEXT ${un.SecPersonalSettings} "Uninstall personal settings like your preferences file from your profile: $PROFILE."
   !insertmacro MUI_DESCRIPTION_TEXT ${un.SecWinPcap} "Call WinPcap's uninstall program."
 !insertmacro MUI_UNFUNCTION_DESCRIPTION_END
-  
+
 ; ============================================================================
 ; 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
+
+onSelChange.unselect:
+       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
@@ -1197,34 +1190,21 @@ Function myShowCallback
        StrCmp $R0 '95' lbl_winversion_unsupported
        StrCmp $R0 '98' lbl_winversion_unsupported
        StrCmp $R0 'ME' lbl_winversion_unsupported
-       ;StrCmp $R0 'NT 4.0' lbl_winversion_unsupported
+       StrCmp $R0 'NT 4.0' lbl_winversion_unsupported_nt4
        Goto lbl_winversion_supported
 lbl_winversion_unsupported:
-       MessageBox MB_OK "Windows $R0 is no longer supported. The last known version working with 98/ME was Ethereal 0.99.0!" 
+       MessageBox MB_OK "Windows $R0 is no longer supported. The last known version working with 98/ME was Ethereal 0.99.0!"
        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 GTK-Wimp!"
-
-       Goto lbl_ignore_wimp
-lbl_select_wimp:
-       !insertmacro SelectSection ${SecGTKWimp}
-
-lbl_ignore_wimp:
-!endif
+lbl_winversion_unsupported_nt4:
+       MessageBox MB_OK "Windows $R0 is no longer supported. The last known version working with NT 4.0 was Wireshark 0.99.4!"
+       Quit
 
+lbl_winversion_supported:
 
        ; detect if WinPcap should be installed
-       WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "Text" "Install WinPcap 4.0"
-       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"
@@ -1232,60 +1212,57 @@ 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
+       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"
+       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, 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:
 
-       ; Disable NPF service setting for Win OT 
+       ; Disable NPF service setting for Win OT
        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
 lbl_npf_disable:
        WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 8" "State" "0"
        WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 8" "Flags" "DISABLED"
-       WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 9" "Flags" "DISABLED"  
+       WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 9" "Flags" "DISABLED"
 lbl_npf_done:
 
 
        ; if Wireshark was previously installed, unselect previously not installed icons etc.
-       ; detect if Wireshark is already installed -> 
+       ; detect if Wireshark is already installed ->
        ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "UninstallString"
        IfErrors lbl_wireshark_notinstalled ;if RegKey is unavailable, Wireshark is not installed
 
@@ -1293,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: