From 62a17766dc827e2d7843e350003404b16a8b02fe Mon Sep 17 00:00:00 2001 From: Timothy Baldridge Date: Wed, 4 Sep 2019 15:19:37 -0600 Subject: [PATCH] fixes #23 and #24 --- CHANGELOG.md | 2 ++ VirtualFileSystem/VirtualFileSystem.cs | 1 + Wabbajack/AppState.cs | 2 ++ Wabbajack/Installer.cs | 13 +++++++++++++ 4 files changed, 18 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 57b4e65d..06b1d8a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,8 @@ to be a list of other profiles to be included in the install. This list should b * Refuse to run inside `downloads` folders (anti-virus watches these files too closely and it can cause VFS issues) * Refuse to run if MO2 is on the system installed in non-portable mode (otherwise broken installs may result) * Config files that don't otherwise match a rule are inlined into the modlist +* Warn users before installing into an existing MO2 install folder (prevents unintentional data loss from overwriting existing data #24) +* Fix for read only folder deletion bug (#23) #### Version 0.8.1 - 8/29/2019 * Fixed a bug that was causing VFS temp folders not to be cleaned diff --git a/VirtualFileSystem/VirtualFileSystem.cs b/VirtualFileSystem/VirtualFileSystem.cs index 788ad79f..6ba9e2dc 100644 --- a/VirtualFileSystem/VirtualFileSystem.cs +++ b/VirtualFileSystem/VirtualFileSystem.cs @@ -63,6 +63,7 @@ namespace VFS }); Directory.EnumerateDirectories(path, DirectoryEnumerationOptions.Recursive) + .OrderByDescending(d => d.Length) .DoProgress("Cleaning VFS Folders", folder => { try diff --git a/Wabbajack/AppState.cs b/Wabbajack/AppState.cs index ce513b9e..ab3b5195 100644 --- a/Wabbajack/AppState.cs +++ b/Wabbajack/AppState.cs @@ -292,6 +292,8 @@ namespace Wabbajack if (ofd.ShowDialog() == true) { Location = ofd.SelectedPath; + if (_downloadLocation == null) + DownloadLocation = Path.Combine(Location, "downloads"); } } else diff --git a/Wabbajack/Installer.cs b/Wabbajack/Installer.cs index 165ba57f..ddf8ba47 100644 --- a/Wabbajack/Installer.cs +++ b/Wabbajack/Installer.cs @@ -83,6 +83,19 @@ namespace Wabbajack Directory.CreateDirectory(Outputfolder); Directory.CreateDirectory(DownloadFolder); + if (Directory.Exists(Path.Combine(Outputfolder, "mods"))) + { + if (MessageBox.Show("There already appears to be a Mod Organize 2 install in this folder, are you sure you wish to continue" + + " with installation? If you do, you may render both your existing install and the new modlist inoperable.", + "Existing MO2 installation in install folder", + MessageBoxButton.YesNo, + MessageBoxImage.Exclamation) == MessageBoxResult.No) + Utils.Log("Existing installation at the request of the user, existing mods folder found."); + return; + + + } + if (ModList.Directives.OfType().FirstOrDefault() != null || ModList.Directives.OfType().FirstOrDefault() != null) {