#! /bin/bash

command -v mono >/dev/null 2>&1
if [[ $? != 0 ]]; then
	##TODO Try using Zenity or similar, in case the user is running from a GUI and not seeing our output
	echo "WarFoundry requires Mono to run - please install it from your package manager" >&2
	exit 3
fi

MONO_ARGS=''

command -v lsb_release >/dev/null 2>&1
if [[ $? == 0 ]]; then
	if [[ `lsb_release -is` == "Ubuntu" && `lsb_release -rs` > 12 ]]; then
		MONO_ARGS=' --runtime=v4.0'
	fi
fi

mono $MONO_ARGS WarFoundry-GTK.exe $@
