From cefe7cd22a1a5b1b9911ca324ac0f3a21b75a948 Mon Sep 17 00:00:00 2001 From: pizzaboxer Date: Sat, 22 Jul 2023 12:18:55 +0100 Subject: [PATCH] Silently fail when making desktop shortcut (#410) --- Bloxstrap/Bootstrapper.cs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Bloxstrap/Bootstrapper.cs b/Bloxstrap/Bootstrapper.cs index 8fc9475..163aa00 100644 --- a/Bloxstrap/Bootstrapper.cs +++ b/Bloxstrap/Bootstrapper.cs @@ -454,7 +454,7 @@ namespace Bloxstrap 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 // this doesn't go under register, so we check every launch @@ -502,8 +502,16 @@ namespace Bloxstrap { if (!File.Exists(DesktopShortcutLocation)) { - ShellLink.Shortcut.CreateShortcut(Directories.Application, "", Directories.Application, 0) - .WriteToFile(DesktopShortcutLocation); + try + { + 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