< prev index next >
src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WindowsAppImageBuilder.java
Print this page
@@ -180,26 +180,27 @@
Writer output = new OutputStreamWriter(fout, "UTF-8")) {
output.write(content);
}
}
- 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) {
return new File(getConfigRoot(params),
APP_NAME.fetchFrom(params) + ".ico");
@@ -344,16 +345,16 @@
w.write(content);
}
}
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",
"icon",
TEMPLATE_APP_ICON,
@@ -362,31 +363,32 @@
RESOURCE_DIR.fetchFrom(params));
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);
}
File launcher = executableFile.toFile();
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)) {
Log.error(MessageFormat.format(I18N.getString(
"message.potential.windows.defender.issue"),
@@ -398,11 +400,12 @@
if (iconTarget.exists()) {
iconSwap(iconTarget.getAbsolutePath(),
launcher.getAbsolutePath());
}
- File executableProperties = getConfig_ExecutableProperties(p);
+ File executableProperties =
+ getConfig_ExecutableProperties(params);
if (executableProperties.exists()) {
if (versionSwap(executableProperties.getAbsolutePath(),
launcher.getAbsolutePath()) != 0) {
throw new RuntimeException(MessageFormat.format(
@@ -414,11 +417,11 @@
executableFile.toFile().setReadOnly();
}
}
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)
throws IOException {
List<RelativeFileSet> appResourcesList =
< prev index next >