diff --git a/DS4Windows/DS4Control/Util.cs b/DS4Windows/DS4Control/Util.cs index e05cd23..fe3535b 100644 --- a/DS4Windows/DS4Control/Util.cs +++ b/DS4Windows/DS4Control/Util.cs @@ -145,6 +145,18 @@ namespace DS4Windows } } + public static void StartProcessHelper(string path) + { + if (!Global.IsAdministrator()) + { + Process.Start(path); + } + else + { + StartProcessInExplorer(path); + } + } + public static void StartProcessInExplorer(string path) { string tmpPath = Path.Combine(Path.GetTempPath(), "urlopener.bat"); diff --git a/DS4Windows/DS4Forms/About.xaml.cs b/DS4Windows/DS4Forms/About.xaml.cs index 0f3e2a7..24e6f8d 100644 --- a/DS4Windows/DS4Forms/About.xaml.cs +++ b/DS4Windows/DS4Forms/About.xaml.cs @@ -18,87 +18,87 @@ namespace DS4WinWPF.DS4Forms private void ChangeLogLink_Click(object sender, RoutedEventArgs e) { - Util.StartProcessInExplorer("https://docs.google.com/document/d/1CovpH08fbPSXrC6TmEprzgPwCe0tTjQ_HTFfDotpmxk/edit?usp=sharing"); + Util.StartProcessHelper("https://docs.google.com/document/d/1CovpH08fbPSXrC6TmEprzgPwCe0tTjQ_HTFfDotpmxk/edit?usp=sharing"); } private void PaypalLink_Click(object sender, RoutedEventArgs e) { - Util.StartProcessInExplorer("https://paypal.me/ryochan7"); + Util.StartProcessHelper("https://paypal.me/ryochan7"); } private void PatreonLink_Click(object sender, RoutedEventArgs e) { - Util.StartProcessInExplorer("https://patreon.com/user?u=501036"); + Util.StartProcessHelper("https://patreon.com/user?u=501036"); } private void SubscribeStartLink_Click(object sender, RoutedEventArgs e) { - Util.StartProcessInExplorer("https://subscribestar.com/ryochan7"); + Util.StartProcessHelper("https://subscribestar.com/ryochan7"); } private void SiteLink_Click(object sender, RoutedEventArgs e) { - Util.StartProcessInExplorer("https://ryochan7.github.io/ds4windows-site/"); + Util.StartProcessHelper("https://ryochan7.github.io/ds4windows-site/"); } private void SourceLink_Click(object sender, RoutedEventArgs e) { - Util.StartProcessInExplorer("https://github.com/Ryochan7/DS4Windows"); + Util.StartProcessHelper("https://github.com/Ryochan7/DS4Windows"); } private void Jays2KingsLink_Click(object sender, RoutedEventArgs e) { - Util.StartProcessInExplorer("https://github.com/Jays2Kings/"); + Util.StartProcessHelper("https://github.com/Jays2Kings/"); } private void InhexSTERLink_Click(object sender, RoutedEventArgs e) { - Util.StartProcessInExplorer("https://code.google.com/p/ds4-tool/"); + Util.StartProcessHelper("https://code.google.com/p/ds4-tool/"); } private void ElectrobrainsLink_Click(object sender, RoutedEventArgs e) { - Util.StartProcessInExplorer("https://code.google.com/r/brianfundakowskifeldman-ds4windows/"); + Util.StartProcessHelper("https://code.google.com/r/brianfundakowskifeldman-ds4windows/"); } private void YoutubeSocialBtn_Click(object sender, RoutedEventArgs e) { - Util.StartProcessInExplorer("https://www.youtube.com/channel/UCIoUA_XLlCSZbvZGeg3Byeg"); + Util.StartProcessHelper("https://www.youtube.com/channel/UCIoUA_XLlCSZbvZGeg3Byeg"); } private void BitchuteSocialBtn_Click(object sender, RoutedEventArgs e) { - Util.StartProcessInExplorer("https://www.bitchute.com/channel/uE2CbiV96u1k/"); + Util.StartProcessHelper("https://www.bitchute.com/channel/uE2CbiV96u1k/"); } private void BittubeSocialBtn_Click(object sender, RoutedEventArgs e) { - Util.StartProcessInExplorer("https://bittube.tv/profile/ds4windows"); + Util.StartProcessHelper("https://bittube.tv/profile/ds4windows"); } private void LbrySocialBtn_Click(object sender, RoutedEventArgs e) { - Util.StartProcessInExplorer("https://lbry.tv/@ds4windows"); + Util.StartProcessHelper("https://lbry.tv/@ds4windows"); } private void TwitterSocialBtn_Click(object sender, RoutedEventArgs e) { - Util.StartProcessInExplorer("https://twitter.com/ds4windows"); + Util.StartProcessHelper("https://twitter.com/ds4windows"); } private void MastodonSocialBtn_Click(object sender, RoutedEventArgs e) { - Util.StartProcessInExplorer("https://fosstodon.org/@ds4windows"); + Util.StartProcessHelper("https://fosstodon.org/@ds4windows"); } private void MindsSocialBtn_Click(object sender, RoutedEventArgs e) { - Util.StartProcessInExplorer("https://www.minds.com/ds4windows/"); + Util.StartProcessHelper("https://www.minds.com/ds4windows/"); } private void DiscordSocialBtn_Click(object sender, RoutedEventArgs e) { - Util.StartProcessInExplorer("https://discord.gg/zrpPgyN"); + Util.StartProcessHelper("https://discord.gg/zrpPgyN"); } } } diff --git a/DS4Windows/DS4Forms/MainWindow.xaml.cs b/DS4Windows/DS4Forms/MainWindow.xaml.cs index f1d9dc5..9d497e8 100644 --- a/DS4Windows/DS4Forms/MainWindow.xaml.cs +++ b/DS4Windows/DS4Forms/MainWindow.xaml.cs @@ -1356,7 +1356,7 @@ Suspend support not enabled.", true); private void Html5GameBtn_Click(object sender, RoutedEventArgs e) { - Util.StartProcessInExplorer("https://html5gamepad.com/"); + Util.StartProcessHelper("https://html5gamepad.com/"); } } }