macOS: Make Wireshark.app drag-installable.

Create ChmodBPF installer and uninstaller packages using pkgbuild and
productbuild. Place them in Wireshark.app/Resources/Extras.

Add a path_helper installer and uninstaller which respectively add and
remove /etc/*paths.d/Wireshark.

Remove the PackageMaker and utility-launcher assets and build targets.

Show a message in the main welcome screen if we don't have capture
permissions. Add an link which launches the ChmodBPF installer.

Add a "macOS Extras" item to About → Folders.

Migrate "Read me first" from RTF to Asciidoctor, which lets us add links
and looks like our other documentation.

Rename dmg_set_style.scpt to arrange_dmg.applescript and make it plain
text. Always run it in osx-dmg.sh.

Bug: 6991
Bug: 12593
Bug: 11399
Ping-Bug: 16074
Change-Id: I7b6aa89aae2be522b4141b0d44e8142dec749e90
Reviewed-on: https://code.wireshark.org/review/31047
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
This commit is contained in:
Gerald Combs 2018-12-11 16:26:51 -08:00
parent 1f779bf9c9
commit ac4f3c0f4d
40 changed files with 575 additions and 907 deletions

View File

@ -1193,6 +1193,8 @@ endif()
# Windows version updates
ws_find_package(WINSPARKLE ENABLE_WINSPARKLE HAVE_SOFTWARE_UPDATE)
find_package( Asciidoctor 1.5 )
find_package(POD REQUIRED)
find_package(DOXYGEN)
@ -1552,10 +1554,9 @@ set(CFG_OUT_FILES
image/wiretap.rc
image/wireshark.exe.manifest
packaging/macosx/Info.plist
packaging/macosx/arrange_dmg.applescript
packaging/macosx/osx-app.sh
packaging/macosx/osx-dmg.sh
packaging/macosx/Read_me_first.rtf
packaging/macosx/Wireshark_package.pmdoc/index.xml
packaging/source/git-export-release.sh
wireshark.pc
)
@ -2764,6 +2765,109 @@ if (MAXMINDDB_FOUND)
endif()
if(ENABLE_APPLICATION_BUNDLE)
set (install_chmodbpf_component_pkg "${CMAKE_BINARY_DIR}/install.ChmodBPF.pkg")
add_custom_command(OUTPUT "${install_chmodbpf_component_pkg}"
COMMAND pkgbuild
--identifier org.wireshark.ChmodBPF.pkg
--version 1.1
--root "${CMAKE_SOURCE_DIR}/packaging/macosx/ChmodBPF/root"
--scripts "${CMAKE_SOURCE_DIR}/packaging/macosx/ChmodBPF/install-scripts"
${install_chmodbpf_component_pkg}
DEPENDS
"${CMAKE_SOURCE_DIR}/packaging/macosx/ChmodBPF/root/Library/Application Support/Wireshark/ChmodBPF/ChmodBPF"
"${CMAKE_SOURCE_DIR}/packaging/macosx/ChmodBPF/root/Library/LaunchDaemons/org.wireshark.ChmodBPF.plist"
"${CMAKE_SOURCE_DIR}/packaging/macosx/ChmodBPF/install-scripts/postinstall"
)
set (install_chmodbpf_pkg "${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/Resources/Extras/Install ChmodBPF.pkg")
add_custom_command(OUTPUT "${install_chmodbpf_pkg}"
COMMAND productbuild
--identifier org.wireshark.install.ChmodBPF.product
--version 1.1
--distribution "${CMAKE_SOURCE_DIR}/packaging/macosx/ChmodBPF/install-distribution.xml"
--package-path "${CMAKE_BINARY_DIR}"
${install_chmodbpf_pkg}
DEPENDS
"${CMAKE_SOURCE_DIR}/packaging/macosx/ChmodBPF/install-distribution.xml"
${install_chmodbpf_component_pkg}
)
set (uninstall_chmodbpf_component_pkg "${CMAKE_BINARY_DIR}/uninstall.ChmodBPF.pkg")
add_custom_command(OUTPUT "${uninstall_chmodbpf_component_pkg}"
COMMAND pkgbuild
--identifier org.wireshark.uninstall.ChmodBPF.pkg
--version 1.1
--nopayload
--scripts "${CMAKE_SOURCE_DIR}/packaging/macosx/ChmodBPF/uninstall-scripts"
${uninstall_chmodbpf_component_pkg}
DEPENDS
"${CMAKE_SOURCE_DIR}/packaging/macosx/ChmodBPF/uninstall-scripts/postinstall"
)
set (uninstall_chmodbpf_pkg "${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/Resources/Extras/Uninstall ChmodBPF.pkg")
add_custom_command(OUTPUT "${uninstall_chmodbpf_pkg}"
COMMAND productbuild
--identifier org.wireshark.uninstall.ChmodBPF.product
--version 1.1
--distribution "${CMAKE_SOURCE_DIR}/packaging/macosx/ChmodBPF/uninstall-distribution.xml"
--package-path "${CMAKE_BINARY_DIR}"
${uninstall_chmodbpf_pkg}
DEPENDS
"${CMAKE_SOURCE_DIR}/packaging/macosx/ChmodBPF/uninstall-distribution.xml"
${uninstall_chmodbpf_component_pkg}
)
add_custom_target(chmodbpf DEPENDS ${install_chmodbpf_pkg} ${uninstall_chmodbpf_pkg})
set (install_path_helper_component_pkg "${CMAKE_BINARY_DIR}/install.path_helper.pkg")
add_custom_command(OUTPUT "${install_path_helper_component_pkg}"
COMMAND pkgbuild
--identifier org.wireshark.path_helper.pkg
--version 1.0
--root "${CMAKE_SOURCE_DIR}/packaging/macosx/path_helper/root/etc"
--install-location /private/etc
${install_path_helper_component_pkg}
DEPENDS
"${CMAKE_SOURCE_DIR}/packaging/macosx/path_helper/root/etc/paths.d/Wireshark"
"${CMAKE_SOURCE_DIR}/packaging/macosx/path_helper/root/etc/manpaths.d/Wireshark"
)
set (install_path_helper_pkg "${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/Resources/Extras/Add Wireshark to the system path.pkg")
add_custom_command(OUTPUT "${install_path_helper_pkg}"
COMMAND productbuild
--identifier org.wireshark.install.path_helper.product
--version 1.0
--distribution "${CMAKE_SOURCE_DIR}/packaging/macosx/path_helper/install-distribution.xml"
--package-path "${CMAKE_BINARY_DIR}"
${install_path_helper_pkg}
DEPENDS
"${CMAKE_SOURCE_DIR}/packaging/macosx/path_helper/install-distribution.xml"
${install_path_helper_component_pkg}
)
set (uninstall_path_helper_component_pkg "${CMAKE_BINARY_DIR}/uninstall.path_helper.pkg")
add_custom_command(OUTPUT "${uninstall_path_helper_component_pkg}"
COMMAND pkgbuild
--identifier org.wireshark.uninstall.path_helper.pkg
--version 1.0
--nopayload
--scripts "${CMAKE_SOURCE_DIR}/packaging/macosx/path_helper/uninstall-scripts"
${uninstall_path_helper_component_pkg}
DEPENDS
"${CMAKE_SOURCE_DIR}/packaging/macosx/path_helper/uninstall-scripts/postinstall"
)
set (uninstall_path_helper_pkg "${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/Resources/Extras/Remove Wireshark from the system path.pkg")
add_custom_command(OUTPUT "${uninstall_path_helper_pkg}"
COMMAND productbuild
--identifier org.wireshark.uninstall.path_helper.product
--version 1.0
--distribution "${CMAKE_SOURCE_DIR}/packaging/macosx/path_helper/uninstall-distribution.xml"
--package-path "${CMAKE_BINARY_DIR}"
${uninstall_path_helper_pkg}
DEPENDS
${CMAKE_SOURCE_DIR}/packaging/macosx/path_helper/uninstall-distribution.xml
${uninstall_path_helper_component_pkg}
)
add_custom_target(path_helper DEPENDS ${install_path_helper_pkg} ${uninstall_path_helper_pkg})
add_custom_target(app_bundle)
set_target_properties(app_bundle PROPERTIES FOLDER "Copy Tasks")
add_custom_command(TARGET app_bundle
@ -2771,37 +2875,31 @@ if(ENABLE_APPLICATION_BUNDLE)
COMMAND "${CMAKE_BINARY_DIR}/packaging/macosx/osx-app.sh"
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/run"
)
add_dependencies(app_bundle ${PROGLIST})
add_dependencies(app_bundle ${PROGLIST} chmodbpf path_helper)
add_custom_target(dmg_package_prep DEPENDS app_bundle)
ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_BINARY_DIR}/packaging/macosx/PkgInfo
COMMAND ${CMAKE_COMMAND} -E echo APPLWshk > ${CMAKE_BINARY_DIR}/packaging/macosx/PkgInfo
)
if( ASCIIDOCTOR_FOUND )
ADD_CUSTOM_COMMAND(
OUTPUT
packaging/macosx/Read_me_first.html
COMMAND ${ASCIIDOCTOR_EXECUTABLE}
--backend html
--out-file packaging/macosx/Read_me_first.html
--attribute include-dir=${CMAKE_SOURCE_DIR}/docbook
--attribute min-macos-version=${MIN_MACOS_VERSION}
${CMAKE_CURRENT_SOURCE_DIR}/packaging/macosx/Read_me_first.adoc
DEPENDS
${CMAKE_CURRENT_SOURCE_DIR}/packaging/macosx/Read_me_first.adoc
)
add_custom_target(read_me_first_html DEPENDS packaging/macosx/Read_me_first.html )
add_dependencies(dmg_package_prep read_me_first_html)
endif()
ADD_CUSTOM_TARGET( dmg_package
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/packaging/macosx/ChmodBPF
${CMAKE_BINARY_DIR}/run/ChmodBPF
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/packaging/macosx/Scripts
${CMAKE_BINARY_DIR}/run/Scripts
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/packaging/macosx/utility-launcher
${CMAKE_BINARY_DIR}/run/utility-launcher
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_SOURCE_DIR}/COPYING
${CMAKE_BINARY_DIR}/run/COPYING.txt
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/packaging/macosx/Wireshark_package.pmdoc
${CMAKE_BINARY_DIR}/run/Wireshark_package.pmdoc
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_BINARY_DIR}/packaging/macosx/Wireshark_package.pmdoc/index.xml
${CMAKE_BINARY_DIR}/run/Wireshark_package.pmdoc/index.xml
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_SOURCE_DIR}/packaging/macosx/dmg_background.png
${CMAKE_BINARY_DIR}/run/dmg_background.png
COMMAND bash -x ${CMAKE_BINARY_DIR}/packaging/macosx/osx-dmg.sh
--source-directory ${CMAKE_SOURCE_DIR}/packaging/macosx
# Unlike nsis_package_prep + nsis_package, we can add a direct

View File

@ -36,6 +36,7 @@ since version 3.1.0:
* You can once again mark and unmark packets using the middle mouse button. This feature
went missing around 2009 or so.
* On macOS, Wireshark can now be installed by dropping it onto the Applications folder.
The following features are new (or have been significantly updated)
since version 3.0.0:

View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Created using `productbuild -\-synthesize -\-package install.ChmodBPF.pkg /tmp/distribution.xml`
See also: https://github.com/open-eid/osx-installer/blob/master/distribution.xml
https://developer.apple.com/library/mac/documentation/DeveloperTools/Reference/DistributionDefinitionRef/
https://developer.apple.com/library/mac/documentation/DeveloperTools/Reference/InstallerJavaScriptRef/
-->
<installer-gui-script minSpecVersion="1">
<title>ChmodBPF</title>
<welcome language="en" mime-type="text/html"><![CDATA[<html><body><br />
<p style="margin: 0px; font: 13px 'Lucida Grande'">This package will install the ChmodBPF launch daemon, create the access_bpf group, and add you to that group.</p></body></html>]]></welcome>
<pkg-ref id="org.wireshark.ChmodBPF.pkg"/>
<options customize="never" require-scripts="false"/>
<domains enable_anywhere="false" enable_currentUserHome="false" enable_localSystem="true"/>
<choices-outline>
<line choice="default">
<line choice="org.wireshark.ChmodBPF.pkg"/>
</line>
</choices-outline>
<choice id="default"/>
<choice id="org.wireshark.ChmodBPF.pkg" visible="false">
<pkg-ref id="org.wireshark.ChmodBPF.pkg"/>
</choice>
<pkg-ref id="org.wireshark.ChmodBPF.pkg" version="1.1" onConclusion="none">install.ChmodBPF.pkg</pkg-ref>
</installer-gui-script>

View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Created using `productbuild -\-synthesize -\-package install.ChmodBPF.pkg /tmp/distribution.xml`
See also: https://github.com/open-eid/osx-installer/blob/master/distribution.xml
https://developer.apple.com/library/mac/documentation/DeveloperTools/Reference/DistributionDefinitionRef/
https://developer.apple.com/library/mac/documentation/DeveloperTools/Reference/InstallerJavaScriptRef/
-->
<installer-gui-script minSpecVersion="1">
<title>Uninstall ChmodBPF</title>
<welcome language="en" mime-type="text/html"><![CDATA[<html><body><br />
<p style="margin: 0px; font: 13px 'Lucida Grande'">This package will uninstall the ChmodBPF launch daemon and remove the access_bpf group.</p></body></html>]]></welcome>
<pkg-ref id="org.wireshark.uninstall.ChmodBPF.pkg"/>
<options customize="never" require-scripts="false"/>
<domains enable_anywhere="false" enable_currentUserHome="false" enable_localSystem="true"/>
<choices-outline>
<line choice="default">
<line choice="org.wireshark.uninstall.ChmodBPF.pkg"/>
</line>
</choices-outline>
<choice id="default"/>
<choice id="org.wireshark.uninstall.ChmodBPF.pkg" visible="false">
<pkg-ref id="org.wireshark.uninstall.ChmodBPF.pkg"/>
</choice>
<pkg-ref id="org.wireshark.uninstall.ChmodBPF.pkg" version="1.1" onConclusion="none">uninstall.ChmodBPF.pkg</pkg-ref>
</installer-gui-script>

View File

@ -0,0 +1,22 @@
#!/bin/sh
#
# Remove the following:
# - The ChmmodBPF launch daemon
# - The ChmmodBPF script
# - The access_bpf group
#
CHMOD_BPF_PLIST="/Library/LaunchDaemons/org.wireshark.ChmodBPF.plist"
BPF_GROUP="access_bpf"
launchctl unload -F "$CHMOD_BPF_PLIST"
dscl . -read /Groups/"$BPF_GROUP" > /dev/null 2>&1 && \
dseditgroup -q -o delete "$BPF_GROUP"
rm -rf "/Library/Application Support/Wireshark"
rm -f "$CHMOD_BPF_PLIST"
rm -rf /Library/StartupItems/ChmodBPF

View File

@ -0,0 +1,72 @@
// Required attributes:
// include-dir
// min-macos-version
include::{include-dir}/attributes.adoc[]
:stylesheet: {include-dir}/ws.css
= Before You Begin
This release of Wireshark requires macOS {min-macos-version} or later.
If you are running an earlier version of macOS you can install using another packaging system such as Homebrew or MacPorts.
== Quick Setup
To install Wireshark, drag the _Wireshark_ application bundle to the _Applications_ folder.
In order to be able to capture packets, install the
link:Wireshark.app/Contents/Resources/Extras/Install%20ChmodBPF.pkg[Install ChmodBPF]
package.
If you would like to add the path to
https://www.wireshark.org/docs/man-pages/wireshark.html[Wireshark],
https://www.wireshark.org/docs/man-pages/tshark.html[TShark],
https://www.wireshark.org/docs/man-pages/capinfos.html[capinfos],
https://www.wireshark.org/docs/man-pages/editcap.html[editcap],
and
https://www.wireshark.org/docs/man-pages/[other command line utilities]
to the system PATH, install the
link:Wireshark.app/Contents/Resources/Extras/Add%20Wireshark%20to%20the%20system%20path.pkg[Add Wireshark to the system path]
package.
== Package Installation Details
The ChmodBPF installer writes to the following locations:
* _/Library/LaunchDaemons/org.wireshark.ChmodBPF.plist_. A launch daemon that adjusts permissions on the system's packet capture devices (/dev/bpf*) when the system starts up.
* _/Library/Application Support/Wireshark/ChmodBPF_. A copy of the launch daemon property list, and the script that the launch daemon runs.
The installer group named “access_bpf” is created. The user who opened the package is added to the group.
The system path installer writes to the following locations:
* _/etc/paths.d/Wireshark_. The folder name in this file is automatically added to PATH
* _/etc/manpaths.d/Wireshark_. The folder name in this file is used by the man command.
It assumes that Wireshark is installed in _/Applications_.
== Uninstalling
To uninstall Wireshark, do the following:
. Remove _/Applications/Wireshark.app_
. Remove _/Library/Application Support/Wireshark_
You can uninstall ChmodBPF via the
link:Wireshark.app/Contents/Resources/Extras/Uninstall%20ChmodBPF.pkg[Uninstall ChmodBPF]
package, which is available on this disk or via menu:Wireshark[About Wireshark,Folders,macOS Extras].
You can also uninstall it manually by doing the following:
. Unload the “org.wireshark.ChmodBPF.plist” launchd job
. Remove _/Library/LaunchDaemons/org.wireshark.ChmodBPF.plist_
. Remove the “access_bpf” group.
You can uninstall the system path components via the
link:Wireshark.app/Contents/Resources/Extras/Remove%20Wireshark%20from%20the%20system%20path.pkg[Remove Wireshark from the system path]
package, which is available on this disk or via menu:Wireshark[About Wireshark,Folders,macOS Extras].
You can also uninstall it manually by doing the following:
. Remove _/etc/paths.d/Wireshark_
. Remove _/etc/manpaths.d/Wireshark_
If you move Wireshark.app the script should automatically find it. If it doesn't you will have to set WIRESHARK_APP_DIR to the path to (and including) Wireshark.app. Automatic discovery might fail if you have multiple copies of Wireshark installed on your system or if Spotlight indexing isn't working properly.

View File

@ -1,120 +0,0 @@
{\rtf1\ansi\ansicpg1252\cocoartf1561\cocoasubrtf600
\cocoascreenfonts1{\fonttbl\f0\froman\fcharset0 TimesNewRomanPSMT;\f1\fswiss\fcharset0 Helvetica;\f2\fnil\fcharset0 Menlo-Regular;
}
{\colortbl;\red255\green255\blue255;\red38\green38\blue38;\red242\green242\blue242;}
{\*\expandedcolortbl;;\cssrgb\c20000\c20000\c20000;\cssrgb\c96078\c96078\c96078;}
{\*\listtable{\list\listtemplateid1\listhybrid{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{decimal\}.}{\leveltext\leveltemplateid1\'02\'00.;}{\levelnumbers\'01;}\fi-360\li720\lin720 }{\listname ;}\listid1}
{\list\listtemplateid2\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid101\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid2}
{\list\listtemplateid3\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid201\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid3}
{\list\listtemplateid4\listhybrid{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{decimal\}.}{\leveltext\leveltemplateid301\'02\'00.;}{\levelnumbers\'01;}\fi-360\li720\lin720 }{\listname ;}\listid4}
{\list\listtemplateid5\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid401\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid5}}
{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}{\listoverride\listid2\listoverridecount0\ls2}{\listoverride\listid3\listoverridecount0\ls3}{\listoverride\listid4\listoverridecount0\ls4}{\listoverride\listid5\listoverridecount0\ls5}}
\margl1440\margr1440\vieww13060\viewh12960\viewkind0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
\f0\b\fs28 \cf0 Before You Begin\
\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
\f1\b0\fs24 \cf0 This release of Wireshark requires macOS @MIN_MACOS_VERSION@ or later. If you are running an earlier version of macOS you can install using another packaging system such as Homebrew or MacPorts.
\f0\b\fs28 \
\
Quick Setup\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
\b0\fs24 \cf0 \
\pard\tx220\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li720\fi-720\pardirnatural\partightenfactor0
\ls1\ilvl0
\f1 \cf0 Simply double-click the Wireshark package. For details about the installation read below.\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
\cf0 \
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
\f0\b\fs28 \cf0 What changes does the installer make?\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
\b0\fs24 \cf0 \
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
\f1 \cf0 The installer writes to the following locations:\
\
\pard\tx220\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li720\fi-720\pardirnatural\partightenfactor0
\ls2\ilvl0\cf0 {\listtext \uc0\u8226 }
\i /Applications/Wireshark.app
\i0 . The main Wireshark application.\
{\listtext \uc0\u8226 }
\i /Library/LaunchDaemons/org.wireshark.ChmodBPF.plist
\i0 . A launch daemon that adjusts permissions on the system's packet capture devices (
\i /dev/bpf
\i0 *) when the system starts up.\
{\listtext \uc0\u8226 }
\i /Library/Application Support/Wireshark/ChmodBPF
\i0 A copy of the launch daemon property list, and the script that the launch daemon runs.\
{\listtext \uc0\u8226 }
\i /usr/local/bin
\i0 . A wrapper script and symbolic links which will let you run Wireshark and its associated utilities from the command line. You can access them directly or by adding /usr/local/bin to your PATH if it's not already in your PATH.\
\pard\tx220\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li720\fi-720\pardirnatural\partightenfactor0
\ls3\ilvl0\cf0 {\listtext \uc0\u8226 }
\i /etc/paths.d/Wireshark
\i0 . The folder name in this file is automatically added to PATH\
{\listtext \uc0\u8226 }
\i /etc/manpaths.d/Wireshark
\i0 . The folder name in this file is used by the man command.\
\pard\tx560\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
\cf0 \
Additionally a group named
\i access_bpf
\i0 is created. The user who opened the package is added to the group.\
\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
\f0\b\fs28 \cf0 How do I uninstall?\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
\b0\fs24 \cf0 \
\pard\tx220\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li720\fi-720\pardirnatural\partightenfactor0
\ls4\ilvl0
\f1 \cf0 {\listtext 1. }Remove
\i /Applications/Wireshark.app
\i0 \
{\listtext 2. }Remove
\i /Library/Application Support/Wireshark
\i0 \
{\listtext 3. }Remove the wrapper scripts from
\i /usr/local/bin
\i0 \
{\listtext 4. }Unload the
\i org.wireshark.ChmodBPF.plist
\i0 launchd job\
{\listtext 5. }Remove
\i /Library/LaunchDaemons/org.wireshark.ChmodBPF.plist
\i0 \
{\listtext 6. }Remove the
\i access_bpf
\i0 group.\
{\listtext 7. }Remove
\i /etc/paths.d/Wireshark
\i0 \
{\listtext 8. }Remove
\i /etc/manpaths.d/Wireshark
\i0 \
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
\f0\b\fs28 \cf0 \
How does the wrapper script work? What if I move Wireshark.app?\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
\b0\fs24 \cf0 \
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
\f1 \cf0 The script should find the Wireshark application bundle and run the appropriate executable automatically. It looks for Wireshark.app in the following locations:\
\
\pard\tx220\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li720\fi-720\pardirnatural\partightenfactor0
\ls5\ilvl0\cf0 {\listtext \uc0\u8226 }The path set in the WIRESHARK_APP_DIR environment variable\
{\listtext \uc0\u8226 }/Applications/Wireshark.app\
{\listtext \uc0\u8226 }The first path returned by
\f2 mdfind "kMDItemCFBundleIdentifier == 'org.wireshark.Wireshark'"
\f1 \
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
\cf0 \
If you move Wireshark.app the script should automatically find it. If it doesn't you will have to set WIRESHARK_APP_DIR to the path to (and including) Wireshark.app. Automatic discovery might fail if you have multiple copies of Wireshark installed on your system or if Spotlight indexing isn't working properly.}

View File

@ -1,27 +0,0 @@
#!/bin/sh
CLI_PATH="$2"
BINARIES="
capinfos
captype
dftest
dumpcap
editcap
mergecap
mmdbresolve
randpkt
rawshark
reordercap
text2pcap
tshark
"
cd "$CLI_PATH"
chmod 755 wireshark
chown root:wheel wireshark
for BIN in $BINARIES ; do
rm -f ./"$BIN"
ln -sn ./wireshark "$BIN"
done

View File

@ -1,18 +0,0 @@
#!/bin/sh
# Create any missing directories with mode 755, owned by root:wheel.
# Don't blindly clobber anything that's already there.
function build_path()
{
echo "Checking $1"
if [ ! -d "$1" ] ; then
TRIMMED=`dirname "$1"`
if [ ! -d "$TRIMMED" ] ; then
build_path "$TRIMMED"
fi
install -v -o root -g wheel -m 0755 -d "$1"
fi
}
build_path "$2"

View File

@ -1,40 +0,0 @@
#!/bin/sh
# Setting PATH
# if /etc/paths.d/Wireshark already exists we overwrite it.
#
WSPATH="$2/Wireshark.app/Contents/MacOS"
if [ ! -d /etc/paths.d ]
then
mkdir -m u=rwx,g=rx,o=rx /etc/paths.d
fi
echo $WSPATH > /etc/paths.d/Wireshark
# Setting MANPATH
# if /etc/manpaths.d/Wireshark already exists we overwrite it.
#
WSMANPATH="$2/Wireshark.app/Contents/Resources/share/man"
if [ ! -d /etc/manpaths.d ]
then
mkdir -m u=rwx,g=rx,o=rx /etc/manpaths.d
fi
echo $WSMANPATH > /etc/manpaths.d/Wireshark
#
# If we still have the old XQuartz fixer, get rid of it; we don't use
# X11, and haven't used it since Wireshark 2.0, so we don't need it.
#
XQUARTZ_FIXER_PLIST="/Library/LaunchDaemons/org.wireshark.XQuartzFixer.plist"
if [ -e "$XQUARTZ_FIXER_PLIST" ]
then
launchctl unload "$XQUARTZ_FIXER_PLIST"
rm -rf "/Library/Application Support/Wireshark/XQuartzFixer"
rm -f "$XQUARTZ_FIXER_PLIST"
fi
#
# And get rid of the *really* old XQuartz fixer while we're at it.
#
rm -rf /Library/StartupItems/XQuartzFixer

View File

@ -1,16 +0,0 @@
#!/bin/sh
#
# If we're upgrading, remove the old Wireshark.app before installing
# the new one so that we don't try to load old, incompatible libraries,
# plugins, codes, or other code.
#
OLD_APP="$2/Wireshark.app"
# This is the wrong way to go about ensuring that our installation is
# deterministic.
# https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=16050
#if [ -d "$OLD_APP" ] ; then
# rm -rf "$OLD_APP"
#fi

View File

@ -1 +0,0 @@
<pkg-contents spec="1.12"/>

View File

@ -1 +0,0 @@
<pkgref spec="1.12" uuid="0B0ABFF7-3A3D-4F37-B998-DC99734E0EFC"><config><identifier>org.wireshark.Wireshark.pkg</identifier><version>0.0.0.0</version><description></description><post-install type="none"/><requireAuthorization/><installFrom relative="true" mod="true" includeRoot="true">Wireshark.app</installFrom><installTo>/Applications</installTo><flags><followSymbolicLinks/><allowRevert/><mod>allowRevert</mod></flags><packageStore type="internal"></packageStore><mod>scripts.scriptsDirectoryPath.isAbsoluteType</mod><mod>scripts.scriptsDirectoryPath.isRelativeType</mod><mod>installTo</mod><mod>scripts.postinstall.path</mod><mod>installFrom.isRelativeType</mod><mod>includeRoot</mod><mod>scripts.postinstall.isRelativeType</mod><mod>version</mod><mod>parent</mod><mod>scripts.scriptsDirectoryPath.path</mod><mod>identifier</mod><mod>relocatable</mod><mod>requireAuthorization</mod><mod>extraFiles</mod><mod>postInstall</mod></config><scripts><preflight relative="true" mod="true">Scripts/wireshark-preflight.sh</preflight><postinstall relative="true" mod="true">Scripts/wireshark-postinstall.sh</postinstall><scripts-dir relative="true" mod="true">Scripts</scripts-dir><scripts-element/></scripts><extra-files/></pkgref>

View File

@ -1 +0,0 @@
<pkg-contents spec="1.12"/>

View File

@ -1 +0,0 @@
<pkgref spec="1.12" uuid="67B4E446-7EE6-4D65-9616-CECAA7FB2094"><config><identifier>org.wireshark.ChmodBPF.pkg</identifier><version>1.0</version><description></description><post-install type="none"/><requireAuthorization/><installFrom relative="true" includeRoot="true">ChmodBPF</installFrom><installTo mod="true">/Library/Application Support/Wireshark</installTo><flags><followSymbolicLinks/></flags><packageStore type="internal"></packageStore><mod>installTo</mod><mod>scripts.postinstall.path</mod><mod>includeRoot</mod><mod>installFrom.isRelativeType</mod><mod>version</mod><mod>parent</mod><mod>scripts.scriptsDirectoryPath.path</mod><mod>requireAuthorization</mod><mod>identifier</mod><mod>extraFiles</mod><mod>installTo.path</mod><mod>postInstall</mod></config><scripts><postinstall relative="true" mod="true">Scripts/chmodbpf-postinstall.sh</postinstall><scripts-dir relative="true" mod="true">Scripts</scripts-dir><scripts-element/></scripts><extra-files/><additionalPkgInfoXML><pkg-info><scripts><postinstall file="./postinstall"/></scripts></pkg-info></additionalPkgInfoXML></pkgref>

View File

@ -1 +0,0 @@
<pkg-contents spec="1.12"><f n="utility-launcher" o="root" g="wheel" p="33261" pt="/Users/gcombs/Development/wireshark/packaging/macosx/utility-launcher/wireshark" m="false" t="file"><mod>group</mod><mod>owner</mod></f></pkg-contents>

View File

@ -1,36 +0,0 @@
<pkgref spec="1.12" uuid="F7F04C41-A94E-4CCA-A8F5-8B774B8D9151">
<config>
<identifier>org.wireshark.cli.pkg</identifier>
<version>1.0</version>
<description/>
<post-install type="none"/>
<requireAuthorization/>
<installFrom relative="true">utility-launcher</installFrom>
<installTo mod="true" relocatable="true">/usr/local/bin</installTo>
<flags>
<followSymbolicLinks/>
</flags>
<packageStore type="internal"/>
<mod>installTo</mod>
<mod>relocatable</mod>
<mod>scripts.scriptsDirectoryPath.isRelativeType</mod>
<mod>identifier</mod>
<mod>parent</mod>
<mod>installTo.path</mod>
<mod>installFrom.isRelativeType</mod>
<mod>scripts.postinstall.isRelativeType</mod>
</config>
<scripts>
<preinstall relative="true" mod="true">Scripts/cli-preinstall.sh</preinstall>
<postinstall relative="true" mod="true">Scripts/cli-postinstall.sh</postinstall>
<scripts-dir relative="true" mod="true">Scripts</scripts-dir>
</scripts>
<contents>
<file-list>03utility-contents.xml</file-list>
<filter>/CVS$</filter>
<filter>/\.svn$</filter>
<filter>/\.cvsignore$</filter>
<filter>/\.cvspass$</filter>
<filter>/\.DS_Store$</filter>
</contents>
</pkgref>

View File

@ -1 +0,0 @@
<pkmkdoc spec="1.12"><properties><title>Wireshark</title><build>Wireshark.pkg</build><organization>org.wireshark</organization><userSees ui="both"/><min-target os="3"/><domain anywhere="true"/></properties><distribution><versions min-spec="1.000000"/><scripts></scripts></distribution><description>Wireshark and associated command line utilities.</description><contents><choice title="Wireshark" id="wireshark" tooltip="The Wireshark network protocol analyzer" description="The main Wireshark application" starts_selected="true" starts_enabled="true" starts_hidden="false"><pkgref id="org.wireshark.Wireshark.pkg"/></choice><choice title="Set capture permissions at startup" id="chmodbpf" tooltip="Install the ChmodBPF launch daemon and add an access_bpf group" description="This installs a launch daemon (org.wireshark.ChmodBPF.plist) that changes the group permissions of each BPF device to allow access for the &quot;access_bpf&quot; group. It creates the &quot;access_bpf&quot; group if it doesn't exist and adds the current user to the group." starts_selected="true" starts_enabled="true" starts_hidden="false"><pkgref id="org.wireshark.ChmodBPF.pkg"/></choice><choice title="Command line utilities" id="cli" tooltip="Command line utilities associated with Wireshark" description="Various utilities associated with Wireshark including TShark, dumpcap, mergecap, capinfos, and editcap." starts_selected="true" starts_enabled="true" starts_hidden="false"><pkgref id="org.wireshark.cli.pkg"/></choice></contents><resources bg-scale="none" bg-align="topleft"><locale lang="en"><resource relative="true" type="license">COPYING.txt</resource></locale></resources><requirements><requirement id="tosv" operator="ge" value="'@MIN_MACOS_VERSION@'"><message-title>Failure</message-title><message>This package requires macOS @MIN_MACOS_VERSION@ or later. If you cannot upgrade you might try installing using MacPorts or Fink.</message></requirement></requirements><flags/><extra-files/><item type="file">01wireshark.xml</item><item type="file">02chmodbpf.xml</item><item type="file">03utility.xml</item><mod>description</mod><mod>properties.title</mod><mod>properties.anywhereDomain</mod><mod>properties.userDomain</mod><mod>properties.customizeOption</mod><mod>extraFiles</mod><mod>postinstallActions.actions</mod><mod>properties.systemDomain</mod></pkmkdoc>

View File

@ -0,0 +1,43 @@
(*
This AppleScript customizes the appearance of the
disk image in which Wireshark is bundled on macOS
Author:
Jean-Olivier Irisson <jo.irisson@gmail.com>
Modified by:
Gerald Combs <gerald@wireshark.org>
Copyright 2006
Licensed under GNU General Public License
*)
tell application "Finder"
tell disk "Wireshark @VERSION@"
open
tell container window
set current view to icon view
set toolbar visible to false
set statusbar visible to false
set the bounds to {600, 200, 950, 725}
end tell
set iv_opts to the icon view options of container window
set background picture of iv_opts to POSIX file "/Volumes/Wireshark @VERSION@/.assets/dmg_background.png"
tell iv_opts
set icon size to 72
set arrangement to not arranged
end tell
set position of application file "Wireshark.app" to {80, 64}
set position of alias file "Applications" to {240, 64}
set position of file "Read me first.html" to {160, 170}
set position of alias file "Install ChmodBPF.pkg" to {80, 276}
set position of alias file "Uninstall ChmodBPF.pkg" to {250, 276}
set position of alias file "Add Wireshark to the system path.pkg" to {80, 382}
set position of alias file "Remove Wireshark from the system path.pkg" to {250, 382}
update without registering applications
end tell
--give the finder some time to write the .DS_Store file
delay 7
end tell

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
@ -10,17 +11,16 @@
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="400"
height="350"
height="500"
id="svg2"
sodipodi:version="0.32"
inkscape:version="0.46"
inkscape:version="0.92.2 5c3e80d, 2017-08-06"
version="1.0"
sodipodi:docbase="/Users/gerald/devel/wireshark/packaging/macosx"
sodipodi:docname="dmg_background.svg"
inkscape:output_extension="org.inkscape.output.svg.inkscape"
inkscape:export-filename="/Users/gerald/Development/wireshark/packaging/macosx/dmg_background.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90">
inkscape:export-filename="/tmp/dmg_background.png"
inkscape:export-xdpi="72"
inkscape:export-ydpi="72">
<defs
id="defs4">
<linearGradient
@ -38,16 +38,6 @@
offset="1"
id="stop3161" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3157"
id="linearGradient2419"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0,-3.3291384,3.3394872,0,-1517.2685,891.61083)"
x1="228.43385"
y1="522.79901"
x2="248.31575"
y2="522.79901" />
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 175 : 1"
@ -117,44 +107,15 @@
y2="108.51223"
gradientUnits="userSpaceOnUse"
gradientTransform="translate(10.101525,393.9595)" />
<filter
inkscape:collect="always"
x="-0.55671173"
width="2.1134236"
y="-0.55558705"
height="2.1111741"
id="filter4219">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="2.3402816"
id="feGaussianBlur4221" />
</filter>
<filter
inkscape:collect="always"
x="-0.01353314"
width="1.0270663"
y="-0.11603204"
height="1.2320641"
id="filter4223">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="2.3402817"
id="feGaussianBlur4225" />
</filter>
<filter
inkscape:collect="always"
x="-0.013595353"
width="1.0271907"
y="-0.10226213"
height="1.2045243"
id="filter5200">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="2.2503457"
id="feGaussianBlur5202" />
</filter>
<inkscape:perspective
id="perspective2500"
id="perspective3625"
inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
inkscape:vp_z="744.09448 : 526.18109 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 526.18109 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective2594"
inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
inkscape:vp_z="744.09448 : 526.18109 : 1"
inkscape:vp_y="0 : 1000 : 0"
@ -169,20 +130,22 @@
gridtolerance="10000"
guidetolerance="10"
objecttolerance="10"
inkscape:pageopacity="0.0"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:zoom="0.98994949"
inkscape:cx="323.61168"
inkscape:cy="211.48805"
inkscape:zoom="1.3"
inkscape:cx="200"
inkscape:cy="250"
inkscape:document-units="px"
inkscape:current-layer="layer1"
width="625px"
height="350px"
inkscape:window-width="1172"
inkscape:window-height="811"
inkscape:window-x="79"
inkscape:window-y="35"
showgrid="false" />
inkscape:window-x="0"
inkscape:window-y="877"
showgrid="false"
inkscape:window-maximized="0"
inkscape:pagecheckerboard="true" />
<metadata
id="metadata7">
<rdf:RDF>
@ -191,13 +154,15 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1">
id="layer1"
transform="translate(0,150)">
<rect
style="opacity:1;fill:url(#linearGradient4266);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.17716534;stroke-linecap:round;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect3289"
@ -205,62 +170,26 @@
height="267.69043"
x="5.0507655"
y="389.39594" />
<g
id="g2425"
transform="translate(-19.999991,-25)">
<g
transform="matrix(1.1558451,-0.3853304,0.3853307,1.1558443,-238.94396,-89.857966)"
id="g5204">
<text
style="font-size:96.08612823px;font-style:normal;font-weight:bold;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#d7d7d7;fill-opacity:1;stroke:none;stroke-width:1pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter4223);font-family:Luxi Sans"
x="111.0079"
y="296.20258"
id="text555"
transform="scale(0.9479031,1.0549601)"
sodipodi:linespacing="125%"
inkscape:export-filename="/home/gerald/devel/wsweb/image/wslogo.png"
inkscape:export-xdpi="90.000000"
inkscape:export-ydpi="90.000000">
<tspan
x="111.0079"
y="296.20258"
sodipodi:role="line"
id="tspan563"
style="font-size:64px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125.00002384%;writing-mode:lr-tb;text-anchor:start;fill:#d7d7d7;fill-opacity:1;font-family:Bitstream Vera Sans">WIRE<tspan
style="font-size:64px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#d7d7d7;fill-opacity:1;font-family:Bitstream Vera Sans"
id="tspan1330">SHARK</tspan>
<tspan
id="tspan1334"
style="font-size:40px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125.00002384%;writing-mode:lr-tb;text-anchor:start;fill:#d7d7d7;fill-opacity:1;font-family:Bitstream Vera Sans" />
</tspan>
</text>
<path
style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#d7d7d7;stroke-width:4.29723692;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;filter:url(#filter5200)"
d="M 106.5666,255.33213 L 263.50037,255.33213 C 263.50037,255.33213 267.57147,207.5469 309.63965,206.88321 C 296.06928,228.12109 308.84175,255.39956 308.84175,255.39956 L 499.52492,255.39956"
id="path1328"
sodipodi:nodetypes="ccccc"
inkscape:export-filename="/home/gerald/devel/wsweb/image/wslogo.png"
inkscape:export-xdpi="90.000000"
inkscape:export-ydpi="90.000000" />
<text
id="text4138"
y="248.90048"
x="485.69824"
style="font-size:13.94218159px;font-style:normal;font-weight:normal;fill:#d7d7d7;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter4219);font-family:Bitstream Vera Sans"
xml:space="preserve"><tspan
y="248.90048"
x="485.69824"
id="tspan4140"
sodipodi:role="line">®</tspan></text>
</g>
<path
sodipodi:nodetypes="cccccccc"
id="path2417"
d="M 213.71311,129 C 259,98.53122 259,98.53122 259,98.53122 L 213.71311,67 L 213.71311,85.01782 L 181,84.80586 L 181,112.04458 L 213.71311,112.04458 L 213.71311,129 z"
style="opacity:1;fill:url(#linearGradient2419);fill-opacity:1;fill-rule:evenodd;stroke:#53851a;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
inkscape:export-filename="/Users/gerald/devel/wsweb/image/dlarrow.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90" />
</g>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:17.55733299px;line-height:100%;font-family:'Lucida Grande';-inkscape-font-specification:'Lucida Grande';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="215.77544"
y="-28.865963"
id="text9542"
transform="scale(0.84814722,1.1790406)"
inkscape:export-filename="/tmp/util_background.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"><tspan
sodipodi:role="line"
id="tspan9540"
x="215.77544"
y="-28.865963"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:62.42607117px;font-family:'Arial Narrow';-inkscape-font-specification:'Arial Narrow Bold';stroke-width:0.86972553px"><tspan
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:62.42607117px;font-family:'Arial Narrow';-inkscape-font-specification:'Arial Narrow Bold';fill:#000000;fill-opacity:0.37254902;stroke-width:1px"
id="tspan9544">&gt;</tspan><tspan
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:62.42607117px;font-family:'Arial Narrow';-inkscape-font-specification:'Arial Narrow Bold';fill:#000000;fill-opacity:0.49803922;stroke-width:1px"
id="tspan9624">&gt;</tspan><tspan
style="fill:#000000;fill-opacity:0.62352941"
id="tspan9676">&gt;</tspan></tspan></text>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 9.7 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

View File

@ -34,55 +34,20 @@
# to be commited to the repository when this is done.
#
# Defaults
set_ds_store=false
ds_store_root="root.ds_store"
app_bundle="Wireshark.app"
rw_name="RWwireshark.dmg"
volume_name="Wireshark"
src_dir="."
tmp_dir="/tmp/dmg-$$"
auto_open_opt=
packagemaker=$( type -p packagemaker || type -p PackageMaker )
if [ -z "$packagemaker" ] ; then
if [ -f /Applications/Xcode.app/Contents/Applications/PackageMaker.app/Contents/MacOS/PackageMaker ]
then
#
# Xcode 4 and later, with the "Auxiliary Tools for Xcode"
# download from developer.apple.com. (There are no such
# downloads for Mavericks or later, but PackageMaker from
# the Late July 2012 download for Mountain Lion appears to
# work on Yosemite.)
#
packagemaker=/Applications/Xcode.app//Contents/Applications/PackageMaker.app/Contents/MacOS/PackageMaker
elif [ -f /Applications/Xcode.app/Developer/Tools/packagemaker ]
then
packagemaker=/Applications/Xcode.app/Developer/Tools/packagemaker
elif [ -f /Applications/Xcode.app/Developer/usr/bin/packagemaker ]
then
packagemaker=/Applications/Xcode.app/Developer/usr/bin/packagemaker
elif [ -f /Developer/Tools/packagemaker ]
then
packagemaker=/Developer/Tools/packagemaker
elif [ -f /Developer/usr/bin/packagemaker ]
then
packagemaker=/Developer/usr/bin/packagemaker
elif [ -f /usr/bin/packagemaker ]
then
packagemaker=/usr/bin/packagemaker
elif [ -f /usr/local/bin/packagemaker ]
then
packagemaker=/usr/local/bin/packagemaker
fi
fi
if [ -z "$packagemaker" ]
then
echo "$0: couldn't find PackageMaker" 1>&2
# Set during configuration
version="@VERSION@"
if [ -z "$version" ] ; then
echo "VERSION not set"
exit 1
fi
# Defaults
app_bundle="Wireshark.app"
rw_name="RWwireshark $version.dmg"
volume_name="Wireshark $version"
src_dir="."
tmp_dir="/tmp/dmg-$$"
# Help message
#----------------------------------------------------------
help()
@ -96,14 +61,15 @@ USAGE
OPTIONS
-h,--help
Display this help message.
-s
Set a new apperance (do not actually create a bundle).
-b,--app-bundle
Set the path to the Wireshark.app that should be copied
in the dmg.
-S,--source-directory
If this is an out-of-tree build, set this to the path
to the packaging/macosx source directory.
Icons are positioned and the background image is set in
arrange_dmg.applescript.
"
}
@ -114,8 +80,6 @@ do
-h|--help)
help
exit 0 ;;
-s)
set_ds_store=true ;;
-b|--app-bundle)
app_bundle="$2"
shift 1 ;;
@ -129,7 +93,6 @@ do
shift 1
done
# Safety checks
if [ ! -e "$app_bundle" ]; then
echo "Cannot find application bundle: $app_bundle"
@ -151,46 +114,7 @@ case $( file "$ws_bin" ) in
exit 1
;;
esac
# Set the version
version="@VERSION@"
if [ -z "$version" ] ; then
echo "VERSION not set"
exit 1
fi
echo -e "\\nCREATE WIRESHARK PACKAGE\\n"
pkg_title="$volume_name $version $architecture"
pkg_file="$pkg_title.pkg"
rm -rf "$pkg_file"
$packagemaker --doc "Wireshark_package.pmdoc" \
--title "$pkg_title" \
--id "org.wireshark.pkg.Wireshark" \
--version "$version" \
--target @MIN_MACOS_VERSION@ \
--verbose || exit 1
if [ -n "$CODE_SIGN_IDENTITY" ] ; then
pkg_file_unsigned="$pkg_title UNSIGNED.pkg"
echo -e "Signing $pkg_file"
mv "$pkg_file" "$pkg_file_unsigned" || exit 1
productsign \
--sign "Developer ID Installer: $CODE_SIGN_IDENTITY" \
--timestamp \
"$pkg_file_unsigned" "$pkg_file" || exit 1
# TN2206, "Checking Gatekeeper Conformance"
spctl --assess --type install "$pkg_file" || exit 1
pkgutil --check-signature "$pkg_file" || exit 1
shasum "$pkg_file"
shasum -a 256 "$pkg_file"
rm -rf "$pkg_file_unsigned"
else
echo "Code signing not performed (no identity)"
fi
# To do: Notarize our package.
# https://developer.apple.com/documentation/security/notarizing_your_app_before_distribution/customizing_the_notarization_workflow?language=objc
pkg_title="$volume_name $architecture"
echo -e "\\nCREATE WIRESHARK DISK IMAGE\\n"
img_name="$pkg_title.dmg"
@ -200,20 +124,19 @@ rm -rf "$tmp_dir"
mkdir "$tmp_dir" || exit 1
echo -e "Copying files to temp directory"
# Copy the installer package
cp "$pkg_file" "$tmp_dir"/ || exit 1
# Copy the readme
cp "../packaging/macosx/Read_me_first.rtf" "$tmp_dir/Read me first.rtf" || exit 1
# Copy the application bundle
cp -r "$app_bundle" "$tmp_dir"/ || exit 1
ln -sn "/Applications" "$tmp_dir"/
# If the appearance settings are not to be modified we just copy them
if [ ${set_ds_store} = "false" ]; then
# Copy the .DS_Store file which contains information about
# window size, appearance, etc. Most of this can be set
# with Apple script but involves user intervention so we
# just keep a copy of the correct settings and use that instead.
cp "$src_dir/$ds_store_root" "$tmp_dir/.DS_Store" || exit 1
auto_open_opt=-noautoopen
fi
# Copy the readme
cp "../packaging/macosx/Read_me_first.html" "$tmp_dir/Read me first.html" || exit 1
# Copy the background image
mkdir "$tmp_dir/.assets" || exit 1
cp "$src_dir/dmg_background.png" "$tmp_dir/.assets/" || exit 1
# Create top-level package symlinks
ln -sn "$app_bundle/Contents/Resources/Extras/"*.pkg "$tmp_dir/"
# Create a new RW image from the temp directory.
echo -e "Creating a temporary disk image"
@ -225,47 +148,20 @@ rm -rf "$tmp_dir"
# Mount the created image.
#MOUNT_DIR="/Volumes/$volume_name"
DEV_NAME=$( /usr/bin/hdiutil attach -readwrite -noverify $auto_open_opt "$rw_name" | grep -E '^/dev/' | sed 1q | awk '{print $1}' )
DEV_NAME=$( /usr/bin/hdiutil attach -readwrite -noverify -noautoopen "$rw_name" | grep -E '^/dev/' | sed 1q | awk '{print $1}' )
# Set icon positions and background image
# Work around 'Finder got an error: Cant get disk "Wireshark 3.1.1". (-1728)'
sleep 5
osascript ../packaging/macosx/arrange_dmg.applescript || exit 1
# Have the disk image window open automatically when mounted.
bless -openfolder /Volumes/$volume_name
bless -openfolder "/Volumes/$volume_name"
# `hdiutil detach` sometimes fails with "Resource busy", possibly due to Spotlight.
# Give it a chance to finish up here and pass `-force` to hdiutil below.
sleep 5
# In case the apperance has to be modified, mount the image and apply the base settings to it via Applescript
if [ ${set_ds_store} = "true" ]; then
/usr/bin/osascript dmg_set_style.scpt
open "/Volumes/$volume_name"
# BUG: one needs to move and close the window manually for the
# changes in appearance to be retained...
echo "
**************************************
* Please move the disk image window *
* to the center of the screen *
* then close it and press enter *
**************************************
"
read -r -e _
# .DS_Store files aren't written till the disk is unmounted, or finder is restarted.
hdiutil detach "$DEV_NAME" -force
auto_open_opt=-noautoopen
DEV_NAME=$( /usr/bin/hdiutil attach -readwrite -noverify $auto_open_opt "$rw_name" | grep -E '^/dev/' | sed 1q | awk '{print $1}' )
echo
cp /Volumes/$volume_name/.DS_Store ./$ds_store_root
SetFile -a v ./$ds_store_root
echo "New $ds_store_root written. Re-run $0 without the -s option to use them"
# Unmount the disk image.
hdiutil detach "$DEV_NAME" -force
rm -f "$rw_name"
exit 0
fi
# Unmount the disk image.
hdiutil detach "$DEV_NAME"

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Created using `productbuild -\-synthesize -\-package org.wireshark.path_helper.pkg.pkg /tmp/install-distribution.xml`
See also: https://github.com/open-eid/osx-installer/blob/master/distribution.xml
https://developer.apple.com/library/mac/documentation/DeveloperTools/Reference/DistributionDefinitionRef/
https://developer.apple.com/library/mac/documentation/DeveloperTools/Reference/InstallerJavaScriptRef/
-->
<installer-gui-script minSpecVersion="1">
<title>Add Wireshark to the system PATH</title>
<welcome language="en" mime-type="text/html"><![CDATA[<html><body><br />
<p style="margin: 0px; font: 13px 'Lucida Grande'">This package will add Wireshark and its associated utilities to the system PATH and MANPATH. Wireshark must be installed in /Applications.</p></body></html>]]></welcome>
<pkg-ref id="org.wireshark.path_helper.pkg"/>
<options customize="never" require-scripts="false"/>
<choices-outline>
<line choice="default">
<line choice="org.wireshark.path_helper.pkg"/>
</line>
</choices-outline>
<choice id="default"/>
<choice id="org.wireshark.path_helper.pkg" visible="false">
<pkg-ref id="org.wireshark.path_helper.pkg"/>
</choice>
<pkg-ref id="org.wireshark.path_helper.pkg" version="1.0" onConclusion="none">install.path_helper.pkg</pkg-ref>
</installer-gui-script>

View File

@ -0,0 +1 @@
/Applications/Wireshark.app/Contents/Resources/share/man

View File

@ -0,0 +1 @@
/Applications/Wireshark.app/Contents/MacOS

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Created using `productbuild -\-synthesize -\-package org.wireshark.uninstall.path.pkg /tmp/uninstall-distribution.xml`
See also: https://github.com/open-eid/osx-installer/blob/master/distribution.xml
https://developer.apple.com/library/mac/documentation/DeveloperTools/Reference/DistributionDefinitionRef/
https://developer.apple.com/library/mac/documentation/DeveloperTools/Reference/InstallerJavaScriptRef/
-->
<installer-gui-script minSpecVersion="1">
<title>Add Wireshark to the system PATH</title>
<welcome language="en" mime-type="text/html"><![CDATA[<html><body><br />
<p style="margin: 0px; font: 13px 'Lucida Grande'">This package will remove Wireshark and its associated utilities from the system PATH and MANPATH.</p></body></html>]]></welcome>
<pkg-ref id="org.wireshark.uninstall.path_helper.pkg"/>
<options customize="never" require-scripts="false"/>
<choices-outline>
<line choice="default">
<line choice="org.wireshark.uninstall.path_helper.pkg"/>
</line>
</choices-outline>
<choice id="default"/>
<choice id="org.wireshark.uninstall.path_helper.pkg" visible="false">
<pkg-ref id="org.wireshark.uninstall.path_helper.pkg"/>
</choice>
<pkg-ref id="org.wireshark.uninstall.path_helper.pkg" version="1.0" onConclusion="none">uninstall.path_helper.pkg</pkg-ref>
</installer-gui-script>

View File

@ -0,0 +1,8 @@
#!/bin/sh
#
# Remove the Wireshark paths.d and manpaths.d entries.
#
rm -f /private/etc/paths.d/Wireshark
rm -f /private/etc/manpaths.d/Wireshark

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

View File

@ -1,273 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="400"
height="350"
id="svg2"
sodipodi:version="0.32"
inkscape:version="0.46"
version="1.0"
sodipodi:docbase="/Users/gerald/devel/wireshark/packaging/macosx"
sodipodi:docname="util_background.svg"
inkscape:output_extension="org.inkscape.output.svg.inkscape"
inkscape:export-filename="/Users/gerald/Development/wireshark/packaging/macosx/util_background.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90">
<defs
id="defs4">
<linearGradient
id="linearGradient3157">
<stop
style="stop-color:#6eac2c;stop-opacity:1;"
offset="0"
id="stop3159" />
<stop
id="stop3848"
offset="0.5"
style="stop-color:#acdd4a;stop-opacity:1;" />
<stop
style="stop-color:#dbf1b0;stop-opacity:1;"
offset="1"
id="stop3161" />
</linearGradient>
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 175 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="625 : 175 : 1"
inkscape:persp3d-origin="312.5 : 116.66667 : 1"
id="perspective2499" />
<linearGradient
id="linearGradient4260">
<stop
style="stop-color:#d3d3d3;stop-opacity:1;"
offset="0"
id="stop4262" />
<stop
style="stop-color:#ffffff;stop-opacity:1;"
offset="1"
id="stop4264" />
</linearGradient>
<linearGradient
id="linearGradient10020">
<stop
id="stop10022"
offset="0"
style="stop-color:#ffffff;stop-opacity:0.85567009;" />
<stop
style="stop-color:#ffffff;stop-opacity:0.49411765;"
offset="0.09"
id="stop3157" />
<stop
style="stop-color:#ffffff;stop-opacity:0.35051546;"
offset="0.28999999"
id="stop4129" />
<stop
id="stop10024"
offset="1"
style="stop-color:#ffffff;stop-opacity:0.05882353;" />
</linearGradient>
<linearGradient
id="linearGradient3152">
<stop
style="stop-color:#1ba0df;stop-opacity:1;"
offset="0"
id="stop3154" />
<stop
style="stop-color:#1373a1;stop-opacity:1;"
offset="1"
id="stop3156" />
</linearGradient>
<linearGradient
id="linearGradient3978">
<stop
style="stop-color:#50e740;stop-opacity:1;"
offset="0"
id="stop3980" />
<stop
style="stop-color:#45a615;stop-opacity:0.94117647;"
offset="1"
id="stop3982" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient4260"
id="linearGradient4266"
x1="289.91379"
y1="4.5278296"
x2="289.91379"
y2="108.51223"
gradientUnits="userSpaceOnUse"
gradientTransform="translate(10.101525,393.9595)" />
<filter
inkscape:collect="always"
x="-0.55671173"
width="2.1134236"
y="-0.55558705"
height="2.1111741"
id="filter4219">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="2.3402816"
id="feGaussianBlur4221" />
</filter>
<filter
inkscape:collect="always"
x="-0.01353314"
width="1.0270663"
y="-0.11603204"
height="1.2320641"
id="filter4223">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="2.3402817"
id="feGaussianBlur4225" />
</filter>
<filter
inkscape:collect="always"
x="-0.013595353"
width="1.0271907"
y="-0.10226213"
height="1.2045243"
id="filter5200">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="2.2503457"
id="feGaussianBlur5202" />
</filter>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3157"
id="linearGradient3579"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0,-3.3291384,3.3394872,0,-1517.2685,971.6108)"
x1="228.43385"
y1="522.79901"
x2="248.31575"
y2="522.79901" />
<inkscape:perspective
id="perspective3625"
inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
inkscape:vp_z="744.09448 : 526.18109 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 526.18109 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective2594"
inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
inkscape:vp_z="744.09448 : 526.18109 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 526.18109 : 1"
sodipodi:type="inkscape:persp3d" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
gridtolerance="10000"
guidetolerance="10"
objecttolerance="10"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.98994949"
inkscape:cx="220.57612"
inkscape:cy="211.48805"
inkscape:document-units="px"
inkscape:current-layer="layer1"
width="625px"
height="350px"
inkscape:window-width="1172"
inkscape:window-height="811"
inkscape:window-x="79"
inkscape:window-y="35"
showgrid="false" />
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1">
<rect
style="opacity:1;fill:url(#linearGradient4266);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.17716534;stroke-linecap:round;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect3289"
width="637.40625"
height="267.69043"
x="5.0507655"
y="389.39594" />
<g
id="g3568"
transform="translate(-19.999991,24)">
<g
transform="matrix(1.1558451,-0.3853304,0.3853307,1.1558443,-238.94396,-9.8579659)"
id="g5204">
<text
style="font-size:96.08612823px;font-style:normal;font-weight:bold;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#d7d7d7;fill-opacity:1;stroke:none;stroke-width:1pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter4223);font-family:Luxi Sans"
x="111.0079"
y="296.20258"
id="text555"
transform="scale(0.9479031,1.0549601)"
sodipodi:linespacing="125%"
inkscape:export-filename="/home/gerald/devel/wsweb/image/wslogo.png"
inkscape:export-xdpi="90.000000"
inkscape:export-ydpi="90.000000">
<tspan
x="111.0079"
y="296.20258"
sodipodi:role="line"
id="tspan563"
style="font-size:64px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125.00002384%;writing-mode:lr-tb;text-anchor:start;fill:#d7d7d7;fill-opacity:1;font-family:Bitstream Vera Sans">WIRE<tspan
style="font-size:64px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#d7d7d7;fill-opacity:1;font-family:Bitstream Vera Sans"
id="tspan1330">SHARK</tspan>
<tspan
id="tspan1334"
style="font-size:40px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125.00002384%;writing-mode:lr-tb;text-anchor:start;fill:#d7d7d7;fill-opacity:1;font-family:Bitstream Vera Sans" />
</tspan>
</text>
<path
style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#d7d7d7;stroke-width:4.29723692;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;filter:url(#filter5200)"
d="M 106.5666,255.33213 L 263.50037,255.33213 C 263.50037,255.33213 267.57147,207.5469 309.63965,206.88321 C 296.06928,228.12109 308.84175,255.39956 308.84175,255.39956 L 499.52492,255.39956"
id="path1328"
sodipodi:nodetypes="ccccc"
inkscape:export-filename="/home/gerald/devel/wsweb/image/wslogo.png"
inkscape:export-xdpi="90.000000"
inkscape:export-ydpi="90.000000" />
<text
id="text4138"
y="248.90048"
x="485.69824"
style="font-size:13.94218159px;font-style:normal;font-weight:normal;fill:#d7d7d7;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter4219);font-family:Bitstream Vera Sans"
xml:space="preserve"><tspan
y="248.90048"
x="485.69824"
id="tspan4140"
sodipodi:role="line">®</tspan></text>
</g>
<path
sodipodi:nodetypes="cccccccc"
id="path2417"
d="M 213.71311,209 C 259,178.53122 259,178.53122 259,178.53122 L 213.71311,147 L 213.71311,165.01782 L 181,164.80586 L 181,192.04458 L 213.71311,192.04458 L 213.71311,209 z"
style="opacity:1;fill:url(#linearGradient3579);fill-opacity:1;fill-rule:evenodd;stroke:#53851a;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
inkscape:export-filename="/Users/gerald/devel/wsweb/image/dlarrow.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90" />
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 10 KiB

View File

@ -1,23 +0,0 @@
#!/bin/sh
#
# Wireshark CLI utility launcher
if [ -z "$WIRESHARK_APP_DIR" ] ; then
WIRESHARK_APP_DIR="/Applications/Wireshark.app"
fi
if [ ! -d "$WIRESHARK_APP_DIR" ] ; then
WIRESHARK_APP_DIR=`mdfind "kMDItemCFBundleIdentifier == 'org.wireshark.Wireshark'" | head -n 1`
fi
if [ ! -d "$WIRESHARK_APP_DIR" ] ; then
echo "Wireshark doesn't appear to be located at $WIRESHARK_APP_DIR."
echo "Please set WIRESHARK_APP_DIR to its proper location and try again."
exit 1
fi
APP_NAME=`basename "$0"`
if [ "$APP_NAME" = "wireshark" ] ; then
APP_NAME=Wireshark
fi
exec "$WIRESHARK_APP_DIR/Contents/MacOS/$APP_NAME" "$@"

View File

@ -253,6 +253,13 @@ FolderListModel::FolderListModel(QObject * parent):
foreach(QString path, smiPaths)
appendRow( QStringList() << tr("MIB/PIB path") << path.trimmed() << tr("SMI MIB/PIB search path"));
#endif
#ifdef Q_OS_MAC
/* Mac Extras */
QString extras_path = wsApp->applicationDirPath() + "/../Resources/Extras";
appendRow( QStringList() << tr("macOS Extras") << QDir::cleanPath(extras_path) << tr("Extra macOS packages"));
#endif
}
QStringList FolderListModel::headerColumns() const

