From 22fcd4b5c8f1cd996e8be884a11f4708c8985145 Mon Sep 17 00:00:00 2001 From: Aidan M Date: Wed, 3 Jul 2024 20:53:35 +0100 Subject: [PATCH] Add check to ensure it is definitely a folder being opened, and modify other hard-coded `explorer.exe` reference --- Wabbajack.App.Wpf/Util/UIUtils.cs | 9 ++++++++- .../View Models/Installers/MO2InstallerVM.cs | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Wabbajack.App.Wpf/Util/UIUtils.cs b/Wabbajack.App.Wpf/Util/UIUtils.cs index 63cfb9e7..7368d2bc 100644 --- a/Wabbajack.App.Wpf/Util/UIUtils.cs +++ b/Wabbajack.App.Wpf/Util/UIUtils.cs @@ -19,6 +19,7 @@ using Wabbajack.Extensions; using Wabbajack.Models; using Wabbajack.Paths; using Wabbajack.Paths.IO; +using System.Linq; namespace Wabbajack { @@ -66,9 +67,15 @@ namespace Wabbajack public static void OpenFolder(AbsolutePath path) { + String folderPath = path.ToString(); + if (!folderPath.EndsWith(Path.DirectorySeparatorChar.ToString())) + { + folderPath += Path.DirectorySeparatorChar.ToString(); + } + Process.Start(new ProcessStartInfo() { - FileName = path.ToString(), + FileName = folderPath, UseShellExecute = true, Verb = "open" }); diff --git a/Wabbajack.App.Wpf/View Models/Installers/MO2InstallerVM.cs b/Wabbajack.App.Wpf/View Models/Installers/MO2InstallerVM.cs index f9bc25a4..623381e0 100644 --- a/Wabbajack.App.Wpf/View Models/Installers/MO2InstallerVM.cs +++ b/Wabbajack.App.Wpf/View Models/Installers/MO2InstallerVM.cs @@ -77,7 +77,7 @@ namespace Wabbajack public void AfterInstallNavigation() { - Process.Start("explorer.exe", Location.TargetPath.ToString()); + UIUtils.OpenFolder(Location.TargetPath); } public async Task Install()