Improvements to web URL opening

This commit is contained in:
pizzaboxer 2023-08-01 17:33:41 +01:00
parent f00de2bc2e
commit bf53b0642e
No known key found for this signature in database
GPG Key ID: 59D4A1DBAD0F2BA8
2 changed files with 31 additions and 3 deletions

View File

@ -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
);
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;
}

View File

@ -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}"
});
}
}
/// <summary>
///