From d4060cde6d75c0045d5d04d8df8b76c5062b0ad7 Mon Sep 17 00:00:00 2001 From: Perfare Date: Sat, 4 Dec 2021 02:05:35 +0800 Subject: [PATCH] Fixed bug --- AssetStudioGUI/Studio.cs | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/AssetStudioGUI/Studio.cs b/AssetStudioGUI/Studio.cs index 7243398..fc56544 100644 --- a/AssetStudioGUI/Studio.cs +++ b/AssetStudioGUI/Studio.cs @@ -457,7 +457,7 @@ namespace AssetStudioGUI if (Properties.Settings.Default.openAfterExport && exportedCount > 0) { - Process.Start(savePath); + OpenFolderInExplorer(savePath); } }); } @@ -502,7 +502,7 @@ namespace AssetStudioGUI if (Properties.Settings.Default.openAfterExport && toExportAssets.Count() > 0) { - Process.Start(savePath); + OpenFolderInExplorer(savePath); } }); } @@ -562,7 +562,7 @@ namespace AssetStudioGUI } if (Properties.Settings.Default.openAfterExport) { - Process.Start(savePath); + OpenFolderInExplorer(savePath); } StatusStripUpdate("Finished"); }); @@ -588,7 +588,7 @@ namespace AssetStudioGUI ExportAnimator(animator, exportPath, animationList); if (Properties.Settings.Default.openAfterExport) { - Process.Start(exportPath); + OpenFolderInExplorer(exportPath); } Progress.Report(1, 1); StatusStripUpdate($"Finished exporting {animator.Text}"); @@ -630,7 +630,7 @@ namespace AssetStudioGUI } if (Properties.Settings.Default.openAfterExport) { - Process.Start(exportPath); + OpenFolderInExplorer(exportPath); } } else @@ -660,7 +660,7 @@ namespace AssetStudioGUI } if (Properties.Settings.Default.openAfterExport) { - Process.Start(Path.GetDirectoryName(exportPath)); + OpenFolderInExplorer(Path.GetDirectoryName(exportPath)); } }); } @@ -708,5 +708,12 @@ namespace AssetStudioGUI } return str; } + + public static void OpenFolderInExplorer(string path) + { + var info = new ProcessStartInfo(path); + info.UseShellExecute = true; + Process.Start(info); + } } }