From 52867bb634af4706abe41557728c58b27b69f34d Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 17 Feb 2018 00:38:59 -0500 Subject: fix uninstall script not confirming success on Linux/Mac --- src/SMAPI.Installer/InteractiveInstaller.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/SMAPI.Installer') 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(); } -- cgit From 754e356adc8fa23f4cecef588406f126a3e1a4a4 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 17 Feb 2018 02:00:46 -0500 Subject: add install scripts for Linux/Mac (#434) --- build/prepare-install-package.targets | 3 +- docs/release-notes.md | 1 + .../StardewModdingAPI.Installer.csproj | 8 ++ src/SMAPI.Installer/unix-install.sh | 21 +++++ src/SMAPI.Installer/unix-launcher.sh | 95 ++++++++++++++++++++++ src/SMAPI/StardewModdingAPI.csproj | 3 - src/SMAPI/unix-launcher.sh | 95 ---------------------- 7 files changed, 127 insertions(+), 99 deletions(-) create mode 100644 src/SMAPI.Installer/unix-install.sh create mode 100644 src/SMAPI.Installer/unix-launcher.sh delete mode 100644 src/SMAPI/unix-launcher.sh (limited to 'src/SMAPI.Installer') 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 @@ + + @@ -31,7 +33,6 @@ - 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 @@ Always + + + PreserveNewest + + + PreserveNewest + + 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 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 @@ Always - - Always - diff --git a/src/SMAPI/unix-launcher.sh b/src/SMAPI/unix-launcher.sh deleted file mode 100644 index 2542a286..00000000 --- a/src/SMAPI/unix-launcher.sh +++ /dev/null @@ -1,95 +0,0 @@ -#!/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 -- cgit From f2e8450706d1971d774f870081deffdb0c6b92eb Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 24 Feb 2018 17:45:29 -0500 Subject: update for 2.5 release and simplify assembly info --- build/GlobalAssemblyInfo.cs | 7 +++---- docs/release-notes.md | 17 ++++++++--------- src/SMAPI.AssemblyRewriters/Properties/AssemblyInfo.cs | 5 +---- src/SMAPI.Installer/Properties/AssemblyInfo.cs | 8 +++----- src/SMAPI.ModBuildConfig/Properties/AssemblyInfo.cs | 5 +---- .../Properties/AssemblyInfo.cs | 2 -- src/SMAPI.Mods.ConsoleCommands/manifest.json | 2 +- src/SMAPI.Tests/Properties/AssemblyInfo.cs | 6 ++---- src/SMAPI.Web/Properties/AssemblyInfo.cs | 4 ++-- src/SMAPI/Constants.cs | 2 +- src/SMAPI/Properties/AssemblyInfo.cs | 6 ++---- 11 files changed, 24 insertions(+), 40 deletions(-) (limited to 'src/SMAPI.Installer') diff --git a/build/GlobalAssemblyInfo.cs b/build/GlobalAssemblyInfo.cs index 79d473e6..93e45e30 100644 --- a/build/GlobalAssemblyInfo.cs +++ b/build/GlobalAssemblyInfo.cs @@ -1,6 +1,5 @@ using System.Reflection; -using System.Runtime.InteropServices; -[assembly: ComVisible(false)] -[assembly: AssemblyVersion("2.4.0.0")] -[assembly: AssemblyFileVersion("2.4.0.0")] +[assembly: AssemblyProduct("SMAPI")] +[assembly: AssemblyVersion("2.5.0")] +[assembly: AssemblyFileVersion("2.5.0")] diff --git a/docs/release-notes.md b/docs/release-notes.md index da651be2..3dee3705 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -1,28 +1,27 @@ # Release notes ## 2.5 * For players: - * **Added support for content packs**. + * **Added support for [content packs](https://stardewvalleywiki.com/Modding:Content_packs)**. _Content packs are collections of files for a SMAPI mod to load. These can be installed directly under `Mods` like a normal SMAPI mod, get automatic update and compatibility checks, and provide convenient APIs to the mods that read them._ - * Added mod detection to unhandled errors (i.e. most errors will now mention which mod caused them). + * Added mod detection for unhandled errors (so most errors now mention which mod caused them). * Added install scripts for Linux/Mac (no more manual terminal commands!). - * Added the required mod's name and URL to dependency errors. - * Fixed unhandled mod errors being logged under `[SMAPI]` instead of the mod name. - * Fixed uninstall script not confirming success on Linux/Mac. + * Added the missing mod's name and URL to dependency errors. + * Fixed uninstall script not reporting when done on Linux/Mac. * Updated compatibility list and enabled update checks for more mods. * For modders: - * Added content pack APIs. + * Added support for content packs and new APIs to read them. * Added support for `ISemanticVersion` in JSON models. * Added `SpecialisedEvents.UnvalidatedUpdateTick` event for specialised use cases. - * Added: `helper.ReadJsonFile` and `helper.WriteJsonFile` now normalise path separators automatically. - * Fixed deadlock in rare cases when injecting a file with an asset loader. + * Added path normalising to `ReadJsonFile` and `WriteJsonFile` helpers (so no longer need `Path.Combine` with those). + * Fixed deadlock in rare cases with asset loaders. * Fixed unhelpful error when a mod exposes a non-public API. * Fixed unhelpful error when a translation file has duplicate keys due to case-insensitivity. * Fixed some JSON field names being case-sensitive. * For the [log parser][]: - * Significantly reduced download size when viewing files with repeated errors. * Added support for SMAPI 2.5 content packs. + * Reduced download size when viewing a parsed log with repeated errors. * Improved parse error handling. * Fixed 'log started' field showing incorrect date. diff --git a/src/SMAPI.AssemblyRewriters/Properties/AssemblyInfo.cs b/src/SMAPI.AssemblyRewriters/Properties/AssemblyInfo.cs index 7cc6804a..f456a30d 100644 --- a/src/SMAPI.AssemblyRewriters/Properties/AssemblyInfo.cs +++ b/src/SMAPI.AssemblyRewriters/Properties/AssemblyInfo.cs @@ -1,7 +1,4 @@ using System.Reflection; -using System.Runtime.InteropServices; -[assembly: AssemblyTitle("StardewModdingAPI.AssemblyRewriters")] +[assembly: AssemblyTitle("SMAPI.AssemblyRewriters")] [assembly: AssemblyDescription("Contains internal SMAPI classes used during assembly rewriting that need to be public for technical reasons, but shouldn't be visible to modders.")] -[assembly: AssemblyProduct("StardewModdingAPI.AssemblyRewriters")] -[assembly: Guid("10db0676-9fc1-4771-a2c8-e2519f091e49")] 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.ModBuildConfig/Properties/AssemblyInfo.cs b/src/SMAPI.ModBuildConfig/Properties/AssemblyInfo.cs index 102d4c3d..96bd29f4 100644 --- a/src/SMAPI.ModBuildConfig/Properties/AssemblyInfo.cs +++ b/src/SMAPI.ModBuildConfig/Properties/AssemblyInfo.cs @@ -1,9 +1,6 @@ using System.Reflection; -using System.Runtime.InteropServices; -[assembly: AssemblyTitle("StardewModdingAPI.ModBuildConfig")] +[assembly: AssemblyTitle("SMAPI.ModBuildConfig")] [assembly: AssemblyDescription("")] -[assembly: Guid("ea4f1e80-743f-4a1d-9757-ae66904a196a")] -[assembly: ComVisible(false)] [assembly: AssemblyVersion("2.0.2.0")] [assembly: AssemblyFileVersion("2.0.2.0")] diff --git a/src/SMAPI.Mods.ConsoleCommands/Properties/AssemblyInfo.cs b/src/SMAPI.Mods.ConsoleCommands/Properties/AssemblyInfo.cs index ac15ec72..86653141 100644 --- a/src/SMAPI.Mods.ConsoleCommands/Properties/AssemblyInfo.cs +++ b/src/SMAPI.Mods.ConsoleCommands/Properties/AssemblyInfo.cs @@ -1,6 +1,4 @@ using System.Reflection; -using System.Runtime.InteropServices; [assembly: AssemblyTitle("SMAPI.Mods.ConsoleCommands")] [assembly: AssemblyDescription("")] -[assembly: Guid("76791e28-b1b5-407c-82d6-50c3e5b7e037")] diff --git a/src/SMAPI.Mods.ConsoleCommands/manifest.json b/src/SMAPI.Mods.ConsoleCommands/manifest.json index fc5ce35d..b852f686 100644 --- a/src/SMAPI.Mods.ConsoleCommands/manifest.json +++ b/src/SMAPI.Mods.ConsoleCommands/manifest.json @@ -1,7 +1,7 @@ { "Name": "Console Commands", "Author": "SMAPI", - "Version": "2.4.0", + "Version": "2.5.0", "Description": "Adds SMAPI console commands that let you manipulate the game.", "UniqueID": "SMAPI.ConsoleCommands", "EntryDll": "ConsoleCommands.dll" diff --git a/src/SMAPI.Tests/Properties/AssemblyInfo.cs b/src/SMAPI.Tests/Properties/AssemblyInfo.cs index ee09145b..8b21e8fe 100644 --- a/src/SMAPI.Tests/Properties/AssemblyInfo.cs +++ b/src/SMAPI.Tests/Properties/AssemblyInfo.cs @@ -1,6 +1,4 @@ -using System.Reflection; -using System.Runtime.InteropServices; +using System.Reflection; -[assembly: AssemblyTitle("StardewModdingAPI.Tests")] +[assembly: AssemblyTitle("SMAPI.Tests")] [assembly: AssemblyDescription("")] -[assembly: Guid("36ccb19e-92eb-48c7-9615-98eefd45109b")] diff --git a/src/SMAPI.Web/Properties/AssemblyInfo.cs b/src/SMAPI.Web/Properties/AssemblyInfo.cs index 63f787a4..31e6fc30 100644 --- a/src/SMAPI.Web/Properties/AssemblyInfo.cs +++ b/src/SMAPI.Web/Properties/AssemblyInfo.cs @@ -1,4 +1,4 @@ using System.Reflection; -[assembly: AssemblyTitle("StardewModdingAPI.Web")] -[assembly: AssemblyProduct("StardewModdingAPI.Web")] +[assembly: AssemblyTitle("SMAPI.Web")] +[assembly: AssemblyDescription("")] diff --git a/src/SMAPI/Constants.cs b/src/SMAPI/Constants.cs index 615f45b9..8fe2b55b 100644 --- a/src/SMAPI/Constants.cs +++ b/src/SMAPI/Constants.cs @@ -37,7 +37,7 @@ namespace StardewModdingAPI ** Public ****/ /// SMAPI's current semantic version. - public static ISemanticVersion ApiVersion { get; } = new SemanticVersion("2.4.0"); + public static ISemanticVersion ApiVersion { get; } = new SemanticVersion("2.5.0"); /// The minimum supported version of Stardew Valley. public static ISemanticVersion MinimumGameVersion { get; } = new SemanticVersion("1.2.30"); diff --git a/src/SMAPI/Properties/AssemblyInfo.cs b/src/SMAPI/Properties/AssemblyInfo.cs index b0a065f5..03843ea8 100644 --- a/src/SMAPI/Properties/AssemblyInfo.cs +++ b/src/SMAPI/Properties/AssemblyInfo.cs @@ -1,9 +1,7 @@ -using System.Reflection; +using System.Reflection; using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -[assembly: AssemblyTitle("Stardew Modding API (SMAPI)")] +[assembly: AssemblyTitle("SMAPI")] [assembly: AssemblyDescription("A modding API for Stardew Valley.")] -[assembly: Guid("5c3f7f42-fefd-43db-aaea-92ea3bcad531")] [assembly: InternalsVisibleTo("StardewModdingAPI.Tests")] [assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")] // Moq for unit testing -- cgit