Replace the OSX binary launcher with a simple script using the SDL2 renderer.

This commit is contained in:
Paul Chote
2013-11-02 21:02:32 +13:00
parent 14b15b5ba1
commit 9b6f145c8b
22 changed files with 46 additions and 1791 deletions

View File

@@ -14,16 +14,22 @@ fi
# Copy the template to build the game package
# Assumes it is layed out with the correct directory structure
cp -rv ../../OpenRA.Launcher.Mac/build/Release/OpenRA.app OpenRA.app
cp -rv template.app OpenRA.app
cp -rv $2/* "OpenRA.app/Contents/Resources/" || exit 3
# Icon isn't used, and editor doesn't work.
rm OpenRA.app/Contents/Resources/OpenRA.ico
rm OpenRA.app/Contents/Resources/OpenRA.Editor.exe
# SDL2 is the only supported renderer
rm -rf OpenRA.app/Contents/Resources/cg
rm OpenRA.app/Contents/Resources/OpenRA.Renderer.Cg.dll
rm OpenRA.app/Contents/Resources/Tao.Sdl.*
rm OpenRA.app/Contents/Resources/Tao.Cg.*
# Change the .config to use the packaged SDL
sed "s/\/Library\/Frameworks\/SDL.framework/./" OpenRA.app/Contents/Resources/Tao.Sdl.dll.config > temp
mv temp OpenRA.app/Contents/Resources/Tao.Sdl.dll.config
sed "s/\/Library\/Frameworks\/SDL2.framework/./" OpenRA.app/Contents/Resources/SDL2\#.dll.config > temp
mv temp OpenRA.app/Contents/Resources/SDL2\#.dll.config
rm temp
# Package app bundle into a zip and clean up

View File

@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleDisplayName</key>
<string>OpenRA</string>
<key>CFBundleExecutable</key>
<string>OpenRA</string>
<key>CFBundleIconFile</key>
<string>OpenRA.icns</string>
<key>CFBundleIdentifier</key>
<string>org.open-ra.launcher</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>OpenRA</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSMinimumSystemVersion</key>
<string>10.5</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>

View File

@@ -0,0 +1,33 @@
#!/bin/bash
# OpenRA OSX launcher script
# Checks for a sufficiently recent mono version, then launches the game from the resources directory.
# Based on code from the monodevelop project
REQUIRED_MAJOR=2
REQUIRED_MINOR=10
TITLE="Cannot launch OpenRA"
MESSAGE="OpenRA requires the Mono Framework version $REQUIRED_MAJOR.$REQUIRED_MINOR or later."
MONO_URL="http://www.go-mono.com/mono-downloads/download.html"
DIR=$(cd "$(dirname "$0")"; pwd)
RESOURCES="$DIR/../Resources"
MONO_VERSION="$(mono --version | grep 'Mono JIT compiler version ' | cut -f5 -d\ )"
MONO_VERSION_MAJOR="$(echo $MONO_VERSION | cut -f1 -d.)"
MONO_VERSION_MINOR="$(echo $MONO_VERSION | cut -f2 -d.)"
if [ -z "$MONO_VERSION" ] \
|| [ $MONO_VERSION_MAJOR -lt $REQUIRED_MAJOR ] \
|| [ $MONO_VERSION_MAJOR -eq $REQUIRED_MAJOR -a $MONO_VERSION_MINOR -lt $REQUIRED_MINOR ]
then
osascript \
-e "tell application \"Finder\"" \
-e " set question to display dialog \"$MESSAGE\" with title \"$TITLE\" with icon alias (POSIX file \"$RESOURCES/OpenRA.icns\") buttons {\"Cancel\", \"Download...\"} default button 2" \
-e " if button returned of question is equal to \"Download...\" then open location \"$MONO_URL\"" \
-e " activate" \
-e "end tell"
exit 1
fi
cd "$RESOURCES" && mono --debug OpenRA.Game.exe Graphics.Renderer=Sdl2

View File

@@ -0,0 +1 @@
APPL????

Binary file not shown.

Binary file not shown.