< prev index next >
src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WindowsAppImageBuilder.java
Print this page
*** 180,205 ****
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";
}
// Returns launcher resource name for launcher we need to use.
public static String getLauncherResourceName(
! Map<String, ? super Object> p) {
! if (CONSOLE_HINT.fetchFrom(p)) {
return "jpackageapplauncher.exe";
} else {
return "jpackageapplauncherw.exe";
}
}
! public static String getLauncherCfgName(Map<String, ? super Object> p) {
! return "app/" + APP_NAME.fetchFrom(p) +".cfg";
}
private File getConfig_AppIcon(Map<String, ? super Object> params) {
return new File(getConfigRoot(params),
APP_NAME.fetchFrom(params) + ".ico");
--- 180,206 ----
Writer output = new OutputStreamWriter(fout, "UTF-8")) {
output.write(content);
}
}
! 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> params) {
! if (CONSOLE_HINT.fetchFrom(params)) {
return "jpackageapplauncher.exe";
} else {
return "jpackageapplauncherw.exe";
}
}
! 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,359 ****
w.write(content);
}
}
private void createLauncherForEntryPoint(
! Map<String, ? super Object> p) throws IOException {
! File launcherIcon = ICON_ICO.fetchFrom(p);
File icon = launcherIcon != null ?
launcherIcon : ICON_ICO.fetchFrom(params);
! File iconTarget = getConfig_AppIcon(p);
InputStream in = locateResource(
APP_NAME.fetchFrom(params) + ".ico",
"icon",
TEMPLATE_APP_ICON,
--- 345,360 ----
w.write(content);
}
}
private void createLauncherForEntryPoint(
! Map<String, ? super Object> params) throws IOException {
! File launcherIcon = ICON_ICO.fetchFrom(params);
File icon = launcherIcon != null ?
launcherIcon : ICON_ICO.fetchFrom(params);
! File iconTarget = getConfig_AppIcon(params);
InputStream in = locateResource(
APP_NAME.fetchFrom(params) + ".ico",
"icon",
TEMPLATE_APP_ICON,
*** 362,392 ****
RESOURCE_DIR.fetchFrom(params));
Files.copy(in, iconTarget.toPath(),
StandardCopyOption.REPLACE_EXISTING);
! writeCfgFile(p, root.resolve(
! getLauncherCfgName(p)).toFile(), "$APPDIR\\runtime");
! prepareExecutableProperties(p);
// Copy executable root folder
! Path executableFile = root.resolve(getLauncherName(p));
try (InputStream is_launcher =
! getResourceAsStream(getLauncherResourceName(p))) {
writeEntry(is_launcher, executableFile);
}
File launcher = executableFile.toFile();
launcher.setWritable(true, true);
// Update branding of EXE file
! if (REBRAND_EXECUTABLE.fetchFrom(p)) {
try {
String tempDirectory = WindowsDefender.getUserTempDirectory();
if (Arguments.CLIOptions.context().userProvidedBuildRoot) {
! tempDirectory = TEMP_ROOT.fetchFrom(p).getAbsolutePath();
}
if (WindowsDefender.isThereAPotentialWindowsDefenderIssue(
tempDirectory)) {
Log.error(MessageFormat.format(I18N.getString(
"message.potential.windows.defender.issue"),
--- 363,394 ----
RESOURCE_DIR.fetchFrom(params));
Files.copy(in, iconTarget.toPath(),
StandardCopyOption.REPLACE_EXISTING);
! writeCfgFile(params, root.resolve(
! getLauncherCfgName(params)).toFile(), "$APPDIR\\runtime");
! prepareExecutableProperties(params);
// Copy executable root folder
! Path executableFile = root.resolve(getLauncherName(params));
try (InputStream is_launcher =
! getResourceAsStream(getLauncherResourceName(params))) {
writeEntry(is_launcher, executableFile);
}
File launcher = executableFile.toFile();
launcher.setWritable(true, true);
// Update branding of EXE file
! if (REBRAND_EXECUTABLE.fetchFrom(params)) {
try {
String tempDirectory = WindowsDefender.getUserTempDirectory();
if (Arguments.CLIOptions.context().userProvidedBuildRoot) {
! tempDirectory =
! TEMP_ROOT.fetchFrom(params).getAbsolutePath();
}
if (WindowsDefender.isThereAPotentialWindowsDefenderIssue(
tempDirectory)) {
Log.error(MessageFormat.format(I18N.getString(
"message.potential.windows.defender.issue"),
*** 398,408 ****
if (iconTarget.exists()) {
iconSwap(iconTarget.getAbsolutePath(),
launcher.getAbsolutePath());
}
! File executableProperties = getConfig_ExecutableProperties(p);
if (executableProperties.exists()) {
if (versionSwap(executableProperties.getAbsolutePath(),
launcher.getAbsolutePath()) != 0) {
throw new RuntimeException(MessageFormat.format(
--- 400,411 ----
if (iconTarget.exists()) {
iconSwap(iconTarget.getAbsolutePath(),
launcher.getAbsolutePath());
}
! File executableProperties =
! getConfig_ExecutableProperties(params);
if (executableProperties.exists()) {
if (versionSwap(executableProperties.getAbsolutePath(),
launcher.getAbsolutePath()) != 0) {
throw new RuntimeException(MessageFormat.format(
*** 414,424 ****
executableFile.toFile().setReadOnly();
}
}
Files.copy(iconTarget.toPath(),
! root.resolve(APP_NAME.fetchFrom(p) + ".ico"));
}
private void copyApplication(Map<String, ? super Object> params)
throws IOException {
List<RelativeFileSet> appResourcesList =
--- 417,427 ----
executableFile.toFile().setReadOnly();
}
}
Files.copy(iconTarget.toPath(),
! root.resolve(APP_NAME.fetchFrom(params) + ".ico"));
}
private void copyApplication(Map<String, ? super Object> params)
throws IOException {
List<RelativeFileSet> appResourcesList =
< prev index next >