View File

@ -12,14 +12,20 @@
#include <ui_interface_frame.h>
#include "caputils/capture_ifinfo.h"
#include "ui/qt/interface_frame.h"
#include <ui/qt/models/interface_tree_model.h>
#include "ui/qt/interface_frame.h"
#include <ui/qt/wireshark_application.h>
#include <ui/qt/models/interface_tree_model.h>
#include <ui/qt/models/sparkline_delegate.h>
#include "wireshark_application.h"
#include <ui/qt/utils/tango_colors.h>
#include "extcap.h"
#include <wsutil/utf8_entities.h>
#include <QFrame>
#include <QPushButton>
#include <QHBoxLayout>
@ -37,9 +43,9 @@ const int stat_update_interval_ = 1000; // ms
InterfaceFrame::InterfaceFrame(QWidget * parent)
: QFrame(parent),
ui(new Ui::InterfaceFrame)
, proxyModel(Q_NULLPTR)
, sourceModel(Q_NULLPTR)
, infoModel(this)
, proxy_model_(Q_NULLPTR)
, source_model_(Q_NULLPTR)
, info_model_(this)
#ifdef HAVE_LIBPCAP
,stat_timer_(NULL)
#endif // HAVE_LIBPCAP
@ -53,7 +59,19 @@ InterfaceFrame::InterfaceFrame(QWidget * parent)
"QTreeView {"
" border: 0;"
"}"
));
"QLabel {"
" border-radius: 0.5em;"
" padding: 0.33em;"
" margin-bottom: 0.25em;"
// We might want to transition this to normal colors this after a timeout.
" color: #%1;"
" background-color: #%2;"
"}"
)
.arg(ws_css_warn_text, 6, 16, QChar('0'))
.arg(ws_css_warn_background, 6, 16, QChar('0')));
ui->warningLabel->hide();
#ifdef Q_OS_MAC
ui->interfaceTree->setAttribute(Qt::WA_MacShowFocusRect, false);
@ -75,16 +93,16 @@ InterfaceFrame::InterfaceFrame(QWidget * parent)
columns.append(IFTREE_COL_EXTCAP);
columns.append(IFTREE_COL_DISPLAY_NAME);
columns.append(IFTREE_COL_STATS);
proxyModel.setColumns(columns);
proxyModel.setStoreOnChange(true);
proxyModel.setSourceModel(&sourceModel);
proxy_model_.setColumns(columns);
proxy_model_.setStoreOnChange(true);
proxy_model_.setSourceModel(&source_model_);
infoModel.setSourceModel(&proxyModel);
infoModel.setColumn(columns.indexOf(IFTREE_COL_STATS));
ui->interfaceTree->setModel(&infoModel);
info_model_.setSourceModel(&proxy_model_);
info_model_.setColumn(columns.indexOf(IFTREE_COL_STATS));
ui->interfaceTree->setItemDelegateForColumn(proxyModel.mapSourceToColumn(IFTREE_COL_STATS), new SparkLineDelegate(this));
ui->interfaceTree->setModel(&info_model_);
ui->interfaceTree->setItemDelegateForColumn(proxy_model_.mapSourceToColumn(IFTREE_COL_STATS), new SparkLineDelegate(this));
ui->interfaceTree->setContextMenuPolicy(Qt::CustomContextMenu);
connect(ui->interfaceTree, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showContextMenu(QPoint)));
@ -104,7 +122,7 @@ InterfaceFrame::~InterfaceFrame()
QMenu * InterfaceFrame::getSelectionMenu()
{
QMenu * contextMenu = new QMenu(this);
QList<int> typesDisplayed = proxyModel.typesDisplayed();
QList<int> typesDisplayed = proxy_model_.typesDisplayed();
QMap<int, QString>::const_iterator it = ifTypeDescription.constBegin();
while(it != ifTypeDescription.constEnd())
@ -116,7 +134,7 @@ QMenu * InterfaceFrame::getSelectionMenu()
QAction *endp_action = new QAction(it.value(), this);
endp_action->setData(QVariant::fromValue(ifType));
endp_action->setCheckable(true);
endp_action->setChecked(proxyModel.isInterfaceTypeShown(ifType));
endp_action->setChecked(proxy_model_.isInterfaceTypeShown(ifType));
connect(endp_action, SIGNAL(triggered()), this, SLOT(triggeredIfTypeButton()));
contextMenu->addAction(endp_action);
}
@ -124,11 +142,11 @@ QMenu * InterfaceFrame::getSelectionMenu()
}
#ifdef HAVE_PCAP_REMOTE
if ( proxyModel.remoteInterfacesExist() )
if ( proxy_model_.remoteInterfacesExist() )
{
QAction * toggleRemoteAction = new QAction(tr("Remote interfaces"), this);
toggleRemoteAction->setCheckable(true);
toggleRemoteAction->setChecked(! proxyModel.remoteDisplay());
toggleRemoteAction->setChecked(! proxy_model_.remoteDisplay());
connect(toggleRemoteAction, SIGNAL(triggered()), this, SLOT(toggleRemoteInterfaces()));
contextMenu->addAction(toggleRemoteAction);
}
@ -139,7 +157,7 @@ QMenu * InterfaceFrame::getSelectionMenu()
contextMenu->addSeparator();
QAction * toggleHideAction = new QAction(tr("Show hidden interfaces"), this);
toggleHideAction->setCheckable(true);
toggleHideAction->setChecked(! proxyModel->filterHidden());
toggleHideAction->setChecked(! proxy_model_->filterHidden());
connect(toggleHideAction, SIGNAL(triggered()), this, SLOT(toggleHiddenInterfaces()));
contextMenu->addAction(toggleHideAction);
#endif
@ -149,12 +167,12 @@ QMenu * InterfaceFrame::getSelectionMenu()
int InterfaceFrame::interfacesHidden()
{
return proxyModel.interfacesHidden();
return proxy_model_.interfacesHidden();
}
int InterfaceFrame::interfacesPresent()
{
return sourceModel.rowCount() - proxyModel.interfacesHidden();
return source_model_.rowCount() - proxy_model_.interfacesHidden();
}
void InterfaceFrame::ensureSelectedInterface()
@ -162,8 +180,8 @@ void InterfaceFrame::ensureSelectedInterface()
#ifdef HAVE_LIBPCAP
if (interfacesPresent() < 1) return;
if (sourceModel.selectedDevices().count() < 1) {
QModelIndex first_idx = infoModel.mapFromSource(proxyModel.index(0, 0));
if (source_model_.selectedDevices().count() < 1) {
QModelIndex first_idx = info_model_.mapFromSource(proxy_model_.index(0, 0));
ui->interfaceTree->setCurrentIndex(first_idx);
}
@ -175,7 +193,7 @@ void InterfaceFrame::hideEvent(QHideEvent *) {
#ifdef HAVE_LIBPCAP
if (stat_timer_)
stat_timer_->stop();
sourceModel.stopStatistic();
source_model_.stopStatistic();
#endif // HAVE_LIBPCAP
}
@ -192,7 +210,7 @@ void InterfaceFrame::actionButton_toggled(bool checked)
QVariant ifType = sender()->property(BTN_IFTYPE_PROPERTY);
if ( ifType.isValid() )
{
proxyModel.setInterfaceTypeVisible(ifType.toInt(), checked);
proxy_model_.setInterfaceTypeVisible(ifType.toInt(), checked);
}
resetInterfaceTreeDisplay();
@ -204,7 +222,7 @@ void InterfaceFrame::triggeredIfTypeButton()
if ( sender )
{
int ifType = sender->data().value<int>();
proxyModel.toggleTypeVisibility(ifType);
proxy_model_.toggleTypeVisibility(ifType);
resetInterfaceTreeDisplay();
emit typeSelectionChanged();
@ -213,9 +231,9 @@ void InterfaceFrame::triggeredIfTypeButton()
void InterfaceFrame::interfaceListChanged()
{
infoModel.clearInfos();
info_model_.clearInfos();
if ( prefs.capture_no_extcap )
infoModel.appendInfo(tr("External capture interfaces disabled."));
info_model_.appendInfo(tr("External capture interfaces disabled."));
resetInterfaceTreeDisplay();
// Ensure that device selection is consistent with the displayed selection.
@ -233,7 +251,7 @@ void InterfaceFrame::interfaceListChanged()
void InterfaceFrame::toggleHiddenInterfaces()
{
proxyModel.toggleFilterHidden();
proxy_model_.toggleFilterHidden();
emit typeSelectionChanged();
}
@ -241,38 +259,61 @@ void InterfaceFrame::toggleHiddenInterfaces()
#ifdef HAVE_PCAP_REMOTE
void InterfaceFrame::toggleRemoteInterfaces()
{
proxyModel.toggleRemoteDisplay();
proxy_model_.toggleRemoteDisplay();
emit typeSelectionChanged();
}
#endif
#include <QDebug>
void InterfaceFrame::resetInterfaceTreeDisplay()
{
if ( proxyModel.rowCount() == 0 )
ui->warningLabel->setText(tr("No interfaces found"));
ui->warningLabel->hide();
if ( proxy_model_.rowCount() == 0 )
{
ui->interfaceTree->setHidden(true);
ui->lblNoInterfaces->setHidden(false);
ui->lblNoInterfaces->setText( proxyModel.interfaceError() );
if ( prefs.capture_no_interface_load )
ui->lblNoInterfaces->setText( "Interfaces not loaded (due to preference). Go to Capture -> Refresh Interfaces to load." );
ui->interfaceTree->hide();
ui->warningLabel->show();
ui->warningLabel->setText(proxy_model_.interfaceError());
if ( prefs.capture_no_interface_load ) {
ui->warningLabel->setText(tr("Interfaces not loaded (due to preference). Go to Capture " UTF8_RIGHTWARDS_ARROW " Refresh Interfaces to load."));
}
}
else if (!haveCapturePermissions())
{
#ifdef Q_OS_MAC
QString install_chmodbpf_path = wsApp->applicationDirPath() + "/../Resources/Extras/Install ChmodBPF.pkg";
ui->warningLabel->setText(tr("You don't have permission to capture. You can <a href=\"file://%1\">install ChmodBPF to fix this</a>.").arg(install_chmodbpf_path));
ui->warningLabel->show();
#endif
}
else
{
ui->interfaceTree->setHidden(false);
ui->lblNoInterfaces->setHidden(true);
ui->interfaceTree->resizeColumnToContents(proxyModel.mapSourceToColumn(IFTREE_COL_EXTCAP));
ui->interfaceTree->resizeColumnToContents(proxyModel.mapSourceToColumn(IFTREE_COL_DISPLAY_NAME));
ui->interfaceTree->resizeColumnToContents(proxyModel.mapSourceToColumn(IFTREE_COL_STATS));
ui->interfaceTree->show();
ui->warningLabel->hide();
ui->interfaceTree->resizeColumnToContents(proxy_model_.mapSourceToColumn(IFTREE_COL_EXTCAP));
ui->interfaceTree->resizeColumnToContents(proxy_model_.mapSourceToColumn(IFTREE_COL_DISPLAY_NAME));
ui->interfaceTree->resizeColumnToContents(proxy_model_.mapSourceToColumn(IFTREE_COL_STATS));
}
}
bool InterfaceFrame::haveCapturePermissions() const
{
#ifdef Q_OS_MAC
QFileInfo bpf0_fi = QFileInfo("/dev/bpf0");
return bpf0_fi.isReadable() && bpf0_fi.isWritable();
#else
return true;
#endif
}
void InterfaceFrame::updateSelectedInterfaces()
{
if ( sourceModel.rowCount() == 0 )
if ( source_model_.rowCount() == 0 )
return;
#ifdef HAVE_LIBPCAP
QItemSelection sourceSelection = sourceModel.selectedDevices();
QItemSelection mySelection = infoModel.mapSelectionFromSource(proxyModel.mapSelectionFromSource(sourceSelection));
QItemSelection sourceSelection = source_model_.selectedDevices();
QItemSelection mySelection = info_model_.mapSelectionFromSource(proxy_model_.mapSelectionFromSource(sourceSelection));
ui->interfaceTree->selectionModel()->clearSelection();
ui->interfaceTree->selectionModel()->select(mySelection, QItemSelectionModel::SelectCurrent );
@ -283,30 +324,30 @@ void InterfaceFrame::interfaceTreeSelectionChanged(const QItemSelection & select
{
if (selected.count() == 0 && deselected.count() == 0)
return;
if ( sourceModel.rowCount() == 0 )
if ( source_model_.rowCount() == 0 )
return;
#ifdef HAVE_LIBPCAP
/* Take all selected interfaces, not just the newly ones */
QItemSelection allSelected = ui->interfaceTree->selectionModel()->selection();
QItemSelection sourceSelection = proxyModel.mapSelectionToSource(infoModel.mapSelectionToSource(allSelected));
QItemSelection sourceSelection = proxy_model_.mapSelectionToSource(info_model_.mapSelectionToSource(allSelected));
if ( sourceModel.updateSelectedDevices(sourceSelection) )
if ( source_model_.updateSelectedDevices(sourceSelection) )
emit itemSelectionChanged();
#endif
}
void InterfaceFrame::on_interfaceTree_doubleClicked(const QModelIndex &index)
{
QModelIndex realIndex = proxyModel.mapToSource(infoModel.mapToSource(index));
QModelIndex realIndex = proxy_model_.mapToSource(info_model_.mapToSource(index));
if ( ! realIndex.isValid() )
return;
#ifdef HAVE_LIBPCAP
QString device_name = sourceModel.getColumnContent(realIndex.row(), IFTREE_COL_NAME).toString();
QString extcap_string = sourceModel.getColumnContent(realIndex.row(), IFTREE_COL_EXTCAP_PATH).toString();
QString device_name = source_model_.getColumnContent(realIndex.row(), IFTREE_COL_NAME).toString();
QString extcap_string = source_model_.getColumnContent(realIndex.row(), IFTREE_COL_EXTCAP_PATH).toString();
/* We trust the string here. If this interface is really extcap, the string is
* being checked immediatly before the dialog is being generated */
@ -328,13 +369,13 @@ void InterfaceFrame::on_interfaceTree_clicked(const QModelIndex &index)
{
if ( index.column() == 0 )
{
QModelIndex realIndex = proxyModel.mapToSource(infoModel.mapToSource(index));
QModelIndex realIndex = proxy_model_.mapToSource(info_model_.mapToSource(index));
if ( ! realIndex.isValid() )
return;
QString device_name = sourceModel.getColumnContent(realIndex.row(), IFTREE_COL_NAME).toString();
QString extcap_string = sourceModel.getColumnContent(realIndex.row(), IFTREE_COL_EXTCAP_PATH).toString();
QString device_name = source_model_.getColumnContent(realIndex.row(), IFTREE_COL_NAME).toString();
QString extcap_string = source_model_.getColumnContent(realIndex.row(), IFTREE_COL_EXTCAP_PATH).toString();
/* We trust the string here. If this interface is really extcap, the string is
* being checked immediatly before the dialog is being generated */
@ -353,18 +394,18 @@ void InterfaceFrame::on_interfaceTree_clicked(const QModelIndex &index)
void InterfaceFrame::updateStatistics(void)
{
if ( sourceModel.rowCount() == 0 )
if ( source_model_.rowCount() == 0 )
return;
#ifdef HAVE_LIBPCAP
for( int idx = 0; idx < proxyModel.rowCount(); idx++ )
for( int idx = 0; idx < proxy_model_.rowCount(); idx++ )
{
QModelIndex selectIndex = infoModel.mapFromSource(proxyModel.mapFromSource(sourceModel.index(idx, 0)));
QModelIndex selectIndex = info_model_.mapFromSource(proxy_model_.mapFromSource(source_model_.index(idx, 0)));
/* Proxy model has not masked out the interface */
if ( selectIndex.isValid() )
sourceModel.updateStatistic(idx);
source_model_.updateStatistic(idx);
}
#endif
@ -373,12 +414,12 @@ void InterfaceFrame::updateStatistics(void)
/* Proxy Method so we do not need to expose the source model */
void InterfaceFrame::getPoints(int idx, PointList * pts)
{
sourceModel.getPoints(idx, pts);
source_model_.getPoints(idx, pts);
}
void InterfaceFrame::showRunOnFile(void)
{
ui->lblNoInterfaces->setText("Interfaces not loaded on startup (run on capture file). Go to Capture -> Refresh Interfaces to load.");
ui->warningLabel->setText("Interfaces not loaded on startup (run on capture file). Go to Capture -> Refresh Interfaces to load.");
}
void InterfaceFrame::showContextMenu(QPoint pos)

View File

@ -68,12 +68,13 @@ protected:
private:
void resetInterfaceTreeDisplay();
bool haveCapturePermissions() const;
Ui::InterfaceFrame *ui;
InterfaceSortFilterModel proxyModel;
InterfaceTreeModel sourceModel;
InfoProxyModel infoModel;
InterfaceSortFilterModel proxy_model_;
InterfaceTreeModel source_model_;
InfoProxyModel info_model_;
QMap<int, QString> ifTypeDescription;

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>676</width>
<height>350</height>
<width>256</width>
<height>209</height>
</rect>
</property>
<property name="sizePolicy">
@ -39,7 +39,7 @@
<number>0</number>
</property>
<item>
<widget class="QLabel" name="lblNoInterfaces">
<widget class="QLabel" name="warningLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
@ -47,11 +47,20 @@
</sizepolicy>
</property>
<property name="text">
<string>No interfaces found</string>
<string/>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item>