Skip to content

Commit c91df13

Browse files
Follow up fix after config files compared
1 parent 21eab4a commit c91df13

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacDmgPackager.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ String volumeName() {
165165
String createVolumeUrlLocation() throws IOException {
166166
final var volumeParentDir = volumePath().getParent();
167167
Files.createDirectories(volumeParentDir);
168-
// Url should end with '/' and it should be real path (no symbolic links).
168+
// The URL should end with '/' and it should be real path (no symbolic links).
169169
return volumeParentDir.toRealPath().resolve(volumePath().getFileName()).toUri().toString() + File.separator;
170170
}
171171

@@ -222,9 +222,9 @@ private void prepareDMGSetupScript() throws IOException {
222222
data.put("DEPLOY_VOLUME_URL", createVolumeUrlLocation());
223223

224224
// Full path to background image, so we can find it.
225-
data.put("DEPLOY_BG_FILE", bgImageFileInMountedDmg().toString());
225+
data.put("DEPLOY_BG_FILE", bgImageFileInMountedDmg().toAbsolutePath().toString());
226226

227-
data.put("DEPLOY_VOLUME_PATH", volumePath().toString());
227+
data.put("DEPLOY_VOLUME_PATH", volumePath().toAbsolutePath().toString());
228228
data.put("DEPLOY_APPLICATION_NAME", pkg.app().name());
229229

230230
String targetItem = pkg.relativeInstallDir().getFileName().toString();

src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacPkgPackager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ static Services create(MacPkgPackage pkg, BuildEnv env) {
153153
"--scripts", normalizedAbsolutePathString(servicesScriptsDir)));
154154

155155
final var supportPkg = InternalPackageType.SUPPORT.createInternalPackage(
156-
supportRoot, pkg, env, List.of(
156+
supportRoot.resolve("src"), pkg, env, List.of(
157157
"--install-location", "/Library/Application Support"));
158158

159159
return new Services(servicesPkg, servicesScriptsDir, supportPkg);
@@ -189,7 +189,7 @@ private void prepareSupportForPkgbuild(MacPkgPackage pkg, BuildEnv env,
189189
final var supportInstallDir = Path.of("/Library/Application Support").resolve(pkg.packageName());
190190

191191
Map<String, String> data = new HashMap<>(servicesSubstitutionData);
192-
data.put("APP_INSTALLATION_FOLDER", mainInstallDir.toString());
192+
data.put("APP_INSTALLATION_FOLDER", enqouter.applyTo(mainInstallDir.toString()));
193193
data.put("SUPPORT_INSTALLATION_FOLDER", enqouter.applyTo(supportInstallDir.toString()));
194194

195195
new ShellScriptResource("uninstall.command")

src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WixAppImageFragmentBuilder.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -669,6 +669,11 @@ public void createDirectory(final Path dir) throws IOException {
669669
}
670670
});
671671

672+
// The installed "app" directory is never empty as it contains at least ".package" file.
673+
// However, the "app" directory in the source app image can be empty because the ".package"
674+
// file is picked from the build config directory, not from the source app image.
675+
Optional.ofNullable(installedAppImage).map(ApplicationLayout::appDirectory).ifPresent(emptyDirs::remove);
676+
672677
List<String> componentIds = new ArrayList<>();
673678
for (var dir : emptyDirs) {
674679
componentIds.add(addComponent(xml, dir, Component.CreateFolder,

src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WixUiFragmentBuilder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ void initFromParams(BuildEnv env, WinMsiPackage pkg) {
6262

6363
withInstallDirChooserDlg = pkg.withInstallDirChooser();
6464

65-
var shortcutFolders = ShortcutsFolder.getForPackage(pkg);
65+
final var shortcutFolders = ShortcutsFolder.getForPackage(pkg);
6666

67-
withShortcutPromptDlg = !shortcutFolders.isEmpty();
67+
withShortcutPromptDlg = !shortcutFolders.isEmpty() && pkg.withShortcutPrompt();
6868

6969
customDialogs = new ArrayList<>();
7070

0 commit comments

Comments
 (0)