fix<About, Upgrade>: fix isusse reported by https://gitee.com/sourcegit/sourcegit/issues/I44GJO

This commit is contained in:
leo 2021-08-09 14:28:18 +08:00
parent 43ce225af1
commit 5c4c050e94
2 changed files with 10 additions and 3 deletions

View file

@ -38,9 +38,13 @@ namespace SourceGit.Views {
} }
private void OnRequestNavigate(object sender, System.Windows.Navigation.RequestNavigateEventArgs e) { 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}"); var info = new ProcessStartInfo("cmd", $"/c start {e.Uri.AbsoluteUri}");
info.CreateNoWindow = true; info.CreateNoWindow = true;
Process.Start(info); Process.Start(info);
#endif
} }
private void Quit(object sender, RoutedEventArgs e) { private void Quit(object sender, RoutedEventArgs e) {

View file

@ -15,11 +15,14 @@ namespace SourceGit.Views {
} }
private void Download(object sender, RoutedEventArgs e) { 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; info.CreateNoWindow = true;
Process.Start(info); Process.Start(info);
e.Handled = true; #endif
} }
private void Quit(object sender, RoutedEventArgs e) { private void Quit(object sender, RoutedEventArgs e) {