Add check to ensure it is definitely a folder being opened, and modify other hard-coded explorer.exe reference

This commit is contained in:
Aidan M 2024-07-03 20:53:35 +01:00
parent fdce8e2f1b
commit 22fcd4b5c8
2 changed files with 9 additions and 2 deletions

View File

@ -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"
});

View File

@ -77,7 +77,7 @@ namespace Wabbajack
public void AfterInstallNavigation()
{
Process.Start("explorer.exe", Location.TargetPath.ToString());
UIUtils.OpenFolder(Location.TargetPath);
}
public async Task<bool> Install()