< prev index next >

src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WinMsiBundler.java

Print this page

        

*** 40,69 **** private static final ResourceBundle I18N = ResourceBundle.getBundle( "jdk.jpackage.internal.resources.WinResources"); public static final BundlerParamInfo<WinAppBundler> APP_BUNDLER = new WindowsBundlerParam<>( - I18N.getString("param.msi-bundler.name"), - I18N.getString("param.msi-bundler.description"), "win.app.bundler", WinAppBundler.class, params -> new WinAppBundler(), null); public static final BundlerParamInfo<Boolean> CAN_USE_WIX36 = new WindowsBundlerParam<>( - I18N.getString("param.can-use-wix36.name"), - I18N.getString("param.can-use-wix36.description"), "win.msi.canUseWix36", Boolean.class, params -> false, (s, p) -> Boolean.valueOf(s)); public static final BundlerParamInfo<File> MSI_IMAGE_DIR = new WindowsBundlerParam<>( - I18N.getString("param.image-dir.name"), - I18N.getString("param.image-dir.description"), "win.msi.imageDir", File.class, params -> { File imagesRoot = IMAGES_ROOT.fetchFrom(params); if (!imagesRoot.exists()) imagesRoot.mkdirs(); --- 40,63 ----
*** 71,91 **** }, (s, p) -> null); public static final BundlerParamInfo<File> WIN_APP_IMAGE = new WindowsBundlerParam<>( - I18N.getString("param.app-dir.name"), - I18N.getString("param.app-dir.description"), "win.app.image", File.class, null, (s, p) -> null); public static final StandardBundlerParam<Boolean> MSI_SYSTEM_WIDE = new StandardBundlerParam<>( - I18N.getString("param.system-wide.name"), - I18N.getString("param.system-wide.description"), Arguments.CLIOptions.WIN_PER_USER_INSTALLATION.getId(), Boolean.class, params -> true, // MSIs default to system wide // valueOf(null) is false, // and we actually do want null --- 65,81 ----
*** 94,115 **** ); public static final StandardBundlerParam<String> PRODUCT_VERSION = new StandardBundlerParam<>( - I18N.getString("param.product-version.name"), - I18N.getString("param.product-version.description"), "win.msi.productVersion", String.class, VERSION::fetchFrom, (s, p) -> s ); public static final BundlerParamInfo<UUID> UPGRADE_UUID = new WindowsBundlerParam<>( - I18N.getString("param.upgrade-uuid.name"), - I18N.getString("param.upgrade-uuid.description"), Arguments.CLIOptions.WIN_UPGRADE_UUID.getId(), UUID.class, params -> UUID.randomUUID(), (s, p) -> UUID.fromString(s)); --- 84,101 ----
*** 128,139 **** + "C:\\Program Files (x86)\\WiX Toolset v3.7\\bin;" + "C:\\Program Files\\WiX Toolset v3.7\\bin"; public static final BundlerParamInfo<String> TOOL_CANDLE_EXECUTABLE = new WindowsBundlerParam<>( - I18N.getString("param.candle-path.name"), - I18N.getString("param.candle-path.description"), "win.msi.candle.exe", String.class, params -> { for (String dirString : (System.getenv("PATH") + AUTODETECT_DIRS).split(";")) { --- 114,123 ----
*** 146,157 **** }, null); public static final BundlerParamInfo<String> TOOL_LIGHT_EXECUTABLE = new WindowsBundlerParam<>( - I18N.getString("param.light-path.name"), - I18N.getString("param.light-path.description"), "win.msi.light.exe", String.class, params -> { for (String dirString : (System.getenv("PATH") + AUTODETECT_DIRS).split(";")) { --- 130,139 ----
*** 164,175 **** }, null); public static final StandardBundlerParam<Boolean> MENU_HINT = new WindowsBundlerParam<>( - I18N.getString("param.menu-shortcut-hint.name"), - I18N.getString("param.menu-shortcut-hint.description"), Arguments.CLIOptions.WIN_MENU_HINT.getId(), Boolean.class, params -> false, // valueOf(null) is false, // and we actually do want null in some cases --- 146,155 ----
*** 177,188 **** "null".equalsIgnoreCase(s))? true : Boolean.valueOf(s) ); public static final StandardBundlerParam<Boolean> SHORTCUT_HINT = new WindowsBundlerParam<>( - I18N.getString("param.desktop-shortcut-hint.name"), - I18N.getString("param.desktop-shortcut-hint.description"), Arguments.CLIOptions.WIN_SHORTCUT_HINT.getId(), Boolean.class, params -> false, // valueOf(null) is false, // and we actually do want null in some cases --- 157,166 ----
*** 590,624 **** data.put("PLATFORM", "x64"); data.put("WIN64", "yes"); data.put("UI_BLOCK", getUIBlock(params)); ! List<Map<String, ? super Object>> secondaryLaunchers = ! SECONDARY_LAUNCHERS.fetchFrom(params); ! StringBuilder secondaryLauncherIcons = new StringBuilder(); ! for (int i = 0; i < secondaryLaunchers.size(); i++) { ! Map<String, ? super Object> sl = secondaryLaunchers.get(i); // <Icon Id="DesktopIcon.exe" SourceFile="APPLICATION_ICON" /> if (SHORTCUT_HINT.fetchFrom(sl) || MENU_HINT.fetchFrom(sl)) { ! File secondaryLauncher = new File(imageRootDir, WinAppBundler.getLauncherName(sl)); ! String secondaryLauncherPath = ! relativePath(imageRootDir, secondaryLauncher); ! String secondaryLauncherIconPath = ! secondaryLauncherPath.replace(".exe", ".ico"); ! secondaryLauncherIcons.append(" <Icon Id=\"Launcher"); ! secondaryLauncherIcons.append(i); ! secondaryLauncherIcons.append(".exe\" SourceFile=\""); ! secondaryLauncherIcons.append(secondaryLauncherIconPath); ! secondaryLauncherIcons.append("\" />\r\n"); } } ! data.put("SECONDARY_LAUNCHER_ICONS", secondaryLauncherIcons.toString()); ! String wxs = RUNTIME_INSTALLER.fetchFrom(params) ? MSI_PROJECT_TEMPLATE_SERVER_JRE : MSI_PROJECT_TEMPLATE; Writer w = new BufferedWriter( new FileWriter(getConfig_ProjectFile(params))); --- 568,602 ---- data.put("PLATFORM", "x64"); data.put("WIN64", "yes"); data.put("UI_BLOCK", getUIBlock(params)); ! List<Map<String, ? super Object>> addLaunchers = ! ADD_LAUNCHERS.fetchFrom(params); ! StringBuilder addLauncherIcons = new StringBuilder(); ! for (int i = 0; i < addLaunchers.size(); i++) { ! Map<String, ? super Object> sl = addLaunchers.get(i); // <Icon Id="DesktopIcon.exe" SourceFile="APPLICATION_ICON" /> if (SHORTCUT_HINT.fetchFrom(sl) || MENU_HINT.fetchFrom(sl)) { ! File addLauncher = new File(imageRootDir, WinAppBundler.getLauncherName(sl)); ! String addLauncherPath = ! relativePath(imageRootDir, addLauncher); ! String addLauncherIconPath = ! addLauncherPath.replace(".exe", ".ico"); ! addLauncherIcons.append(" <Icon Id=\"Launcher"); ! addLauncherIcons.append(i); ! addLauncherIcons.append(".exe\" SourceFile=\""); ! addLauncherIcons.append(addLauncherIconPath); ! addLauncherIcons.append("\" />\r\n"); } } ! data.put("ADD_LAUNCHER_ICONS", addLauncherIcons.toString()); ! String wxs = StandardBundlerParam.isRuntimeInstaller(params) ? MSI_PROJECT_TEMPLATE_SERVER_JRE : MSI_PROJECT_TEMPLATE; Writer w = new BufferedWriter( new FileWriter(getConfig_ProjectFile(params)));
*** 795,811 **** + " Name=\"" + APP_NAME.fetchFrom(params) + "\" Advertise=\"no\" Icon=\"StartMenuIcon.exe\"" + " IconIndex=\"0\" />"); } ! List<Map<String, ? super Object>> secondaryLaunchers = ! SECONDARY_LAUNCHERS.fetchFrom(params); ! for (int i = 0; i < secondaryLaunchers.size(); i++) { ! Map<String, ? super Object> sl = secondaryLaunchers.get(i); ! File secondaryLauncherFile = new File(imageRootDir, WinAppBundler.getLauncherName(sl)); ! if (f.equals(secondaryLauncherFile)) { if (SHORTCUT_HINT.fetchFrom(sl)) { out.println(prefix + " <Shortcut Id=\"desktopShortcut" + i + "\" Directory=\"DesktopFolder\"" + " Name=\"" + APP_NAME.fetchFrom(sl) --- 773,789 ---- + " Name=\"" + APP_NAME.fetchFrom(params) + "\" Advertise=\"no\" Icon=\"StartMenuIcon.exe\"" + " IconIndex=\"0\" />"); } ! List<Map<String, ? super Object>> addLaunchers = ! ADD_LAUNCHERS.fetchFrom(params); ! for (int i = 0; i < addLaunchers.size(); i++) { ! Map<String, ? super Object> sl = addLaunchers.get(i); ! File addLauncherFile = new File(imageRootDir, WinAppBundler.getLauncherName(sl)); ! if (f.equals(addLauncherFile)) { if (SHORTCUT_HINT.fetchFrom(sl)) { out.println(prefix + " <Shortcut Id=\"desktopShortcut" + i + "\" Directory=\"DesktopFolder\"" + " Name=\"" + APP_NAME.fetchFrom(sl)
*** 1030,1040 **** "template.jre.wxs"; private final static String MSI_PROJECT_CONTENT_FILE = "bundle.wxi"; private File buildMSI(Map<String, ? super Object> params, File outdir) throws IOException { ! File tmpDir = new File(BUILD_ROOT.fetchFrom(params), "tmp"); File candleOut = new File( tmpDir, APP_NAME.fetchFrom(params) +".wixobj"); File msiOut = new File( outdir, INSTALLER_FILE_NAME.fetchFrom(params) + ".msi"); --- 1008,1018 ---- "template.jre.wxs"; private final static String MSI_PROJECT_CONTENT_FILE = "bundle.wxi"; private File buildMSI(Map<String, ? super Object> params, File outdir) throws IOException { ! File tmpDir = new File(TEMP_ROOT.fetchFrom(params), "tmp"); File candleOut = new File( tmpDir, APP_NAME.fetchFrom(params) +".wixobj"); File msiOut = new File( outdir, INSTALLER_FILE_NAME.fetchFrom(params) + ".msi");
< prev index next >