From 5c4c050e941527f24e9f997ffb0c152323495d39 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 9 Aug 2021 14:28:18 +0800 Subject: [PATCH] fix: fix isusse reported by https://gitee.com/sourcegit/sourcegit/issues/I44GJO --- src/Views/About.xaml.cs | 4 ++++ src/Views/Upgrade.xaml.cs | 9 ++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/Views/About.xaml.cs b/src/Views/About.xaml.cs index c0c912c5..4cdc72cf 100644 --- a/src/Views/About.xaml.cs +++ b/src/Views/About.xaml.cs @@ -38,9 +38,13 @@ namespace SourceGit.Views { } private void OnRequestNavigate(object sender, System.Windows.Navigation.RequestNavigateEventArgs e) { +#if NET48 + Process.Start(e.Uri.AbsoluteUri); +#else var info = new ProcessStartInfo("cmd", $"/c start {e.Uri.AbsoluteUri}"); info.CreateNoWindow = true; Process.Start(info); +#endif } private void Quit(object sender, RoutedEventArgs e) { diff --git a/src/Views/Upgrade.xaml.cs b/src/Views/Upgrade.xaml.cs index 645c38c4..c0d80c0c 100644 --- a/src/Views/Upgrade.xaml.cs +++ b/src/Views/Upgrade.xaml.cs @@ -15,11 +15,14 @@ namespace SourceGit.Views { } private void Download(object sender, RoutedEventArgs e) { - var info = new ProcessStartInfo("cmd", $"/c start https://gitee.com/sourcegit/sourcegit/releases/{Version.TagName}"); + var url = $"https://gitee.com/sourcegit/sourcegit/releases/{Version.TagName}"; +#if NET48 + Process.Start(url); +#else + var info = new ProcessStartInfo("cmd", $"/c start {url}"); info.CreateNoWindow = true; - Process.Start(info); - e.Handled = true; +#endif } private void Quit(object sender, RoutedEventArgs e) {