Skip to content

Commit

Permalink
Improvements to web URL opening
Browse files Browse the repository at this point in the history
  • Loading branch information
pizzaboxer committed Aug 1, 2023
1 parent f00de2b commit bf53b06
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
5 changes: 4 additions & 1 deletion Bloxstrap/Bootstrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,10 @@ private async Task StartRoblox()
"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;
}
Expand Down
29 changes: 27 additions & 2 deletions Bloxstrap/Utilities.cs
Original file line number Diff line number Diff line change
@@ -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>
///
Expand Down

0 comments on commit bf53b06

Please sign in to comment.