From 26d0d677980ca6f0b33a4cff891980f6b4e8a579 Mon Sep 17 00:00:00 2001 From: Steve Hannah Date: Sun, 27 Nov 2022 09:06:35 -0800 Subject: [PATCH] Windows links now include branch suffix when app uses github branch --- .../java/ca/weblite/jdeploy/installer/Main.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/installer/src/main/java/ca/weblite/jdeploy/installer/Main.java b/installer/src/main/java/ca/weblite/jdeploy/installer/Main.java index 4143afe4..a3a5a57e 100644 --- a/installer/src/main/java/ca/weblite/jdeploy/installer/Main.java +++ b/installer/src/main/java/ca/weblite/jdeploy/installer/Main.java @@ -607,7 +607,7 @@ private void install() throws Exception { if (Files.exists(bundleIcon.toPath())) { FileUtil.copy(bundleIcon, iconPath); } - installWindowsLinks(exePath); + installWindowsLinks(exePath, appInfo().getTitle() + nameSuffix); File registryBackupLogs = new File(exePath.getParentFile(), "registry-backup-logs"); @@ -796,11 +796,11 @@ private void convertWindowsIcon(File srcPng, File destIco) throws IOException { - private void installWindowsLink(int type, File exePath, File iconPath) throws Exception { + private void installWindowsLink(int type, File exePath, File iconPath, String appTitle) throws Exception { System.out.println("Installing windows link type "+type+" for exe "+exePath+" and icon "+iconPath); - ShellLink link = new ShellLink(type, appInfo().getTitle()); + ShellLink link = new ShellLink(type, appTitle); System.out.println("current user link path: "+link.getcurrentUserLinkPath()); link.setUserType(ShellLink.CURRENT_USER); @@ -827,7 +827,7 @@ private void installWindowsLink(int type, File exePath, File iconPath) throws Ex - private void installWindowsLinks(File exePath) throws Exception { + private void installWindowsLinks(File exePath, String appTitle) throws Exception { System.out.println("Installing Windows links for exe "+exePath); File pngIconPath = new File(exePath.getParentFile(), "icon.png"); File icoPath = new File(exePath.getParentFile().getCanonicalFile(), "icon.ico"); @@ -845,7 +845,7 @@ private void installWindowsLinks(File exePath) throws Exception { if (installationSettings.isAddToDesktop()) { try { - installWindowsLink(ShellLink.DESKTOP, exePath, icoPath); + installWindowsLink(ShellLink.DESKTOP, exePath, icoPath, appTitle); } catch (Exception ex) { throw new RuntimeException("Failed to install desktop shortcut", ex); @@ -853,7 +853,7 @@ private void installWindowsLinks(File exePath) throws Exception { } if (installationSettings.isAddToPrograms()) { try { - installWindowsLink(ShellLink.PROGRAM_MENU, exePath, icoPath); + installWindowsLink(ShellLink.PROGRAM_MENU, exePath, icoPath, appTitle); } catch (Exception ex) { throw new RuntimeException("Failed to install program menu shortcut", ex); @@ -861,7 +861,7 @@ private void installWindowsLinks(File exePath) throws Exception { } if (installationSettings.isAddToStartMenu()) { try { - installWindowsLink(ShellLink.START_MENU, exePath, icoPath); + installWindowsLink(ShellLink.START_MENU, exePath, icoPath, appTitle); } catch (Exception ex) { throw new RuntimeException("Failed to install start menu shortcut", ex);