Skip to content
Permalink
Browse files
8254783: jpackage fails on Windows when application name differs from…
… installer name

Reviewed-by: asemenyuk, kizune, almatvee
  • Loading branch information
Andy Herrick committed Oct 20, 2020
1 parent 3ccf487 commit afc967fcd0bf2d51eef7e0a9e8a7fc3d2f14575a
Showing with 8 additions and 1 deletion.
  1. +8 −1 src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/WinMsiBundler.java
@@ -306,15 +306,22 @@ private void prepareProto(Map<String, ? super Object> params)
throws PackagerException, IOException {
Path appImage = StandardBundlerParam.getPredefinedAppImage(params);
Path appDir;
String appName;

// we either have an application image or need to build one
if (appImage != null) {
appDir = MSI_IMAGE_DIR.fetchFrom(params).resolve(APP_NAME.fetchFrom(params));
// copy everything from appImage dir into appDir/name
IOUtils.copyRecursive(appImage, appDir);
try {
appName = AppImageFile.load(appDir).getLauncherName();
} catch (Exception e) {
appName = APP_NAME.fetchFrom(params);
}
} else {
appDir = appImageBundler.execute(params, MSI_IMAGE_DIR.fetchFrom(
params));
appName = APP_NAME.fetchFrom(params);
}

// Configure installer icon
@@ -331,7 +338,7 @@ private void prepareProto(Map<String, ? super Object> params)
installerIcon = ApplicationLayout.windowsAppImage()
.resolveAt(appDir)
.launchersDirectory()
.resolve(APP_NAME.fetchFrom(params) + ".exe");
.resolve(appName + ".exe");
}
installerIcon = installerIcon.toAbsolutePath();

1 comment on commit afc967f

@bridgekeeper

This comment has been minimized.

Copy link

@bridgekeeper bridgekeeper bot commented on afc967f Oct 20, 2020

Please sign in to comment.