Fix check for Downloads folder

This commit is contained in:
trawzified 2019-10-12 10:02:58 +02:00
parent cad6944d3c
commit e67a89327f

View File

@ -1,4 +1,5 @@
using System;
using Syroot.Windows.IO;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
@ -47,12 +48,13 @@ namespace Wabbajack
_slideShow = new SlideShow(this, true);
if (Assembly.GetEntryAssembly().Location.ToLower().Contains("\\downloads\\"))
if (Path.GetDirectoryName(Assembly.GetEntryAssembly().Location.ToLower()) == KnownFolders.Downloads.Path.ToLower())
{
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 " +
"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'",
"Wabbajack is running inside your Downloads folder. 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.",
"Cannot run inside Downloads",
MessageBoxButton.OK,
MessageBoxImage.Error);
Environment.Exit(1);