8223586: remove jpackage dead code and other cleanup
Reviewed-by: asemenyuk, almatvee
--- a/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxAppBundler.java Thu Jun 06 19:31:11 2019 -0400
+++ b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxAppBundler.java Thu Jun 06 19:51:17 2019 -0400
@@ -85,14 +85,14 @@
);
@Override
- public boolean validate(Map<String, ? super Object> p)
+ public boolean validate(Map<String, ? super Object> params)
throws UnsupportedPlatformException, ConfigException {
try {
- if (p == null) throw new ConfigException(
+ if (params == null) throw new ConfigException(
I18N.getString("error.parameters-null"),
I18N.getString("error.parameters-null.advice"));
- return doValidate(p);
+ return doValidate(params);
} catch (RuntimeException re) {
if (re.getCause() instanceof ConfigException) {
throw (ConfigException) re.getCause();
@@ -102,47 +102,48 @@
}
}
- private boolean doValidate(Map<String, ? super Object> p)
+ private boolean doValidate(Map<String, ? super Object> params)
throws UnsupportedPlatformException, ConfigException {
if (Platform.getPlatform() != Platform.LINUX) {
throw new UnsupportedPlatformException();
}
- imageBundleValidation(p);
+ imageBundleValidation(params);
return true;
}
// it is static for the sake of sharing with "installer" bundlers
// that may skip calls to validate/bundle in this class!
- static File getRootDir(File outDir, Map<String, ? super Object> p) {
- return new File(outDir, APP_NAME.fetchFrom(p));
+ static File getRootDir(File outDir, Map<String, ? super Object> params) {
+ return new File(outDir, APP_NAME.fetchFrom(params));
}
- static String getLauncherCfgName(Map<String, ? super Object> p) {
- return "app/" + APP_NAME.fetchFrom(p) +".cfg";
+ static String getLauncherCfgName(Map<String, ? super Object> params) {
+ return "app/" + APP_NAME.fetchFrom(params) +".cfg";
}
- File doBundle(Map<String, ? super Object> p, File outputDirectory,
+ File doBundle(Map<String, ? super Object> params, File outputDirectory,
boolean dependentTask) throws PackagerException {
- if (StandardBundlerParam.isRuntimeInstaller(p)) {
- return PREDEFINED_RUNTIME_IMAGE.fetchFrom(p);
+ if (StandardBundlerParam.isRuntimeInstaller(params)) {
+ return PREDEFINED_RUNTIME_IMAGE.fetchFrom(params);
} else {
- return doAppBundle(p, outputDirectory, dependentTask);
+ return doAppBundle(params, outputDirectory, dependentTask);
}
}
- private File doAppBundle(Map<String, ? super Object> p,
+ private File doAppBundle(Map<String, ? super Object> params,
File outputDirectory, boolean dependentTask) throws PackagerException {
try {
- File rootDirectory = createRoot(p, outputDirectory, dependentTask,
- APP_NAME.fetchFrom(p));
- AbstractAppImageBuilder appBuilder = new LinuxAppImageBuilder(p,
- outputDirectory.toPath());
- if (PREDEFINED_RUNTIME_IMAGE.fetchFrom(p) == null ) {
- JLinkBundlerHelper.execute(p, appBuilder);
+ File rootDirectory = createRoot(params, outputDirectory,
+ dependentTask, APP_NAME.fetchFrom(params));
+ AbstractAppImageBuilder appBuilder = new LinuxAppImageBuilder(
+ params, outputDirectory.toPath());
+ if (PREDEFINED_RUNTIME_IMAGE.fetchFrom(params) == null ) {
+ JLinkBundlerHelper.execute(params, appBuilder);
} else {
- StandardBundlerParam.copyPredefinedRuntimeImage(p, appBuilder);
+ StandardBundlerParam.copyPredefinedRuntimeImage(
+ params, appBuilder);
}
return rootDirectory;
} catch (PackagerException pe) {
--- a/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxAppImageBuilder.java Thu Jun 06 19:31:11 2019 -0400
+++ b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxAppImageBuilder.java Thu Jun 06 19:51:17 2019 -0400
@@ -146,16 +146,18 @@
// it is static for the sake of sharing with "installer" bundlers
// that may skip calls to validate/bundle in this class!
- public static File getRootDir(File outDir, Map<String, ? super Object> p) {
- return new File(outDir, APP_NAME.fetchFrom(p));
+ public static File getRootDir(File outDir,
+ Map<String, ? super Object> params) {
+ return new File(outDir, APP_NAME.fetchFrom(params));
}
- public static String getLauncherName(Map<String, ? super Object> p) {
- return APP_NAME.fetchFrom(p);
+ public static String getLauncherName(Map<String, ? super Object> params) {
+ return APP_NAME.fetchFrom(params);
}
- public static String getLauncherCfgName(Map<String, ? super Object> p) {
- return "app/" + APP_NAME.fetchFrom(p) + ".cfg";
+ public static String getLauncherCfgName(
+ Map<String, ? super Object> params) {
+ return "app/" + APP_NAME.fetchFrom(params) + ".cfg";
}
@Override
@@ -198,10 +200,10 @@
@Override
public void prepareJreFiles() throws IOException {}
- private void createLauncherForEntryPoint(Map<String, ? super Object> p)
- throws IOException {
+ private void createLauncherForEntryPoint(
+ Map<String, ? super Object> params) throws IOException {
// Copy executable to Linux folder
- Path executableFile = root.resolve(getLauncherName(p));
+ Path executableFile = root.resolve(getLauncherName(params));
try (InputStream is_launcher =
getResourceAsStream("jpackageapplauncher")) {
writeEntry(is_launcher, executableFile);
@@ -210,7 +212,7 @@
executableFile.toFile().setExecutable(true, false);
executableFile.toFile().setWritable(true, true);
- writeCfgFile(p, root.resolve(getLauncherCfgName(p)).toFile(),
+ writeCfgFile(params, root.resolve(getLauncherCfgName(params)).toFile(),
"$APPDIR/runtime");
}
--- a/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxDebBundler.java Thu Jun 06 19:31:11 2019 -0400
+++ b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxDebBundler.java Thu Jun 06 19:51:17 2019 -0400
@@ -218,16 +218,16 @@
}
@Override
- public boolean validate(Map<String, ? super Object> p)
+ public boolean validate(Map<String, ? super Object> params)
throws UnsupportedPlatformException, ConfigException {
try {
- if (p == null) throw new ConfigException(
+ if (params == null) throw new ConfigException(
I18N.getString("error.parameters-null"),
I18N.getString("error.parameters-null.advice"));
//run basic validation to ensure requirements are met
//we are not interested in return code, only possible exception
- APP_BUNDLER.fetchFrom(p).validate(p);
+ APP_BUNDLER.fetchFrom(params).validate(params);
// NOTE: Can we validate that the required tools are available
// before we start?
@@ -239,14 +239,14 @@
// Show warning is license file is missing
- String licenseFile = LICENSE_FILE.fetchFrom(p);
+ String licenseFile = LICENSE_FILE.fetchFrom(params);
if (licenseFile == null) {
Log.verbose(I18N.getString("message.debs-like-licenses"));
}
// only one mime type per association, at least one file extention
List<Map<String, ? super Object>> associations =
- FILE_ASSOCIATIONS.fetchFrom(p);
+ FILE_ASSOCIATIONS.fetchFrom(params);
if (associations != null) {
for (int i = 0; i < associations.size(); i++) {
Map<String, ? super Object> assoc = associations.get(i);
@@ -270,7 +270,8 @@
// bundle name has some restrictions
// the string converter will throw an exception if invalid
- BUNDLE_NAME.getStringConverter().apply(BUNDLE_NAME.fetchFrom(p), p);
+ BUNDLE_NAME.getStringConverter().apply(
+ BUNDLE_NAME.fetchFrom(params), params);
return true;
} catch (RuntimeException re) {
@@ -282,26 +283,26 @@
}
}
- private boolean prepareProto(Map<String, ? super Object> p)
+ private boolean prepareProto(Map<String, ? super Object> params)
throws PackagerException, IOException {
- File appImage = StandardBundlerParam.getPredefinedAppImage(p);
+ File appImage = StandardBundlerParam.getPredefinedAppImage(params);
File appDir = null;
// we either have an application image or need to build one
if (appImage != null) {
- appDir = new File(APP_IMAGE_ROOT.fetchFrom(p),
- APP_NAME.fetchFrom(p));
+ appDir = new File(APP_IMAGE_ROOT.fetchFrom(params),
+ APP_NAME.fetchFrom(params));
// copy everything from appImage dir into appDir/name
IOUtils.copyRecursive(appImage.toPath(), appDir.toPath());
} else {
- appDir = APP_BUNDLER.fetchFrom(p).doBundle(p,
- APP_IMAGE_ROOT.fetchFrom(p), true);
+ appDir = APP_BUNDLER.fetchFrom(params).doBundle(params,
+ APP_IMAGE_ROOT.fetchFrom(params), true);
}
return appDir != null;
}
//@Override
- public File bundle(Map<String, ? super Object> p,
+ public File bundle(Map<String, ? super Object> params,
File outdir) throws PackagerException {
if (!outdir.isDirectory() && !outdir.mkdirs()) {
throw new PackagerException ("error.cannot-create-output-dir",
@@ -324,15 +325,15 @@
// app
// runtime
- File imageDir = DEB_IMAGE_DIR.fetchFrom(p);
- File configDir = CONFIG_DIR.fetchFrom(p);
+ File imageDir = DEB_IMAGE_DIR.fetchFrom(params);
+ File configDir = CONFIG_DIR.fetchFrom(params);
try {
imageDir.mkdirs();
configDir.mkdirs();
- if (prepareProto(p) && prepareProjectConfig(p)) {
- return buildDeb(p, outdir);
+ if (prepareProto(params) && prepareProjectConfig(params)) {
+ return buildDeb(params, outdir);
}
return null;
} catch (IOException ex) {
--- a/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxRpmBundler.java Thu Jun 06 19:31:11 2019 -0400
+++ b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxRpmBundler.java Thu Jun 06 19:51:17 2019 -0400
@@ -173,16 +173,16 @@
}
@Override
- public boolean validate(Map<String, ? super Object> p)
+ public boolean validate(Map<String, ? super Object> params)
throws UnsupportedPlatformException, ConfigException {
try {
- if (p == null) throw new ConfigException(
+ if (params == null) throw new ConfigException(
I18N.getString("error.parameters-null"),
I18N.getString("error.parameters-null.advice"));
// run basic validation to ensure requirements are met
// we are not interested in return code, only possible exception
- APP_BUNDLER.fetchFrom(p).validate(p);
+ APP_BUNDLER.fetchFrom(params).validate(params);
// validate presense of required tools
if (!testTool(TOOL_RPMBUILD, TOOL_RPMBUILD_MIN_VERSION)){
@@ -197,7 +197,7 @@
// only one mime type per association, at least one file extension
List<Map<String, ? super Object>> associations =
- FILE_ASSOCIATIONS.fetchFrom(p);
+ FILE_ASSOCIATIONS.fetchFrom(params);
if (associations != null) {
for (int i = 0; i < associations.size(); i++) {
Map<String, ? super Object> assoc = associations.get(i);
@@ -220,7 +220,8 @@
// bundle name has some restrictions
// the string converter will throw an exception if invalid
- BUNDLE_NAME.getStringConverter().apply(BUNDLE_NAME.fetchFrom(p), p);
+ BUNDLE_NAME.getStringConverter().apply(
+ BUNDLE_NAME.fetchFrom(params), params);
return true;
} catch (RuntimeException re) {
@@ -232,25 +233,25 @@
}
}
- private boolean prepareProto(Map<String, ? super Object> p)
+ private boolean prepareProto(Map<String, ? super Object> params)
throws PackagerException, IOException {
- File appImage = StandardBundlerParam.getPredefinedAppImage(p);
+ File appImage = StandardBundlerParam.getPredefinedAppImage(params);
File appDir = null;
// we either have an application image or need to build one
if (appImage != null) {
- appDir = new File(RPM_IMAGE_DIR.fetchFrom(p),
- APP_NAME.fetchFrom(p));
+ appDir = new File(RPM_IMAGE_DIR.fetchFrom(params),
+ APP_NAME.fetchFrom(params));
// copy everything from appImage dir into appDir/name
IOUtils.copyRecursive(appImage.toPath(), appDir.toPath());
} else {
- appDir = APP_BUNDLER.fetchFrom(p).doBundle(p,
- RPM_IMAGE_DIR.fetchFrom(p), true);
+ appDir = APP_BUNDLER.fetchFrom(params).doBundle(params,
+ RPM_IMAGE_DIR.fetchFrom(params), true);
}
return appDir != null;
}
- public File bundle(Map<String, ? super Object> p,
+ public File bundle(Map<String, ? super Object> params,
File outdir) throws PackagerException {
if (!outdir.isDirectory() && !outdir.mkdirs()) {
throw new PackagerException(
@@ -263,13 +264,13 @@
outdir.getAbsolutePath());
}
- File imageDir = RPM_IMAGE_DIR.fetchFrom(p);
+ File imageDir = RPM_IMAGE_DIR.fetchFrom(params);
try {
imageDir.mkdirs();
- if (prepareProto(p) && prepareProjectConfig(p)) {
- return buildRPM(p, outdir);
+ if (prepareProto(params) && prepareProjectConfig(params)) {
+ return buildRPM(params, outdir);
}
return null;
} catch (IOException ex) {
--- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppBundler.java Thu Jun 06 19:31:11 2019 -0400
+++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppBundler.java Thu Jun 06 19:51:17 2019 -0400
@@ -252,20 +252,20 @@
}
}
- private boolean doValidate(Map<String, ? super Object> p)
+ private boolean doValidate(Map<String, ? super Object> params)
throws UnsupportedPlatformException, ConfigException {
if (Platform.getPlatform() != Platform.MAC) {
throw new UnsupportedPlatformException();
}
- imageBundleValidation(p);
+ imageBundleValidation(params);
- if (StandardBundlerParam.getPredefinedAppImage(p) != null) {
+ if (StandardBundlerParam.getPredefinedAppImage(params) != null) {
return true;
}
// validate short version
- if (!validCFBundleVersion(MAC_CF_BUNDLE_VERSION.fetchFrom(p))) {
+ if (!validCFBundleVersion(MAC_CF_BUNDLE_VERSION.fetchFrom(params))) {
throw new ConfigException(
I18N.getString("error.invalid-cfbundle-version"),
I18N.getString("error.invalid-cfbundle-version.advice"));
@@ -273,8 +273,9 @@
// reject explicitly set sign to true and no valid signature key
if (Optional.ofNullable(MacAppImageBuilder.
- SIGN_BUNDLE.fetchFrom(p)).orElse(Boolean.FALSE)) {
- String signingIdentity = DEVELOPER_ID_APP_SIGNING_KEY.fetchFrom(p);
+ SIGN_BUNDLE.fetchFrom(params)).orElse(Boolean.FALSE)) {
+ String signingIdentity =
+ DEVELOPER_ID_APP_SIGNING_KEY.fetchFrom(params);
if (signingIdentity == null) {
throw new ConfigException(
I18N.getString("error.explicit-sign-no-cert"),
@@ -285,26 +286,27 @@
return true;
}
- File doBundle(Map<String, ? super Object> p, File outputDirectory,
+ File doBundle(Map<String, ? super Object> params, File outputDirectory,
boolean dependentTask) throws PackagerException {
- if (StandardBundlerParam.isRuntimeInstaller(p)) {
- return PREDEFINED_RUNTIME_IMAGE.fetchFrom(p);
+ if (StandardBundlerParam.isRuntimeInstaller(params)) {
+ return PREDEFINED_RUNTIME_IMAGE.fetchFrom(params);
} else {
- return doAppBundle(p, outputDirectory, dependentTask);
+ return doAppBundle(params, outputDirectory, dependentTask);
}
}
- File doAppBundle(Map<String, ? super Object> p, File outputDirectory,
+ File doAppBundle(Map<String, ? super Object> params, File outputDirectory,
boolean dependentTask) throws PackagerException {
try {
- File rootDirectory = createRoot(p, outputDirectory, dependentTask,
- APP_NAME.fetchFrom(p) + ".app");
+ File rootDirectory = createRoot(params, outputDirectory,
+ dependentTask, APP_NAME.fetchFrom(params) + ".app");
AbstractAppImageBuilder appBuilder =
- new MacAppImageBuilder(p, outputDirectory.toPath());
- if (PREDEFINED_RUNTIME_IMAGE.fetchFrom(p) == null ) {
- JLinkBundlerHelper.execute(p, appBuilder);
+ new MacAppImageBuilder(params, outputDirectory.toPath());
+ if (PREDEFINED_RUNTIME_IMAGE.fetchFrom(params) == null ) {
+ JLinkBundlerHelper.execute(params, appBuilder);
} else {
- StandardBundlerParam.copyPredefinedRuntimeImage(p, appBuilder);
+ StandardBundlerParam.copyPredefinedRuntimeImage(
+ params, appBuilder);
}
return rootDirectory;
} catch (PackagerException pe) {
--- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppImageBuilder.java Thu Jun 06 19:31:11 2019 -0400
+++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppImageBuilder.java Thu Jun 06 19:51:17 2019 -0400
@@ -424,8 +424,9 @@
}
}
- public static String getLauncherCfgName(Map<String, ? super Object> p) {
- return "Contents/Java/" + APP_NAME.fetchFrom(p) + ".cfg";
+ public static String getLauncherCfgName(
+ Map<String, ? super Object> params) {
+ return "Contents/Java/" + APP_NAME.fetchFrom(params) + ".cfg";
}
private void copyClassPathEntries(Path javaDirectory) throws IOException {
--- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppStoreBundler.java Thu Jun 06 19:31:11 2019 -0400
+++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppStoreBundler.java Thu Jun 06 19:51:17 2019 -0400
@@ -118,10 +118,10 @@
(s, p) -> s);
//@Override
- public File bundle(Map<String, ? super Object> p,
+ public File bundle(Map<String, ? super Object> params,
File outdir) throws PackagerException {
Log.verbose(MessageFormat.format(I18N.getString(
- "message.building-bundle"), APP_NAME.fetchFrom(p)));
+ "message.building-bundle"), APP_NAME.fetchFrom(params)));
if (!outdir.isDirectory() && !outdir.mkdirs()) {
throw new PackagerException(
"error.cannot-create-output-dir",
@@ -135,45 +135,48 @@
// first, load in some overrides
// icns needs @2 versions, so load in the @2 default
- p.put(DEFAULT_ICNS_ICON.getID(), TEMPLATE_BUNDLE_ICON_HIDPI);
+ params.put(DEFAULT_ICNS_ICON.getID(), TEMPLATE_BUNDLE_ICON_HIDPI);
// now we create the app
- File appImageDir = APP_IMAGE_TEMP_ROOT.fetchFrom(p);
+ File appImageDir = APP_IMAGE_TEMP_ROOT.fetchFrom(params);
try {
appImageDir.mkdirs();
try {
- MacAppImageBuilder.addNewKeychain(p);
+ MacAppImageBuilder.addNewKeychain(params);
} catch (InterruptedException e) {
Log.error(e.getMessage());
}
// first, make sure we don't use the local signing key
- p.put(DEVELOPER_ID_APP_SIGNING_KEY.getID(), null);
- File appLocation = prepareAppBundle(p, false);
+ params.put(DEVELOPER_ID_APP_SIGNING_KEY.getID(), null);
+ File appLocation = prepareAppBundle(params, false);
- prepareEntitlements(p);
+ prepareEntitlements(params);
- String signingIdentity = MAC_APP_STORE_APP_SIGNING_KEY.fetchFrom(p);
- String identifierPrefix = BUNDLE_ID_SIGNING_PREFIX.fetchFrom(p);
- String entitlementsFile = getConfig_Entitlements(p).toString();
+ String signingIdentity =
+ MAC_APP_STORE_APP_SIGNING_KEY.fetchFrom(params);
+ String identifierPrefix =
+ BUNDLE_ID_SIGNING_PREFIX.fetchFrom(params);
+ String entitlementsFile =
+ getConfig_Entitlements(params).toString();
String inheritEntitlements =
- getConfig_Inherit_Entitlements(p).toString();
+ getConfig_Inherit_Entitlements(params).toString();
- MacAppImageBuilder.signAppBundle(p, appLocation.toPath(),
+ MacAppImageBuilder.signAppBundle(params, appLocation.toPath(),
signingIdentity, identifierPrefix,
entitlementsFile, inheritEntitlements);
- MacAppImageBuilder.restoreKeychainList(p);
+ MacAppImageBuilder.restoreKeychainList(params);
ProcessBuilder pb;
// create the final pkg file
- File finalPKG = new File(outdir, INSTALLER_NAME.fetchFrom(p)
- + INSTALLER_SUFFIX.fetchFrom(p)
+ File finalPKG = new File(outdir, INSTALLER_NAME.fetchFrom(params)
+ + INSTALLER_SUFFIX.fetchFrom(params)
+ ".pkg");
outdir.mkdirs();
String installIdentify =
- MAC_APP_STORE_PKG_SIGNING_KEY.fetchFrom(p);
+ MAC_APP_STORE_PKG_SIGNING_KEY.fetchFrom(params);
List<String> buildOptions = new ArrayList<>();
buildOptions.add("productbuild");
@@ -184,7 +187,7 @@
buildOptions.add(installIdentify);
buildOptions.add("--product");
buildOptions.add(appLocation + "/Contents/Info.plist");
- String keychainName = SIGNING_KEYCHAIN.fetchFrom(p);
+ String keychainName = SIGNING_KEYCHAIN.fetchFrom(params);
if (keychainName != null && !keychainName.isEmpty()) {
buildOptions.add("--keychain");
buildOptions.add(keychainName);
--- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacBaseInstallerBundler.java Thu Jun 06 19:31:11 2019 -0400
+++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacBaseInstallerBundler.java Thu Jun 06 19:51:17 2019 -0400
@@ -135,18 +135,20 @@
}
}
- protected File prepareAppBundle(Map<String, ? super Object> p,
+ protected File prepareAppBundle(Map<String, ? super Object> params,
boolean pkg) throws PackagerException {
- File predefinedImage = StandardBundlerParam.getPredefinedAppImage(p);
+ File predefinedImage =
+ StandardBundlerParam.getPredefinedAppImage(params);
if (predefinedImage != null) {
return predefinedImage;
}
- File appImageRoot = APP_IMAGE_TEMP_ROOT.fetchFrom(p);
+ File appImageRoot = APP_IMAGE_TEMP_ROOT.fetchFrom(params);
if (pkg) {
// create pkg in dmg
- return new MacPkgBundler().bundle(p, appImageRoot);
+ return new MacPkgBundler().bundle(params, appImageRoot);
} else {
- return APP_BUNDLER.fetchFrom(p).doBundle(p, appImageRoot, true);
+ return APP_BUNDLER.fetchFrom(params).doBundle(
+ params, appImageRoot, true);
}
}
--- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacDmgBundler.java Thu Jun 06 19:31:11 2019 -0400
+++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacDmgBundler.java Thu Jun 06 19:51:17 2019 -0400
@@ -91,8 +91,8 @@
private static final String hdiutil = "/usr/bin/hdiutil";
private void prepareDMGSetupScript(String volumeName,
- Map<String, ? super Object> p) throws IOException {
- File dmgSetup = getConfig_VolumeScript(p);
+ Map<String, ? super Object> params) throws IOException {
+ File dmgSetup = getConfig_VolumeScript(params);
Log.verbose(MessageFormat.format(
I18N.getString("message.preparing-dmg-setup"),
dmgSetup.getAbsolutePath()));
@@ -100,7 +100,7 @@
//prepare config for exe
Map<String, String> data = new HashMap<>();
data.put("DEPLOY_ACTUAL_VOLUME_NAME", volumeName);
- data.put("DEPLOY_APPLICATION_NAME", APP_NAME.fetchFrom(p));
+ data.put("DEPLOY_APPLICATION_NAME", APP_NAME.fetchFrom(params));
data.put("DEPLOY_INSTALL_LOCATION", "(path to desktop folder)");
data.put("DEPLOY_INSTALL_NAME", "Desktop");
@@ -108,8 +108,8 @@
try (Writer w = Files.newBufferedWriter(dmgSetup.toPath())) {
w.write(preprocessTextResource(dmgSetup.getName(),
I18N.getString("resource.dmg-setup-script"),
- DEFAULT_DMG_SETUP_SCRIPT, data, VERBOSE.fetchFrom(p),
- RESOURCE_DIR.fetchFrom(p)));
+ DEFAULT_DMG_SETUP_SCRIPT, data, VERBOSE.fetchFrom(params),
+ RESOURCE_DIR.fetchFrom(params)));
}
}
@@ -250,18 +250,19 @@
}
private File buildDMG(
- Map<String, ? super Object> p, File outdir)
+ Map<String, ? super Object> params, File outdir)
throws IOException {
- File imagesRoot = IMAGES_ROOT.fetchFrom(p);
+ File imagesRoot = IMAGES_ROOT.fetchFrom(params);
if (!imagesRoot.exists()) imagesRoot.mkdirs();
- File protoDMG = new File(imagesRoot, APP_NAME.fetchFrom(p) +"-tmp.dmg");
- File finalDMG = new File(outdir, INSTALLER_NAME.fetchFrom(p)
- + INSTALLER_SUFFIX.fetchFrom(p)
- + ".dmg");
+ File protoDMG = new File(imagesRoot,
+ APP_NAME.fetchFrom(params) +"-tmp.dmg");
+ File finalDMG = new File(outdir, INSTALLER_NAME.fetchFrom(params)
+ + INSTALLER_SUFFIX.fetchFrom(params) + ".dmg");
- File srcFolder = APP_IMAGE_TEMP_ROOT.fetchFrom(p);
- File predefinedImage = StandardBundlerParam.getPredefinedAppImage(p);
+ File srcFolder = APP_IMAGE_TEMP_ROOT.fetchFrom(params);
+ File predefinedImage =
+ StandardBundlerParam.getPredefinedAppImage(params);
if (predefinedImage != null) {
srcFolder = predefinedImage;
}
@@ -287,7 +288,7 @@
"create",
hdiUtilVerbosityFlag,
"-srcfolder", srcFolder.getAbsolutePath(),
- "-volname", APP_NAME.fetchFrom(p),
+ "-volname", APP_NAME.fetchFrom(params),
"-ov", protoDMG.getAbsolutePath(),
"-fs", "HFS+",
"-format", "UDRW");
@@ -302,16 +303,16 @@
"-mountroot", imagesRoot.getAbsolutePath());
IOUtils.exec(pb);
- File mountedRoot =
- new File(imagesRoot.getAbsolutePath(), APP_NAME.fetchFrom(p));
+ File mountedRoot = new File(imagesRoot.getAbsolutePath(),
+ APP_NAME.fetchFrom(params));
// volume icon
File volumeIconFile = new File(mountedRoot, ".VolumeIcon.icns");
- IOUtils.copyFile(getConfig_VolumeIcon(p),
+ IOUtils.copyFile(getConfig_VolumeIcon(params),
volumeIconFile);
pb = new ProcessBuilder("osascript",
- getConfig_VolumeScript(p).getAbsolutePath());
+ getConfig_VolumeScript(params).getAbsolutePath());
IOUtils.exec(pb);
// Indicate that we want a custom icon
@@ -368,7 +369,7 @@
IOUtils.exec(pb);
//add license if needed
- if (getConfig_LicenseFile(p).exists()) {
+ if (getConfig_LicenseFile(params).exists()) {
//hdiutil unflatten your_image_file.dmg
pb = new ProcessBuilder(
hdiutil,
@@ -383,7 +384,7 @@
"udifrez",
finalDMG.getAbsolutePath(),
"-xml",
- getConfig_LicenseFile(p).getAbsolutePath()
+ getConfig_LicenseFile(params).getAbsolutePath()
);
IOUtils.exec(pb);
@@ -402,7 +403,7 @@
Log.verbose(MessageFormat.format(I18N.getString(
"message.output-to-location"),
- APP_NAME.fetchFrom(p), finalDMG.getAbsolutePath()));
+ APP_NAME.fetchFrom(params), finalDMG.getAbsolutePath()));
return finalDMG;
}
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/AbstractImageBundler.java Thu Jun 06 19:31:11 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/AbstractImageBundler.java Thu Jun 06 19:51:17 2019 -0400
@@ -49,67 +49,16 @@
*/
public abstract class AbstractImageBundler extends AbstractBundler {
- private final static String JAVA_VERSION_SPEC =
- "java version \"((\\d+).(\\d+).(\\d+).(\\d+))(-(.*))?(\\+[^\"]*)?\"";
-
private static final ResourceBundle I18N = ResourceBundle.getBundle(
"jdk.jpackage.internal.resources.MainResources");
- public void imageBundleValidation(Map<String, ? super Object> p)
+ public void imageBundleValidation(Map<String, ? super Object> params)
throws ConfigException {
- StandardBundlerParam.validateMainClassInfoFromAppResources(p);
+ StandardBundlerParam.validateMainClassInfoFromAppResources(params);
}
- public static void extractFlagsFromVersion(
- Map<String, ? super Object> params, String versionOutput) {
- Pattern bitArchPattern = Pattern.compile("(\\d*)[- ]?[bB]it");
- Matcher matcher = bitArchPattern.matcher(versionOutput);
- if (matcher.find()) {
- params.put(".runtime.bit-arch", matcher.group(1));
- } else {
- // presume 32 bit on no match
- params.put(".runtime.bit-arch", "32");
- }
-
- Pattern oldVersionMatcher = Pattern.compile(
- "java version \"((\\d+.(\\d+).\\d+)(_(\\d+)))?(-(.*))?\"");
- matcher = oldVersionMatcher.matcher(versionOutput);
- if (matcher.find()) {
- params.put(".runtime.version", matcher.group(1));
- params.put(".runtime.version.release", matcher.group(2));
- params.put(".runtime.version.major", matcher.group(3));
- params.put(".runtime.version.update", matcher.group(5));
- params.put(".runtime.version.minor", matcher.group(5));
- params.put(".runtime.version.security", matcher.group(5));
- params.put(".runtime.version.patch", "0");
- params.put(".runtime.version.modifiers", matcher.group(7));
- } else {
- Pattern newVersionMatcher = Pattern.compile(JAVA_VERSION_SPEC);
- matcher = newVersionMatcher.matcher(versionOutput);
- if (matcher.find()) {
- params.put(".runtime.version", matcher.group(1));
- params.put(".runtime.version.release", matcher.group(1));
- params.put(".runtime.version.major", matcher.group(2));
- params.put(".runtime.version.update", matcher.group(3));
- params.put(".runtime.version.minor", matcher.group(3));
- params.put(".runtime.version.security", matcher.group(4));
- params.put(".runtime.version.patch", matcher.group(5));
- params.put(".runtime.version.modifiers", matcher.group(7));
- } else {
- params.put(".runtime.version", "");
- params.put(".runtime.version.release", "");
- params.put(".runtime.version.major", "");
- params.put(".runtime.version.update", "");
- params.put(".runtime.version.minor", "");
- params.put(".runtime.version.security", "");
- params.put(".runtime.version.patch", "");
- params.put(".runtime.version.modifiers", "");
- }
- }
- }
-
- protected File createRoot(Map<String, ? super Object> p,
+ protected File createRoot(Map<String, ? super Object> params,
File outputDirectory, boolean dependentTask, String name)
throws PackagerException {
if (!outputDirectory.isDirectory() && !outputDirectory.mkdirs()) {
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/BundleParams.java Thu Jun 06 19:31:11 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/BundleParams.java Thu Jun 06 19:51:17 2019 -0400
@@ -109,8 +109,8 @@
this.params = new HashMap<>(params);
}
- public void addAllBundleParams(Map<String, ? super Object> p) {
- params.putAll(p);
+ public void addAllBundleParams(Map<String, ? super Object> params) {
+ this.params.putAll(params);
}
public <T> T fetchParam(BundlerParamInfo<T> paramInfo) {
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/DeployParams.java Thu Jun 06 19:31:11 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/DeployParams.java Thu Jun 06 19:51:17 2019 -0400
@@ -52,31 +52,20 @@
final List<RelativeFileSet> resources = new ArrayList<>();
- String id;
- String vendor;
- String email;
- String description;
+ BundlerType bundleType = BundlerType.NONE;
+ String targetFormat = null; //means any
String licenseType;
String copyright;
String version;
- Boolean systemWide;
- Boolean serviceHint;
- Boolean signBundle;
- Boolean installdirChooser;
-
String applicationClass;
- List<Param> params;
-
// Java modules support
String addModules = null;
String limitModules = null;
- String modulePath = null;
String module = null;
File outdir = null;
- String appId = null;
// list of jvm args
// (in theory string can contain spaces and need to be escaped
@@ -97,18 +86,6 @@
this.version = version;
}
- void setSystemWide(Boolean systemWide) {
- this.systemWide = systemWide;
- }
-
- void setInstalldirChooser(Boolean installdirChooser) {
- this.installdirChooser = installdirChooser;
- }
-
- void setSignBundle(Boolean signBundle) {
- this.signBundle = signBundle;
- }
-
void addJvmArg(String v) {
jvmargs.add(v);
}
@@ -131,38 +108,10 @@
}
}
- String getModulePath() {
- return this.modulePath;
- }
-
- void setModulePath(String value) {
- this.modulePath = value;
- }
-
void setModule(String value) {
this.module = value;
}
- void setDescription(String description) {
- this.description = description;
- }
-
- public void setAppId(String id) {
- appId = id;
- }
-
- void setParams(List<Param> params) {
- this.params = params;
- }
-
- void setVendor(String vendor) {
- this.vendor = vendor;
- }
-
- void setEmail(String email) {
- this.email = email;
- }
-
void setApplicationClass(String applicationClass) {
this.applicationClass = applicationClass;
}
@@ -237,13 +186,6 @@
StandardBundlerParam.CLASSPATH.getID(), classpath);
}
- private static File createFile(final File baseDir, final String path) {
- final File testFile = new File(path);
- return testFile.isAbsolute() ?
- testFile : new File(baseDir == null ?
- null : baseDir.getAbsolutePath(), path);
- }
-
static void validateName(String s, boolean forApp)
throws PackagerException {
@@ -400,9 +342,6 @@
return result;
}
- BundlerType bundleType = BundlerType.NONE;
- String targetFormat = null; //means any
-
void setBundleType(BundlerType type) {
bundleType = type;
}
@@ -419,20 +358,7 @@
return targetFormat;
}
- private String getArch() {
- String arch = System.getProperty("os.arch").toLowerCase();
-
- if ("x86".equals(arch) || "i386".equals(arch) || "i486".equals(arch)
- || "i586".equals(arch) || "i686".equals(arch)) {
- arch = "x86";
- } else if ("x86_64".equals(arch) || "amd64".equals("arch")) {
- arch = "x86_64";
- }
-
- return arch;
- }
-
- static final Set<String> multi_args = new TreeSet<>(Arrays.asList(
+ private static final Set<String> multi_args = new TreeSet<>(Arrays.asList(
StandardBundlerParam.JAVA_OPTIONS.getID(),
StandardBundlerParam.ARGUMENTS.getID(),
StandardBundlerParam.MODULE_PATH.getID(),
@@ -479,11 +405,7 @@
bundleParams.setAppVersion(version);
bundleParams.setType(bundleType);
bundleParams.setBundleFormat(targetFormat);
- bundleParams.setVendor(vendor);
- bundleParams.setEmail(email);
- bundleParams.setInstalldirChooser(installdirChooser);
bundleParams.setCopyright(copyright);
- bundleParams.setDescription(description);
bundleParams.setJvmargs(jvmargs);
@@ -495,21 +417,10 @@
bundleParams.setLimitModules(limitModules);
}
- if (modulePath != null && !modulePath.isEmpty()) {
- bundleParams.setModulePath(modulePath);
- }
-
if (module != null && !module.isEmpty()) {
bundleParams.setMainModule(module);
}
- Map<String, String> paramsMap = new TreeMap<>();
- if (params != null) {
- for (Param p : params) {
- paramsMap.put(p.name, p.value);
- }
- }
-
Map<String, String> unescapedHtmlParams = new TreeMap<>();
Map<String, String> escapedHtmlParams = new TreeMap<>();
@@ -531,24 +442,6 @@
return this.bundlerArguments;
}
- void putUnlessNull(String param, Object value) {
- if (value != null) {
- bundlerArguments.put(param, value);
- }
- }
-
- void putUnlessNullOrEmpty(String param, Map<?, ?> value) {
- if (value != null && !value.isEmpty()) {
- bundlerArguments.put(param, value);
- }
- }
-
- void putUnlessNullOrEmpty(String param, Collection<?> value) {
- if (value != null && !value.isEmpty()) {
- bundlerArguments.put(param, value);
- }
- }
-
@Override
public String toString() {
return "DeployParams {" + "output: " + outdir
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Param.java Thu Jun 06 19:31:11 2019 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 2011, 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
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package jdk.jpackage.internal;
-
-class Param {
- String name;
- String value;
-
- void setName(String name) {
- this.name = name;
- }
-
- void setValue(String value) {
- this.value = value;
- }
-
-}
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/RelativeFileSet.java Thu Jun 06 19:31:11 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/RelativeFileSet.java Thu Jun 06 19:51:17 2019 -0400
@@ -40,11 +40,6 @@
private File basedir;
private Set<String> files = new LinkedHashSet<>();
- RelativeFileSet(RelativeFileSet copy) {
- basedir = copy.basedir;
- files = new LinkedHashSet<>(copy.files);
- }
-
RelativeFileSet(File base, Collection<File> files) {
basedir = base;
String baseAbsolute = basedir.getAbsolutePath();
@@ -61,42 +56,10 @@
}
}
- void upshift() {
- String root = basedir.getName();
- basedir = basedir.getParentFile();
- Set<String> newFiles = new LinkedHashSet<>();
- for (String s : files) {
- newFiles.add(root + File.separator + s);
- }
- files = newFiles;
- }
-
RelativeFileSet(File base, Set<File> files) {
this(base, (Collection<File>) files);
}
- boolean contains(String[] requiredFiles) {
- boolean result = true;
-
- for(String fname: requiredFiles) {
- if (!files.contains(fname)) {
- Log.debug(" RelativeFileSet does not contain [" + fname + "]");
- result = false;
- }
- }
-
- return result;
- }
-
- boolean contains(String requiredFile) {
- if (files.contains(requiredFile)) {
- return true;
- } else {
- Log.debug("RelativeFileSet does not contain [" +requiredFile+ "]");
- return false;
- }
- }
-
File getBaseDirectory() {
return basedir;
}
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/StandardBundlerParam.java Thu Jun 06 19:31:11 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/StandardBundlerParam.java Thu Jun 06 19:51:17 2019 -0400
@@ -472,21 +472,21 @@
(s, p) -> new LinkedHashSet<>(Arrays.asList(s.split(",")))
);
- static boolean isRuntimeInstaller(Map<String, ? super Object> p) {
- if (p.containsKey(MODULE.getID()) ||
- p.containsKey(MAIN_JAR.getID()) ||
- p.containsKey(PREDEFINED_APP_IMAGE.getID())) {
+ static boolean isRuntimeInstaller(Map<String, ? super Object> params) {
+ if (params.containsKey(MODULE.getID()) ||
+ params.containsKey(MAIN_JAR.getID()) ||
+ params.containsKey(PREDEFINED_APP_IMAGE.getID())) {
return false; // we are building or are given an application
}
// runtime installer requires --runtime-image, if this is false
// here then we should have thrown error validating args.
- return p.containsKey(PREDEFINED_RUNTIME_IMAGE.getID());
+ return params.containsKey(PREDEFINED_RUNTIME_IMAGE.getID());
}
- static File getPredefinedAppImage(Map<String, ? super Object> p) {
+ static File getPredefinedAppImage(Map<String, ? super Object> params) {
File applicationImage = null;
- if (PREDEFINED_APP_IMAGE.fetchFrom(p) != null) {
- applicationImage = PREDEFINED_APP_IMAGE.fetchFrom(p);
+ if (PREDEFINED_APP_IMAGE.fetchFrom(params) != null) {
+ applicationImage = PREDEFINED_APP_IMAGE.fetchFrom(params);
Log.debug("Using App Image from " + applicationImage);
if (!applicationImage.exists()) {
throw new RuntimeException(
@@ -500,10 +500,10 @@
}
static void copyPredefinedRuntimeImage(
- Map<String, ? super Object> p,
+ Map<String, ? super Object> params,
AbstractAppImageBuilder appBuilder)
throws IOException , ConfigException {
- File image = PREDEFINED_RUNTIME_IMAGE.fetchFrom(p);
+ File image = PREDEFINED_RUNTIME_IMAGE.fetchFrom(params);
if (!image.exists()) {
throw new ConfigException(
MessageFormat.format(I18N.getString(
@@ -520,7 +520,7 @@
// if module-path given - copy modules to appDir/mods
List<Path> modulePath =
- StandardBundlerParam.MODULE_PATH.fetchFrom(p);
+ StandardBundlerParam.MODULE_PATH.fetchFrom(params);
List<Path> defaultModulePath = getDefaultModulePath();
Path dest = appBuilder.getAppModsDir();
--- a/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WinExeBundler.java Thu Jun 06 19:31:11 2019 -0400
+++ b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WinExeBundler.java Thu Jun 06 19:51:17 2019 -0400
@@ -169,9 +169,9 @@
}
@Override
- public File execute(Map<String, ? super Object> p,
+ public File execute(Map<String, ? super Object> params,
File outputParentDir) throws PackagerException {
- return bundle(p, outputParentDir);
+ return bundle(params, outputParentDir);
}
@Override
@@ -203,16 +203,16 @@
}
@Override
- public boolean validate(Map<String, ? super Object> p)
+ public boolean validate(Map<String, ? super Object> params)
throws UnsupportedPlatformException, ConfigException {
try {
- if (p == null) throw new ConfigException(
+ if (params == null) throw new ConfigException(
getString("error.parameters-null"),
getString("error.parameters-null.advice"));
// run basic validation to ensure requirements are met
// we are not interested in return code, only possible exception
- APP_BUNDLER.fetchFrom(p).validate(p);
+ APP_BUNDLER.fetchFrom(params).validate(params);
// make sure some key values don't have newlines
for (BundlerParamInfo<String> pi : Arrays.asList(
@@ -223,7 +223,7 @@
VENDOR,
VERSION)
) {
- String v = pi.fetchFrom(p);
+ String v = pi.fetchFrom(params);
if (v.contains("\n") | v.contains("\r")) {
throw new ConfigException("Parmeter '" + pi.getID() +
"' cannot contain a newline.",
@@ -234,14 +234,14 @@
// exe bundlers trim the copyright to 100 characters,
// tell them this will happen
- if (COPYRIGHT.fetchFrom(p).length() > 100) {
+ if (COPYRIGHT.fetchFrom(params).length() > 100) {
throw new ConfigException(
getString("error.copyright-is-too-long"),
getString("error.copyright-is-too-long.advice"));
}
String innoVersion = findToolVersion(
- TOOL_INNO_SETUP_COMPILER_EXECUTABLE.fetchFrom(p));
+ TOOL_INNO_SETUP_COMPILER_EXECUTABLE.fetchFrom(params));
//Inno Setup 5+ is required
String minVersion = "5.0";
@@ -259,7 +259,7 @@
// only one mime type per association, at least one file extension
List<Map<String, ? super Object>> associations =
- FILE_ASSOCIATIONS.fetchFrom(p);
+ FILE_ASSOCIATIONS.fetchFrom(params);
if (associations != null) {
for (int i = 0; i < associations.size(); i++) {
Map<String, ? super Object> assoc = associations.get(i);
@@ -284,40 +284,41 @@
}
}
- private boolean prepareProto(Map<String, ? super Object> p)
+ private boolean prepareProto(Map<String, ? super Object> params)
throws PackagerException, IOException {
- File appImage = StandardBundlerParam.getPredefinedAppImage(p);
+ File appImage = StandardBundlerParam.getPredefinedAppImage(params);
File appDir = null;
// we either have an application image or need to build one
if (appImage != null) {
- appDir = new File(
- EXE_IMAGE_DIR.fetchFrom(p), APP_NAME.fetchFrom(p));
+ appDir = new File(EXE_IMAGE_DIR.fetchFrom(params),
+ APP_NAME.fetchFrom(params));
// copy everything from appImage dir into appDir/name
IOUtils.copyRecursive(appImage.toPath(), appDir.toPath());
} else {
- appDir = APP_BUNDLER.fetchFrom(p).doBundle(p,
- EXE_IMAGE_DIR.fetchFrom(p), true);
+ appDir = APP_BUNDLER.fetchFrom(params).doBundle(params,
+ EXE_IMAGE_DIR.fetchFrom(params), true);
}
if (appDir == null) {
return false;
}
- p.put(WIN_APP_IMAGE.getID(), appDir);
+ params.put(WIN_APP_IMAGE.getID(), appDir);
- String licenseFile = LICENSE_FILE.fetchFrom(p);
+ String licenseFile = LICENSE_FILE.fetchFrom(params);
if (licenseFile != null) {
// need to copy license file to the working directory and convert to rtf if needed
File lfile = new File(licenseFile);
- File destFile = new File(CONFIG_ROOT.fetchFrom(p), lfile.getName());
+ File destFile = new File(CONFIG_ROOT.fetchFrom(params),
+ lfile.getName());
IOUtils.copyFile(lfile, destFile);
ensureByMutationFileIsRTF(destFile);
}
// copy file association icons
List<Map<String, ? super Object>> fileAssociations =
- FILE_ASSOCIATIONS.fetchFrom(p);
+ FILE_ASSOCIATIONS.fetchFrom(params);
for (Map<String, ? super Object> fa : fileAssociations) {
File icon = FA_ICON.fetchFrom(fa); // TODO FA_ICON_ICO
@@ -339,7 +340,7 @@
return true;
}
- public File bundle(Map<String, ? super Object> p, File outdir)
+ public File bundle(Map<String, ? super Object> params, File outdir)
throws PackagerException {
if (!outdir.isDirectory() && !outdir.mkdirs()) {
throw new PackagerException("error.cannot-create-output-dir",
@@ -352,7 +353,7 @@
String tempDirectory = WindowsDefender.getUserTempDirectory();
if (Arguments.CLIOptions.context().userProvidedBuildRoot) {
- tempDirectory = TEMP_ROOT.fetchFrom(p).getAbsolutePath();
+ tempDirectory = TEMP_ROOT.fetchFrom(params).getAbsolutePath();
}
if (WindowsDefender.isThereAPotentialWindowsDefenderIssue(
tempDirectory)) {
@@ -362,7 +363,7 @@
}
// validate we have valid tools before continuing
- String iscc = TOOL_INNO_SETUP_COMPILER_EXECUTABLE.fetchFrom(p);
+ String iscc = TOOL_INNO_SETUP_COMPILER_EXECUTABLE.fetchFrom(params);
if (iscc == null || !new File(iscc).isFile()) {
Log.verbose(getString("error.iscc-not-found"));
Log.verbose(MessageFormat.format(
@@ -370,27 +371,27 @@
throw new PackagerException("error.iscc-not-found");
}
- File imageDir = EXE_IMAGE_DIR.fetchFrom(p);
+ File imageDir = EXE_IMAGE_DIR.fetchFrom(params);
try {
imageDir.mkdirs();
- boolean menuShortcut = MENU_HINT.fetchFrom(p);
- boolean desktopShortcut = SHORTCUT_HINT.fetchFrom(p);
+ boolean menuShortcut = MENU_HINT.fetchFrom(params);
+ boolean desktopShortcut = SHORTCUT_HINT.fetchFrom(params);
if (!menuShortcut && !desktopShortcut) {
// both can not be false - user will not find the app
Log.verbose(getString("message.one-shortcut-required"));
- p.put(MENU_HINT.getID(), true);
+ params.put(MENU_HINT.getID(), true);
}
- if (prepareProto(p) && prepareProjectConfig(p)) {
- File configScript = getConfig_Script(p);
+ if (prepareProto(params) && prepareProjectConfig(params)) {
+ File configScript = getConfig_Script(params);
if (configScript.exists()) {
Log.verbose(MessageFormat.format(
getString("message.running-wsh-script"),
configScript.getAbsolutePath()));
IOUtils.run("wscript", configScript);
}
- return buildEXE(p, outdir);
+ return buildEXE(params, outdir);
}
return null;
} catch (IOException ex) {
@@ -400,13 +401,13 @@
}
// name of post-image script
- private File getConfig_Script(Map<String, ? super Object> p) {
- return new File(EXE_IMAGE_DIR.fetchFrom(p),
- APP_NAME.fetchFrom(p) + "-post-image.wsf");
+ private File getConfig_Script(Map<String, ? super Object> params) {
+ return new File(EXE_IMAGE_DIR.fetchFrom(params),
+ APP_NAME.fetchFrom(params) + "-post-image.wsf");
}
- private String getAppIdentifier(Map<String, ? super Object> p) {
- String nm = UPGRADE_UUID.fetchFrom(p).toString();
+ private String getAppIdentifier(Map<String, ? super Object> params) {
+ String nm = UPGRADE_UUID.fetchFrom(params).toString();
// limitation of innosetup
if (nm.length() > 126) {
@@ -417,11 +418,12 @@
return nm;
}
- private String getLicenseFile(Map<String, ? super Object> p) {
- String licenseFile = LICENSE_FILE.fetchFrom(p);
+ private String getLicenseFile(Map<String, ? super Object> params) {
+ String licenseFile = LICENSE_FILE.fetchFrom(params);
if (licenseFile != null) {
File lfile = new File(licenseFile);
- File destFile = new File(CONFIG_ROOT.fetchFrom(p), lfile.getName());
+ File destFile = new File(CONFIG_ROOT.fetchFrom(params),
+ lfile.getName());
String filePath = destFile.getAbsolutePath();
if (filePath.contains(" ")) {
return "\"" + filePath + "\"";
@@ -435,8 +437,8 @@
void validateValueAndPut(Map<String, String> data, String key,
BundlerParamInfo<String> param,
- Map<String, ? super Object> p) throws IOException {
- String value = param.fetchFrom(p);
+ Map<String, ? super Object> params) throws IOException {
+ String value = param.fetchFrom(params);
if (value.contains("\r") || value.contains("\n")) {
throw new IOException("Configuration Parameter " +
param.getID() + " cannot contain multiple lines of text");
@@ -455,38 +457,38 @@
return value;
}
- boolean prepareMainProjectFile(Map<String, ? super Object> p)
+ boolean prepareMainProjectFile(Map<String, ? super Object> params)
throws IOException {
Map<String, String> data = new HashMap<>();
data.put("PRODUCT_APP_IDENTIFIER",
- innosetupEscape(getAppIdentifier(p)));
+ innosetupEscape(getAppIdentifier(params)));
- validateValueAndPut(data, "INSTALL_DIR", WINDOWS_INSTALL_DIR, p);
- validateValueAndPut(data, "INSTALLER_NAME", APP_NAME, p);
- validateValueAndPut(data, "APPLICATION_VENDOR", VENDOR, p);
- validateValueAndPut(data, "APPLICATION_VERSION", VERSION, p);
+ validateValueAndPut(data, "INSTALL_DIR", WINDOWS_INSTALL_DIR, params);
+ validateValueAndPut(data, "INSTALLER_NAME", APP_NAME, params);
+ validateValueAndPut(data, "APPLICATION_VENDOR", VENDOR, params);
+ validateValueAndPut(data, "APPLICATION_VERSION", VERSION, params);
validateValueAndPut(data, "INSTALLER_FILE_NAME",
- INSTALLER_FILE_NAME, p);
+ INSTALLER_FILE_NAME, params);
data.put("LAUNCHER_NAME",
- innosetupEscape(WinAppBundler.getAppName(p)));
+ innosetupEscape(WinAppBundler.getAppName(params)));
data.put("APPLICATION_LAUNCHER_FILENAME",
- innosetupEscape(WinAppBundler.getLauncherName(p)));
+ innosetupEscape(WinAppBundler.getLauncherName(params)));
data.put("APPLICATION_DESKTOP_SHORTCUT",
- SHORTCUT_HINT.fetchFrom(p) ? "returnTrue" : "returnFalse");
+ SHORTCUT_HINT.fetchFrom(params) ? "returnTrue" : "returnFalse");
data.put("APPLICATION_MENU_SHORTCUT",
- MENU_HINT.fetchFrom(p) ? "returnTrue" : "returnFalse");
- validateValueAndPut(data, "APPLICATION_GROUP", MENU_GROUP, p);
- validateValueAndPut(data, "APPLICATION_COPYRIGHT", COPYRIGHT, p);
+ MENU_HINT.fetchFrom(params) ? "returnTrue" : "returnFalse");
+ validateValueAndPut(data, "APPLICATION_GROUP", MENU_GROUP, params);
+ validateValueAndPut(data, "APPLICATION_COPYRIGHT", COPYRIGHT, params);
data.put("APPLICATION_LICENSE_FILE",
- innosetupEscape(getLicenseFile(p)));
+ innosetupEscape(getLicenseFile(params)));
data.put("DISABLE_DIR_PAGE",
- INSTALLDIR_CHOOSER.fetchFrom(p) ? "No" : "Yes");
+ INSTALLDIR_CHOOSER.fetchFrom(params) ? "No" : "Yes");
- Boolean isSystemWide = EXE_SYSTEM_WIDE.fetchFrom(p);
+ Boolean isSystemWide = EXE_SYSTEM_WIDE.fetchFrom(params);
if (isSystemWide) {
data.put("APPLICATION_INSTALL_ROOT", "{pf}");
@@ -498,10 +500,10 @@
data.put("ARCHITECTURE_BIT_MODE", "x64");
- validateValueAndPut(data, "RUN_FILENAME", APP_NAME, p);
+ validateValueAndPut(data, "RUN_FILENAME", APP_NAME, params);
validateValueAndPut(data, "APPLICATION_DESCRIPTION",
- DESCRIPTION, p);
+ DESCRIPTION, params);
data.put("APPLICATION_SERVICE", "returnFalse");
data.put("APPLICATION_NOT_SERVICE", "returnFalse");
@@ -510,15 +512,15 @@
data.put("STOP_ON_UNINSTALL", "");
data.put("RUN_AT_STARTUP", "");
- String imagePathString =
- WIN_APP_IMAGE.fetchFrom(p).toPath().toAbsolutePath().toString();
+ String imagePathString = WIN_APP_IMAGE
+ .fetchFrom(params).toPath().toAbsolutePath().toString();
data.put("APPLICATION_IMAGE", innosetupEscape(imagePathString));
Log.verbose("setting APPLICATION_IMAGE to " +
innosetupEscape(imagePathString) + " for InnoSetup");
StringBuilder addLaunchersCfg = new StringBuilder();
for (Map<String, ? super Object>
- launcher : ADD_LAUNCHERS.fetchFrom(p)) {
+ launcher : ADD_LAUNCHERS.fetchFrom(params)) {
String application_name = APP_NAME.fetchFrom(launcher);
if (MENU_HINT.fetchFrom(launcher)) {
// Name: "{group}\APPLICATION_NAME";
@@ -548,9 +550,9 @@
data.put("ADD_LAUNCHERS", addLaunchersCfg.toString());
StringBuilder registryEntries = new StringBuilder();
- String regName = APP_REGISTRY_NAME.fetchFrom(p);
+ String regName = APP_REGISTRY_NAME.fetchFrom(params);
List<Map<String, ? super Object>> fetchFrom =
- FILE_ASSOCIATIONS.fetchFrom(p);
+ FILE_ASSOCIATIONS.fetchFrom(params);
for (int i = 0; i < fetchFrom.size(); i++) {
Map<String, ? super Object> fileAssociation = fetchFrom.get(i);
String description = FA_DESCRIPTION.fetchFrom(fileAssociation);
@@ -680,7 +682,7 @@
.append(entryName)
.append("\\shell\\open\\command\"; ValueType: " +
"string; ValueName: \"\"; ValueData: \"\"\"{app}\\")
- .append(APP_NAME.fetchFrom(p))
+ .append(APP_NAME.fetchFrom(params))
.append("\"\" \"\"%1\"\"\"\r\n");
} else {
registryEntries.append(
@@ -688,7 +690,7 @@
.append(entryName)
.append("\\shell\\open\\command\"; ValueType: " +
"string; ValueName: \"\"; ValueData: \"\"\"{app}\\")
- .append(APP_NAME.fetchFrom(p))
+ .append(APP_NAME.fetchFrom(params))
.append("\"\" \"\"%1\"\"\"\r\n");
}
}
@@ -700,17 +702,17 @@
data.put("FILE_ASSOCIATIONS", "");
}
- String iss = StandardBundlerParam.isRuntimeInstaller(p) ?
+ String iss = StandardBundlerParam.isRuntimeInstaller(params) ?
DEFAULT_JRE_EXE_TEMPLATE : DEFAULT_EXE_PROJECT_TEMPLATE;
try (Writer w = Files.newBufferedWriter(
- getConfig_ExeProjectFile(p).toPath())) {
+ getConfig_ExeProjectFile(params).toPath())) {
String content = preprocessTextResource(
- getConfig_ExeProjectFile(p).getName(),
+ getConfig_ExeProjectFile(params).getName(),
getString("resource.inno-setup-project-file"),
- iss, data, VERBOSE.fetchFrom(p),
- RESOURCE_DIR.fetchFrom(p));
+ iss, data, VERBOSE.fetchFrom(params),
+ RESOURCE_DIR.fetchFrom(params));
w.write(content);
}
return true;
@@ -729,41 +731,41 @@
private final static String DEFAULT_INNO_SETUP_ICON =
"icon_inno_setup.bmp";
- private boolean prepareProjectConfig(Map<String, ? super Object> p)
+ private boolean prepareProjectConfig(Map<String, ? super Object> params)
throws IOException {
- prepareMainProjectFile(p);
+ prepareMainProjectFile(params);
// prepare installer icon
- File iconTarget = getConfig_SmallInnoSetupIcon(p);
+ File iconTarget = getConfig_SmallInnoSetupIcon(params);
fetchResource(iconTarget.getName(),
getString("resource.setup-icon"),
DEFAULT_INNO_SETUP_ICON,
iconTarget,
- VERBOSE.fetchFrom(p),
- RESOURCE_DIR.fetchFrom(p));
+ VERBOSE.fetchFrom(params),
+ RESOURCE_DIR.fetchFrom(params));
- fetchResource(getConfig_Script(p).getName(),
+ fetchResource(getConfig_Script(params).getName(),
getString("resource.post-install-script"),
(String) null,
- getConfig_Script(p),
- VERBOSE.fetchFrom(p),
- RESOURCE_DIR.fetchFrom(p));
+ getConfig_Script(params),
+ VERBOSE.fetchFrom(params),
+ RESOURCE_DIR.fetchFrom(params));
return true;
}
private File getConfig_SmallInnoSetupIcon(
- Map<String, ? super Object> p) {
- return new File(EXE_IMAGE_DIR.fetchFrom(p),
- APP_NAME.fetchFrom(p) + "-setup-icon.bmp");
+ Map<String, ? super Object> params) {
+ return new File(EXE_IMAGE_DIR.fetchFrom(params),
+ APP_NAME.fetchFrom(params) + "-setup-icon.bmp");
}
- private File getConfig_ExeProjectFile(Map<String, ? super Object> p) {
- return new File(EXE_IMAGE_DIR.fetchFrom(p),
- APP_NAME.fetchFrom(p) + ".iss");
+ private File getConfig_ExeProjectFile(Map<String, ? super Object> params) {
+ return new File(EXE_IMAGE_DIR.fetchFrom(params),
+ APP_NAME.fetchFrom(params) + ".iss");
}
- private File buildEXE(Map<String, ? super Object> p, File outdir)
+ private File buildEXE(Map<String, ? super Object> params, File outdir)
throws IOException {
Log.verbose(MessageFormat.format(
getString("message.outputting-to-location"),
@@ -773,11 +775,11 @@
// run Inno Setup
ProcessBuilder pb = new ProcessBuilder(
- TOOL_INNO_SETUP_COMPILER_EXECUTABLE.fetchFrom(p),
+ TOOL_INNO_SETUP_COMPILER_EXECUTABLE.fetchFrom(params),
"/q", // turn off inno setup output
"/o"+outdir.getAbsolutePath(),
- getConfig_ExeProjectFile(p).getAbsolutePath());
- pb = pb.directory(EXE_IMAGE_DIR.fetchFrom(p));
+ getConfig_ExeProjectFile(params).getAbsolutePath());
+ pb = pb.directory(EXE_IMAGE_DIR.fetchFrom(params));
IOUtils.exec(pb);
Log.verbose(MessageFormat.format(
--- a/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WinMsiBundler.java Thu Jun 06 19:31:11 2019 -0400
+++ b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WinMsiBundler.java Thu Jun 06 19:51:17 2019 -0400
@@ -244,21 +244,21 @@
}
@Override
- public boolean validate(Map<String, ? super Object> p)
+ public boolean validate(Map<String, ? super Object> params)
throws UnsupportedPlatformException, ConfigException {
try {
- if (p == null) throw new ConfigException(
+ if (params == null) throw new ConfigException(
I18N.getString("error.parameters-null"),
I18N.getString("error.parameters-null.advice"));
// run basic validation to ensure requirements are met
// we are not interested in return code, only possible exception
- APP_BUNDLER.fetchFrom(p).validate(p);
+ APP_BUNDLER.fetchFrom(params).validate(params);
String candleVersion =
- findToolVersion(TOOL_CANDLE_EXECUTABLE.fetchFrom(p));
+ findToolVersion(TOOL_CANDLE_EXECUTABLE.fetchFrom(params));
String lightVersion =
- findToolVersion(TOOL_LIGHT_EXECUTABLE.fetchFrom(p));
+ findToolVersion(TOOL_LIGHT_EXECUTABLE.fetchFrom(params));
// WiX 3.0+ is required
String minVersion = "3.0";
@@ -285,12 +285,12 @@
if (!VersionExtractor.isLessThan(lightVersion, "3.6")) {
Log.verbose(I18N.getString("message.use-wix36-features"));
- p.put(CAN_USE_WIX36.getID(), Boolean.TRUE);
+ params.put(CAN_USE_WIX36.getID(), Boolean.TRUE);
}
/********* validate bundle parameters *************/
- String version = PRODUCT_VERSION.fetchFrom(p);
+ String version = PRODUCT_VERSION.fetchFrom(params);
if (!isVersionStringValid(version)) {
throw new ConfigException(
MessageFormat.format(I18N.getString(
@@ -302,7 +302,7 @@
// only one mime type per association, at least one file extension
List<Map<String, ? super Object>> associations =
- FILE_ASSOCIATIONS.fetchFrom(p);
+ FILE_ASSOCIATIONS.fetchFrom(params);
if (associations != null) {
for (int i = 0; i < associations.size(); i++) {
Map<String, ? super Object> assoc = associations.get(i);
@@ -378,36 +378,37 @@
return true;
}
- private boolean prepareProto(Map<String, ? super Object> p)
+ private boolean prepareProto(Map<String, ? super Object> params)
throws PackagerException, IOException {
- File appImage = StandardBundlerParam.getPredefinedAppImage(p);
+ File appImage = StandardBundlerParam.getPredefinedAppImage(params);
File appDir = null;
// we either have an application image or need to build one
if (appImage != null) {
- appDir = new File(
- MSI_IMAGE_DIR.fetchFrom(p), APP_NAME.fetchFrom(p));
+ appDir = new File(MSI_IMAGE_DIR.fetchFrom(params),
+ APP_NAME.fetchFrom(params));
// copy everything from appImage dir into appDir/name
IOUtils.copyRecursive(appImage.toPath(), appDir.toPath());
} else {
- appDir = APP_BUNDLER.fetchFrom(p).doBundle(p,
- MSI_IMAGE_DIR.fetchFrom(p), true);
+ appDir = APP_BUNDLER.fetchFrom(params).doBundle(params,
+ MSI_IMAGE_DIR.fetchFrom(params), true);
}
- p.put(WIN_APP_IMAGE.getID(), appDir);
+ params.put(WIN_APP_IMAGE.getID(), appDir);
- String licenseFile = LICENSE_FILE.fetchFrom(p);
+ String licenseFile = LICENSE_FILE.fetchFrom(params);
if (licenseFile != null) {
// need to copy license file to the working directory and convert to rtf if needed
File lfile = new File(licenseFile);
- File destFile = new File(CONFIG_ROOT.fetchFrom(p), lfile.getName());
+ File destFile = new File(CONFIG_ROOT.fetchFrom(params),
+ lfile.getName());
IOUtils.copyFile(lfile, destFile);
ensureByMutationFileIsRTF(destFile);
}
// copy file association icons
List<Map<String, ? super Object>> fileAssociations =
- FILE_ASSOCIATIONS.fetchFrom(p);
+ FILE_ASSOCIATIONS.fetchFrom(params);
for (Map<String, ? super Object> fa : fileAssociations) {
File icon = FA_ICON.fetchFrom(fa); // TODO FA_ICON_ICO
if (icon == null) {
@@ -428,7 +429,7 @@
return appDir != null;
}
- public File bundle(Map<String, ? super Object> p, File outdir)
+ public File bundle(Map<String, ? super Object> params, File outdir)
throws PackagerException {
if (!outdir.isDirectory() && !outdir.mkdirs()) {
throw new PackagerException("error.cannot-create-output-dir",
@@ -440,8 +441,8 @@
}
// validate we have valid tools before continuing
- String light = TOOL_LIGHT_EXECUTABLE.fetchFrom(p);
- String candle = TOOL_CANDLE_EXECUTABLE.fetchFrom(p);
+ String light = TOOL_LIGHT_EXECUTABLE.fetchFrom(params);
+ String candle = TOOL_CANDLE_EXECUTABLE.fetchFrom(params);
if (light == null || !new File(light).isFile() ||
candle == null || !new File(candle).isFile()) {
Log.verbose(MessageFormat.format(
@@ -451,21 +452,21 @@
throw new PackagerException("error.no-wix-tools");
}
- File imageDir = MSI_IMAGE_DIR.fetchFrom(p);
+ File imageDir = MSI_IMAGE_DIR.fetchFrom(params);
try {
imageDir.mkdirs();
- boolean menuShortcut = MENU_HINT.fetchFrom(p);
- boolean desktopShortcut = SHORTCUT_HINT.fetchFrom(p);
+ boolean menuShortcut = MENU_HINT.fetchFrom(params);
+ boolean desktopShortcut = SHORTCUT_HINT.fetchFrom(params);
if (!menuShortcut && !desktopShortcut) {
// both can not be false - user will not find the app
Log.verbose(I18N.getString("message.one-shortcut-required"));
- p.put(MENU_HINT.getID(), true);
+ params.put(MENU_HINT.getID(), true);
}
- if (prepareProto(p) && prepareWiXConfig(p)
- && prepareBasicProjectConfig(p)) {
- File configScriptSrc = getConfig_Script(p);
+ if (prepareProto(params) && prepareWiXConfig(params)
+ && prepareBasicProjectConfig(params)) {
+ File configScriptSrc = getConfig_Script(params);
if (configScriptSrc.exists()) {
// we need to be running post script in the image folder
@@ -481,7 +482,7 @@
configScript.getAbsolutePath()));
IOUtils.run("wscript", configScript);
}
- return buildMSI(p, outdir);
+ return buildMSI(params, outdir);
}
return null;
} catch (IOException ex) {
@@ -1038,11 +1039,12 @@
APP_NAME.fetchFrom(params) + ".wxs");
}
- private String getLicenseFile(Map<String, ? super Object> p) {
- String licenseFile = LICENSE_FILE.fetchFrom(p);
+ private String getLicenseFile(Map<String, ? super Object> params) {
+ String licenseFile = LICENSE_FILE.fetchFrom(params);
if (licenseFile != null) {
File lfile = new File(licenseFile);
- File destFile = new File(CONFIG_ROOT.fetchFrom(p), lfile.getName());
+ File destFile = new File(CONFIG_ROOT.fetchFrom(params),
+ lfile.getName());
String filePath = destFile.getAbsolutePath();
if (filePath.contains(" ")) {
return "\"" + filePath + "\"";
--- a/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WindowsAppImageBuilder.java Thu Jun 06 19:31:11 2019 -0400
+++ b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WindowsAppImageBuilder.java Thu Jun 06 19:51:17 2019 -0400
@@ -182,22 +182,23 @@
}
}
- public static String getLauncherName(Map<String, ? super Object> p) {
- return APP_NAME.fetchFrom(p) + ".exe";
+ public static String getLauncherName(Map<String, ? super Object> params) {
+ return APP_NAME.fetchFrom(params) + ".exe";
}
// Returns launcher resource name for launcher we need to use.
public static String getLauncherResourceName(
- Map<String, ? super Object> p) {
- if (CONSOLE_HINT.fetchFrom(p)) {
+ Map<String, ? super Object> params) {
+ if (CONSOLE_HINT.fetchFrom(params)) {
return "jpackageapplauncher.exe";
} else {
return "jpackageapplauncherw.exe";
}
}
- public static String getLauncherCfgName(Map<String, ? super Object> p) {
- return "app/" + APP_NAME.fetchFrom(p) +".cfg";
+ public static String getLauncherCfgName(
+ Map<String, ? super Object> params) {
+ return "app/" + APP_NAME.fetchFrom(params) +".cfg";
}
private File getConfig_AppIcon(Map<String, ? super Object> params) {
@@ -346,12 +347,12 @@
}
private void createLauncherForEntryPoint(
- Map<String, ? super Object> p) throws IOException {
+ Map<String, ? super Object> params) throws IOException {
- File launcherIcon = ICON_ICO.fetchFrom(p);
+ File launcherIcon = ICON_ICO.fetchFrom(params);
File icon = launcherIcon != null ?
launcherIcon : ICON_ICO.fetchFrom(params);
- File iconTarget = getConfig_AppIcon(p);
+ File iconTarget = getConfig_AppIcon(params);
InputStream in = locateResource(
APP_NAME.fetchFrom(params) + ".ico",
@@ -364,15 +365,15 @@
Files.copy(in, iconTarget.toPath(),
StandardCopyOption.REPLACE_EXISTING);
- writeCfgFile(p, root.resolve(
- getLauncherCfgName(p)).toFile(), "$APPDIR\\runtime");
+ writeCfgFile(params, root.resolve(
+ getLauncherCfgName(params)).toFile(), "$APPDIR\\runtime");
- prepareExecutableProperties(p);
+ prepareExecutableProperties(params);
// Copy executable root folder
- Path executableFile = root.resolve(getLauncherName(p));
+ Path executableFile = root.resolve(getLauncherName(params));
try (InputStream is_launcher =
- getResourceAsStream(getLauncherResourceName(p))) {
+ getResourceAsStream(getLauncherResourceName(params))) {
writeEntry(is_launcher, executableFile);
}
@@ -380,11 +381,12 @@
launcher.setWritable(true, true);
// Update branding of EXE file
- if (REBRAND_EXECUTABLE.fetchFrom(p)) {
+ if (REBRAND_EXECUTABLE.fetchFrom(params)) {
try {
String tempDirectory = WindowsDefender.getUserTempDirectory();
if (Arguments.CLIOptions.context().userProvidedBuildRoot) {
- tempDirectory = TEMP_ROOT.fetchFrom(p).getAbsolutePath();
+ tempDirectory =
+ TEMP_ROOT.fetchFrom(params).getAbsolutePath();
}
if (WindowsDefender.isThereAPotentialWindowsDefenderIssue(
tempDirectory)) {
@@ -400,7 +402,8 @@
launcher.getAbsolutePath());
}
- File executableProperties = getConfig_ExecutableProperties(p);
+ File executableProperties =
+ getConfig_ExecutableProperties(params);
if (executableProperties.exists()) {
if (versionSwap(executableProperties.getAbsolutePath(),
@@ -416,7 +419,7 @@
}
Files.copy(iconTarget.toPath(),
- root.resolve(APP_NAME.fetchFrom(p) + ".ico"));
+ root.resolve(APP_NAME.fetchFrom(params) + ".ico"));
}
private void copyApplication(Map<String, ? super Object> params)