2019-01-03 22:50:55 +00:00
#!/bin/sh
2020-06-28 09:45:39 +00:00
cd " $( dirname " $( realpath " $0 " ) " ) "
2019-01-03 22:50:55 +00:00
if [ " $( ps -C "mono" -o "cmd" --no-headers | grep "EmuHawk.exe" ) " ] ; then
echo "EmuHawk is already running, exiting..."
exit 0
fi
libpath = ""
2020-07-28 08:11:50 +00:00
winepath = ""
2019-01-03 22:50:55 +00:00
if [ " $( command -v lsb_release) " ] ; then
case " $( lsb_release -i | cut -c17- | tr -d "\n" ) " in
2020-07-28 08:11:50 +00:00
"Arch" | "ManjaroLinux" ) libpath = "/usr/lib" ; ;
2020-09-19 04:45:33 +00:00
"Debian" | "LinuxMint" | "Ubuntu" | "Pop" ) libpath = "/usr/lib/x86_64-linux-gnu" ; export MONO_WINFORMS_XIM_STYLE = disabled; ; # see https://bugzilla.xamarin.com/show_bug.cgi?id=28047#c9
2019-01-03 22:50:55 +00:00
esac
2019-05-18 04:09:50 +00:00
else
printf "Distro does not provide LSB release info API! (You've met with a terrible fate, haven't you?)\n"
2019-01-03 22:50:55 +00:00
fi
if [ -z " $libpath " ] ; then
2020-07-28 08:11:50 +00:00
printf "%s\n" "Unknown distro, assuming system-wide libraries are in /usr/lib..."
libpath = "/usr/lib"
2019-01-03 22:50:55 +00:00
fi
2020-07-28 08:11:50 +00:00
if [ -z " $winepath " ] ; then winepath = " $libpath /wine " ; fi
export LD_LIBRARY_PATH = " $PWD /dll: $PWD : $winepath : $libpath "
2020-07-28 08:15:37 +00:00
export BIZHAWK_INT_SYSLIB_PATH = " $libpath "
2019-12-27 16:15:51 +00:00
if [ " $1 " = "--mono-no-redirect" ] ; then
shift
printf "(received --mono-no-redirect, stdout was not captured)\n" >EmuHawkMono_laststdout.txt
mono ./EmuHawk.exe " $@ "
else
mono ./EmuHawk.exe " $@ " >EmuHawkMono_laststdout.txt
fi