From bf53b0642ee910dded04e09df837bb91019cdeec Mon Sep 17 00:00:00 2001 From: pizzaboxer Date: Tue, 1 Aug 2023 17:33:41 +0100 Subject: [PATCH] Improvements to web URL opening --- Bloxstrap/Bootstrapper.cs | 5 ++++- Bloxstrap/Utilities.cs | 29 +++++++++++++++++++++++++++-- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/Bloxstrap/Bootstrapper.cs b/Bloxstrap/Bootstrapper.cs index 85eaaf2..024fa9b 100644 --- a/Bloxstrap/Bootstrapper.cs +++ b/Bloxstrap/Bootstrapper.cs @@ -256,7 +256,10 @@ namespace Bloxstrap "Roblox requires the use of Windows Media Foundation components. You appear to be missing them, likely because you are using an N edition of Windows. Please install them first, and then launch Roblox.", MessageBoxImage.Error ); - Utilities.ShellExecute("https://support.microsoft.com/en-us/topic/media-feature-pack-list-for-windows-n-editions-c1c6fffa-d052-8338-7a79-a4bb980a700a"); + + if (!App.IsQuiet) + Utilities.ShellExecute("https://support.microsoft.com/en-us/topic/media-feature-pack-list-for-windows-n-editions-c1c6fffa-d052-8338-7a79-a4bb980a700a"); + Dialog?.CloseBootstrapper(); return; } diff --git a/Bloxstrap/Utilities.cs b/Bloxstrap/Utilities.cs index abf568b..533928a 100644 --- a/Bloxstrap/Utilities.cs +++ b/Bloxstrap/Utilities.cs @@ -1,8 +1,33 @@ -namespace Bloxstrap +using System.ComponentModel; + +namespace Bloxstrap { static class Utilities { - public static void ShellExecute(string website) => Process.Start(new ProcessStartInfo { FileName = website, UseShellExecute = true }); + public static void ShellExecute(string website) + { + try + { + Process.Start(new ProcessStartInfo + { + FileName = website, + UseShellExecute = true + }); + } + catch (Win32Exception ex) + { + // lmfao + + if (!ex.Message.Contains("Application not found")) + throw; + + Process.Start(new ProcessStartInfo + { + FileName = "rundll32.exe", + Arguments = $"shell32,OpenAs_RunDLL {website}" + }); + } + } /// ///