summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2016-11-08 01:09:51 -0500
committerJesse Plamondon-Willard <github@jplamondonw.com>2016-11-08 01:09:51 -0500
commit7eee2158a0629396baef8fc36a1cbcbc929becef (patch)
treee9d273a4a1778a742bc35d331d64d7a51d11fe41
parent71e2ad82a987b6296edc74faf8f451c99a39945c (diff)
downloadSMAPI-7eee2158a0629396baef8fc36a1cbcbc929becef.tar.gz
SMAPI-7eee2158a0629396baef8fc36a1cbcbc929becef.tar.bz2
SMAPI-7eee2158a0629396baef8fc36a1cbcbc929becef.zip
fix an initialisation error when a Windows user has both "StardewValley.exe" and "Stardew Valley.exe" in their game directory
-rw-r--r--src/StardewModdingAPI/Program.cs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/StardewModdingAPI/Program.cs b/src/StardewModdingAPI/Program.cs
index 989b2abd..e66abb25 100644
--- a/src/StardewModdingAPI/Program.cs
+++ b/src/StardewModdingAPI/Program.cs
@@ -23,9 +23,11 @@ namespace StardewModdingAPI
** Properties
*********/
/// <summary>The full path to the Stardew Valley executable.</summary>
- private static readonly string GameExecutablePath = File.Exists(Path.Combine(Constants.ExecutionPath, "StardewValley.exe"))
- ? Path.Combine(Constants.ExecutionPath, "StardewValley.exe") // Linux or Mac
- : Path.Combine(Constants.ExecutionPath, "Stardew Valley.exe"); // Windows
+#if SMAPI_FOR_WINDOWS
+ private static readonly string GameExecutablePath = Path.Combine(Constants.ExecutionPath, "Stardew Valley.exe");
+#else
+ private static readonly string GameExecutablePath = Path.Combine(Constants.ExecutionPath, "StardewValley.exe");
+#endif
/// <summary>The full path to the folder containing mods.</summary>
private static readonly string ModPath = Path.Combine(Constants.ExecutionPath, "Mods");