diff --git a/docs/release-notes.md b/docs/release-notes.md index ba2fe46a..45670c29 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -3,6 +3,7 @@ # Release notes ## Upcoming release * For players: + * Added friendly error when using SMAPI 3.2._x_ with Stardew Valley 1.5.5 or later. * Improved mod compatibility in 64-bit mode (thanks to spacechase0!). * Reducing load time when scanning/rewriting many mods for compatibility. * Updated compatibility list. diff --git a/src/SMAPI.Installer/InteractiveInstaller.cs b/src/SMAPI.Installer/InteractiveInstaller.cs index b91d0dd3..17c3198f 100644 --- a/src/SMAPI.Installer/InteractiveInstaller.cs +++ b/src/SMAPI.Installer/InteractiveInstaller.cs @@ -298,6 +298,14 @@ namespace StardewModdingApi.Installer return; } + // not Stardew Valley 1.5.5+ + if (File.Exists(Path.Combine(paths.GamePath, "Stardew Valley.dll"))) + { + this.PrintError($"Oops! The detected game install path seems to be Stardew Valley 1.5.5 or later, but this version of SMAPI is only compatible up to Stardew Valley 1.5.4. Please check for a newer version of SMAPI: https://smapi.io."); + Console.ReadLine(); + return; + } + // game folder doesn't contain paths beyond the max limit { string[] tooLongPaths = PathUtilities.GetTooLongPaths(Path.Combine(paths.GamePath, "Mods")).ToArray(); diff --git a/src/SMAPI/Constants.cs b/src/SMAPI/Constants.cs index 04e15998..247e32b7 100644 --- a/src/SMAPI/Constants.cs +++ b/src/SMAPI/Constants.cs @@ -81,7 +81,7 @@ namespace StardewModdingAPI public static ISemanticVersion MinimumGameVersion { get; } = new GameVersion("1.5.4"); /// The maximum supported version of Stardew Valley. - public static ISemanticVersion MaximumGameVersion { get; } = null; + public static ISemanticVersion MaximumGameVersion { get; } = new GameVersion("1.5.4"); /// The target game platform. public static GamePlatform TargetPlatform { get; } = EarlyConstants.Platform; diff --git a/src/SMAPI/Program.cs b/src/SMAPI/Program.cs index 3249e02f..b6464f3c 100644 --- a/src/SMAPI/Program.cs +++ b/src/SMAPI/Program.cs @@ -88,6 +88,10 @@ namespace StardewModdingAPI if (!File.Exists(Path.Combine(EarlyConstants.ExecutionPath, $"{EarlyConstants.GameAssemblyName}.exe"))) Program.PrintErrorAndExit("Oops! SMAPI can't find the game. Make sure you're running StardewModdingAPI.exe in your game folder."); + // Stardew Valley 1.5.5+ + if (File.Exists(Path.Combine(EarlyConstants.ExecutionPath, "Stardew Valley.dll"))) + Program.PrintErrorAndExit("Oops! You're running Stardew Valley 1.5.5 or later, but this version of SMAPI is only compatible up to Stardew Valley 1.5.4. Please check for a newer version of SMAPI: https://smapi.io."); + // can't load file Program.PrintErrorAndExit( message: "Oops! SMAPI couldn't load the game executable. The technical details below may have more info.",