Skip to content

Commit

Permalink
Merge pull request #2596 from wabbajack-tools/AidanMaskelyne-pr-branch
Browse files Browse the repository at this point in the history
Use the default file manager when opening a folder.
  • Loading branch information
tr4wzified authored Aug 13, 2024
2 parents 75a07ea + f58b619 commit 4cc08cf
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* Added logging to determine which downloaded files cannot be hashed
* This could occur in the downloading phase when installing a modlist when there are broken/corrupted files in the downloads folder
* Fixed Wabbajack crashing when double-clicking the browser window titlebar or URL
* Fixed Wabbajack always using explorer.exe instead of the default file browser

#### Version - 3.7.0.0 - 6/21/2024
* Added Starfield support
Expand Down
16 changes: 11 additions & 5 deletions Wabbajack.App.Wpf/Util/UIUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,24 +56,30 @@ public static bool TryGetBitmapImageFromFile(AbsolutePath path, out BitmapImage
}
}


public static void OpenWebsite(Uri url)
{
Process.Start(new ProcessStartInfo("cmd.exe", $"/c start {url}")
{
CreateNoWindow = true,
});
}

public static void OpenFolder(AbsolutePath path)
{
Process.Start(new ProcessStartInfo(KnownFolders.Windows.Combine("explorer.exe").ToString(), path.ToString())
string folderPath = path.ToString();
if (!folderPath.EndsWith(Path.DirectorySeparatorChar.ToString()))
{
CreateNoWindow = true,
folderPath += Path.DirectorySeparatorChar.ToString();
}

Process.Start(new ProcessStartInfo()
{
FileName = folderPath,
UseShellExecute = true,
Verb = "open"
});
}


public static AbsolutePath OpenFileDialog(string filter, string initialDirectory = null)
{
OpenFileDialog ofd = new OpenFileDialog();
Expand Down
2 changes: 1 addition & 1 deletion Wabbajack.App.Wpf/View Models/Installers/MO2InstallerVM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ private void SaveSettings(Mo2ModlistInstallationSettings settings)

public void AfterInstallNavigation()
{
Process.Start("explorer.exe", Location.TargetPath.ToString());
UIUtils.OpenFolder(Location.TargetPath);
}

public async Task<bool> Install()
Expand Down

0 comments on commit 4cc08cf

Please sign in to comment.