fix broken path in installer (#582)

This commit is contained in:
Jesse Plamondon-Willard 2018-08-20 00:00:45 -04:00
parent 498a950be8
commit 49870671cf
2 changed files with 6 additions and 3 deletions

View File

@ -26,6 +26,9 @@ namespace StardewModdingAPI.Installer.Framework
/// <summary>The full path to the directory into which to install mods.</summary>
public string ModsPath => this.ModsDir.FullName;
/// <summary>The full path to SMAPI's internal configuration file.</summary>
public string ApiConfigPath { get; }
/// <summary>The full path to the installed SMAPI executable file.</summary>
public string ExecutablePath { get; }
@ -56,6 +59,7 @@ namespace StardewModdingAPI.Installer.Framework
this.UnixLauncherPath = Path.Combine(gameDir.FullName, "StardewValley");
this.UnixSmapiLauncherPath = Path.Combine(gameDir.FullName, "StardewModdingAPI");
this.UnixBackupLauncherPath = Path.Combine(gameDir.FullName, "StardewValley-original");
this.ApiConfigPath = Path.Combine(gameDir.FullName, "smapi-internal", "StardewModdingAPI.config.json");
}
}
}

View File

@ -505,11 +505,10 @@ namespace StardewModdingApi.Installer
// set SMAPI's color scheme if defined
if (scheme != MonitorColorScheme.AutoDetect)
{
string configPath = Path.Combine(paths.GamePath, "StardewModdingAPI.config.json");
string text = File
.ReadAllText(configPath)
.ReadAllText(paths.ApiConfigPath)
.Replace(@"""ColorScheme"": ""AutoDetect""", $@"""ColorScheme"": ""{scheme}""");
File.WriteAllText(configPath, text);
File.WriteAllText(paths.ApiConfigPath, text);
}
// remove obsolete appdata mods