Fixed bug

This commit is contained in:
Perfare 2021-12-04 02:05:35 +08:00
parent 582a779441
commit d4060cde6d

View File

@ -457,7 +457,7 @@ namespace AssetStudioGUI
if (Properties.Settings.Default.openAfterExport && exportedCount > 0) 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) if (Properties.Settings.Default.openAfterExport && toExportAssets.Count() > 0)
{ {
Process.Start(savePath); OpenFolderInExplorer(savePath);
} }
}); });
} }
@ -562,7 +562,7 @@ namespace AssetStudioGUI
} }
if (Properties.Settings.Default.openAfterExport) if (Properties.Settings.Default.openAfterExport)
{ {
Process.Start(savePath); OpenFolderInExplorer(savePath);
} }
StatusStripUpdate("Finished"); StatusStripUpdate("Finished");
}); });
@ -588,7 +588,7 @@ namespace AssetStudioGUI
ExportAnimator(animator, exportPath, animationList); ExportAnimator(animator, exportPath, animationList);
if (Properties.Settings.Default.openAfterExport) if (Properties.Settings.Default.openAfterExport)
{ {
Process.Start(exportPath); OpenFolderInExplorer(exportPath);
} }
Progress.Report(1, 1); Progress.Report(1, 1);
StatusStripUpdate($"Finished exporting {animator.Text}"); StatusStripUpdate($"Finished exporting {animator.Text}");
@ -630,7 +630,7 @@ namespace AssetStudioGUI
} }
if (Properties.Settings.Default.openAfterExport) if (Properties.Settings.Default.openAfterExport)
{ {
Process.Start(exportPath); OpenFolderInExplorer(exportPath);
} }
} }
else else
@ -660,7 +660,7 @@ namespace AssetStudioGUI
} }
if (Properties.Settings.Default.openAfterExport) if (Properties.Settings.Default.openAfterExport)
{ {
Process.Start(Path.GetDirectoryName(exportPath)); OpenFolderInExplorer(Path.GetDirectoryName(exportPath));
} }
}); });
} }
@ -708,5 +708,12 @@ namespace AssetStudioGUI
} }
return str; return str;
} }
public static void OpenFolderInExplorer(string path)
{
var info = new ProcessStartInfo(path);
info.UseShellExecute = true;
Process.Start(info);
}
} }
} }