summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2018-02-17 02:00:46 -0500
committerJesse Plamondon-Willard <github@jplamondonw.com>2018-02-17 02:00:46 -0500
commit754e356adc8fa23f4cecef588406f126a3e1a4a4 (patch)
tree49b15bdc7438496de92adce948e5985259079b8d
parent52867bb634af4706abe41557728c58b27b69f34d (diff)
downloadSMAPI-754e356adc8fa23f4cecef588406f126a3e1a4a4.tar.gz
SMAPI-754e356adc8fa23f4cecef588406f126a3e1a4a4.tar.bz2
SMAPI-754e356adc8fa23f4cecef588406f126a3e1a4a4.zip
add install scripts for Linux/Mac (#434)
-rw-r--r--build/prepare-install-package.targets3
-rw-r--r--docs/release-notes.md1
-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.sh (renamed from src/SMAPI/unix-launcher.sh)0
-rw-r--r--src/SMAPI/StardewModdingAPI.csproj3
6 files changed, 32 insertions, 4 deletions
diff --git a/build/prepare-install-package.targets b/build/prepare-install-package.targets
index f2a2b23c..fca311f2 100644
--- a/build/prepare-install-package.targets
+++ b/build/prepare-install-package.targets
@@ -20,6 +20,8 @@
<!-- copy installer files -->
<Copy SourceFiles="$(TargetDir)\$(TargetName).exe" DestinationFiles="$(PackagePath)\install.exe" />
<Copy SourceFiles="$(TargetDir)\readme.txt" DestinationFiles="$(PackagePath)\README.txt" />
+ <Copy Condition="$(OS) != 'Windows_NT'" SourceFiles="$(TargetDir)\unix-launcher.sh" DestinationFiles="$(PackageInternalPath)\Mono\StardewModdingAPI" />
+ <Copy Condition="$(OS) != 'Windows_NT'" SourceFiles="$(TargetDir)\unix-install.sh" DestinationFiles="$(PackagePath)\install.sh" />
<!-- copy SMAPI files for Mono -->
<Copy Condition="$(OS) != 'Windows_NT'" SourceFiles="$(CompiledSmapiPath)\Mono.Cecil.dll" DestinationFolder="$(PackageInternalPath)\Mono" />
@@ -31,7 +33,6 @@
<Copy Condition="$(OS) != 'Windows_NT'" SourceFiles="$(CompiledSmapiPath)\StardewModdingAPI.config.json" DestinationFolder="$(PackageInternalPath)\Mono" />
<Copy Condition="$(OS) != 'Windows_NT'" SourceFiles="$(CompiledSmapiPath)\System.Numerics.dll" DestinationFolder="$(PackageInternalPath)\Mono" />
<Copy Condition="$(OS) != 'Windows_NT'" SourceFiles="$(CompiledSmapiPath)\System.Runtime.Caching.dll" DestinationFolder="$(PackageInternalPath)\Mono" />
- <Copy Condition="$(OS) != 'Windows_NT'" SourceFiles="$(CompiledSmapiPath)\unix-launcher.sh" DestinationFiles="$(PackageInternalPath)\Mono\StardewModdingAPI" />
<Copy Condition="$(OS) != 'Windows_NT'" SourceFiles="$(CompiledSmapiPath)\steam_appid.txt" DestinationFolder="$(PackageInternalPath)\Mono" />
<Copy Condition="$(OS) != 'Windows_NT'" SourceFiles="@(CompiledMods)" DestinationFolder="$(PackageInternalPath)\Mono\Mods\%(RecursiveDir)" />
diff --git a/docs/release-notes.md b/docs/release-notes.md
index 51f0b76c..f44db00c 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -1,6 +1,7 @@
# Release notes
## 2.5
* For players:
+ * Added install scripts for Linux/Mac (no longer need to run `mono install.exe` through the terminal).
* When a mod is skipped because you're missing a dependency, the error now shows the name and URL of the missing mod.
* Fixed mod crashes being logged under `[SMAPI]` instead of the mod name.
* Fixed uninstall script not confirming success on Linux/Mac.
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/unix-launcher.sh b/src/SMAPI.Installer/unix-launcher.sh
index 2542a286..2542a286 100644
--- a/src/SMAPI/unix-launcher.sh
+++ b/src/SMAPI.Installer/unix-launcher.sh
diff --git a/src/SMAPI/StardewModdingAPI.csproj b/src/SMAPI/StardewModdingAPI.csproj
index e181c435..ab247f05 100644
--- a/src/SMAPI/StardewModdingAPI.csproj
+++ b/src/SMAPI/StardewModdingAPI.csproj
@@ -250,9 +250,6 @@
<Content Include="StardewModdingAPI.config.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
- <None Include="unix-launcher.sh">
- <CopyToOutputDirectory>Always</CopyToOutputDirectory>
- </None>
</ItemGroup>
<ItemGroup>
<Content Include="icon.ico" />