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()
{
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
@ -501,10 +501,18 @@ namespace Bloxstrap
if (App.Settings.Prop.CreateDesktopIcon)
{
if (!File.Exists(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
App.Settings.Prop.CreateDesktopIcon = false;