Selecting "Open Folder" will no longer return with an error message

This commit is contained in:
ZestyTS 2022-08-22 14:32:35 -07:00
parent a07c74e04c
commit 6baea082df

View file

@ -110,15 +110,24 @@ namespace UWUVCI_AIO_WPF.UI.Windows
private void Folder_Click(object sender, RoutedEventArgs e)
{
var filePath = "";
try
{
if (File.Exists(path)) path = new FileInfo(path).DirectoryName;
Process.Start(path);
filePath = path;
if (File.Exists(filePath))
filePath = new FileInfo(filePath).DirectoryName;
Process.Start(new ProcessStartInfo()
{
FileName = filePath,
UseShellExecute = true,
Verb = "open"
});
Close();
}
catch (Exception)
{
Custom_Message cm = new Custom_Message("An Error occured", "An error occured opening the folder. Please make sure the Output Path exists.");
Custom_Message cm = new Custom_Message("An Error occured", "An error occured opening the folder. Please make sure the Output Path exists.\n\nFile path: " + filePath);
try
{
cm.Owner = (FindResource("mvm") as MainViewModel).mw;