diff options
-rw-r--r-- | src/StardewModdingAPI/Constants.cs | 3 | ||||
-rw-r--r-- | src/StardewModdingAPI/Program.cs | 15 |
2 files changed, 14 insertions, 4 deletions
diff --git a/src/StardewModdingAPI/Constants.cs b/src/StardewModdingAPI/Constants.cs index e5752dfd..48304de5 100644 --- a/src/StardewModdingAPI/Constants.cs +++ b/src/StardewModdingAPI/Constants.cs @@ -25,6 +25,9 @@ namespace StardewModdingAPI /// <summary>SMAPI's current semantic version.</summary> public static readonly Version Version = new Version(1, 0, 0, $"alpha-{DateTime.UtcNow.ToString("yyyyMMddHHmm")}"); + /// <summary>The minimum supported version of Stardew Valley.</summary> + public const string MinimumGameVersion = "1.1"; + /// <summary>The GitHub repository to check for updates.</summary> public const string GitHubRepository = "cjsu/SMAPI"; diff --git a/src/StardewModdingAPI/Program.cs b/src/StardewModdingAPI/Program.cs index 01cb3ac5..8c38a88b 100644 --- a/src/StardewModdingAPI/Program.cs +++ b/src/StardewModdingAPI/Program.cs @@ -69,12 +69,19 @@ namespace StardewModdingAPI try { Log.SyncColour($"Launching SMAPI {Constants.Version} with Stardew Valley {Game1.version} on {Environment.OSVersion}", ConsoleColor.DarkGray); // make sure this is the first line, to simplify troubleshooting instructions - Log.Debug("Initialising..."); - // set window title - Console.Title = Constants.ConsoleTitle; + // verify version + if (String.Compare(Game1.version, Constants.MinimumGameVersion, StringComparison.InvariantCultureIgnoreCase) < 0) + { + Log.Error($"Oops! You're running Stardew Valley {Game1.version}, but the oldest supported version is {Constants.MinimumGameVersion}. Please update your game before using SMAPI. If you're on the Steam beta channel, note that the beta channel may not receive the latest updates."); + Log.Debug("Shutting down. Press any key to continue..."); + Console.ReadKey(); + return; + } - // verify paths + // initialise + Log.Debug("Initialising..."); + Console.Title = Constants.ConsoleTitle; Program.VerifyPath(Program.ModPath); Program.VerifyPath(Constants.LogDir); if (!File.Exists(Program.GameExecutablePath)) |