aboutsummaryrefslogtreecommitdiffstats
path: root/packaging
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2015-10-07 23:27:17 +0200
committerAnders Broman <a.broman58@gmail.com>2015-10-08 04:18:39 +0000
commit7d252d4b55e06d577f56f2169a757e81276dba7b (patch)
treed1308732241337f459dcc48be54e7db93986ebeb /packaging
parent291bca0056f0f3c6d3bcd232991cec66d79b17f2 (diff)
Add USBPcap 1.1.0.0-g794bf26 to Windows installer
Change-Id: Idb88cd41436e49b7a29bd4a8e896c92d8489318d Reviewed-on: https://code.wireshark.org/review/10868 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'packaging')
-rw-r--r--packaging/nsis/USBPcapPage.ini52
-rw-r--r--packaging/nsis/config.nsh.in1
-rwxr-xr-xpackaging/nsis/uninstall.nsi30
-rw-r--r--packaging/nsis/wireshark.nsi66
4 files changed, 149 insertions, 0 deletions
diff --git a/packaging/nsis/USBPcapPage.ini b/packaging/nsis/USBPcapPage.ini
new file mode 100644
index 0000000000..5b40701c64
--- /dev/null
+++ b/packaging/nsis/USBPcapPage.ini
@@ -0,0 +1,52 @@
+[Settings]
+NumFields=9
+
+[Field 1]
+Type=GroupBox
+Left=0
+Right=-1
+Top=0
+Bottom=25
+Text=Currently installed USBPcap version
+
+[Field 2]
+Type=Label
+Left=10
+Right=250
+Top=10
+Bottom=18
+Text=This text will be replaced with current USBPcap installer version
+
+[Field 3]
+Type=GroupBox
+Left=0
+Right=-1
+Top=30
+Bottom=65
+Text=Install
+
+[Field 4]
+Type=CheckBox
+Left=10
+Right=250
+Top=40
+Bottom=48
+Text=This text will be replaced, depending on current USBPcap version in wireshark.nsi
+State=0
+
+[Field 5]
+Type=Label
+Left=20
+Right=290
+Top=50
+Bottom=58
+Text=This text will be replaced, depending if USBPcap is already installed
+
+[Field 6]
+Type=Button
+Left=0
+Right=100
+Top=120
+Bottom=135
+Text=What is USBPcap?
+State=http://desowin.org/usbpcap/
diff --git a/packaging/nsis/config.nsh.in b/packaging/nsis/config.nsh.in
index d42667270c..0030b1de8d 100644
--- a/packaging/nsis/config.nsh.in
+++ b/packaging/nsis/config.nsh.in
@@ -13,6 +13,7 @@
!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.1.0.0-g794bf26"
!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 f4b4c4b078..e72e759c66 100755
--- a/packaging/nsis/uninstall.nsi
+++ b/packaging/nsis/uninstall.nsi
@@ -8,6 +8,9 @@
!include "common.nsh"
!include 'LogicLib.nsh'
+!include x64.nsh
+!include "StrFunc.nsh"
+${UnStrRep}
SetCompress off
OutFile "${STAGING_DIR}\uninstall_installer.exe"
@@ -86,6 +89,32 @@ SectionEnd
!define EXECUTABLE_MARKER "EXECUTABLE_MARKER"
Var EXECUTABLE
+Section /o "Un.USBPcap" un.SecUSBPcap
+;-------------------------------------------
+SectionIn 2
+${If} ${RunningX64}
+ ${DisableX64FSRedirection}
+ SetRegView 64
+${EndIf}
+ReadRegStr $1 HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\USBPcap" "UninstallString"
+${If} ${RunningX64}
+ ${EnableX64FSRedirection}
+ SetRegView 32
+${EndIf}
+${If} $1 != ""
+ ${UnStrRep} $2 '$1' '\Uninstall.exe' ''
+ ${UnStrRep} $3 '$2' '"' ''
+ ExecWait '$1 _?=$3' $0
+ DetailPrint "USBPcap uninstaller returned $0"
+ ${If} $0 == "0"
+ Delete "$3\Uninstall.exe"
+ Delete "$INSTDIR\extcap\USBPcapCMD.exe"
+ ${EndIf}
+${EndIf}
+ClearErrors
+SectionEnd
+
+
Section "Uninstall" un.SecUinstall
;-------------------------------------------
;
@@ -332,6 +361,7 @@ SectionEnd
!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.SecUSBPcap} "Call USBPcap's uninstall program."
!insertmacro MUI_UNFUNCTION_DESCRIPTION_END
;
diff --git a/packaging/nsis/wireshark.nsi b/packaging/nsis/wireshark.nsi
index 77b323475a..079d152b2b 100644
--- a/packaging/nsis/wireshark.nsi
+++ b/packaging/nsis/wireshark.nsi
@@ -12,6 +12,8 @@ SetCompressorDictSize 64 ; MB
!include "common.nsh"
!include 'LogicLib.nsh'
+!include "StrFunc.nsh"
+${StrRep}
; See http://nsis.sourceforge.net/Check_if_a_file_exists_at_compile_time for documentation
!macro !defineifexist _VAR_NAME _FILE_NAME
@@ -81,6 +83,7 @@ BrandingText "Wireshark Installer (tm)"
Page custom DisplayAdditionalTasksPage
!insertmacro MUI_PAGE_DIRECTORY
Page custom DisplayWinPcapPage
+Page custom DisplayUSBPcapPage
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
@@ -99,6 +102,7 @@ Page custom DisplayWinPcapPage
ReserveFile "AdditionalTasksPage.ini"
ReserveFile "WinPcapPage.ini"
+ ReserveFile "USBPcapPage.ini"
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
; ============================================================================
@@ -303,6 +307,7 @@ done:
;Extract InstallOptions INI files
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "AdditionalTasksPage.ini"
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "WinpcapPage.ini"
+ !insertmacro MUI_INSTALLOPTIONS_EXTRACT "USBPcapPage.ini"
FunctionEnd
Function DisplayAdditionalTasksPage
@@ -315,11 +320,17 @@ Function DisplayWinPcapPage
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "WinPcapPage.ini"
FunctionEnd
+Function DisplayUSBPcapPage
+ !insertmacro MUI_HEADER_TEXT "Install USBPcap?" "USBPcap is required to capture USB traffic. Should USBPcap be installed?"
+ !insertmacro MUI_INSTALLOPTIONS_DISPLAY "USBPcapPage.ini"
+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
!ifdef VCREDIST_EXE
@@ -817,6 +828,33 @@ ExecWait '"$INSTDIR\WinPcap_${WINPCAP_PACKAGE_VERSION}.exe"' $0
DetailPrint "WinPcap installer returned $0"
SecRequired_skip_Winpcap:
+; If running as a silent installer, don't try to install USBPcap
+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
+DetailPrint "USBPcap installer returned $0"
+${If} $0 == "0"
+ ${If} ${RunningX64}
+ ${DisableX64FSRedirection}
+ SetRegView 64
+ ${EndIf}
+ ReadRegStr $USBPCAP_UNINSTALL HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\USBPcap" "UninstallString"
+ ${If} ${RunningX64}
+ ${EnableX64FSRedirection}
+ SetRegView 32
+ ${EndIf}
+ CreateDirectory $INSTDIR\extcap
+ ${StrRep} $0 '$USBPCAP_UNINSTALL' 'Uninstall.exe' 'USBPcapCMD.exe'
+ ${StrRep} $1 '$0' '"' ''
+ CopyFiles /SILENT $1 $INSTDIR\extcap
+ SetRebootFlag true
+${EndIf}
+SecRequired_skip_USBPcap:
+
; If no user profile exists for Wireshark but for Ethereal, copy it over
SetShellVarContext current
IfFileExists $APPDATA\Wireshark profile_done
@@ -1169,6 +1207,7 @@ FunctionEnd
Var WINPCAP_NAME ; DisplayName from WinPcap installation
Var WINWINPCAP_VERSION ; DisplayVersion from WinPcap installation
Var NPCAP_NAME ; DisplayName from Npcap installation
+Var USBPCAP_NAME ; DisplayName from USBPcap installation
Function myShowCallback
@@ -1244,6 +1283,33 @@ lbl_winpcap_do_install:
lbl_winpcap_done:
+ ; detect if USBPcap should be installed
+ WriteINIStr "$PLUGINSDIR\USBPcapPage.ini" "Field 4" "Text" "Install USBPcap ${USBPCAP_DISPLAY_VERSION}"
+ ${If} ${RunningX64}
+ ${DisableX64FSRedirection}
+ SetRegView 64
+ ${EndIf}
+ ReadRegStr $USBPCAP_NAME HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\USBPcap" "DisplayName"
+ ${If} ${RunningX64}
+ ${EnableX64FSRedirection}
+ SetRegView 32
+ ${EndIf}
+ IfErrors 0 lbl_usbpcap_installed ;if RegKey is available, USBPcap is already installed
+ WriteINIStr "$PLUGINSDIR\USBPcapPage.ini" "Field 2" "Text" "USBPcap is currently not installed"
+ WriteINIStr "$PLUGINSDIR\USBPcapPage.ini" "Field 2" "Flags" "DISABLED"
+ WriteINIStr "$PLUGINSDIR\USBPcapPage.ini" "Field 5" "Text" "(Use Add/Remove Programs first to uninstall any undetected old USBPcap versions)"
+ Goto lbl_usbpcap_done
+
+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" "Flags" "DISABLED"
+ Goto lbl_usbpcap_done
+
+lbl_usbpcap_done:
+
; if Wireshark was previously installed, unselect previously not installed icons etc.
; detect if Wireshark is already installed ->
ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" "UninstallString"