Files
OpenRA/packaging/linux/openra.in
2018-05-05 22:34:27 +02:00

25 lines
877 B
Bash
Executable File

#!/bin/sh
cd "{GAME_INSTALL_DIR}"
# Search for server connection
PROTOCOL_PREFIX="openra-{MODID}-{TAG}://"
JOIN_SERVER=""
if [ "${1#${PROTOCOL_PREFIX}}" != "${1}" ]; then
JOIN_SERVER="Launch.Connect=${1#${PROTOCOL_PREFIX}}"
fi
# Run the game
mono {DEBUG} OpenRA.Game.exe Game.Mod={MODID} Engine.LaunchPath="{BIN_DIR}/openra-{MODID}" "${JOIN_SERVER}" "$@"
# Show a crash dialog if required
if [ $? != 0 ] && [ $? != 1 ]
then
if which zenity > /dev/null
then
zenity --question --title "{MODNAME}" --text "{MODNAME} has encountered a fatal error.\nLog Files are available in ~/.openra." --ok-label "Quit" --cancel-label "View FAQ" || xdg-open https://github.com/OpenRA/OpenRA/wiki/FAQ
else
printf "{MODNAME} has encountered a fatal error.\n -> Log Files are available in ~/.openra\n -> FAQ is available at https://github.com/OpenRA/OpenRA/wiki/FAQ\n"
fi
exit 1
fi