summaryrefslogtreecommitdiff
path: root/src/SMAPI.Installer
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2018-02-24 17:54:31 -0500
committerJesse Plamondon-Willard <github@jplamondonw.com>2018-02-24 17:54:31 -0500
commit414cf5c197b5b59776d3dda914eb15710efb0868 (patch)
tree0393a95194ad78cf4440c68657b0488b7db6d68b /src/SMAPI.Installer
parent5da8b707385b9851ff3f6442de58519125f5c96f (diff)
parentf2e8450706d1971d774f870081deffdb0c6b92eb (diff)
downloadSMAPI-414cf5c197b5b59776d3dda914eb15710efb0868.tar.gz
SMAPI-414cf5c197b5b59776d3dda914eb15710efb0868.tar.bz2
SMAPI-414cf5c197b5b59776d3dda914eb15710efb0868.zip
Merge branch 'develop' into stable
Diffstat (limited to 'src/SMAPI.Installer')
-rw-r--r--src/SMAPI.Installer/InteractiveInstaller.cs9
-rw-r--r--src/SMAPI.Installer/Properties/AssemblyInfo.cs8
-rw-r--r--src/SMAPI.Installer/StardewModdingAPI.Installer.csproj8
-rw-r--r--src/SMAPI.Installer/unix-install.sh21
-rw-r--r--src/SMAPI.Installer/unix-launcher.sh95
5 files changed, 134 insertions, 7 deletions
diff --git a/src/SMAPI.Installer/InteractiveInstaller.cs b/src/SMAPI.Installer/InteractiveInstaller.cs
index 43d31eea..b7e698ad 100644
--- a/src/SMAPI.Installer/InteractiveInstaller.cs
+++ b/src/SMAPI.Installer/InteractiveInstaller.cs
@@ -364,8 +364,13 @@ namespace StardewModdingApi.Installer
else
this.PrintColor("SMAPI is removed! If you configured Steam to launch SMAPI, don't forget to clear your launch options.", ConsoleColor.DarkGreen);
}
- else if (action == ScriptAction.Install)
- this.PrintColor("SMAPI is installed! Launch the game the same way as before to play with mods.", ConsoleColor.DarkGreen);
+ else
+ {
+ if (action == ScriptAction.Install)
+ this.PrintColor("SMAPI is installed! Launch the game the same way as before to play with mods.", ConsoleColor.DarkGreen);
+ else
+ this.PrintColor("SMAPI is removed! Launch the game the same way as before to play without mods.", ConsoleColor.DarkGreen);
+ }
Console.ReadKey();
}
diff --git a/src/SMAPI.Installer/Properties/AssemblyInfo.cs b/src/SMAPI.Installer/Properties/AssemblyInfo.cs
index 3a6a4648..9838e5a0 100644
--- a/src/SMAPI.Installer/Properties/AssemblyInfo.cs
+++ b/src/SMAPI.Installer/Properties/AssemblyInfo.cs
@@ -1,6 +1,4 @@
-using System.Reflection;
-using System.Runtime.InteropServices;
+using System.Reflection;
-[assembly: AssemblyTitle("StardewModdingAPI.Installer")]
-[assembly: AssemblyProduct("StardewModdingAPI.Installer")]
-[assembly: Guid("443ddf81-6aaf-420a-a610-3459f37e5575")]
+[assembly: AssemblyTitle("SMAPI.Installer")]
+[assembly: AssemblyDescription("The SMAPI installer for players.")]
diff --git a/src/SMAPI.Installer/StardewModdingAPI.Installer.csproj b/src/SMAPI.Installer/StardewModdingAPI.Installer.csproj
index d3a6aa0b..a575e06f 100644
--- a/src/SMAPI.Installer/StardewModdingAPI.Installer.csproj
+++ b/src/SMAPI.Installer/StardewModdingAPI.Installer.csproj
@@ -50,6 +50,14 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
+ <ItemGroup>
+ <None Include="unix-install.sh">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="unix-launcher.sh">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ </ItemGroup>
<Import Project="..\SMAPI.Common\StardewModdingAPI.Common.projitems" Label="Shared" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\..\build\common.targets" />
diff --git a/src/SMAPI.Installer/unix-install.sh b/src/SMAPI.Installer/unix-install.sh
new file mode 100644
index 00000000..a0bd9346
--- /dev/null
+++ b/src/SMAPI.Installer/unix-install.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+# Run the SMAPI installer through Mono on Linux or Mac.
+
+# Move to script's directory
+cd "`dirname "$0"`"
+
+# get cross-distro version of POSIX command
+COMMAND=""
+if command -v command >/dev/null 2>&1; then
+ COMMAND="command -v"
+elif type type >/dev/null 2>&1; then
+ COMMAND="type"
+fi
+
+# validate Mono & run installer
+if $COMMAND mono >/dev/null 2>&1; then
+ mono install.exe
+else
+ echo "Oops! Looks like Mono isn't installed. Please install Mono from http://mono-project.com, reboot, and run this installer again."
+ read
+fi
diff --git a/src/SMAPI.Installer/unix-launcher.sh b/src/SMAPI.Installer/unix-launcher.sh
new file mode 100644
index 00000000..2542a286
--- /dev/null
+++ b/src/SMAPI.Installer/unix-launcher.sh
@@ -0,0 +1,95 @@
+#!/bin/bash
+# MonoKickstart Shell Script
+# Written by Ethan "flibitijibibo" Lee
+# Modified for StardewModdingAPI by Viz and Pathoschild
+
+# 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
+
+ # this was here before
+ ln -sf mcs.bin.osx mcs
+
+ # fix "DllNotFoundException: libgdiplus.dylib" errors when loading images in SMAPI
+ if [ -f libgdiplus.dylib ]; then
+ rm libgdiplus.dylib
+ fi
+ if [ -f /Library/Frameworks/Mono.framework/Versions/Current/lib/libgdiplus.dylib ]; then
+ ln -s /Library/Frameworks/Mono.framework/Versions/Current/lib/libgdiplus.dylib libgdiplus.dylib
+ fi
+
+ # launch SMAPI
+ cp StardewValley.bin.osx StardewModdingAPI.bin.osx
+ open -a Terminal ./StardewModdingAPI.bin.osx $@
+else
+ # choose launcher
+ LAUNCHER=""
+ if [ "$ARCH" == "x86_64" ]; then
+ ln -sf mcs.bin.x86_64 mcs
+ cp StardewValley.bin.x86_64 StardewModdingAPI.bin.x86_64
+ LAUNCHER="./StardewModdingAPI.bin.x86_64 $@"
+ else
+ ln -sf mcs.bin.x86 mcs
+ cp StardewValley.bin.x86 StardewModdingAPI.bin.x86
+ LAUNCHER="./StardewModdingAPI.bin.x86 $@"
+ fi
+
+ # get cross-distro version of POSIX command
+ COMMAND=""
+ if command -v command 2>/dev/null; then
+ COMMAND="command -v"
+ elif type type 2>/dev/null; then
+ COMMAND="type"
+ fi
+
+ # open SMAPI in terminal
+ if $COMMAND x-terminal-emulator 2>/dev/null; then
+ # Terminator converts -e to -x when used through x-terminal-emulator for some reason (per
+ # `man terminator`), which causes an "unable to find shell" error. If x-terminal-emulator
+ # is mapped to Terminator, invoke it directly instead.
+ if [[ "$(readlink -e $(which x-terminal-emulator))" == *"/terminator" ]]; then
+ terminator -e "$LAUNCHER"
+ else
+ x-terminal-emulator -e "$LAUNCHER"
+ fi
+ elif $COMMAND xfce4-terminal 2>/dev/null; then
+ xfce4-terminal -e "$LAUNCHER"
+ elif $COMMAND gnome-terminal 2>/dev/null; then
+ gnome-terminal -e "$LAUNCHER"
+ elif $COMMAND xterm 2>/dev/null; then
+ xterm -e "$LAUNCHER"
+ elif $COMMAND konsole 2>/dev/null; then
+ konsole -e "$LAUNCHER"
+ elif $COMMAND terminal 2>/dev/null; then
+ terminal -e "$LAUNCHER"
+ else
+ $LAUNCHER
+ fi
+
+ # some Linux users get error 127 (command not found) from the above block, even though
+ # `command -v` indicates the command is valid. As a fallback, launch SMAPI without a terminal when
+ # that happens and pass in an argument indicating SMAPI shouldn't try writing to the terminal
+ # (which can be slow if there is none).
+ if [ $? -eq 127 ]; then
+ $LAUNCHER --no-terminal
+ fi
+fi