Skip to content

Commit

Permalink
Windows links now include branch suffix when app uses github branch
Browse files Browse the repository at this point in the history
  • Loading branch information
shannah committed Nov 27, 2022
1 parent 7fb87d8 commit 26d0d67
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions installer/src/main/java/ca/weblite/jdeploy/installer/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down Expand Up @@ -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);
Expand All @@ -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");
Expand All @@ -845,23 +845,23 @@ 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);

}
}
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);

}
}
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);

Expand Down

0 comments on commit 26d0d67

Please sign in to comment.