refuse to run if MO2 is installed in non-portable mode

This commit is contained in:
Timothy Baldridge 2019-09-03 19:59:07 -06:00
parent 685f0d991d
commit 1b4b2d5bac
2 changed files with 17 additions and 1 deletions

View File

@ -16,6 +16,7 @@ to be a list of other profiles to be included in the install. This list should b
* Can now set the download folder both during compilation and installation. * Can now set the download folder both during compilation and installation.
* Any config files pointing to the download folder are remapped. * Any config files pointing to the download folder are remapped.
* Refuse to run inside `downloads` folders (anti-virus watches these files too closely and it can cause VFS issues) * 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)
#### Version 0.8.1 - 8/29/2019 #### Version 0.8.1 - 8/29/2019
* Fixed a bug that was causing VFS temp folders not to be cleaned * Fixed a bug that was causing VFS temp folders not to be cleaned
@ -24,6 +25,7 @@ to be a list of other profiles to be included in the install. This list should b
* Fixed several places where we were using long-path incompatible file routines * Fixed several places where we were using long-path incompatible file routines
* Changed the work queue from FIFO to LIFO which results in depth-first work instead of breadth-first * Changed the work queue from FIFO to LIFO which results in depth-first work instead of breadth-first
TLDR: We now fully analyze a single archive before moving on to the next. TLDR: We now fully analyze a single archive before moving on to the next.
#### Version 0.8 - 8/26/2019 #### Version 0.8 - 8/26/2019

View File

@ -4,6 +4,7 @@ using System.Collections.ObjectModel;
using System.ComponentModel; using System.ComponentModel;
using System.Diagnostics; using System.Diagnostics;
using System.IO; using System.IO;
using System.Linq;
using System.Reflection; using System.Reflection;
using System.Threading; using System.Threading;
using System.Windows; using System.Windows;
@ -161,7 +162,7 @@ namespace Wabbajack
if (Assembly.GetEntryAssembly().Location.ToLower().Contains("\\downloads\\")) if (Assembly.GetEntryAssembly().Location.ToLower().Contains("\\downloads\\"))
{ {
MessageBox.Show( MessageBox.Show(
"This app seems to be running inside a folder called `Downloads`, such folders are often highly monitored by Antivirus software and they can often" + "This app seems to be running inside a folder called `Downloads`, such folders are often highly monitored by Antivirus software and they can often " +
"conflict with the operations Wabbajack needs to perform. Please move this executable outside of your `Downloads` folder and then restart the app.", "conflict with the operations Wabbajack needs to perform. Please move this executable outside of your `Downloads` folder and then restart the app.",
"Cannot run inside `Downloads`", "Cannot run inside `Downloads`",
MessageBoxButton.OK, MessageBoxButton.OK,
@ -169,6 +170,19 @@ namespace Wabbajack
Environment.Exit(1); Environment.Exit(1);
} }
if (Directory.EnumerateDirectories(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "ModOrganizer"))
.Any(f => !f.EndsWith("\\cache")))
{
MessageBox.Show(
"You seem to have a installed copy of Mod Organizer 2 on your system. Wabbajack requires that Mod Organizer 2 be run in `Portable` mode. " +
"Unfortunately it is impossible to have both portable and non-portable versions of MO2 on the same system at the same time. Pleas uninstall Mod Organizer 2 " +
"and use only portable (archive) versions with Wabbajack. If you get this message after uninstalling MO2, be sure to delete the folders in `AppData\\Local\\Mod Organizer`",
"Cannot run with non-portable MO2 installed.",
MessageBoxButton.OK,
MessageBoxImage.Error);
Environment.Exit(2);
}
_startTime = DateTime.Now; _startTime = DateTime.Now;
LogFile = Assembly.GetExecutingAssembly().Location + ".log"; LogFile = Assembly.GetExecutingAssembly().Location + ".log";