From 7be96b2882aab6e55d7dae03161f2b8aa3182b33 Mon Sep 17 00:00:00 2001 From: Tres Finocchiaro Date: Sat, 7 May 2022 19:45:56 -0400 Subject: [PATCH] Catch more InvalidPathExceptions on shortcut creation Per #971 --- src/qz/installer/WindowsInstaller.java | 2 +- src/qz/installer/shortcut/WindowsShortcutCreator.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qz/installer/WindowsInstaller.java b/src/qz/installer/WindowsInstaller.java index c52f1c600..665dd2cf6 100644 --- a/src/qz/installer/WindowsInstaller.java +++ b/src/qz/installer/WindowsInstaller.java @@ -84,7 +84,7 @@ public Installer addStartupEntry() { log.info("Creating startup entry \"{}\" -> \"{}\"", lnk, exe); ShellLink link = ShellLink.createLink(exe, lnk); link.setCMDArgs("--honorautostart"); // honors auto-start preferences - } catch(IOException | Win32Exception e) { + } catch(InvalidPathException | IOException | Win32Exception e) { log.warn("Could not create startup launcher", e); } return this; diff --git a/src/qz/installer/shortcut/WindowsShortcutCreator.java b/src/qz/installer/shortcut/WindowsShortcutCreator.java index e9f2a2143..5d2727a24 100644 --- a/src/qz/installer/shortcut/WindowsShortcutCreator.java +++ b/src/qz/installer/shortcut/WindowsShortcutCreator.java @@ -38,7 +38,7 @@ private void createShortcut(String folderPath) { try { ShellLink.createLink(getAppPath(), folderPath + File.separator + SHORTCUT_NAME); } - catch(IOException ex) { + catch(InvalidPathException | IOException ex) { log.warn("Error creating desktop shortcut", ex); } }