From 2cc215c7d0b07c2be3d5d5908664f5e9b9bdc0de Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Wed, 4 Jan 2017 03:05:14 -0800 Subject: Running Wireshark through a symlink doesn't work. We can't just symbolically link to the executables, as that means that the executable won't be in Contents/MacOS, which means that all @executable_path-relative references will go to the wrong place if we run the executables using the symlink, which means that the executables could fail (they *do* fail to find the Cocoa Qt plugin, for example). So, instead, we go back to the old version of the utility launcher, and put that in Contents/Resources/bin as well as, if the user requests the CLI utilities, /usr/local/bin. Maybe PackageMaker will find that acceptable and include them in the installer package. Bug: 13270 Change-Id: I4016b58c9ce0df05d78525d35e53431750c2b4d9 Reviewed-on: https://code.wireshark.org/review/19536 Reviewed-by: Guy Harris --- packaging/macosx/Scripts/wireshark-postinstall.sh | 18 +----------------- packaging/macosx/osx-app.sh | 13 ++++++++++--- packaging/macosx/utility-launcher/wireshark | 12 +++++++++++- 3 files changed, 22 insertions(+), 21 deletions(-) (limited to 'packaging') diff --git a/packaging/macosx/Scripts/wireshark-postinstall.sh b/packaging/macosx/Scripts/wireshark-postinstall.sh index 96ed64d89b..98c0e683cd 100755 --- a/packaging/macosx/Scripts/wireshark-postinstall.sh +++ b/packaging/macosx/Scripts/wireshark-postinstall.sh @@ -19,26 +19,10 @@ do rm -f "$PLUGINS_PATH"/$plugin.so "$PLUGINS_PATH"/$plugin.la done -BIN_PATH="$2/Wireshark.app/Contents/Resources/bin" -# -# For some reason, packagemaker isn't including Contents/Resources/bin -# in the app bundle, so let's just construct it ourselves. -# -if [ ! -d "$BIN_PATH" ] -then - mkdir -m u=rwx,g=rx,o=rx "$BIN_PATH" -fi -for i in capinfos dftest dumpcap editcap mergecap randpkt rawshark \ - tshark text2pcap -do - ln -s ../../MacOS/"$i" "$BIN_PATH/$i" -done -ln -s ../../MacOS/Wireshark "$BIN_PATH/wireshark" - # Setting PATH # if /etc/paths.d/Wireshark already exists we overwrite it. # -WSPATH="$BIN_PATH" +WSPATH="$2/Wireshark.app/Contents/MacOS" if [ ! -d /etc/paths.d ] then diff --git a/packaging/macosx/osx-app.sh b/packaging/macosx/osx-app.sh index 5356d7434f..158b930496 100755 --- a/packaging/macosx/osx-app.sh +++ b/packaging/macosx/osx-app.sh @@ -290,11 +290,18 @@ create_bundle() { done # - # Links to executables + # Executable launchers in $pkgbin # - ln -s ../../MacOS/Wireshark $pkgbin/wireshark + # We can't just symbolically link to the executables, as + # that means that the executable won't be in Contents/MacOS, + # which means that all @executable_path-relative references + # will go to the wrong place if we run the executables using + # the symlink, which means that the executables could fail + # (they *do* fail to find the Cocoa Qt plugin, for example). + # + cp utility-launcher/wireshark $pkgbin for binary in $cli_binary_list ; do - ln -s ../../MacOS/$binary $pkgbin/$binary + ln -s ./wireshark $pkgbin/$binary done # The rest of the Wireshark installation (we handled bin above) diff --git a/packaging/macosx/utility-launcher/wireshark b/packaging/macosx/utility-launcher/wireshark index 383730f493..e412a5024c 100755 --- a/packaging/macosx/utility-launcher/wireshark +++ b/packaging/macosx/utility-launcher/wireshark @@ -18,4 +18,14 @@ fi APP_NAME=`basename "$0"` -exec "$WIRESHARK_APP_DIR/Contents/Resources/bin/$APP_NAME" "$@" +APP_CONTENTS="$WIRESHARK_APP_DIR/Contents" +if [ -f "$APP_CONTENTS/Frameworks/QtWidgets" -o -d "$APP_CONTENTS/Frameworks/QtWidgets.framework" ] ; then + # Qt + if [ "$APP_NAME" = "wireshark" ] ; then + APP_NAME=Wireshark + fi + exec "$APP_CONTENTS/MacOS/$APP_NAME" "$@" +else + # GTK+ + exec "$APP_CONTENTS/Resources/bin/$APP_NAME" "$@" +fi -- cgit v1.2.1