aboutsummaryrefslogtreecommitdiffstats
path: root/packaging
diff options
context:
space:
mode:
authorChuck Craft <bubbasnmp@gmail.com>2020-05-12 13:48:10 -0500
committerAnders Broman <a.broman58@gmail.com>2020-07-15 20:36:35 +0000
commit93012800c8b27815db844785d61c79a93d1fb834 (patch)
tree6ffb404997cf8eefe2dbec88cf84d05cd238e6b5 /packaging
parentf793923a12e9a39bdfb2a2aaa83a8b1042b3ef7e (diff)
Extcap: silent mode install
Extcap binaries are not part of default install. Normal (graphical) allows them to be selected for installation. Add flags to allow install when doing command line (silent) install. Ping-Bug: 16562 Change-Id: I6ce0fa3b46f9820dc7f66945cda963a3f629579b Reviewed-on: https://code.wireshark.org/review/37185 Petri-Dish: Roland Knall <rknall@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'packaging')
-rw-r--r--packaging/nsis/wireshark.nsi92
1 files changed, 66 insertions, 26 deletions
diff --git a/packaging/nsis/wireshark.nsi b/packaging/nsis/wireshark.nsi
index 5a0a047e92..a0e6db604b 100644
--- a/packaging/nsis/wireshark.nsi
+++ b/packaging/nsis/wireshark.nsi
@@ -139,6 +139,54 @@ Page custom DisplayUSBPcapPage
!insertmacro GetParameters
!insertmacro GetOptions
+; ========= Install extcap binary and help file =========
+!macro InstallExtcap EXTCAP_NAME
+
+ SetOutPath $INSTDIR
+ File "${STAGING_DIR}\${EXTCAP_NAME}.html"
+ SetOutPath $INSTDIR\extcap
+ File "${STAGING_DIR}\extcap\${EXTCAP_NAME}.exe"
+
+!macroend
+
+; ========= Check if silent mode install of /EXTRACOMPONENTS =========
+!macro CheckExtrasFlag EXTRAS_NAME
+ !define EXTRAS_FLAG ${__LINE__}
+Section
+ IfSilent +1 skip_${EXTRAS_FLAG}
+ push $R0
+ push $R1
+ push $R2
+ ${GetParameters} $R0
+ ${GetOptions} $R0 "/EXTRACOMPONENTS=" $R1
+ IfErrors popreg_${EXTRAS_FLAG}
+ ${WordFind} $R1 "," "E+1" $R0
+
+; No delimiters found - check for single word match
+ ${If} $R0 = 1
+ StrCmp $R1 ${EXTRAS_NAME} install_${EXTRAS_FLAG} popreg_${EXTRAS_FLAG}
+ ${ENDIF}
+
+; Loop through all delimited words checking for match
+ IntOp $R2 0 + 1
+ ${While} $R0 != 2
+ StrCmp $R0 ${EXTRAS_NAME} install_${EXTRAS_FLAG} 0
+ IntOp $R2 $R2 + 1
+ ${WordFind} $R1 "," "E+$R2" $R0
+ ${EndWhile}
+ Goto popreg_${EXTRAS_FLAG}
+
+install_${EXTRAS_FLAG}:
+ !insertmacro InstallExtcap ${EXTRAS_NAME}
+popreg_${EXTRAS_FLAG}:
+ pop $R2
+ pop $R1
+ pop $R0
+skip_${EXTRAS_FLAG}:
+ !undef EXTRAS_FLAG
+SectionEnd
+!macroend
+
; ============================================================================
; Component page configuration
; ============================================================================
@@ -1105,39 +1153,31 @@ File "${STAGING_DIR}\mmdbresolve.exe"
SectionEnd
!endif
-Section /o "Androiddump" SecAndroiddumpinfos
+Section /o "Androiddump" SecAndroiddump
;-------------------------------------------
-SetOutPath $INSTDIR
-File "${STAGING_DIR}\androiddump.html"
-SetOutPath $INSTDIR\extcap
-File "${STAGING_DIR}\extcap\androiddump.exe"
+ !insertmacro InstallExtcap "androiddump"
SectionEnd
+!insertmacro CheckExtrasFlag "androiddump"
-Section /o "Sshdump and Ciscodump" SecSshdumpinfos
+Section /o "Sshdump and Ciscodump" SecSshdump
;-------------------------------------------
-SetOutPath $INSTDIR
-File "${STAGING_DIR}\sshdump.html"
-File "${STAGING_DIR}\ciscodump.html"
-SetOutPath $INSTDIR\extcap
-File "${STAGING_DIR}\extcap\sshdump.exe"
-File "${STAGING_DIR}\extcap\ciscodump.exe"
+ !insertmacro InstallExtcap "sshdump"
+ !insertmacro InstallExtcap "ciscodump"
SectionEnd
+!insertmacro CheckExtrasFlag "sshdump"
+!insertmacro CheckExtrasFlag "ciscodump"
-Section /o "UDPdump" SecUDPdumpinfos
+Section /o "UDPdump" SecUDPdump
;-------------------------------------------
-SetOutPath $INSTDIR
-File "${STAGING_DIR}\udpdump.html"
-SetOutPath $INSTDIR\extcap
-File "${STAGING_DIR}\extcap\udpdump.exe"
+ !insertmacro InstallExtcap "udpdump"
SectionEnd
+!insertmacro CheckExtrasFlag "udpdump"
-Section /o "Randpktdump" SecRandpktdumpinfos
+Section /o "Randpktdump" SecRandpktdump
;-------------------------------------------
-SetOutPath $INSTDIR
-File "${STAGING_DIR}\randpktdump.html"
-SetOutPath $INSTDIR\extcap
-File "${STAGING_DIR}\extcap\randpktdump.exe"
+ !insertmacro InstallExtcap "randpktdump"
SectionEnd
+!insertmacro CheckExtrasFlag "randpktdump"
SectionGroupEnd ; "Tools"
@@ -1184,10 +1224,10 @@ SectionEnd
!endif
!insertmacro MUI_DESCRIPTION_TEXT ${SecToolsGroup} "Additional command line based tools."
- !insertmacro MUI_DESCRIPTION_TEXT ${SecAndroiddumpinfos} "Provide capture interfaces from Android devices"
- !insertmacro MUI_DESCRIPTION_TEXT ${SecSshdumpinfos} "Provide remote capture through SSH"
- !insertmacro MUI_DESCRIPTION_TEXT ${SecUDPdumpinfos} "Provide capture interface that gets UDP packets from network devices"
- !insertmacro MUI_DESCRIPTION_TEXT ${SecRandpktdumpinfos} "Provide random packet generator"
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecAndroiddump} "Provide capture interfaces from Android devices"
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecSshdump} "Provide remote capture through SSH"
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecUDPdump} "Provide capture interface that gets UDP packets from network devices"
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecRandpktdump} "Provide random packet generator"
!insertmacro MUI_DESCRIPTION_TEXT ${SecEditCap} "Copy packets to a new file, optionally trimmming packets, omitting them, or saving to a different format."
!insertmacro MUI_DESCRIPTION_TEXT ${SecText2Pcap} "Read an ASCII hex dump and write the data into a libpcap-style capture file."
!insertmacro MUI_DESCRIPTION_TEXT ${SecMergecap} "Combine multiple saved capture files into a single output file"