diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2016-11-03 21:03:03 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2016-11-03 21:03:03 -0400 |
commit | 0b5a05ba9120f7acee961ed75e62eff4fd68a821 (patch) | |
tree | dee1e302b6ecdd992efcdd92bcc6bbed8e07223b /src/StardewModdingAPI/unix-launcher.sh | |
parent | 59c900a9ac936491386e70d9c841e572f2a49ecd (diff) | |
download | SMAPI-0b5a05ba9120f7acee961ed75e62eff4fd68a821.tar.gz SMAPI-0b5a05ba9120f7acee961ed75e62eff4fd68a821.tar.bz2 SMAPI-0b5a05ba9120f7acee961ed75e62eff4fd68a821.zip |
add crossplatform installer (#155)
Diffstat (limited to 'src/StardewModdingAPI/unix-launcher.sh')
-rw-r--r-- | src/StardewModdingAPI/unix-launcher.sh | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/StardewModdingAPI/unix-launcher.sh b/src/StardewModdingAPI/unix-launcher.sh new file mode 100644 index 00000000..0bfe0d5c --- /dev/null +++ b/src/StardewModdingAPI/unix-launcher.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# MonoKickstart Shell Script +# Written by Ethan "flibitijibibo" Lee +# Modified for StardewModdingAPI by Viz + +# Move to script's directory +cd "`dirname "$0"`" + +# Get the system architecture +UNAME=`uname` +ARCH=`uname -m` + +# MonoKickstart picks the right libfolder, so just execute the right binary. +if [ "$UNAME" == "Darwin" ]; then + # ... Except on OSX. + export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:./osx/ + + # El Capitan is a total idiot and wipes this variable out, making the + # Steam overlay disappear. This sidesteps "System Integrity Protection" + # and resets the variable with Valve's own variable (they provided this + # fix by the way, thanks Valve!). Note that you will need to update your + # launch configuration to the script location, NOT just the app location + # (i.e. Kick.app/Contents/MacOS/Kick, not just Kick.app). + # -flibit + if [ "$STEAM_DYLD_INSERT_LIBRARIES" != "" ] && [ "$DYLD_INSERT_LIBRARIES" == "" ]; then + export DYLD_INSERT_LIBRARIES="$STEAM_DYLD_INSERT_LIBRARIES" + fi + + ln -sf mcs.bin.osx mcs + cp StardewValley.bin.osx StardewModdingAPI.bin.osx + ./StardewModdingAPI.bin.osx $@ +else + if [ "$ARCH" == "x86_64" ]; then + ln -sf mcs.bin.x86_64 mcs + cp StardewValley.bin.x86_64 StardewModdingAPI.bin.x86_64 + ./StardewModdingAPI.bin.x86_64 $@ + else + ln -sf mcs.bin.x86 mcs + cp StardewValley.bin.x86 StardewModdingAPI.bin.x86 + ./StardewModdingAPI.bin.x86 $@ + fi +fi |