changeset 152:b612d7137f4d

Re #417: Improve WarFoundry installation experience * Initial attempt at a script that tries to do some validation and fix Ubuntu problems
author IBBoard <dev@ibboard.co.uk>
date Tue, 08 May 2012 21:00:24 +0100
parents 7549ed1f4cb2
children 87fda1e6d4d3
files WarFoundry.sh
diffstat 1 files changed, 18 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/WarFoundry.sh	Mon Nov 28 20:05:22 2011 +0000
+++ b/WarFoundry.sh	Tue May 08 21:00:24 2012 +0100
@@ -1,2 +1,19 @@
 #! /bin/bash
-mono WarFoundry-GTK.exe $@
+
+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 $@