< prev index next >
src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/MacPkgBundler.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 360,369 ****
--- 360,370 ----
private String getRoot(Map<String, ? super Object> params,
File appLocation) throws IOException {
String root = appLocation.getParent() == null ?
"." : appLocation.getParent();
File rootDir = new File(root);
+
File[] list = rootDir.listFiles();
if (list != null) { // Should not happend
// We should only have app image and/or .DS_Store
if (list.length == 1) {
return root;
*** 376,390 ****
}
}
// Copy to new root
Path newRoot = Files.createTempDirectory(
! TEMP_ROOT.fetchFrom(params).toPath(),
! "root-");
! IOUtils.copyRecursive(appLocation.toPath(),
! newRoot.resolve(appLocation.getName()));
return newRoot.toString();
}
private File createPKG(Map<String, ? super Object> params,
--- 377,405 ----
}
}
// Copy to new root
Path newRoot = Files.createTempDirectory(
! TEMP_ROOT.fetchFrom(params).toPath(), "root-");
!
! Path source, dest;
! if (StandardBundlerParam.isRuntimeInstaller(params)) {
! // firs, is this already a runtime with
! // <runtime>/Contents/Home - if so we need the Home dir
! Path original = appLocation.toPath();
! Path home = original.resolve("Contents/Home");
! source = (Files.exists(home)) ? home : original;
!
! // Then we need to put back the <NAME>/Content/Home
! dest = newRoot.resolve(
! MAC_CF_BUNDLE_IDENTIFIER.fetchFrom(params) + "/Contents/Home");
! } else {
! source = appLocation.toPath();
! dest = newRoot.resolve(appLocation.getName());
! }
! IOUtils.copyRecursive(source, dest);
return newRoot.toString();
}
private File createPKG(Map<String, ? super Object> params,
*** 420,429 ****
--- 435,446 ----
MAC_INSTALL_DIR.fetchFrom(params),
"--component-plist",
cpl.getAbsolutePath(),
"--scripts",
SCRIPTS_DIR.fetchFrom(params).getAbsolutePath(),
+ "--identifier",
+ MAC_CF_BUNDLE_IDENTIFIER.fetchFrom(params),
appPKG.getAbsolutePath());
IOUtils.exec(pb);
// build final package
File finalPKG = new File(outdir, INSTALLER_NAME.fetchFrom(params)
< prev index next >