Silently fail when making desktop shortcut (#410)

This commit is contained in:
pizzaboxer 2023-07-22 12:18:55 +01:00
parent 46e671e3ff
commit cefe7cd22a
No known key found for this signature in database
GPG Key ID: 59D4A1DBAD0F2BA8

View File

@ -454,7 +454,7 @@ namespace Bloxstrap
public static void CheckInstall() public static void CheckInstall()
{ {
App.Logger.WriteLine("[Bootstrapper::StartRoblox] Checking install"); App.Logger.WriteLine("[Bootstrapper::CheckInstall] Checking install");
// check if launch uri is set to our bootstrapper // check if launch uri is set to our bootstrapper
// this doesn't go under register, so we check every launch // this doesn't go under register, so we check every launch
@ -502,8 +502,16 @@ namespace Bloxstrap
{ {
if (!File.Exists(DesktopShortcutLocation)) if (!File.Exists(DesktopShortcutLocation))
{ {
ShellLink.Shortcut.CreateShortcut(Directories.Application, "", Directories.Application, 0) try
.WriteToFile(DesktopShortcutLocation); {
ShellLink.Shortcut.CreateShortcut(Directories.Application, "", Directories.Application, 0)
.WriteToFile(DesktopShortcutLocation);
}
catch (Exception ex)
{
App.Logger.WriteLine("[Bootstrapper::CheckInstall] Could not create desktop shortcut, aborting");
App.Logger.WriteLine($"[Bootstrapper::CheckInstall] {ex}");
}
} }
// one-time toggle, set it back to false // one-time toggle, set it back to false