diff --git a/src/IntelOrca.OpenLauncher.Core/Shell.cs b/src/IntelOrca.OpenLauncher.Core/Shell.cs index cad7d88..4bcd06a 100644 --- a/src/IntelOrca.OpenLauncher.Core/Shell.cs +++ b/src/IntelOrca.OpenLauncher.Core/Shell.cs @@ -18,6 +18,26 @@ public void StartProcess(string name, params string[] args) Process.Start(psi); } + public void OpenDirectory(string path) + { + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + Process.Start(new ProcessStartInfo(path) { UseShellExecute = true }); + } + else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) + { + StartProcess("open", path); + } + else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) + { + StartProcess("xdg-open", path); + } + else + { + throw new PlatformNotSupportedException(); + } + } + public int RunProcess(string name, params string[] args) { var psi = new ProcessStartInfo(name); diff --git a/src/openlauncher/MainWindow.axaml b/src/openlauncher/MainWindow.axaml index 268a24e..0cc9eef 100644 --- a/src/openlauncher/MainWindow.axaml +++ b/src/openlauncher/MainWindow.axaml @@ -77,11 +77,26 @@ Padding="4"> -