diff options
-rw-r--r-- | src/SMAPI.Installer/Framework/InstallerPaths.cs | 4 | ||||
-rw-r--r-- | src/SMAPI.Installer/InteractiveInstaller.cs | 5 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/SMAPI.Installer/Framework/InstallerPaths.cs b/src/SMAPI.Installer/Framework/InstallerPaths.cs index d212876a..65e7699b 100644 --- a/src/SMAPI.Installer/Framework/InstallerPaths.cs +++ b/src/SMAPI.Installer/Framework/InstallerPaths.cs @@ -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"); } } } diff --git a/src/SMAPI.Installer/InteractiveInstaller.cs b/src/SMAPI.Installer/InteractiveInstaller.cs index 565ad732..7f7acb0b 100644 --- a/src/SMAPI.Installer/InteractiveInstaller.cs +++ b/src/SMAPI.Installer/InteractiveInstaller.cs @@ -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 |