< prev index next >
modules/fxpackager/src/main/java/com/oracle/tools/packager/windows/WinAppBundler.java
Print this page
*** 363,373 ****
// Generate launcher .cfg file
if (LAUNCHER_CFG_FORMAT.fetchFrom(p).equals(CFG_FORMAT_PROPERTIES)) {
writeCfgFile(p, rootDirectory);
} else {
! writeCfgFile(p, new File(rootDirectory, getLauncherCfgName(p)), "$APPDIR\\runtime");
}
// Copy executable root folder
File executableFile = new File(rootDirectory, getLauncherName(p));
IOUtils.copyFromURL(
--- 363,373 ----
// Generate launcher .cfg file
if (LAUNCHER_CFG_FORMAT.fetchFrom(p).equals(CFG_FORMAT_PROPERTIES)) {
writeCfgFile(p, rootDirectory);
} else {
! writeCfgFile(p, new File(rootDirectory, getLauncherCfgName(p)), getRuntimeLocation(p));
}
// Copy executable root folder
File executableFile = new File(rootDirectory, getLauncherName(p));
IOUtils.copyFromURL(
*** 416,436 ****
new File(srcdir, fname), new File(appDirectory, fname));
}
}
}
private void writeCfgFile(Map<String, ? super Object> params, File rootDir) throws FileNotFoundException {
File cfgFile = new File(rootDir, getLauncherCfgName(params));
cfgFile.delete();
PrintStream out = new PrintStream(cfgFile);
! if (WIN_RUNTIME.fetchFrom(params) == null) {
! out.println("app.runtime=");
! } else {
! out.println("app.runtime=$APPDIR\\runtime");
! }
out.println("app.mainjar=" + MAIN_JAR.fetchFrom(params).getIncludedFiles().iterator().next());
out.println("app.version=" + VERSION.fetchFrom(params));
//for future AU support (to be able to find app in the registry)
out.println("app.id=" + IDENTIFIER.fetchFrom(params));
out.println("app.preferences.id=" + PREFERENCES_ID.fetchFrom(params));
--- 416,440 ----
new File(srcdir, fname), new File(appDirectory, fname));
}
}
}
+ private String getRuntimeLocation(Map<String, ? super Object> params) {
+ if (WIN_RUNTIME.fetchFrom(params) == null) {
+ return "";
+ } else {
+ return "$APPDIR\\runtime";
+ }
+ }
+
private void writeCfgFile(Map<String, ? super Object> params, File rootDir) throws FileNotFoundException {
File cfgFile = new File(rootDir, getLauncherCfgName(params));
cfgFile.delete();
PrintStream out = new PrintStream(cfgFile);
! out.println("app.runtime=" + getRuntimeLocation(params));
out.println("app.mainjar=" + MAIN_JAR.fetchFrom(params).getIncludedFiles().iterator().next());
out.println("app.version=" + VERSION.fetchFrom(params));
//for future AU support (to be able to find app in the registry)
out.println("app.id=" + IDENTIFIER.fetchFrom(params));
out.println("app.preferences.id=" + PREFERENCES_ID.fetchFrom(params));
< prev index next >