Skip to content

Commit

Permalink
8254783: jpackage fails on Windows when application name differs from…
Browse files Browse the repository at this point in the history
… installer name

Reviewed-by: asemenyuk, kizune, almatvee
  • Loading branch information
Andy Herrick committed Oct 20, 2020
1 parent 3ccf487 commit afc967f
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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();

Expand Down

1 comment on commit afc967f

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented on afc967f Oct 20, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.