diff options
author | Gerald Combs <gerald@wireshark.org> | 2018-11-28 17:08:27 -0800 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2018-11-30 06:12:23 +0000 |
commit | 2bcc8dbf267bb33aae5c62d93653b0e1d3105a1b (patch) | |
tree | 485d43691dfa705e990476c0139a5fb63f76f29f | |
parent | 1bab83de53995d87c6032cc4872dbc7be2c04cca (diff) |
NSIS: Install NPcap instead of WinPcap.
Install NPcap 0.99-r7 instead of WinPcap in the NSIS installer. Update
and/or remove installer text, variables, and variable names accordingly.
Change-Id: Ied36f00c2516127969894f55698e70401dfffb4f
Reviewed-on: https://code.wireshark.org/review/30829
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r-- | CMakeLists.txt | 4 | ||||
-rw-r--r-- | caputils/capture-wpcap.c | 12 | ||||
-rw-r--r-- | cmake/modules/FindPCAP.cmake | 2 | ||||
-rw-r--r-- | packaging/nsis/CMakeLists.txt | 11 | ||||
-rw-r--r-- | packaging/nsis/NpcapPage.ini (renamed from packaging/nsis/WinPcapPage.ini) | 10 | ||||
-rw-r--r-- | packaging/nsis/VersionCompare.nsh | 91 | ||||
-rw-r--r-- | packaging/nsis/config.nsh.in | 5 | ||||
-rw-r--r-- | packaging/nsis/uninstall.nsi | 18 | ||||
-rw-r--r-- | packaging/nsis/wireshark.nsi | 141 | ||||
-rw-r--r-- | packaging/wix/CMakeLists.txt | 11 | ||||
-rw-r--r-- | tools/win-setup.ps1 | 8 | ||||
-rw-r--r-- | wsutil/wspcap.h | 2 |
12 files changed, 95 insertions, 220 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 92e152e4cd..f7b5cddea7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -351,10 +351,6 @@ if( CMAKE_C_COMPILER_ID MATCHES "MSVC") add_definitions("/D_BIND_TO_CURRENT_CRT_VERSION=1") endif() - # FIXME: WINPCAP_VERSION cannot be determined from source or executable. - set(WINPCAP_VERSION "4_1_3") - add_definitions("/DWINPCAP_VERSION=${WINPCAP_VERSION}") - set(LOCAL_CFLAGS /MP ) diff --git a/caputils/capture-wpcap.c b/caputils/capture-wpcap.c index 0b28494cc4..5ed8c749db 100644 --- a/caputils/capture-wpcap.c +++ b/caputils/capture-wpcap.c @@ -1012,16 +1012,22 @@ open_capture_device_local(capture_options *capture_opts, } /* - * Append the version of WinPcap with which we were compiled to a GString. + * Neither WpdPack nor the Npcap SDK as of version 1.01 defines a version + * string anywhere. Hard-code one for now. + */ +#define WINPCAP_SDK_VERSION "4.1.2" + +/* + * Append the WinPcap or Npcap SDK version with which we were compiled to a GString. */ void get_compiled_caplibs_version(GString *str) { - g_string_append(str, "with WinPcap (" G_STRINGIFY(WINPCAP_VERSION) ")"); + g_string_append(str, "with WinPcap SDK (WpdPack) " WINPCAP_SDK_VERSION); } /* - * Append the version of WinPcap with which we we're running to a GString. + * Append the version of Npcap with which we we're running to a GString. */ void get_runtime_caplibs_version(GString *str) diff --git a/cmake/modules/FindPCAP.cmake b/cmake/modules/FindPCAP.cmake index 5bcf96cd20..d31e3c9e90 100644 --- a/cmake/modules/FindPCAP.cmake +++ b/cmake/modules/FindPCAP.cmake @@ -54,7 +54,7 @@ if( PCAP_FOUND ) set( CMAKE_REQUIRED_LIBRARIES ${PCAP_LIBRARIES} ) if(WIN32) - # Prepopulate some values. WinPcap and NPcap always have these and + # Prepopulate some values. WinPcap and Npcap always have these and # compilation checks on Windows can be slow. set(HAVE_PCAP_OPEN_DEAD TRUE) set(HAVE_PCAP_FREECODE TRUE) diff --git a/packaging/nsis/CMakeLists.txt b/packaging/nsis/CMakeLists.txt index 36e8b2fca6..d2013d9148 100644 --- a/packaging/nsis/CMakeLists.txt +++ b/packaging/nsis/CMakeLists.txt @@ -24,7 +24,7 @@ set(NSIS_FILES GetWindowsVersion.nsh servicelib.nsh AdditionalTasksPage.ini - WinPcapPage.ini + NpcapPage.ini USBPcapPage.ini ${NSIS_GENERATED_FILES} PARENT_SCOPE @@ -45,16 +45,15 @@ else() endif() set (MMDBRESOLVE_EXE ${MAXMINDDB_FOUND}) -# Path to the WinPcap installer. +# Path to the Npcap installer. # XXX Come up with a better variable, e.g. cache WIRESHARK_LIB_DIR in FindWSWinLibs. file(TO_NATIVE_PATH "${GLIB2_DLL_DIR}/../.." _wireshark_lib_dir) set(WIRESHARK_LIB_DIR "${_wireshark_lib_dir}") -# Must match ${WIRESHARK_LIB_DIR}/WinPcap_X_Y_Z.exe -set(WINPCAP_PACKAGE_VERSION ${WINPCAP_VERSION}) -string(REPLACE "_" "." PCAP_DISPLAY_VERSION "${WINPCAP_PACKAGE_VERSION}") +# Must match ${WIRESHARK_LIB_DIR}/Npcap-X.Y.Z.exe +set(NPCAP_PACKAGE_VERSION "0.99-r7") -set(USBPCAP_DISPLAY_VERSION "1.2.0.4") +set(USBPCAP_PACKAGE_VERSION "1.2.0.4") set(PRODUCT_VERSION ${PROJECT_MAJOR_VERSION}.${PROJECT_MINOR_VERSION}.${PROJECT_PATCH_VERSION}.${PROJECT_BUILD_VERSION}) diff --git a/packaging/nsis/WinPcapPage.ini b/packaging/nsis/NpcapPage.ini index 4a27b661e2..ce7f2ab5c1 100644 --- a/packaging/nsis/WinPcapPage.ini +++ b/packaging/nsis/NpcapPage.ini @@ -15,7 +15,7 @@ Left=10 Right=250 Top=10 Bottom=18 -Text=This text will be replaced with current WinPcap installer version +Text=This text will be replaced with current Npcap installer version [Field 3] Type=GroupBox @@ -31,7 +31,7 @@ Left=10 Right=250 Top=40 Bottom=48 -Text=This text will be replaced, depending on current WinPcap version in wireshark.nsi +Text=This text will be replaced, depending on current Npcap version in wireshark.nsi State=1 [Field 5] @@ -40,7 +40,7 @@ Left=20 Right=290 Top=50 Bottom=58 -Text=This text will be replaced, depending if WinPcap is already installed +Text=This text will be replaced, depending on whether Npcap is already installed [Field 6] Type=Link @@ -48,8 +48,8 @@ Left=0 Right=290 Top=112 Bottom=120 -Text=Get Npcap -State=https://nmap.org/npcap +Text=Get WinPcap +State=https://www.winpcap.org/ [Field 7] Type=Link diff --git a/packaging/nsis/VersionCompare.nsh b/packaging/nsis/VersionCompare.nsh deleted file mode 100644 index d2cfe75b8b..0000000000 --- a/packaging/nsis/VersionCompare.nsh +++ /dev/null @@ -1,91 +0,0 @@ -; -; VersionCompare - Compare Windows version numbers -; -; Copied from http://nsis.sourceforge.net/VersionCompare -; -; By Instructor (http://nsis.sourceforge.net/User:Instructor) - -Function VersionCompare - !define VersionCompare `!insertmacro VersionCompareCall` - - !macro VersionCompareCall _VER1 _VER2 _RESULT - Push `${_VER1}` - Push `${_VER2}` - Call VersionCompare - Pop ${_RESULT} - !macroend - - Exch $1 - Exch - Exch $0 - Exch - Push $2 - Push $3 - Push $4 - Push $5 - Push $6 - Push $7 - - begin: - StrCpy $2 -1 - IntOp $2 $2 + 1 - StrCpy $3 $0 1 $2 - StrCmp $3 '' +2 - StrCmp $3 '.' 0 -3 - StrCpy $4 $0 $2 - IntOp $2 $2 + 1 - StrCpy $0 $0 '' $2 - - StrCpy $2 -1 - IntOp $2 $2 + 1 - StrCpy $3 $1 1 $2 - StrCmp $3 '' +2 - StrCmp $3 '.' 0 -3 - StrCpy $5 $1 $2 - IntOp $2 $2 + 1 - StrCpy $1 $1 '' $2 - - StrCmp $4$5 '' equal - - StrCpy $6 -1 - IntOp $6 $6 + 1 - StrCpy $3 $4 1 $6 - StrCmp $3 '0' -2 - StrCmp $3 '' 0 +2 - StrCpy $4 0 - - StrCpy $7 -1 - IntOp $7 $7 + 1 - StrCpy $3 $5 1 $7 - StrCmp $3 '0' -2 - StrCmp $3 '' 0 +2 - StrCpy $5 0 - - StrCmp $4 0 0 +2 - StrCmp $5 0 begin newer2 - StrCmp $5 0 newer1 - IntCmp $6 $7 0 newer1 newer2 - - StrCpy $4 '1$4' - StrCpy $5 '1$5' - IntCmp $4 $5 begin newer2 newer1 - - equal: - StrCpy $0 0 - goto end - newer1: - StrCpy $0 1 - goto end - newer2: - StrCpy $0 2 - - end: - Pop $7 - Pop $6 - Pop $5 - Pop $4 - Pop $3 - Pop $2 - Pop $1 - Exch $0 -FunctionEnd diff --git a/packaging/nsis/config.nsh.in b/packaging/nsis/config.nsh.in index a080ef540e..349b558e46 100644 --- a/packaging/nsis/config.nsh.in +++ b/packaging/nsis/config.nsh.in @@ -11,9 +11,8 @@ !define WIRESHARK_TARGET_PLATFORM @WIRESHARK_TARGET_PLATFORM@ !define TARGET_MACHINE @TARGET_MACHINE@ !define WIRESHARK_LIB_DIR "@WIRESHARK_LIB_DIR@" -!define WINPCAP_PACKAGE_VERSION @WINPCAP_PACKAGE_VERSION@ -!define PCAP_DISPLAY_VERSION @PCAP_DISPLAY_VERSION@ -!define USBPCAP_DISPLAY_VERSION "1.2.0.4" +!define NPCAP_PACKAGE_VERSION @NPCAP_PACKAGE_VERSION@ +!define USBPCAP_PACKAGE_VERSION @USBPCAP_PACKAGE_VERSION@ !define VERSION @VERSION@ !define VERSION_MAJOR @VERSION_MAJOR@ !define VERSION_MINOR @VERSION_MINOR@ diff --git a/packaging/nsis/uninstall.nsi b/packaging/nsis/uninstall.nsi index cf9ba4341d..b33f082865 100644 --- a/packaging/nsis/uninstall.nsi +++ b/packaging/nsis/uninstall.nsi @@ -15,7 +15,7 @@ SetCompress off OutFile "${STAGING_DIR}\uninstall_installer.exe" RequestExecutionLevel user -InstType "un.Default (keep Personal Settings and WinPcap)" +InstType "un.Default (keep Personal Settings and Npcap)" InstType "un.All (remove all)" ; Uninstaller icon @@ -339,20 +339,20 @@ RMDir "$APPDATA\${PROGRAM_NAME}" DeleteRegKey HKCU "Software\${PROGRAM_NAME}" SectionEnd -;VAR un.WINPCAP_UNINSTALL +;VAR un.NPCAP_UNINSTALL -Section /o "Un.WinPcap" un.SecWinPcap +Section /o "Un.Npcap" un.SecNpcap ;------------------------------------------- SectionIn 2 -ReadRegStr $1 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinPcapInst" "UninstallString" -;IfErrors un.lbl_winpcap_notinstalled ;if RegKey is unavailable, WinPcap is not installed +ReadRegStr $1 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\NpcapInst" "UninstallString" +;IfErrors un.lbl_npcap_notinstalled ;if RegKey is unavailable, Npcap is not installed ${If} $1 != "" - ;MessageBox MB_OK "WinPcap $1" /SD IDOK + ;MessageBox MB_OK "Npcap $1" /SD IDOK ExecWait '$1' $0 - DetailPrint "WinPcap uninstaller returned $0" + DetailPrint "Npcap uninstaller returned $0" ;SetRebootFlag true ${EndIf} -;un.lbl_winpcap_notinstalled: +;un.lbl_npcap_notinstalled: SectionEnd Section "-Un.Finally" @@ -373,7 +373,7 @@ SectionEnd !insertmacro MUI_DESCRIPTION_TEXT ${un.SecProfiles} "Uninstall all global configuration profiles." !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_DESCRIPTION_TEXT ${un.SecNpcap} "Call Npcap's uninstall program." !insertmacro MUI_DESCRIPTION_TEXT ${un.SecUSBPcap} "Call USBPcap's uninstall program." !insertmacro MUI_UNFUNCTION_DESCRIPTION_END diff --git a/packaging/nsis/wireshark.nsi b/packaging/nsis/wireshark.nsi index b3244a02b1..5a38fe8402 100644 --- a/packaging/nsis/wireshark.nsi +++ b/packaging/nsis/wireshark.nsi @@ -13,6 +13,8 @@ SetCompressorDictSize 64 ; MB !include "common.nsh" !include 'LogicLib.nsh' !include "StrFunc.nsh" +!include "WordFunc.nsh" + ${StrRep} ; See http://nsis.sourceforge.net/Check_if_a_file_exists_at_compile_time for documentation @@ -59,8 +61,8 @@ BrandingText "Wireshark${U+00ae} Installer" !define MUI_COMPONENTSPAGE_SMALLDESC !define MUI_FINISHPAGE_NOAUTOCLOSE !define MUI_WELCOMEPAGE_TEXT "This wizard will guide you through the installation of ${PROGRAM_NAME}.$\r$\n$\r$\nBefore starting the installation, make sure ${PROGRAM_NAME} is not running.$\r$\n$\r$\nClick 'Next' to continue." -;!define MUI_FINISHPAGE_LINK "Install WinPcap to be able to capture packets from a network." -;!define MUI_FINISHPAGE_LINK_LOCATION "https://www.winpcap.org" +;!define MUI_FINISHPAGE_LINK "Install Npcap to be able to capture packets from a network." +;!define MUI_FINISHPAGE_LINK_LOCATION "https://nmap.org/npcap/" ; 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" @@ -85,7 +87,7 @@ BrandingText "Wireshark${U+00ae} Installer" Page custom DisplayAdditionalTasksPage LeaveAdditionalTasksPage !endif !insertmacro MUI_PAGE_DIRECTORY -Page custom DisplayWinPcapPage +Page custom DisplayNpcapPage Page custom DisplayUSBPcapPage !insertmacro MUI_PAGE_INSTFILES !insertmacro MUI_PAGE_FINISH @@ -106,7 +108,7 @@ Page custom DisplayUSBPcapPage ; Old Modern 1 UI: http://nsis.sourceforge.net/Docs/Modern%20UI/Readme.html ; To do: Upgrade to the Modern 2 UI: ;ReserveFile "AdditionalTasksPage.ini" - ReserveFile "WinPcapPage.ini" + ReserveFile "NpcapPage.ini" ReserveFile "USBPcapPage.ini" ReserveFile /plugin InstallOptions.dll @@ -442,7 +444,7 @@ done: ;Extract InstallOptions INI files ;!insertmacro INSTALLOPTIONS_EXTRACT "AdditionalTasksPage.ini" - !insertmacro INSTALLOPTIONS_EXTRACT "WinpcapPage.ini" + !insertmacro INSTALLOPTIONS_EXTRACT "NpcapPage.ini" !insertmacro INSTALLOPTIONS_EXTRACT "USBPcapPage.ini" FunctionEnd @@ -452,9 +454,9 @@ Function DisplayAdditionalTasksPage FunctionEnd !endif -Function DisplayWinPcapPage +Function DisplayNpcapPage !insertmacro MUI_HEADER_TEXT "Packet Capture" "Wireshark requires either Npcap or WinPcap to capture live network data." - !insertmacro INSTALLOPTIONS_DISPLAY "WinPcapPage.ini" + !insertmacro INSTALLOPTIONS_DISPLAY "NpcapPage.ini" FunctionEnd Function DisplayUSBPcapPage @@ -466,7 +468,6 @@ FunctionEnd ; Installation execution commands ; ============================================================================ -Var WINPCAP_UNINSTALL ;declare variable for holding the value of a registry key Var USBPCAP_UNINSTALL ;declare variable for holding the value of a registry key ;Var WIRESHARK_UNINSTALL ;declare variable for holding the value of a registry key @@ -872,24 +873,17 @@ Call Associate ; AdditionalTasks page ${Endif} -; if running as a silent installer, don't try to install winpcap -IfSilent SecRequired_skip_Winpcap - -; Install WinPcap (depending on winpcap page setting) -ReadINIStr $0 "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "State" -StrCmp $0 "0" SecRequired_skip_Winpcap -; Uninstall old WinPcap first -ReadRegStr $WINPCAP_UNINSTALL HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinPcapInst" "UninstallString" -IfErrors lbl_winpcap_notinstalled ;if RegKey is unavailable, WinPcap is not installed -; from released version 3.1, WinPcap will uninstall an old version by itself -;ExecWait '$WINPCAP_UNINSTALL' $0 -;DetailPrint "WinPcap uninstaller returned $0" -lbl_winpcap_notinstalled: +; if running as a silent installer, don't try to install npcap +IfSilent SecRequired_skip_Npcap + +; Install Npcap (depending on npcap page setting) +ReadINIStr $0 "$PLUGINSDIR\NpcapPage.ini" "Field 4" "State" +StrCmp $0 "0" SecRequired_skip_Npcap SetOutPath $INSTDIR -File "${WIRESHARK_LIB_DIR}\WinPcap_${WINPCAP_PACKAGE_VERSION}.exe" -ExecWait '"$INSTDIR\WinPcap_${WINPCAP_PACKAGE_VERSION}.exe"' $0 -DetailPrint "WinPcap installer returned $0" -SecRequired_skip_Winpcap: +File "${WIRESHARK_LIB_DIR}\npcap-${NPCAP_PACKAGE_VERSION}.exe" +ExecWait '"$INSTDIR\npcap-${NPCAP_PACKAGE_VERSION}.exe"' $0 +DetailPrint "Npcap installer returned $0" +SecRequired_skip_Npcap: ; If running as a silent installer, don't try to install USBPcap IfSilent SecRequired_skip_USBPcap @@ -897,8 +891,8 @@ IfSilent SecRequired_skip_USBPcap ReadINIStr $0 "$PLUGINSDIR\USBPcapPage.ini" "Field 4" "State" StrCmp $0 "0" SecRequired_skip_USBPcap SetOutPath $INSTDIR -File "${WIRESHARK_LIB_DIR}\USBPcapSetup-${USBPCAP_DISPLAY_VERSION}.exe" -ExecWait '"$INSTDIR\USBPcapSetup-${USBPCAP_DISPLAY_VERSION}.exe"' $0 +File "${WIRESHARK_LIB_DIR}\USBPcapSetup-${USBPCAP_PACKAGE_VERSION}.exe" +ExecWait '"$INSTDIR\USBPcapSetup-${USBPCAP_PACKAGE_VERSION}.exe"' $0 DetailPrint "USBPcap installer returned $0" ${If} $0 == "0" ${If} ${RunningX64} @@ -1245,77 +1239,60 @@ FunctionEnd !endif ; QT_DIR -!include "VersionCompare.nsh" - -Var WINPCAP_NAME ; DisplayName from WinPcap installation -Var WINWINPCAP_VERSION ; DisplayVersion from WinPcap installation Var NPCAP_NAME ; DisplayName from Npcap installation +Var WINPCAP_NAME ; DisplayName from WinPcap installation +Var REG_NPCAP_DISPLAY_VERSION ; DisplayVersion from WinPcap installation Var USBPCAP_NAME ; DisplayName from USBPcap installation Function myShowCallback ClearErrors ; detect if WinPcap should be installed - WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "Text" "Install WinPcap ${PCAP_DISPLAY_VERSION}" - 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 - ; check also if Npcap is installed + WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 4" "Text" "Install Npcap ${NPCAP_PACKAGE_VERSION}" ReadRegStr $NPCAP_NAME HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\NpcapInst" "DisplayName" IfErrors 0 lbl_npcap_installed - WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 2" "Text" "Neither of these are installed" - WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 2" "Flags" "DISABLED" - WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Text" "(Use Add/Remove Programs first to uninstall any undetected old WinPcap versions)" - Goto lbl_winpcap_done - -lbl_winpcap_installed: - WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 2" "Text" "$WINPCAP_NAME" - ; Compare the installed build against the one we have. - ReadRegStr $WINWINPCAP_VERSION HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinPcapInst" "DisplayVersion" - StrCmp $WINWINPCAP_VERSION "" lbl_winpcap_do_install ; WinPcap is really old(?) or installed improperly. - ${VersionCompare} $WINWINPCAP_VERSION "4.1.0.2980" $1 ; WinPcap 4.1.3 - StrCmp $1 "2" lbl_winpcap_do_install - -;lbl_winpcap_dont_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_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 ${PCAP_DISPLAY_VERSION}, please uninstall $WINPCAP_NAME manually first." - WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Flags" "DISABLED" - Goto lbl_winpcap_done + ; check also if WinPcap is installed + 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\NpcapPage.ini" "Field 2" "Text" "Neither of these are installed" + WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 2" "Flags" "DISABLED" + WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 5" "Text" "(Use Add/Remove Programs first to uninstall any undetected old WinPcap versions)" + Goto lbl_npcap_done lbl_npcap_installed: ReadRegDWORD $0 HKEY_LOCAL_MACHINE "SOFTWARE\Npcap" "WinPcapCompatible" - WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 1" "Text" "Currently installed Npcap version" - ${If} $0 == "0" - ; Npcap is installed without WinPcap API-compatible mode; WinPcap can be installed - WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 2" "Text" "$NPCAP_NAME is currently installed without WinPcap API-compatible mode" - WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 4" "State" "0" - WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Text" "If you still wish to install WinPcap ${PCAP_DISPLAY_VERSION}, please check this option." - ${Else} - ; Npcap is installed with WinPcap API-compatible mode; WinPcap must not be installed - WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 2" "Text" "$NPCAP_NAME" - 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 ${PCAP_DISPLAY_VERSION}, please uninstall $NPCAP_NAME manually first." - WriteINIStr "$PLUGINSDIR\WinPcapPage.ini" "Field 5" "Flags" "DISABLED" - ${EndIf} - Goto lbl_winpcap_done + WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 1" "Text" "Currently installed Npcap version" + WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 2" "Text" "$NPCAP_NAME" + + ; Compare the installed build against the one we have. + ReadRegStr $REG_NPCAP_DISPLAY_VERSION HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\NpcapInst" "DisplayVersion" + StrCmp $REG_NPCAP_DISPLAY_VERSION "" lbl_npcap_do_install ; Npcap wasn't installed improperly? + ${VersionConvert} $REG_NPCAP_DISPLAY_VERSION "" $R0 ; 0.99-r7 -> 0.99.114.7 + ${VersionConvert} "${NPCAP_PACKAGE_VERSION}" "" $R1 + ${VersionCompare} $R0 $R1 $1 + StrCmp $1 "2" lbl_npcap_do_install + + WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 4" "State" "0" + WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 4" "Flags" "DISABLED" + WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 5" "Text" "If you wish to install WinPcap, please uninstall $NPCAP_NAME manually first." + WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 5" "Flags" "DISABLED" + Goto lbl_npcap_done + +lbl_winpcap_installed: + WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 2" "Text" "$WINPCAP_NAME" + WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 4" "State" "0" + WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 5" "Text" "If selected, the currently installed $WINPCAP_NAME will be uninstalled first." + Goto lbl_npcap_done -lbl_winpcap_do_install: +lbl_npcap_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_NAME will be uninstalled first." + WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 4" "State" "1" + WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 5" "Text" "The currently installed $NPCAP_NAME will be uninstalled first." -lbl_winpcap_done: +lbl_npcap_done: ; detect if USBPcap should be installed - WriteINIStr "$PLUGINSDIR\USBPcapPage.ini" "Field 4" "Text" "Install USBPcap ${USBPCAP_DISPLAY_VERSION}" + WriteINIStr "$PLUGINSDIR\USBPcapPage.ini" "Field 4" "Text" "Install USBPcap ${USBPCAP_PACKAGE_VERSION}" ${If} ${RunningX64} ${DisableX64FSRedirection} SetRegView 64 @@ -1335,7 +1312,7 @@ lbl_usbpcap_installed: WriteINIStr "$PLUGINSDIR\USBPcapPage.ini" "Field 2" "Text" "$USBPCAP_NAME" WriteINIStr "$PLUGINSDIR\USBPcapPage.ini" "Field 4" "State" "0" WriteINIStr "$PLUGINSDIR\USBPcapPage.ini" "Field 4" "Flags" "DISABLED" - WriteINIStr "$PLUGINSDIR\USBPcapPage.ini" "Field 5" "Text" "If you wish to install USBPcap ${USBPCAP_DISPLAY_VERSION}, please uninstall $USBPCAP_NAME manually first." + WriteINIStr "$PLUGINSDIR\USBPcapPage.ini" "Field 5" "Text" "If you wish to install USBPcap ${USBPCAP_PACKAGE_VERSION}, please uninstall $USBPCAP_NAME manually first." WriteINIStr "$PLUGINSDIR\USBPcapPage.ini" "Field 5" "Flags" "DISABLED" Goto lbl_usbpcap_done diff --git a/packaging/wix/CMakeLists.txt b/packaging/wix/CMakeLists.txt index 508b86275d..ec4bf067d7 100644 --- a/packaging/wix/CMakeLists.txt +++ b/packaging/wix/CMakeLists.txt @@ -67,17 +67,6 @@ else() message(FATAL_ERROR "Your mysterious moon-man architecture \"${WIRESHARK_TARGET_PLATFORM}\" frightens and confuses us.") endif() -# Path to the WinPcap installer. -# XXX Come up with a better variable, e.g. cache WIRESHARK_LIB_DIR in FindWSWinLibs. -file(TO_NATIVE_PATH "${GLIB2_DLL_DIR}/../.." _wireshark_lib_dir) -set(WIRESHARK_LIB_DIR "${_wireshark_lib_dir}") - -# Must match ${WIRESHARK_LIB_DIR}/WinPcap_X_Y_Z.exe -set(WINPCAP_PACKAGE_VERSION ${WINPCAP_VERSION}) -string(REPLACE "_" "." PCAP_DISPLAY_VERSION "${WINPCAP_PACKAGE_VERSION}") - -set(USBPCAP_DISPLAY_VERSION "1.2.0.4") - set(PRODUCT_VERSION ${PROJECT_MAJOR_VERSION}.${PROJECT_MINOR_VERSION}.${PROJECT_PATCH_VERSION}.${PROJECT_BUILD_VERSION}) # To do: diff --git a/tools/win-setup.ps1 b/tools/win-setup.ps1 index ca3c5e8294..e31d545427 100644 --- a/tools/win-setup.ps1 +++ b/tools/win-setup.ps1 @@ -69,8 +69,8 @@ Param( # trouble instead of trying to catch exceptions everywhere. $ErrorActionPreference = "Stop" -$Win64CurrentTag = "2018-08-15" -$Win32CurrentTag = "2018-08-15" +$Win64CurrentTag = "2018-11-28" +$Win32CurrentTag = "2018-11-28" # Archive file / SHA256 $Win64Archives = @{ @@ -129,12 +129,12 @@ $ArchivesSubDirectory = @{ # Plain file downloads $Win32Files = @{ - "WinPcap_4_1_3.exe" = "fc4623b113a1f603c0d9ad5f83130bd6de1c62b973be9892305132389c8588de"; + "npcap-0.99-r7.exe" = "5df0b4ac9160eaaae24b57357e2a1d93a0e15c1957b29e01b45f659f7c40269d"; "USBPcapSetup-1.2.0.4.exe" = "0a5ac30b0264e058f262e9c28e5865af7b836620ca5d68bb4bb42c9a808f7a43"; } $Win64Files = @{ - "WinPcap_4_1_3.exe" = "fc4623b113a1f603c0d9ad5f83130bd6de1c62b973be9892305132389c8588de"; + "npcap-0.99-r7.exe" = "5df0b4ac9160eaaae24b57357e2a1d93a0e15c1957b29e01b45f659f7c40269d"; "USBPcapSetup-1.2.0.4.exe" = "0a5ac30b0264e058f262e9c28e5865af7b836620ca5d68bb4bb42c9a808f7a43"; } diff --git a/wsutil/wspcap.h b/wsutil/wspcap.h index 1478803044..74245b56e7 100644 --- a/wsutil/wspcap.h +++ b/wsutil/wspcap.h @@ -13,7 +13,7 @@ * * This bug is fixed in the master branch of libpcap, so any libpcap * release with remote capture support will not have this problem, and - * any future WinPcap/NPcap release based on current libpcap code will + * any future WinPcap/Npcap release based on current libpcap code will * not have this problem. * * Wireshark - Network traffic analyzer |