Skip to content

Commit

Permalink
Add icons to the osx launcher
Browse files Browse the repository at this point in the history
  • Loading branch information
pchote authored and chrisforbes committed Jul 7, 2010
1 parent bc84e33 commit c17a63a
Showing 1 changed file with 24 additions and 9 deletions.
33 changes: 24 additions & 9 deletions packaging/osx/OpenRA.app/Contents/MacOS/OpenRA
Expand Up @@ -25,8 +25,9 @@ CNC_MIXEN="http://open-ra.org/packages/cnc-packages.zip"

# Internal options
APP_PATH=`echo $0 | awk '{split($0,patharr,"/"); idx=1; while(patharr[idx+3] != "") { if (patharr[idx] != "/") {printf("%s/", patharr[idx]); idx++ }} }'`
EXE_PATH="$APP_PATH/Contents/MacOS/"
PAYLOAD="$APP_PATH/Contents/Resources/payload.zip"
EXE_PATH=$APP_PATH/Contents/MacOS/
RESOURCES_PATH=$APP_PATH/Contents/Resources
PAYLOAD=$RESOURCES_PATH/payload.zip
VERSION=`cat "$APP_PATH/Contents/Resources/VERSION"`
export LD_LIBRARY_PATH="$EXE_PATH/lib":$LD_LIBRARY_PATH
export MONO_PATH="$EXE_PATH/lib"
Expand All @@ -39,7 +40,12 @@ function display_error
{
`/usr/bin/osascript << EOT
tell application "Finder"
display dialog "${2}\n\nSupport is available in our irc channel irc.freenode.net #openra." buttons "Exit" default button 1 with title "${1}" with icon stop
display dialog "${2}\n\nSupport is available in our irc channel irc.freenode.net #openra." \
buttons "Exit" \
default button 1 \
with title "${1}" \
with icon stop \
with icon alias (POSIX file "$RESOURCES_PATH/OpenRA.icns")
activate
end tell
EOT`
Expand All @@ -62,8 +68,10 @@ function download_package
CONTINUE=`/usr/bin/osascript << EOT
tell application "Finder"
display dialog "OpenRA needs to download the ${4} game data. Download size: ${3}" buttons {"Download", "Quit"} \
default button "Download"
display dialog "OpenRA needs to download the ${4} game data.\nDownload size: ${3}" \
buttons {"Download", "Quit"} \
default button "Download" \
with icon alias (POSIX file "$RESOURCES_PATH/OpenRA.icns")
set result to button returned of result
end tell
EOT`
Expand Down Expand Up @@ -109,12 +117,19 @@ if [ $INSTVER -lt $VERSION ]; then
fi
# Prompt for the mod to run
MODBUTTON=`osascript -e 'tell application "Finder"
display dialog "Choose a mod" buttons {"Red Alert", "C&C"} \
default button "Red Alert"
MODBUTTON=`/usr/bin/osascript << EOT
tell application "Finder"
display dialog "Choose a mod" buttons {"Red Alert", "C&C", "Quit"} \
default button "Red Alert" \
with icon alias (POSIX file "$RESOURCES_PATH/OpenRA.icns") \
with title "OpenRA Mod Selector"
set result to button returned of result
end tell'`
end tell
EOT`
if [ "$MODBUTTON" == "Quit" ]; then
exit 0
fi
MOD="ra"
if [ "$MODBUTTON" == "C&C" ]; then
MOD="cnc"
Expand Down

0 comments on commit c17a63a

Please sign in to comment.