mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Merge pull request #133 from erri120/detect-mo2
WJ will close if MO2 is running
This commit is contained in:
commit
ee482b5c69
@ -6,6 +6,7 @@
|
||||
* Slideshow timer resets when next is pressed
|
||||
* Changed modlist extension to `.wabbajack`
|
||||
* You can now open modlists directly (after initial launch)
|
||||
* Wabbajack will exit if MO2 is running
|
||||
|
||||
#### Version 1.0 alpha 2 - 10/15/2019
|
||||
* Fix installer running in wrong mode
|
||||
|
@ -26,6 +26,12 @@ namespace Wabbajack.Common
|
||||
{
|
||||
public static class Utils
|
||||
{
|
||||
public static bool IsMO2Running(string mo2Path)
|
||||
{
|
||||
Process[] processList = Process.GetProcesses();
|
||||
return processList.Where(process => process.ProcessName == "ModOrganizer").Any(process => Path.GetDirectoryName(process.MainModule?.FileName) == mo2Path);
|
||||
}
|
||||
|
||||
public static string LogFile { get; private set; }
|
||||
static Utils()
|
||||
{
|
||||
|
@ -280,6 +280,13 @@ namespace Wabbajack
|
||||
this.ModListName = profile_name;
|
||||
this.Mode = RunMode.Compile;
|
||||
|
||||
if (Utils.IsMO2Running(mo2folder))
|
||||
{
|
||||
MessageBox.Show("You need to close MO2 before running Wabbajack!",
|
||||
"Error", MessageBoxButton.OK);
|
||||
Environment.Exit(1);
|
||||
}
|
||||
|
||||
var tmp_compiler = new Compiler(mo2folder);
|
||||
DownloadLocation = tmp_compiler.MO2DownloadsFolder;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user