diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-05-16 01:45:02 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-05-16 01:45:02 -0400 |
commit | 75af88cf0d09b0ebc9275968c9e5abd3ea179ea6 (patch) | |
tree | f99ee29469540a84c801890e512548b74133e78d /src/SMAPI.Installer | |
parent | 57aa4016abaa1385fbc954c62e3f76d9496c6a42 (diff) | |
download | SMAPI-75af88cf0d09b0ebc9275968c9e5abd3ea179ea6.tar.gz SMAPI-75af88cf0d09b0ebc9275968c9e5abd3ea179ea6.tar.bz2 SMAPI-75af88cf0d09b0ebc9275968c9e5abd3ea179ea6.zip |
fix installer deleting Omegasis' SaveBackup mod (#513)
Diffstat (limited to 'src/SMAPI.Installer')
-rw-r--r-- | src/SMAPI.Installer/InteractiveInstaller.cs | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/SMAPI.Installer/InteractiveInstaller.cs b/src/SMAPI.Installer/InteractiveInstaller.cs index ba7a143c..4d9bc984 100644 --- a/src/SMAPI.Installer/InteractiveInstaller.cs +++ b/src/SMAPI.Installer/InteractiveInstaller.cs @@ -351,11 +351,25 @@ namespace StardewModdingApi.Installer } // add or replace bundled mods - Directory.CreateDirectory(Path.Combine(installDir.FullName, "Mods")); + modsDir.Create(); DirectoryInfo packagedModsDir = new DirectoryInfo(Path.Combine(packageDir.FullName, "Mods")); if (packagedModsDir.Exists && packagedModsDir.EnumerateDirectories().Any()) { this.PrintDebug("Adding bundled mods..."); + + // special case: rename Omegasis' SaveBackup mod + { + DirectoryInfo oldFolder = new DirectoryInfo(Path.Combine(modsDir.FullName, "SaveBackup")); + DirectoryInfo newFolder = new DirectoryInfo(Path.Combine(modsDir.FullName, "SaveBackup (Omegasis)")); + FileInfo manifest = new FileInfo(Path.Combine(oldFolder.FullName, "manifest.json")); + if (manifest.Exists && !newFolder.Exists && File.ReadLines(manifest.FullName).Any(p => p.IndexOf("Omegasis", StringComparison.InvariantCultureIgnoreCase) != -1)) + { + this.PrintDebug($" moving {oldFolder.Name} to {newFolder.Name}..."); + this.Move(oldFolder, newFolder.FullName); + } + } + + // add bundled mods foreach (DirectoryInfo sourceDir in packagedModsDir.EnumerateDirectories()) { this.PrintDebug($" adding {sourceDir.Name}..."); |