Execute self-contained binaries with runtime as backfall

This commit is contained in:
Matthias Mailänder
2022-10-21 18:54:16 +02:00
committed by abcdefg30
parent b0036a2d3e
commit 2d78dae01a
2 changed files with 14 additions and 2 deletions

View File

@@ -3,4 +3,10 @@ set -o errexit || exit $?
cd "{GAME_INSTALL_DIR}"
mono {DEBUG} OpenRA.Server.dll Game.Mod={MODID} "$@"
if test -f "OpenRA.Server"; then
./OpenRA.Server Game.Mod={MODID} "$@"
elif command -v mono >/dev/null 2>&1 && [ "$(grep -c .NETCoreApp,Version= OpenRA.Server.dll)" = "0" ]; then
mono {DEBUG} OpenRA.Server.dll Game.Mod={MODID} "$@"
else
dotnet OpenRA.Server.dll Game.Mod={MODID} "$@"
fi

View File

@@ -11,7 +11,13 @@ if [ "${1#${PROTOCOL_PREFIX}}" != "${1}" ]; then
fi
# Run the game
mono {DEBUG} OpenRA.dll Game.Mod={MODID} Engine.LaunchPath="{BIN_DIR}/openra-{MODID}" "${JOIN_SERVER}" "$@" && rc=0 || rc=$?
if test -f "OpenRA"; then
./OpenRA Game.Mod={MODID} Engine.LaunchPath="{BIN_DIR}/openra-{MODID}" "${JOIN_SERVER}" "$@" && rc=0 || rc=$?
elif command -v mono >/dev/null 2>&1 && [ "$(grep -c .NETCoreApp,Version= OpenRA.dll)" = "0" ]; then
mono {DEBUG} OpenRA.dll Game.Mod={MODID} Engine.LaunchPath="{BIN_DIR}/openra-{MODID}" "${JOIN_SERVER}" "$@" && rc=0 || rc=$?
else
dotnet OpenRA.dll Game.Mod={MODID} Engine.LaunchPath="{BIN_DIR}/openra-{MODID}" "${JOIN_SERVER}" "$@" && rc=0 || rc=$?
fi
# Show a crash dialog if something went wrong
if [ "${rc}" != 0 ] && [ "${rc}" != 1 ]; then