From 08e9cd1263bd985259accab8a76655b533427097 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 22 Jan 2017 22:31:00 -0500 Subject: Add GOG Mac path Thanks to LeonBlade for the path. --- src/StardewModdingAPI.Installer/InteractiveInstaller.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'src/StardewModdingAPI.Installer') diff --git a/src/StardewModdingAPI.Installer/InteractiveInstaller.cs b/src/StardewModdingAPI.Installer/InteractiveInstaller.cs index ef813eb3..c024b128 100644 --- a/src/StardewModdingAPI.Installer/InteractiveInstaller.cs +++ b/src/StardewModdingAPI.Installer/InteractiveInstaller.cs @@ -27,6 +27,7 @@ namespace StardewModdingApi.Installer yield return $"{Environment.GetEnvironmentVariable("HOME")}/.local/share/Steam/steamapps/common/Stardew Valley"; // Mac + yield return $"/Applications/Stardew Valley.app/Contents/MacOS"; yield return $"{Environment.GetEnvironmentVariable("HOME")}/Library/Application Support/Steam/steamapps/common/Stardew Valley/Contents/MacOS"; // Windows -- cgit From 3eb8110c4542e09e40d8bc23a4e54ccd7096e01a Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 3 Feb 2017 20:18:00 -0500 Subject: move build task which prepares install package into a .targets file --- .../StardewModdingAPI.Installer.csproj | 44 +------------------ src/StardewModdingAPI.sln | 1 + src/prepare-install-package.targets | 51 ++++++++++++++++++++++ 3 files changed, 54 insertions(+), 42 deletions(-) create mode 100644 src/prepare-install-package.targets (limited to 'src/StardewModdingAPI.Installer') diff --git a/src/StardewModdingAPI.Installer/StardewModdingAPI.Installer.csproj b/src/StardewModdingAPI.Installer/StardewModdingAPI.Installer.csproj index 4e4872b6..e31a1452 100644 --- a/src/StardewModdingAPI.Installer/StardewModdingAPI.Installer.csproj +++ b/src/StardewModdingAPI.Installer/StardewModdingAPI.Installer.csproj @@ -50,47 +50,7 @@ Always - - - - - $(SolutionDir)\..\bin\Packaged - $(SolutionDir)\..\bin\$(Configuration)\SMAPI - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + \ No newline at end of file diff --git a/src/StardewModdingAPI.sln b/src/StardewModdingAPI.sln index 7229cf30..8ab297ed 100644 --- a/src/StardewModdingAPI.sln +++ b/src/StardewModdingAPI.sln @@ -14,6 +14,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "metadata", "metadata", "{86 crossplatform.targets = crossplatform.targets GlobalAssemblyInfo.cs = GlobalAssemblyInfo.cs ..\LICENSE = ..\LICENSE + prepare-install-package.targets = prepare-install-package.targets ..\README.md = ..\README.md ..\release-notes.md = ..\release-notes.md EndProjectSection diff --git a/src/prepare-install-package.targets b/src/prepare-install-package.targets new file mode 100644 index 00000000..e903e153 --- /dev/null +++ b/src/prepare-install-package.targets @@ -0,0 +1,51 @@ + + + + + $(SolutionDir)\..\bin\Packaged + $(SolutionDir)\..\bin\$(Configuration)\SMAPI + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file -- cgit From 9689bb948455d06b940667753ffeb660c07889a9 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 3 Feb 2017 21:21:35 -0500 Subject: expand & prettify installer readme --- src/StardewModdingAPI.Installer/readme.txt | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) (limited to 'src/StardewModdingAPI.Installer') diff --git a/src/StardewModdingAPI.Installer/readme.txt b/src/StardewModdingAPI.Installer/readme.txt index c5a1caa6..4756099e 100644 --- a/src/StardewModdingAPI.Installer/readme.txt +++ b/src/StardewModdingAPI.Installer/readme.txt @@ -1,4 +1,25 @@ -On Windows, double-click install.exe. -On Linux or Mac, open a terminal and run `mono install.exe`. + ___ ___ ___ ___ + / /\ /__/\ / /\ / /\ ___ + / /:/_ | |::\ / /::\ / /::\ / /\ + / /:/ /\ | |:|:\ / /:/\:\ / /:/\:\ / /:/ + / /:/ /::\ __|__|:|\:\ / /:/~/::\ / /:/~/:/ /__/::\ + /__/:/ /:/\:\ /__/::::| \:\ /__/:/ /:/\:\ /__/:/ /:/ \__\/\:\__ + \ \:\/:/~/:/ \ \:\~~\__\/ \ \:\/:/__\/ \ \:\/:/ \ \:\/\ + \ \::/ /:/ \ \:\ \ \::/ \ \::/ \__\::/ + \__\/ /:/ \ \:\ \ \:\ \ \:\ /__/:/ + /__/:/ \ \:\ \ \:\ \ \:\ \__\/ + \__\/ \__\/ \__\/ \__\/ -For more detailed instructions, see http://canimod.com/guides/using-mods#installing-smapi. \ No newline at end of file + +SMAPI lets you run Stardew Valley with mods. Don't forget to download mods separately. + + +To install: + - Windows: double-click install.exe. + - Linux or Mac: open a terminal and run `mono install.exe`. + + +Need help? See: + - Install guide: http://canimod.com/guides/using-mods#installing-smapi + - Troubleshooting: http://canimod.com/guides/smapi-faq#troubleshooting + - Ask for help: https://discord.gg/kH55QXP -- cgit From 85ff940e6882278fe131cb15b721a09e9283b8fc Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 3 Feb 2017 22:02:54 -0500 Subject: move install package's Mono/Windows folders out of root This will hopefully reduce confusion among players who go into "Windows" instead of running install.exe. --- README.md | 63 +++++++++++----------- release-notes.md | 3 +- .../InteractiveInstaller.cs | 6 +-- src/prepare-install-package.targets | 59 ++++++++++---------- 4 files changed, 67 insertions(+), 64 deletions(-) (limited to 'src/StardewModdingAPI.Installer') diff --git a/README.md b/README.md index f8459006..b1062077 100644 --- a/README.md +++ b/README.md @@ -70,46 +70,47 @@ folder containing `src`). 2. In Linux or Mac: 1. Rebuild the solution in _Release_ mode. - 2. Copy `bin/Packaged/Mono` into the `SMAPI ` folder. + 2. Copy `bin/internal/Packaged/Mono` into the `SMAPI ` folder. 3. If you did everything right so far, you should have a folder like this: ``` SMAPI-1.x/ - Mono/ - Mods/* - Mono.Cecil.dll - Mono.Cecil.Rocks.dll - Newtonsoft.Json.dll - StardewModdingAPI - StardewModdingAPI.config.json - StardewModdingAPI.data.json - StardewModdingAPI.exe - StardewModdingAPI.exe.mdb - StardewModdingAPI.AssemblyRewriters.dll - System.Numerics.dll - System.Runtime.Caching.dll - steam_appid.txt - Windows/ - Mods/* - Mono.Cecil.dll - Mono.Cecil.Rocks.dll - Newtonsoft.Json.dll - StardewModdingAPI.config.json - StardewModdingAPI.data.json - StardewModdingAPI.exe - StardewModdingAPI.pdb - StardewModdingAPI.xml - StardewModdingAPI.AssemblyRewriters.dll - steam_appid.txt install.exe readme.txt + internal/ + Mono/ + Mods/* + Mono.Cecil.dll + Mono.Cecil.Rocks.dll + Newtonsoft.Json.dll + StardewModdingAPI + StardewModdingAPI.AssemblyRewriters.dll + StardewModdingAPI.config.json + StardewModdingAPI.data.json + StardewModdingAPI.exe + StardewModdingAPI.exe.mdb + steam_appid.txt + System.Numerics.dll + System.Runtime.Caching.dll + Windows/ + Mods/* + Mono.Cecil.dll + Mono.Cecil.Rocks.dll + Newtonsoft.Json.dll + StardewModdingAPI.AssemblyRewriters.dll + StardewModdingAPI.config.json + StardewModdingAPI.data.json + StardewModdingAPI.exe + StardewModdingAPI.pdb + StardewModdingAPI.xml + steam_appid.txt ``` - 4. Open a terminal in the `SMAPI ` folder and run `chmod 755 Mono/StardewModdingAPI`. + 4. Open a terminal in the `SMAPI ` folder and run `chmod 755 internal/Mono/StardewModdingAPI`. 5. Copy & paste the `SMAPI ` folder as `SMAPI for developers`. 6. In the `SMAPI ` folder, delete the following files: - * `Mono/StardewModdingAPI.config.json` - * `Windows/StardewModdingAPI.config.json` - * `Windows/StardewModdingAPI.xml` + * `internal/Mono/StardewModdingAPI.config.json` + * `internal/Windows/StardewModdingAPI.config.json` + * `internal/Windows/StardewModdingAPI.xml` 7. Compress the two folders into `SMAPI .zip` and `SMAPI for developers.zip`. ## Advanced usage diff --git a/release-notes.md b/release-notes.md index f9c7add0..1c994b97 100644 --- a/release-notes.md +++ b/release-notes.md @@ -4,8 +4,9 @@ See [log](https://github.com/Pathoschild/SMAPI/compare/1.7...1.8). For players: -* Mods will no longer have generated `.cache` subfolders. +* Mods will no longer generate `.cache` subfolders. * Fixed multiple issues where mods failed during assembly loading. +* Tweaked install package to reduce confusion. For mod developers: * You can now create a `SemanticVersion` from a version string. diff --git a/src/StardewModdingAPI.Installer/InteractiveInstaller.cs b/src/StardewModdingAPI.Installer/InteractiveInstaller.cs index c024b128..306225a7 100644 --- a/src/StardewModdingAPI.Installer/InteractiveInstaller.cs +++ b/src/StardewModdingAPI.Installer/InteractiveInstaller.cs @@ -27,7 +27,7 @@ namespace StardewModdingApi.Installer yield return $"{Environment.GetEnvironmentVariable("HOME")}/.local/share/Steam/steamapps/common/Stardew Valley"; // Mac - yield return $"/Applications/Stardew Valley.app/Contents/MacOS"; + yield return "/Applications/Stardew Valley.app/Contents/MacOS"; yield return $"{Environment.GetEnvironmentVariable("HOME")}/Library/Application Support/Steam/steamapps/common/Stardew Valley/Contents/MacOS"; // Windows @@ -110,7 +110,7 @@ namespace StardewModdingApi.Installer ** collect details ****/ Platform platform = this.DetectPlatform(); - DirectoryInfo packageDir = new DirectoryInfo(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), platform.ToString())); + DirectoryInfo packageDir = new DirectoryInfo(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "internal", platform.ToString())); DirectoryInfo installDir = this.InteractivelyGetInstallPath(platform); var paths = new { @@ -126,7 +126,7 @@ namespace StardewModdingApi.Installer ****/ if (!packageDir.Exists) { - this.ExitError($"The '{platform}' package directory is missing (should be at {packageDir})."); + this.ExitError($"The 'internal/{platform}' package folder is missing (should be at {packageDir})."); return; } if (!File.Exists(paths.executable)) diff --git a/src/prepare-install-package.targets b/src/prepare-install-package.targets index e903e153..f411b909 100644 --- a/src/prepare-install-package.targets +++ b/src/prepare-install-package.targets @@ -7,45 +7,46 @@ --> - $(SolutionDir)\..\bin\Packaged $(SolutionDir)\..\bin\$(Configuration)\SMAPI + $(SolutionDir)\..\bin\Packaged + $(PackagePath)\internal - + - - + + - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - \ No newline at end of file + -- cgit From 4504ddcd9836efbafd955f7fe765684e52f9bfee Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 3 Feb 2017 22:04:43 -0500 Subject: remove mod .cache folders during (un)install process (#229) --- .../InteractiveInstaller.cs | 47 ++++++++++++---------- 1 file changed, 26 insertions(+), 21 deletions(-) (limited to 'src/StardewModdingAPI.Installer') diff --git a/src/StardewModdingAPI.Installer/InteractiveInstaller.cs b/src/StardewModdingAPI.Installer/InteractiveInstaller.cs index 306225a7..ff4849d1 100644 --- a/src/StardewModdingAPI.Installer/InteractiveInstaller.cs +++ b/src/StardewModdingAPI.Installer/InteractiveInstaller.cs @@ -51,32 +51,38 @@ namespace StardewModdingApi.Installer } } - /// The directory or file paths to remove when uninstalling SMAPI, relative to the game directory. - private readonly string[] UninstallPaths = + /// Get the absolute file or folder paths to remove when uninstalling SMAPI. + /// The folder for Stardew Valley and SMAPI. + /// The folder for SMAPI mods. + private IEnumerable GetUninstallPaths(DirectoryInfo installDir, DirectoryInfo modsDir) { + Func installPath = path => Path.Combine(installDir.FullName, path); + // common - "StardewModdingAPI.exe", - "StardewModdingAPI.config.json", - "StardewModdingAPI.data.json", - "StardewModdingAPI.AssemblyRewriters.dll", - "steam_appid.txt", + yield return installPath("StardewModdingAPI.exe"); + yield return installPath("StardewModdingAPI.config.json"); + yield return installPath("StardewModdingAPI.data.json"); + yield return installPath("StardewModdingAPI.AssemblyRewriters.dll"); + yield return installPath("steam_appid.txt"); // Linux/Mac only - "Mono.Cecil.dll", - "Mono.Cecil.Rocks.dll", - "Newtonsoft.Json.dll", - "StardewModdingAPI", - "StardewModdingAPI.exe.mdb", - "System.Numerics.dll", - "System.Runtime.Caching.dll", + yield return installPath("Mono.Cecil.dll"); + yield return installPath("Mono.Cecil.Rocks.dll"); + yield return installPath("Newtonsoft.Json.dll"); + yield return installPath("StardewModdingAPI"); + yield return installPath("StardewModdingAPI.exe.mdb"); + yield return installPath("System.Numerics.dll"); + yield return installPath("System.Runtime.Caching.dll"); // Windows only - "StardewModdingAPI.pdb", + yield return installPath("StardewModdingAPI.pdb"); // obsolete - "Mods/.cache", // 1.3-1.4 - "StardewModdingAPI-settings.json" // 1.0-1.4 - }; + yield return installPath("Mods/.cache"); // 1.3-1.4 + yield return installPath("StardewModdingAPI-settings.json"); // 1.0-1.4 + foreach (DirectoryInfo modDir in modsDir.EnumerateDirectories()) + yield return Path.Combine(modDir.FullName, ".cache"); // 1.4–1.7 + } /// Whether the current console supports color formatting. private static readonly bool ConsoleSupportsColor = InteractiveInstaller.GetConsoleSupportsColor(); @@ -112,6 +118,7 @@ namespace StardewModdingApi.Installer Platform platform = this.DetectPlatform(); DirectoryInfo packageDir = new DirectoryInfo(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "internal", platform.ToString())); DirectoryInfo installDir = this.InteractivelyGetInstallPath(platform); + DirectoryInfo modsDir = new DirectoryInfo(Path.Combine(installDir.FullName, "Mods")); var paths = new { executable = Path.Combine(installDir.FullName, platform == Platform.Mono ? "StardewValley.exe" : "Stardew Valley.exe"), @@ -176,8 +183,7 @@ namespace StardewModdingApi.Installer } // remove old files - string[] removePaths = this.UninstallPaths - .Select(path => Path.Combine(installDir.FullName, path)) + string[] removePaths = this.GetUninstallPaths(installDir, modsDir) .Where(path => Directory.Exists(path) || File.Exists(path)) .ToArray(); if (removePaths.Any()) @@ -220,7 +226,6 @@ namespace StardewModdingApi.Installer } // create mods directory (if needed) - DirectoryInfo modsDir = new DirectoryInfo(Path.Combine(installDir.FullName, "Mods")); if (!modsDir.Exists) { this.PrintDebug("Creating mods directory..."); -- cgit From 8d3e6048b88d1df3dbe47827d9a115c8e359958d Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 3 Feb 2017 22:05:06 -0500 Subject: simplify installer text --- src/StardewModdingAPI.Installer/InteractiveInstaller.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/StardewModdingAPI.Installer') diff --git a/src/StardewModdingAPI.Installer/InteractiveInstaller.cs b/src/StardewModdingAPI.Installer/InteractiveInstaller.cs index ff4849d1..5abcfc8f 100644 --- a/src/StardewModdingAPI.Installer/InteractiveInstaller.cs +++ b/src/StardewModdingAPI.Installer/InteractiveInstaller.cs @@ -147,11 +147,9 @@ namespace StardewModdingApi.Installer ** ask user what to do ****/ Console.WriteLine("You can...."); - Console.WriteLine(platform == Platform.Mono - ? "[1] Install SMAPI. This will safely update the files so you can launch the game the same way as before." - : "[1] Install SMAPI. You'll need to launch StardewModdingAPI.exe instead afterwards; see the readme.txt for details." - ); + Console.WriteLine("[1] Install SMAPI."); Console.WriteLine("[2] Uninstall SMAPI."); + Console.WriteLine(); ScriptAction action; { -- cgit