Fixes for the utility-launcher script.
authorGerald Combs <gerald@wireshark.org>
Thu, 10 Oct 2013 17:30:56 +0000 (17:30 -0000)
committerGerald Combs <gerald@wireshark.org>
Thu, 10 Oct 2013 17:30:56 +0000 (17:30 -0000)
If we don't find Wireshark.app in WIRESHARK_APP_DIR or
/Applications/Wireshark.app, look for it using its bundle ID. Add a
description of this process to the Read Me First files. Look for
executables in the right subdirectory depending on our UI flavor.

Make sure we don't add GTK+-specific items to the app bundle if we're
using Qt.

svn path=/trunk/; revision=52502

packaging/macosx/Read_me_first_gtk.rtf
packaging/macosx/Read_me_first_qt.rtf
packaging/macosx/osx-app.sh
packaging/macosx/utility-launcher

index 7d97e21dcc033de34392080860a6fd00f87cec89..85ed70d5edee937605208dfd45eec674a1455a7c 100644 (file)
@@ -1,10 +1,12 @@
-{\rtf1\ansi\ansicpg1252\cocoartf1187\cocoasubrtf370
-\cocoascreenfonts1{\fonttbl\f0\froman\fcharset0 TimesNewRomanPSMT;\f1\fswiss\fcharset0 Helvetica;}
+{\rtf1\ansi\ansicpg1252\cocoartf1187\cocoasubrtf390
+\cocoascreenfonts1{\fonttbl\f0\froman\fcharset0 TimesNewRomanPSMT;\f1\fswiss\fcharset0 Helvetica;\f2\fnil\fcharset0 Menlo-Regular;
+}
 {\colortbl;\red255\green255\blue255;}
 {\*\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\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{decimal\}.}{\leveltext\leveltemplateid201\'02\'00.;}{\levelnumbers\'01;}\fi-360\li720\lin720 }{\listname ;}\listid3}}
-{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}{\listoverride\listid2\listoverridecount0\ls2}{\listoverride\listid3\listoverridecount0\ls3}}
+{\list\listtemplateid3\listhybrid{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{decimal\}.}{\leveltext\leveltemplateid201\'02\'00.;}{\levelnumbers\'01;}\fi-360\li720\lin720 }{\listname ;}\listid3}
+{\list\listtemplateid4\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid301\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid4}}
+{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}{\listoverride\listid2\listoverridecount0\ls2}{\listoverride\listid3\listoverridecount0\ls3}{\listoverride\listid4\listoverridecount0\ls4}}
 \margl1440\margr1440\vieww13060\viewh12960\viewkind0
 \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural
 
@@ -72,4 +74,23 @@ Additionally a group named
 {\listtext     4.      }Remove the 
 \i access_bpf
 \i0  group.\
-}
\ No newline at end of file
+\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural
+
+\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
+
+\b0\fs24 \cf0 \
+\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural
+
+\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
+\ls4\ilvl0\cf0 {\listtext      \'95    }The path set in the WIRESHARK_APP_DIR environment variable\
+{\listtext     \'95    }/Applications/Wireshark.app\
+{\listtext     \'95    }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
+\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.}
\ No newline at end of file
index 3447dc3a5d70b3146b7d597e68b529d0442f8556..2cecb41d504f1c750bc686a7b9fa63ad9fbcfb7b 100644 (file)
@@ -1,10 +1,12 @@
-{\rtf1\ansi\ansicpg1252\cocoartf1187\cocoasubrtf370
-\cocoascreenfonts1{\fonttbl\f0\froman\fcharset0 TimesNewRomanPSMT;\f1\fswiss\fcharset0 Helvetica;}
+{\rtf1\ansi\ansicpg1252\cocoartf1187\cocoasubrtf390
+\cocoascreenfonts1{\fonttbl\f0\froman\fcharset0 TimesNewRomanPSMT;\f1\fswiss\fcharset0 Helvetica;\f2\fnil\fcharset0 Menlo-Regular;
+}
 {\colortbl;\red255\green255\blue255;}
 {\*\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\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{decimal\}.}{\leveltext\leveltemplateid201\'02\'00.;}{\levelnumbers\'01;}\fi-360\li720\lin720 }{\listname ;}\listid3}}
-{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}{\listoverride\listid2\listoverridecount0\ls2}{\listoverride\listid3\listoverridecount0\ls3}}
+{\list\listtemplateid3\listhybrid{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{decimal\}.}{\leveltext\leveltemplateid201\'02\'00.;}{\levelnumbers\'01;}\fi-360\li720\lin720 }{\listname ;}\listid3}
+{\list\listtemplateid4\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid301\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid4}}
+{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}{\listoverride\listid2\listoverridecount0\ls2}{\listoverride\listid3\listoverridecount0\ls3}{\listoverride\listid4\listoverridecount0\ls4}}
 \margl1440\margr1440\vieww13060\viewh12960\viewkind0
 \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural
 
@@ -72,4 +74,23 @@ Additionally a group named
 {\listtext     4.      }Remove the 
 \i access_bpf
 \i0  group.\
-}
\ No newline at end of file
+\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural
+
+\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
+
+\b0\fs24 \cf0 \
+\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural
+
+\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
+\ls4\ilvl0\cf0 {\listtext      \'95    }The path set in the WIRESHARK_APP_DIR environment variable\
+{\listtext     \'95    }/Applications/Wireshark.app\
+{\listtext     \'95    }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
+\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.}
\ No newline at end of file
index 8af092c340b7208f69c8323a27531534c3130799..a5a84eaecdb88a9dd81ca6b19ea0d745f8346cda 100755 (executable)
@@ -297,14 +297,14 @@ cp "$plist" "$package/Contents/Info.plist"
 res_list="
        Wireshark.icns
        Wiresharkdoc.icns
-       bin
-       openDoc
 "
 
 if [ "$ui_toolkit" = "gtk" ] ; then
        res_list="
                $res_list
+               bin
                etc
+               openDoc
                script
                MenuBar.nib
                ProgressWindow.nib
index c42a64be8796358ce8b32c5ba5d34bbdde056e25..48f00e5c6175194d6a021a14c706bcdb21d8253c 100755 (executable)
@@ -8,6 +8,10 @@ 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."
@@ -15,5 +19,14 @@ if [ ! -d "$WIRESHARK_APP_DIR" ] ; then
 fi
 
 APPNAME=`basename "$0"`
-exec "$WIRESHARK_APP_DIR/Contents/Resources/bin/$APPNAME" "$@"
 
+if [ -f "$WIRESHARK_APP_DIR/Frameworks/QtWidgets" -o -d "$WIRESHARK_APP_DIR/Frameworks/QtWidgets.framework" ] ; then
+       # Qt
+       if [ "$APPNAME" = "wireshark" ] ; then
+               APPNAME=Wireshark
+       fi
+       exec "$WIRESHARK_APP_DIR/Contents/MacOS/$APPNAME" "$@"
+else
+       # GTK+
+       exec "$WIRESHARK_APP_DIR/Contents/Resources/bin/$APPNAME" "$@"
+fi