mirror of
https://github.com/claunia/romrepomgr.git
synced 2025-12-16 19:24:51 +00:00
[About] Replace process launch with URI launcher for website command
This commit is contained in:
@@ -98,34 +98,7 @@ public sealed class AboutViewModel : ViewModelBase
|
|||||||
|
|
||||||
void ExecuteWebsiteCommand()
|
void ExecuteWebsiteCommand()
|
||||||
{
|
{
|
||||||
var process = new Process
|
_ = _view.Launcher.LaunchUriAsync(new Uri("https://www.claunia.com"));
|
||||||
{
|
|
||||||
StartInfo =
|
|
||||||
{
|
|
||||||
UseShellExecute = false,
|
|
||||||
CreateNoWindow = true,
|
|
||||||
Arguments = "https://www.claunia.com"
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
if(RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
|
||||||
{
|
|
||||||
process.StartInfo.FileName = "cmd";
|
|
||||||
process.StartInfo.Arguments = $"/c start {process.StartInfo.Arguments.Replace("&", "^&")}";
|
|
||||||
}
|
|
||||||
else if(RuntimeInformation.IsOSPlatform(OSPlatform.Linux) ||
|
|
||||||
RuntimeInformation.IsOSPlatform(OSPlatform.FreeBSD))
|
|
||||||
process.StartInfo.FileName = "xdg-open";
|
|
||||||
else if(RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
|
|
||||||
process.StartInfo.FileName = "open";
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if(Debugger.IsAttached) throw new ArgumentOutOfRangeException();
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
process.Start();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExecuteLicenseCommand()
|
void ExecuteLicenseCommand()
|
||||||
|
|||||||
Reference in New Issue
Block a user