# HG changeset patch # User herrick # Date 1542840646 18000 # Node ID b0f09e7c4680769059e4dcee5dcad674d05244f3 # Parent a42d0a8e0916edc93a8982c78261f75f62c2216b 8213963: Flatten out jpackager packages and resources Reviewed-by: almatvee diff -r a42d0a8e0916 -r b0f09e7c4680 make/lib/Lib-jdk.jpackager.gmk --- a/make/lib/Lib-jdk.jpackager.gmk Wed Nov 21 13:53:17 2018 -0500 +++ b/make/lib/Lib-jdk.jpackager.gmk Wed Nov 21 17:50:46 2018 -0500 @@ -123,12 +123,6 @@ # Copy binaries to module classes output directory so that JDK build system # put them in module resources. -ifeq ($(OPENJDK_TARGET_OS), macosx) - RESOURCE_SUBDIR := mac -else - RESOURCE_SUBDIR := $(OPENJDK_TARGET_OS) -endif - SetupCopyTargetFiles = \ $(eval $(call SetupCopyFiles, COPY_DEBUG_SYMBOLS_$1, \ SRC := $(dir $(firstword $($1))), \ @@ -137,7 +131,7 @@ )) \ $(eval $(call SetupCopyFiles, COPY_BINARIES_$1, \ SRC := $(dir $(firstword $($1))), \ - DEST := $(JDK_OUTPUTDIR)/modules/$(MODULE)/jdk/jpackager/internal/resources/$(RESOURCE_SUBDIR), \ + DEST := $(JDK_OUTPUTDIR)/modules/$(MODULE)/jdk/jpackager/internal/resources, \ FILES := $(notdir $(firstword $($1))) \ )) \ $(eval TARGETS += $(COPY_DEBUG_SYMBOLS_$1) $(COPY_BINARIES_$1)) diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/LinuxAppBundler.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/linux/classes/jdk/jpackager/internal/LinuxAppBundler.java Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,252 @@ +/* + * Copyright (c) 2012, 2018, 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.jpackager.internal; + +import jdk.jpackager.internal.AbstractImageBundler; +import jdk.jpackager.internal.BundlerParamInfo; +import jdk.jpackager.internal.ConfigException; +import jdk.jpackager.internal.IOUtils; +import jdk.jpackager.internal.Log; +import jdk.jpackager.internal.Platform; +import jdk.jpackager.internal.RelativeFileSet; +import jdk.jpackager.internal.StandardBundlerParam; +import jdk.jpackager.internal.Arguments; +import jdk.jpackager.internal.UnsupportedPlatformException; +import jdk.jpackager.internal.BundleParams; +import jdk.jpackager.internal.LinuxAppImageBuilder; +import jdk.jpackager.internal.resources.LinuxResources; +import jdk.jpackager.internal.JLinkBundlerHelper; +import jdk.jpackager.internal.AbstractAppImageBuilder; + +import java.io.File; +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; +import java.text.MessageFormat; +import java.util.Arrays; +import java.util.Collection; +import java.util.Map; +import java.util.ResourceBundle; + +import static jdk.jpackager.internal.StandardBundlerParam.*; + +public class LinuxAppBundler extends AbstractImageBundler { + + private static final ResourceBundle I18N = ResourceBundle.getBundle( + "jdk.jpackager.internal.resources.LinuxAppBundler"); + + private static final String EXECUTABLE_NAME = "JavaAppLauncher"; + + public static final BundlerParamInfo ICON_PNG = + new StandardBundlerParam<>( + I18N.getString("param.icon-png.name"), + I18N.getString("param.icon-png.description"), + "icon.png", + File.class, + params -> { + File f = ICON.fetchFrom(params); + if (f != null && !f.getName().toLowerCase().endsWith(".png")) { + Log.error(MessageFormat.format( + I18N.getString("message.icon-not-png"), f)); + return null; + } + return f; + }, + (s, p) -> new File(s)); + + public static final BundlerParamInfo LINUX_INSTALL_DIR = + new StandardBundlerParam<>( + I18N.getString("param.linux-install-dir.name"), + I18N.getString("param.linux-install-dir.description"), + "linux-install-dir", + String.class, + params -> { + String dir = INSTALL_DIR.fetchFrom(params); + if (dir != null) { + if (dir.endsWith("/")) { + dir = dir.substring(0, dir.length()-1); + } + return dir; + } + return "/opt"; + }, + (s, p) -> s + ); + + public static final BundlerParamInfo LINUX_PACKAGE_DEPENDENCIES = + new StandardBundlerParam<>( + I18N.getString("param.linux-package-dependencies.name"), + I18N.getString("param.linux-package-dependencies.description"), + Arguments.CLIOptions.LINUX_PACKAGE_DEPENDENCIES.getId(), + String.class, + params -> { + return ""; + }, + (s, p) -> s + ); + + @Override + public boolean validate(Map p) + throws UnsupportedPlatformException, ConfigException { + try { + if (p == null) throw new ConfigException( + I18N.getString("error.parameters-null"), + I18N.getString("error.parameters-null.advice")); + + return doValidate(p); + } catch (RuntimeException re) { + if (re.getCause() instanceof ConfigException) { + throw (ConfigException) re.getCause(); + } else { + throw new ConfigException(re); + } + } + } + + //used by chained bundlers to reuse validation logic + boolean doValidate(Map p) + throws UnsupportedPlatformException, ConfigException { + if (Platform.getPlatform() != Platform.LINUX) { + throw new UnsupportedPlatformException(); + } + + imageBundleValidation(p); + + return true; + } + + // 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 p) { + return new File(outDir, APP_FS_NAME.fetchFrom(p)); + } + + public static String getLauncherCfgName(Map p) { + return "app/" + APP_FS_NAME.fetchFrom(p) +".cfg"; + } + + File doBundle(Map p, File outputDirectory, + boolean dependentTask) { + if (Arguments.CREATE_JRE_INSTALLER.fetchFrom(p)) { + return doJreBundle(p, outputDirectory, dependentTask); + } else { + return doAppBundle(p, outputDirectory, dependentTask); + } + } + + private File doJreBundle(Map p, + File outputDirectory, boolean dependentTask) { + try { + File rootDirectory = createRoot(p, outputDirectory, dependentTask, + APP_FS_NAME.fetchFrom(p), "linuxapp-image-builder"); + AbstractAppImageBuilder appBuilder = new LinuxAppImageBuilder( + APP_NAME.fetchFrom(p), outputDirectory.toPath()); + File predefined = PREDEFINED_RUNTIME_IMAGE.fetchFrom(p); + if (predefined == null ) { + JLinkBundlerHelper.generateServerJre(p, appBuilder); + } else { + return predefined; + } + return rootDirectory; + } catch (Exception ex) { + Log.error("Exception: "+ex); + Log.debug(ex); + return null; + } + } + + private File doAppBundle(Map p, + File outputDirectory, boolean dependentTask) { + try { + File rootDirectory = createRoot(p, outputDirectory, dependentTask, + APP_FS_NAME.fetchFrom(p), "linuxapp-image-builder"); + AbstractAppImageBuilder appBuilder = new LinuxAppImageBuilder(p, + outputDirectory.toPath()); + if (PREDEFINED_RUNTIME_IMAGE.fetchFrom(p) == null ) { + JLinkBundlerHelper.execute(p, appBuilder); + } else { + StandardBundlerParam.copyPredefinedRuntimeImage(p, appBuilder); + } + return rootDirectory; + } catch (Exception ex) { + Log.error("Exception: "+ex); + Log.debug(ex); + return null; + } + } + + @Override + public String getName() { + return I18N.getString("bundler.name"); + } + + @Override + public String getDescription() { + return I18N.getString("bundler.description"); + } + + @Override + public String getID() { + return "linux.app"; + } + + @Override + public String getBundleType() { + return "IMAGE"; + } + + @Override + public Collection> getBundleParameters() { + return getAppBundleParameters(); + } + + public static Collection> getAppBundleParameters() { + return Arrays.asList( + APP_NAME, + APP_RESOURCES, + ARGUMENTS, + CLASSPATH, + JVM_OPTIONS, + JVM_PROPERTIES, + MAIN_CLASS, + MAIN_JAR, + PREFERENCES_ID, + VERSION, + VERBOSE + ); + } + + @Override + public File execute(Map params, + File outputParentDir) { + return doBundle(params, outputParentDir, false); + } + + @Override + public boolean supported() { + return (Platform.getPlatform() == Platform.LINUX); + } +} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/LinuxAppImageBuilder.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/linux/classes/jdk/jpackager/internal/LinuxAppImageBuilder.java Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,254 @@ +/* + * Copyright (c) 2015, 2018, 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.jpackager.internal; + +import jdk.jpackager.internal.BundlerParamInfo; +import jdk.jpackager.internal.IOUtils; +import jdk.jpackager.internal.Log; +import jdk.jpackager.internal.RelativeFileSet; +import jdk.jpackager.internal.StandardBundlerParam; +import jdk.jpackager.internal.resources.LinuxResources; +import jdk.jpackager.internal.AbstractAppImageBuilder; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.UncheckedIOException; +import java.io.Writer; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.attribute.PosixFilePermission; +import java.text.MessageFormat; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.ResourceBundle; +import java.util.Set; + +import static jdk.jpackager.internal.StandardBundlerParam.*; + +public class LinuxAppImageBuilder extends AbstractAppImageBuilder { + + private static final ResourceBundle I18N = ResourceBundle.getBundle( + "jdk.jpackager.internal.resources.LinuxAppImageBuilder"); + + private static final String EXECUTABLE_NAME = "JavaAppLauncher"; + private static final String LIBRARY_NAME = "libjpackager.so"; + + private final Path root; + private final Path appDir; + private final Path runtimeDir; + private final Path resourcesDir; + private final Path mdir; + + private final Map params; + + public static final BundlerParamInfo ICON_PNG = + new StandardBundlerParam<>( + I18N.getString("param.icon-png.name"), + I18N.getString("param.icon-png.description"), + "icon.png", + File.class, + params -> { + File f = ICON.fetchFrom(params); + if (f != null && !f.getName().toLowerCase().endsWith(".png")) { + Log.error(MessageFormat.format(I18N.getString( + "message.icon-not-png"), f)); + return null; + } + return f; + }, + (s, p) -> new File(s)); + + public LinuxAppImageBuilder(Map config, Path imageOutDir) + throws IOException { + super(config, + imageOutDir.resolve(APP_NAME.fetchFrom(config) + "/runtime")); + + Objects.requireNonNull(imageOutDir); + + this.root = imageOutDir.resolve(APP_NAME.fetchFrom(config)); + this.appDir = root.resolve("app"); + this.runtimeDir = root.resolve("runtime"); + this.resourcesDir = root.resolve("resources"); + this.mdir = runtimeDir.resolve("lib"); + this.params = new HashMap<>(); + config.entrySet().stream().forEach(e -> params.put( + e.getKey().toString(), e.getValue())); + Files.createDirectories(appDir); + Files.createDirectories(runtimeDir); + Files.createDirectories(resourcesDir); + } + + public LinuxAppImageBuilder(String appName, Path imageOutDir) + throws IOException { + super(null, imageOutDir.resolve(appName)); + + Objects.requireNonNull(imageOutDir); + + this.root = imageOutDir.resolve(appName); + this.appDir = null; + this.runtimeDir = null; + this.resourcesDir = null; + this.mdir = null; + this.params = new HashMap<>(); + } + + private Path destFile(String dir, String filename) { + return runtimeDir.resolve(dir).resolve(filename); + } + + private void writeEntry(InputStream in, Path dstFile) throws IOException { + Files.createDirectories(dstFile.getParent()); + Files.copy(in, dstFile); + } + + private void writeSymEntry(Path dstFile, Path target) throws IOException { + Files.createDirectories(dstFile.getParent()); + Files.createLink(dstFile, target); + } + + /** + * chmod ugo+x file + */ + private void setExecutable(Path file) { + try { + Set perms = + Files.getPosixFilePermissions(file); + perms.add(PosixFilePermission.OWNER_EXECUTE); + perms.add(PosixFilePermission.GROUP_EXECUTE); + perms.add(PosixFilePermission.OTHERS_EXECUTE); + Files.setPosixFilePermissions(file, perms); + } catch (IOException ioe) { + throw new UncheckedIOException(ioe); + } + } + + private static void createUtf8File(File file, String content) + throws IOException { + try (OutputStream fout = new FileOutputStream(file); + Writer output = new OutputStreamWriter(fout, "UTF-8")) { + output.write(content); + } + } + + + // 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 p) { + return new File(outDir, APP_FS_NAME.fetchFrom(p)); + } + + public static String getLauncherName(Map p) { + return APP_FS_NAME.fetchFrom(p); + } + + public static String getLauncherCfgName(Map p) { + return "app/" + APP_FS_NAME.fetchFrom(p) + ".cfg"; + } + + @Override + public InputStream getResourceAsStream(String name) { + return LinuxResources.class.getResourceAsStream(name); + } + + @Override + public void prepareApplicationFiles() throws IOException { + Map originalParams = new HashMap<>(params); + + // create the primary launcher + createLauncherForEntryPoint(params, root); + + // Copy library to the launcher folder + try (InputStream is_lib = getResourceAsStream(LIBRARY_NAME)) { + writeEntry(is_lib, root.resolve(LIBRARY_NAME)); + } + + // create the secondary launchers, if any + List> entryPoints + = StandardBundlerParam.SECONDARY_LAUNCHERS.fetchFrom(params); + for (Map entryPoint : entryPoints) { + Map tmp = new HashMap<>(originalParams); + tmp.putAll(entryPoint); + // remove name.fs that was calculated for main launcher. + // otherwise, wrong launcher name will be selected. + tmp.remove(APP_FS_NAME.getID()); + createLauncherForEntryPoint(tmp, root); + } + + // Copy class path entries to Java folder + copyApplication(); + + // Copy icon to Resources folder + copyIcon(); + } + + @Override + public void prepareServerJreFiles() throws IOException {} + + private void createLauncherForEntryPoint(Map p, + Path rootDir) throws IOException { + // Copy executable to Linux folder + Path executableFile = root.resolve(getLauncherName(p)); + try (InputStream is_launcher = getResourceAsStream("papplauncher")) { + writeEntry(is_launcher, executableFile); + } + + executableFile.toFile().setExecutable(true, false); + executableFile.toFile().setWritable(true, true); + + writeCfgFile(p, root.resolve(getLauncherCfgName(p)).toFile(), + "$APPDIR/runtime"); + } + + private void copyIcon() throws IOException { + File icon = ICON_PNG.fetchFrom(params); + if (icon != null) { + File iconTarget = new File(resourcesDir.toFile(), + APP_FS_NAME.fetchFrom(params) + ".png"); + IOUtils.copyFile(icon, iconTarget); + } + } + + private void copyApplication() throws IOException { + for (RelativeFileSet appResources : + APP_RESOURCES_LIST.fetchFrom(params)) { + if (appResources == null) { + throw new RuntimeException("Null app resources?"); + } + File srcdir = appResources.getBaseDirectory(); + for (String fname : appResources.getIncludedFiles()) { + copyEntry(appDir, srcdir, fname); + } + } + } + +} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/LinuxDebBundler.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/linux/classes/jdk/jpackager/internal/LinuxDebBundler.java Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,978 @@ +/* + * Copyright (c) 2012, 2018, 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.jpackager.internal; + +import jdk.jpackager.internal.*; +import jdk.jpackager.internal.Arguments; +import jdk.jpackager.internal.BundleParams; +import jdk.jpackager.internal.resources.LinuxResources; + +import javax.imageio.ImageIO; +import java.awt.image.BufferedImage; +import java.io.*; +import java.nio.file.Files; +import java.nio.file.attribute.PosixFilePermission; +import java.nio.file.attribute.PosixFilePermissions; +import java.text.MessageFormat; +import java.util.*; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.regex.Pattern; + +import static jdk.jpackager.internal.StandardBundlerParam.*; +import static jdk.jpackager.internal.LinuxAppBundler.ICON_PNG; +import static jdk.jpackager.internal.LinuxAppBundler.LINUX_INSTALL_DIR; +import static jdk.jpackager.internal.LinuxAppBundler.LINUX_PACKAGE_DEPENDENCIES; + +public class LinuxDebBundler extends AbstractBundler { + + private static final ResourceBundle I18N = ResourceBundle.getBundle( + "jdk.jpackager.internal.resources.LinuxDebBundler"); + + public static final BundlerParamInfo APP_BUNDLER = + new StandardBundlerParam<>( + I18N.getString("param.app-bundler.name"), + I18N.getString("param.app-bundler.description"), + "linux.app.bundler", + LinuxAppBundler.class, + params -> new LinuxAppBundler(), + (s, p) -> null); + + // Debian rules for package naming are used here + // https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Source + // + // Package names must consist only of lower case letters (a-z), + // digits (0-9), plus (+) and minus (-) signs, and periods (.). + // They must be at least two characters long and + // must start with an alphanumeric character. + // + private static final Pattern DEB_BUNDLE_NAME_PATTERN = + Pattern.compile("^[a-z][a-z\\d\\+\\-\\.]+"); + + public static final BundlerParamInfo BUNDLE_NAME = + new StandardBundlerParam<> ( + I18N.getString("param.bundle-name.name"), + I18N.getString("param.bundle-name.description"), + Arguments.CLIOptions.LINUX_BUNDLE_NAME.getId(), + String.class, + params -> { + String nm = APP_NAME.fetchFrom(params); + + if (nm == null) return null; + + // make sure to lower case and spaces/underscores become dashes + nm = nm.toLowerCase().replaceAll("[ _]", "-"); + return nm; + }, + (s, p) -> { + if (!DEB_BUNDLE_NAME_PATTERN.matcher(s).matches()) { + throw new IllegalArgumentException(new ConfigException( + MessageFormat.format(I18N.getString( + "error.invalid-value-for-package-name"), s), + I18N.getString( + "error.invalid-value-for-package-name.advice"))); + } + + return s; + }); + + public static final BundlerParamInfo FULL_PACKAGE_NAME = + new StandardBundlerParam<> ( + I18N.getString("param.full-package-name.name"), + I18N.getString("param.full-package-name.description"), + "linux.deb.fullPackageName", + String.class, + params -> BUNDLE_NAME.fetchFrom(params) + "-" + + VERSION.fetchFrom(params), + (s, p) -> s); + + public static final BundlerParamInfo CONFIG_ROOT = + new StandardBundlerParam<>( + I18N.getString("param.config-root.name"), + I18N.getString("param.config-root.description"), + "configRoot", + File.class, + params -> new File(BUILD_ROOT.fetchFrom(params), "linux"), + (s, p) -> new File(s)); + + public static final BundlerParamInfo DEB_IMAGE_DIR = + new StandardBundlerParam<>( + I18N.getString("param.image-dir.name"), + I18N.getString("param.image-dir.description"), + "linux.deb.imageDir", + File.class, + params -> { + File imagesRoot = IMAGES_ROOT.fetchFrom(params); + if (!imagesRoot.exists()) imagesRoot.mkdirs(); + return new File(new File(imagesRoot, "linux-deb.image"), + FULL_PACKAGE_NAME.fetchFrom(params)); + }, + (s, p) -> new File(s)); + + public static final BundlerParamInfo APP_IMAGE_ROOT = + new StandardBundlerParam<>( + I18N.getString("param.app-image-root.name"), + I18N.getString("param.app-image-root.description"), + "linux.deb.imageRoot", + File.class, + params -> { + File imageDir = DEB_IMAGE_DIR.fetchFrom(params); + return new File(imageDir, LINUX_INSTALL_DIR.fetchFrom(params)); + }, + (s, p) -> new File(s)); + + public static final BundlerParamInfo CONFIG_DIR = + new StandardBundlerParam<>( + I18N.getString("param.config-dir.name"), + I18N.getString("param.config-dir.description"), + "linux.deb.configDir", + File.class, + params -> new File(DEB_IMAGE_DIR.fetchFrom(params), "DEBIAN"), + (s, p) -> new File(s)); + + public static final BundlerParamInfo EMAIL = + new StandardBundlerParam<> ( + I18N.getString("param.maintainer-email.name"), + I18N.getString("param.maintainer-email.description"), + BundleParams.PARAM_EMAIL, + String.class, + params -> "Unknown", + (s, p) -> s); + + public static final BundlerParamInfo MAINTAINER = + new StandardBundlerParam<> ( + I18N.getString("param.maintainer-name.name"), + I18N.getString("param.maintainer-name.description"), + Arguments.CLIOptions.LINUX_DEB_MAINTAINER.getId(), + String.class, + params -> VENDOR.fetchFrom(params) + " <" + + EMAIL.fetchFrom(params) + ">", + (s, p) -> s); + + public static final BundlerParamInfo LICENSE_TEXT = + new StandardBundlerParam<> ( + I18N.getString("param.license-text.name"), + I18N.getString("param.license-text.description"), + "linux.deb.licenseText", + String.class, + params -> { + try { + List licenseFiles = LICENSE_FILE.fetchFrom(params); + + //need to copy license file to the root of linux-app.image + if (licenseFiles.size() > 0) { + String licFileStr = licenseFiles.get(0); + + for (RelativeFileSet rfs : + APP_RESOURCES_LIST.fetchFrom(params)) { + if (rfs.contains(licFileStr)) { + return new String(Files.readAllBytes(( + new File(rfs.getBaseDirectory(), + licFileStr)).toPath())); + } + } + } + } catch (Exception e) { + if (Log.isDebug()) { + e.printStackTrace(); + } + } + return "Unknown"; + }, + (s, p) -> s); + + public static final BundlerParamInfo XDG_FILE_PREFIX = + new StandardBundlerParam<> ( + I18N.getString("param.xdg-prefix.name"), + I18N.getString("param.xdg-prefix.description"), + "linux.xdg-prefix", + String.class, + params -> { + try { + String vendor; + if (params.containsKey(VENDOR.getID())) { + vendor = VENDOR.fetchFrom(params); + } else { + vendor = "jpackager"; + } + String appName = APP_FS_NAME.fetchFrom(params); + + return (appName + "-" + vendor).replaceAll("\\s", ""); + } catch (Exception e) { + if (Log.isDebug()) { + e.printStackTrace(); + } + } + return "unknown-MimeInfo.xml"; + }, + (s, p) -> s); + + private final static String DEFAULT_ICON = "javalogo_white_32.png"; + private final static String DEFAULT_CONTROL_TEMPLATE = "template.control"; + private final static String DEFAULT_PRERM_TEMPLATE = "template.prerm"; + private final static String DEFAULT_PREINSTALL_TEMPLATE = + "template.preinst"; + private final static String DEFAULT_POSTRM_TEMPLATE = "template.postrm"; + private final static String DEFAULT_POSTINSTALL_TEMPLATE = + "template.postinst"; + private final static String DEFAULT_COPYRIGHT_TEMPLATE = + "template.copyright"; + private final static String DEFAULT_DESKTOP_FILE_TEMPLATE = + "template.desktop"; + + public final static String TOOL_DPKG = "dpkg-deb"; + + public LinuxDebBundler() { + super(); + baseResourceLoader = LinuxResources.class; + } + + public static boolean testTool(String toolName, String minVersion) { + try { + ProcessBuilder pb = new ProcessBuilder( + toolName, + "--version"); + // not interested in the output + IOUtils.exec(pb, Log.isDebug(), true); + } catch (Exception e) { + Log.verbose(MessageFormat.format(I18N.getString( + "message.test-for-tool"), toolName, e.getMessage())); + return false; + } + return true; + } + + @Override + public boolean validate(Map p) + throws UnsupportedPlatformException, ConfigException { + try { + if (p == 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).doValidate(p); + + // NOTE: Can we validate that the required tools are available + // before we start? + if (!testTool(TOOL_DPKG, "1")){ + throw new ConfigException(MessageFormat.format( + I18N.getString("error.tool-not-found"), TOOL_DPKG), + I18N.getString("error.tool-not-found.advice")); + } + + + // validate license file, if used, exists in the proper place + if (p.containsKey(LICENSE_FILE.getID())) { + List appResourcesList = + APP_RESOURCES_LIST.fetchFrom(p); + for (String license : LICENSE_FILE.fetchFrom(p)) { + boolean found = false; + for (RelativeFileSet appResources : appResourcesList) { + found = found || appResources.contains(license); + } + if (!found) { + throw new ConfigException( + I18N.getString("error.license-missing"), + MessageFormat.format(I18N.getString( + "error.license-missing.advice"), + license)); + } + } + } else { + Log.verbose(I18N.getString("message.debs-like-licenses")); + } + + // only one mime type per association, at least one file extention + List> associations = + FILE_ASSOCIATIONS.fetchFrom(p); + if (associations != null) { + for (int i = 0; i < associations.size(); i++) { + Map assoc = associations.get(i); + List mimes = FA_CONTENT_TYPE.fetchFrom(assoc); + if (mimes == null || mimes.isEmpty()) { + String msgKey = + "error.no-content-types-for-file-association"; + throw new ConfigException( + MessageFormat.format(I18N.getString(msgKey), i), + I18N.getString(msgKey + ".advise")); + + } else if (mimes.size() > 1) { + String msgKey = + "error.too-many-content-types-for-file-association"; + throw new ConfigException( + MessageFormat.format(I18N.getString(msgKey), i), + I18N.getString(msgKey + ".advise")); + } + } + } + + // bundle name has some restrictions + // the string converter will throw an exception if invalid + BUNDLE_NAME.getStringConverter().apply(BUNDLE_NAME.fetchFrom(p), p); + + return true; + } catch (RuntimeException re) { + if (re.getCause() instanceof ConfigException) { + throw (ConfigException) re.getCause(); + } else { + throw new ConfigException(re); + } + } + } + + private boolean prepareProto(Map p) + throws IOException { + File appImage = StandardBundlerParam.getPredefinedAppImage(p); + 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)); + // 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); + } + return appDir != null; + } + + //@Override + public File bundle(Map p, File outdir) { + if (!outdir.isDirectory() && !outdir.mkdirs()) { + throw new RuntimeException(MessageFormat.format( + I18N.getString("error.cannot-create-output-dir"), + outdir.getAbsolutePath())); + } + if (!outdir.canWrite()) { + throw new RuntimeException(MessageFormat.format( + I18N.getString("error.cannot-write-to-output-dir"), + outdir.getAbsolutePath())); + } + + // we want to create following structure + // + // DEBIAN + // control (file with main package details) + // menu (request to create menu) + // ... other control files if needed .... + // opt (by default) + // AppFolder (this is where app image goes) + // launcher executable + // app + // runtime + + File imageDir = DEB_IMAGE_DIR.fetchFrom(p); + File configDir = CONFIG_DIR.fetchFrom(p); + + try { + + imageDir.mkdirs(); + configDir.mkdirs(); + if (prepareProto(p) && prepareProjectConfig(p)) { + return buildDeb(p, outdir); + } + return null; + } catch (IOException ex) { + ex.printStackTrace(); + return null; + } finally { + try { + if (imageDir != null && + PREDEFINED_APP_IMAGE.fetchFrom(p) == null && + (PREDEFINED_RUNTIME_IMAGE.fetchFrom(p) == null || + !Arguments.CREATE_JRE_INSTALLER.fetchFrom(p)) && + !Log.isDebug() && + !Log.isVerbose()) { + IOUtils.deleteRecursive(imageDir); + } else if (imageDir != null) { + Log.verbose(MessageFormat.format(I18N.getString( + "message.debug-working-directory"), + imageDir.getAbsolutePath())); + } + } catch (IOException ex) { + //noinspection ReturnInsideFinallyBlock + Log.debug(ex.getMessage()); + return null; + } + } + } + + /* + * set permissions with a string like "rwxr-xr-x" + * + * This cannot be directly backport to 22u which is built with 1.6 + */ + private void setPermissions(File file, String permissions) { + Set filePermissions = + PosixFilePermissions.fromString(permissions); + try { + if (file.exists()) { + Files.setPosixFilePermissions(file.toPath(), filePermissions); + } + } catch (IOException ex) { + Logger.getLogger(LinuxDebBundler.class.getName()).log( + Level.SEVERE, null, ex); + } + + } + + private String getArch() { + String arch = System.getProperty("os.arch"); + if ("i386".equals(arch)) + return "i386"; + else + return "amd64"; + } + + private long getInstalledSizeKB(Map params) { + return getInstalledSizeKB(APP_IMAGE_ROOT.fetchFrom(params)) >> 10; + } + + private long getInstalledSizeKB(File dir) { + long count = 0; + File[] children = dir.listFiles(); + if (children != null) { + for (File file : children) { + if (file.isFile()) { + count += file.length(); + } + else if (file.isDirectory()) { + count += getInstalledSizeKB(file); + } + } + } + return count; + } + + private boolean prepareProjectConfig(Map params) + throws IOException { + Map data = createReplacementData(params); + File rootDir = LinuxAppBundler.getRootDir(APP_IMAGE_ROOT.fetchFrom( + params), params); + + File iconTarget = getConfig_IconFile(rootDir, params); + File icon = ICON_PNG.fetchFrom(params); + if (!Arguments.CREATE_JRE_INSTALLER.fetchFrom(params)) { + // prepare installer icon + if (icon == null || !icon.exists()) { + fetchResource(LinuxAppBundler.BUNDLER_PREFIX + + iconTarget.getName(), + I18N.getString("resource.menu-icon"), + DEFAULT_ICON, + iconTarget, + VERBOSE.fetchFrom(params), + DROP_IN_RESOURCES_ROOT.fetchFrom(params)); + } else { + fetchResource(LinuxAppBundler.BUNDLER_PREFIX + + iconTarget.getName(), + I18N.getString("resource.menu-icon"), + icon, + iconTarget, + VERBOSE.fetchFrom(params), + DROP_IN_RESOURCES_ROOT.fetchFrom(params)); + } + } + + StringBuilder installScripts = new StringBuilder(); + StringBuilder removeScripts = new StringBuilder(); + for (Map secondaryLauncher : + SECONDARY_LAUNCHERS.fetchFrom(params)) { + Map secondaryLauncherData = + createReplacementData(secondaryLauncher); + secondaryLauncherData.put("APPLICATION_FS_NAME", + data.get("APPLICATION_FS_NAME")); + secondaryLauncherData.put("DESKTOP_MIMES", ""); + + if (!Arguments.CREATE_JRE_INSTALLER.fetchFrom(params)) { + // prepare desktop shortcut + Writer w = new BufferedWriter(new FileWriter( + getConfig_DesktopShortcutFile( + rootDir, secondaryLauncher))); + String content = preprocessTextResource( + LinuxAppBundler.BUNDLER_PREFIX + + getConfig_DesktopShortcutFile(rootDir, + secondaryLauncher).getName(), + I18N.getString("resource.menu-shortcut-descriptor"), + DEFAULT_DESKTOP_FILE_TEMPLATE, + secondaryLauncherData, + VERBOSE.fetchFrom(params), + DROP_IN_RESOURCES_ROOT.fetchFrom(params)); + w.write(content); + w.close(); + } + + // prepare installer icon + iconTarget = getConfig_IconFile(rootDir, secondaryLauncher); + icon = ICON_PNG.fetchFrom(secondaryLauncher); + if (icon == null || !icon.exists()) { + fetchResource(LinuxAppBundler.BUNDLER_PREFIX + + iconTarget.getName(), + I18N.getString("resource.menu-icon"), + DEFAULT_ICON, + iconTarget, + VERBOSE.fetchFrom(params), + DROP_IN_RESOURCES_ROOT.fetchFrom(params)); + } else { + fetchResource(LinuxAppBundler.BUNDLER_PREFIX + + iconTarget.getName(), + I18N.getString("resource.menu-icon"), + icon, + iconTarget, + VERBOSE.fetchFrom(params), + DROP_IN_RESOURCES_ROOT.fetchFrom(params)); + } + + // postinst copying of desktop icon + installScripts.append( + " xdg-desktop-menu install --novendor "); + installScripts.append(LINUX_INSTALL_DIR.fetchFrom(params)); + installScripts.append("/"); + installScripts.append(data.get("APPLICATION_FS_NAME")); + installScripts.append("/"); + installScripts.append( + secondaryLauncherData.get("APPLICATION_LAUNCHER_FILENAME")); + installScripts.append(".desktop\n"); + + //postrm cleanup of desktop icon + removeScripts.append( + " xdg-desktop-menu uninstall --novendor "); + removeScripts.append(LINUX_INSTALL_DIR.fetchFrom(params)); + removeScripts.append("/"); + removeScripts.append(data.get("APPLICATION_FS_NAME")); + removeScripts.append("/"); + removeScripts.append( + secondaryLauncherData.get("APPLICATION_LAUNCHER_FILENAME")); + removeScripts.append(".desktop\n"); + } + data.put("SECONDARY_LAUNCHERS_INSTALL", installScripts.toString()); + data.put("SECONDARY_LAUNCHERS_REMOVE", removeScripts.toString()); + + List> associations = + FILE_ASSOCIATIONS.fetchFrom(params); + data.put("FILE_ASSOCIATION_INSTALL", ""); + data.put("FILE_ASSOCIATION_REMOVE", ""); + data.put("DESKTOP_MIMES", ""); + if (associations != null) { + String mimeInfoFile = XDG_FILE_PREFIX.fetchFrom(params) + + "-MimeInfo.xml"; + StringBuilder mimeInfo = new StringBuilder( + "\n\n"); + StringBuilder registrations = new StringBuilder(); + StringBuilder deregistrations = new StringBuilder(); + StringBuilder desktopMimes = new StringBuilder("MimeType="); + boolean addedEntry = false; + + for (Map assoc : associations) { + // + // Awesome document + // + // + // + + if (assoc == null) { + continue; + } + + String description = FA_DESCRIPTION.fetchFrom(assoc); + File faIcon = FA_ICON.fetchFrom(assoc); + List extensions = FA_EXTENSIONS.fetchFrom(assoc); + if (extensions == null) { + Log.error(I18N.getString( + "message.creating-association-with-null-extension")); + } + + List mimes = FA_CONTENT_TYPE.fetchFrom(assoc); + if (mimes == null || mimes.isEmpty()) { + continue; + } + String thisMime = mimes.get(0); + String dashMime = thisMime.replace('/', '-'); + + mimeInfo.append(" \n"); + if (description != null && !description.isEmpty()) { + mimeInfo.append(" ") + .append(description) + .append("\n"); + } + + if (extensions != null) { + for (String ext : extensions) { + mimeInfo.append(" \n"); + } + } + + mimeInfo.append(" \n"); + if (!addedEntry) { + registrations.append(" xdg-mime install ") + .append(LINUX_INSTALL_DIR.fetchFrom(params)) + .append("/") + .append(data.get("APPLICATION_FS_NAME")) + .append("/") + .append(mimeInfoFile) + .append("\n"); + + deregistrations.append(" xdg-mime uninstall ") + .append(LINUX_INSTALL_DIR.fetchFrom(params)) + .append("/") + .append(data.get("APPLICATION_FS_NAME")) + .append("/") + .append(mimeInfoFile) + .append("\n"); + addedEntry = true; + } else { + desktopMimes.append(";"); + } + desktopMimes.append(thisMime); + + if (faIcon != null && faIcon.exists()) { + int size = getSquareSizeOfImage(faIcon); + + if (size > 0) { + File target = new File(rootDir, + APP_FS_NAME.fetchFrom(params) + + "_fa_" + faIcon.getName()); + IOUtils.copyFile(faIcon, target); + + // xdg-icon-resource install --context mimetypes + // --size 64 awesomeapp_fa_1.png + // application-x.vnd-awesome + registrations.append( + " xdg-icon-resource install " + + "--context mimetypes --size ") + .append(size) + .append(" ") + .append(LINUX_INSTALL_DIR.fetchFrom(params)) + .append("/") + .append(data.get("APPLICATION_FS_NAME")) + .append("/") + .append(target.getName()) + .append(" ") + .append(dashMime) + .append("\n"); + + // x dg-icon-resource uninstall --context mimetypes + // --size 64 awesomeapp_fa_1.png + // application-x.vnd-awesome + deregistrations.append( + " xdg-icon-resource uninstall " + + "--context mimetypes --size ") + .append(size) + .append(" ") + .append(LINUX_INSTALL_DIR.fetchFrom(params)) + .append("/") + .append(data.get("APPLICATION_FS_NAME")) + .append("/") + .append(target.getName()) + .append(" ") + .append(dashMime) + .append("\n"); + } + } + } + mimeInfo.append(""); + + if (addedEntry) { + Writer w = new BufferedWriter(new FileWriter( + new File(rootDir, mimeInfoFile))); + w.write(mimeInfo.toString()); + w.close(); + data.put("FILE_ASSOCIATION_INSTALL", registrations.toString()); + data.put("FILE_ASSOCIATION_REMOVE", deregistrations.toString()); + data.put("DESKTOP_MIMES", desktopMimes.toString()); + } + } + + if (!Arguments.CREATE_JRE_INSTALLER.fetchFrom(params)) { + //prepare desktop shortcut + Writer w = new BufferedWriter(new FileWriter( + getConfig_DesktopShortcutFile(rootDir, params))); + String content = preprocessTextResource( + LinuxAppBundler.BUNDLER_PREFIX + + getConfig_DesktopShortcutFile( + rootDir, params).getName(), + I18N.getString("resource.menu-shortcut-descriptor"), + DEFAULT_DESKTOP_FILE_TEMPLATE, + data, + VERBOSE.fetchFrom(params), + DROP_IN_RESOURCES_ROOT.fetchFrom(params)); + w.write(content); + w.close(); + } + // prepare control file + Writer w = new BufferedWriter(new FileWriter( + getConfig_ControlFile(params))); + String content = preprocessTextResource( + LinuxAppBundler.BUNDLER_PREFIX + + getConfig_ControlFile(params).getName(), + I18N.getString("resource.deb-control-file"), + DEFAULT_CONTROL_TEMPLATE, + data, + VERBOSE.fetchFrom(params), + DROP_IN_RESOURCES_ROOT.fetchFrom(params)); + w.write(content); + w.close(); + + w = new BufferedWriter(new FileWriter( + getConfig_PreinstallFile(params))); + content = preprocessTextResource( + LinuxAppBundler.BUNDLER_PREFIX + + getConfig_PreinstallFile(params).getName(), + I18N.getString("resource.deb-preinstall-script"), + DEFAULT_PREINSTALL_TEMPLATE, + data, + VERBOSE.fetchFrom(params), + DROP_IN_RESOURCES_ROOT.fetchFrom(params)); + w.write(content); + w.close(); + setPermissions(getConfig_PreinstallFile(params), "rwxr-xr-x"); + + w = new BufferedWriter(new FileWriter(getConfig_PrermFile(params))); + content = preprocessTextResource( + LinuxAppBundler.BUNDLER_PREFIX + + getConfig_PrermFile(params).getName(), + I18N.getString("resource.deb-prerm-script"), + DEFAULT_PRERM_TEMPLATE, + data, + VERBOSE.fetchFrom(params), + DROP_IN_RESOURCES_ROOT.fetchFrom(params)); + w.write(content); + w.close(); + setPermissions(getConfig_PrermFile(params), "rwxr-xr-x"); + + w = new BufferedWriter(new FileWriter( + getConfig_PostinstallFile(params))); + content = preprocessTextResource( + LinuxAppBundler.BUNDLER_PREFIX + + getConfig_PostinstallFile(params).getName(), + I18N.getString("resource.deb-postinstall-script"), + DEFAULT_POSTINSTALL_TEMPLATE, + data, + VERBOSE.fetchFrom(params), + DROP_IN_RESOURCES_ROOT.fetchFrom(params)); + w.write(content); + w.close(); + setPermissions(getConfig_PostinstallFile(params), "rwxr-xr-x"); + + w = new BufferedWriter(new FileWriter(getConfig_PostrmFile(params))); + content = preprocessTextResource( + LinuxAppBundler.BUNDLER_PREFIX + + getConfig_PostrmFile(params).getName(), + I18N.getString("resource.deb-postrm-script"), + DEFAULT_POSTRM_TEMPLATE, + data, + VERBOSE.fetchFrom(params), + DROP_IN_RESOURCES_ROOT.fetchFrom(params)); + w.write(content); + w.close(); + setPermissions(getConfig_PostrmFile(params), "rwxr-xr-x"); + + w = new BufferedWriter(new FileWriter(getConfig_CopyrightFile(params))); + content = preprocessTextResource( + LinuxAppBundler.BUNDLER_PREFIX + + getConfig_CopyrightFile(params).getName(), + I18N.getString("resource.deb-copyright-file"), + DEFAULT_COPYRIGHT_TEMPLATE, + data, + VERBOSE.fetchFrom(params), + DROP_IN_RESOURCES_ROOT.fetchFrom(params)); + w.write(content); + w.close(); + + return true; + } + + private Map createReplacementData( + Map params) { + Map data = new HashMap<>(); + + data.put("APPLICATION_NAME", APP_NAME.fetchFrom(params)); + data.put("APPLICATION_FS_NAME", APP_FS_NAME.fetchFrom(params)); + data.put("APPLICATION_PACKAGE", BUNDLE_NAME.fetchFrom(params)); + data.put("APPLICATION_VENDOR", VENDOR.fetchFrom(params)); + data.put("APPLICATION_MAINTAINER", MAINTAINER.fetchFrom(params)); + data.put("APPLICATION_VERSION", VERSION.fetchFrom(params)); + data.put("APPLICATION_LAUNCHER_FILENAME", + APP_FS_NAME.fetchFrom(params)); + data.put("INSTALLATION_DIRECTORY", LINUX_INSTALL_DIR.fetchFrom(params)); + data.put("XDG_PREFIX", XDG_FILE_PREFIX.fetchFrom(params)); + data.put("DEPLOY_BUNDLE_CATEGORY", CATEGORY.fetchFrom(params)); + data.put("APPLICATION_DESCRIPTION", DESCRIPTION.fetchFrom(params)); + data.put("APPLICATION_SUMMARY", TITLE.fetchFrom(params)); + data.put("APPLICATION_COPYRIGHT", COPYRIGHT.fetchFrom(params)); + data.put("APPLICATION_LICENSE_TEXT", LICENSE_TEXT.fetchFrom(params)); + data.put("APPLICATION_ARCH", getArch()); + data.put("APPLICATION_INSTALLED_SIZE", + Long.toString(getInstalledSizeKB(params))); + String deps = LINUX_PACKAGE_DEPENDENCIES.fetchFrom(params); + data.put("PACKAGE_DEPENDENCIES", + deps.isEmpty() ? "" : "Depends: " + deps); + data.put("CREATE_JRE_INSTALLER", + Arguments.CREATE_JRE_INSTALLER.fetchFrom(params).toString()); + + return data; + } + + private File getConfig_DesktopShortcutFile(File rootDir, + Map params) { + return new File(rootDir, + APP_FS_NAME.fetchFrom(params) + ".desktop"); + } + + private File getConfig_IconFile(File rootDir, + Map params) { + return new File(rootDir, + APP_FS_NAME.fetchFrom(params) + ".png"); + } + + private File getConfig_InitScriptFile(Map params) { + return new File(LinuxAppBundler.getRootDir( + APP_IMAGE_ROOT.fetchFrom(params), params), + BUNDLE_NAME.fetchFrom(params) + ".init"); + } + + private File getConfig_ControlFile(Map params) { + return new File(CONFIG_DIR.fetchFrom(params), "control"); + } + + private File getConfig_PreinstallFile(Map params) { + return new File(CONFIG_DIR.fetchFrom(params), "preinst"); + } + + private File getConfig_PrermFile(Map params) { + return new File(CONFIG_DIR.fetchFrom(params), "prerm"); + } + + private File getConfig_PostinstallFile(Map params) { + return new File(CONFIG_DIR.fetchFrom(params), "postinst"); + } + + private File getConfig_PostrmFile(Map params) { + return new File(CONFIG_DIR.fetchFrom(params), "postrm"); + } + + private File getConfig_CopyrightFile(Map params) { + return new File(CONFIG_DIR.fetchFrom(params), "copyright"); + } + + private File buildDeb(Map params, + File outdir) throws IOException { + File outFile = new File(outdir, + FULL_PACKAGE_NAME.fetchFrom(params)+".deb"); + Log.verbose(MessageFormat.format(I18N.getString( + "message.outputting-to-location"), outFile.getAbsolutePath())); + + outFile.getParentFile().mkdirs(); + + // run dpkg + ProcessBuilder pb = new ProcessBuilder( + "fakeroot", TOOL_DPKG, "-b", + FULL_PACKAGE_NAME.fetchFrom(params), + outFile.getAbsolutePath()); + pb = pb.directory(DEB_IMAGE_DIR.fetchFrom(params).getParentFile()); + IOUtils.exec(pb, false); + + Log.verbose(MessageFormat.format(I18N.getString( + "message.output-to-location"), outFile.getAbsolutePath())); + + return outFile; + } + + @Override + public String getName() { + return I18N.getString("bundler.name"); + } + + @Override + public String getDescription() { + return I18N.getString("bundler.description"); + } + + @Override + public String getID() { + return "deb"; + } + + @Override + public String getBundleType() { + return "INSTALLER"; + } + + @Override + public Collection> getBundleParameters() { + Collection> results = new LinkedHashSet<>(); + results.addAll(LinuxAppBundler.getAppBundleParameters()); + results.addAll(getDebBundleParameters()); + return results; + } + + public static Collection> getDebBundleParameters() { + return Arrays.asList( + BUNDLE_NAME, + COPYRIGHT, + CATEGORY, + DESCRIPTION, + EMAIL, + ICON_PNG, + LICENSE_FILE, + TITLE, + VENDOR + ); + } + + @Override + public File execute(Map params, + File outputParentDir) { + return bundle(params, outputParentDir); + } + + @Override + public boolean supported() { + return (Platform.getPlatform() == Platform.LINUX); + } + + public int getSquareSizeOfImage(File f) { + try { + BufferedImage bi = ImageIO.read(f); + if (bi.getWidth() == bi.getHeight()) { + return bi.getWidth(); + } else { + return 0; + } + } catch (Exception e) { + e.printStackTrace(); + return 0; + } + } +} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/LinuxRpmBundler.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/linux/classes/jdk/jpackager/internal/LinuxRpmBundler.java Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,808 @@ +/* + * Copyright (c) 2012, 2018, 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.jpackager.internal; + +import jdk.jpackager.internal.*; +import jdk.jpackager.internal.Arguments; +import jdk.jpackager.internal.resources.LinuxResources; + +import javax.imageio.ImageIO; +import java.awt.image.BufferedImage; +import java.io.*; +import java.nio.file.Files; +import java.nio.file.attribute.PosixFilePermission; +import java.nio.file.attribute.PosixFilePermissions; +import java.text.MessageFormat; +import java.util.*; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static jdk.jpackager.internal.StandardBundlerParam.*; +import static jdk.jpackager.internal.LinuxAppBundler.LINUX_INSTALL_DIR; +import static + jdk.jpackager.internal.LinuxAppBundler.LINUX_PACKAGE_DEPENDENCIES; + +public class LinuxRpmBundler extends AbstractBundler { + + private static final ResourceBundle I18N = ResourceBundle.getBundle( + "jdk.jpackager.internal.resources.LinuxRpmBundler"); + + public static final BundlerParamInfo APP_BUNDLER = + new StandardBundlerParam<>( + I18N.getString("param.app-bundler.name"), + I18N.getString("param.app-bundler.description"), + "linux.app.bundler", + LinuxAppBundler.class, + params -> new LinuxAppBundler(), + null); + + public static final BundlerParamInfo RPM_IMAGE_DIR = + new StandardBundlerParam<>( + I18N.getString("param.image-dir.name"), + I18N.getString("param.image-dir.description"), + "linux.rpm.imageDir", + File.class, + params -> { + File imagesRoot = IMAGES_ROOT.fetchFrom(params); + if (!imagesRoot.exists()) imagesRoot.mkdirs(); + return new File(imagesRoot, "linux-rpm.image"); + }, + (s, p) -> new File(s)); + + public static final BundlerParamInfo CONFIG_ROOT = + new StandardBundlerParam<>( + I18N.getString("param.config-root.name"), + I18N.getString("param.config-root.description"), + "configRoot", + File.class, + params -> new File(BUILD_ROOT.fetchFrom(params), "linux"), + (s, p) -> new File(s)); + + // Fedora rules for package naming are used here + // https://fedoraproject.org/wiki/Packaging:NamingGuidelines?rd=Packaging/NamingGuidelines + // + // all Fedora packages must be named using only the following ASCII + // characters. These characters are displayed here: + // + // abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._+ + // + private static final Pattern RPM_BUNDLE_NAME_PATTERN = + Pattern.compile("[a-z\\d\\+\\-\\.\\_]+", Pattern.CASE_INSENSITIVE); + + public static final BundlerParamInfo BUNDLE_NAME = + new StandardBundlerParam<> ( + I18N.getString("param.bundle-name.name"), + I18N.getString("param.bundle-name.description"), + Arguments.CLIOptions.LINUX_BUNDLE_NAME.getId(), + String.class, + params -> { + String nm = APP_NAME.fetchFrom(params); + if (nm == null) return null; + + // make sure to lower case and spaces become dashes + nm = nm.toLowerCase().replaceAll("[ ]", "-"); + + return nm; + }, + (s, p) -> { + if (!RPM_BUNDLE_NAME_PATTERN.matcher(s).matches()) { + String msgKey = "error.invalid-value-for-package-name"; + throw new IllegalArgumentException( + new ConfigException(MessageFormat.format( + I18N.getString(msgKey), s), + I18N.getString(msgKey + ".advice"))); + } + + return s; + } + ); + + public static final BundlerParamInfo LICENSE_TYPE = + new StandardBundlerParam<>( + I18N.getString("param.license-type.name"), + I18N.getString("param.license-type.description"), + Arguments.CLIOptions.LINUX_RPM_LICENSE_TYPE.getId(), + String.class, + params -> I18N.getString("param.license-type.default"), + (s, p) -> s + ); + + public static final BundlerParamInfo XDG_FILE_PREFIX = + new StandardBundlerParam<> ( + I18N.getString("param.xdg-prefix.name"), + I18N.getString("param.xdg-prefix.description"), + "linux.xdg-prefix", + String.class, + params -> { + try { + String vendor; + if (params.containsKey(VENDOR.getID())) { + vendor = VENDOR.fetchFrom(params); + } else { + vendor = "jpackager"; + } + String appName = APP_FS_NAME.fetchFrom(params); + + return (vendor + "-" + appName).replaceAll("\\s", ""); + } catch (Exception e) { + if (Log.isDebug()) { + e.printStackTrace(); + } + } + return "unknown-MimeInfo.xml"; + }, + (s, p) -> s); + + private final static String DEFAULT_ICON = "javalogo_white_32.png"; + private final static String DEFAULT_SPEC_TEMPLATE = "template.spec"; + private final static String DEFAULT_DESKTOP_FILE_TEMPLATE = + "template.desktop"; + + public final static String TOOL_RPMBUILD = "rpmbuild"; + public final static double TOOL_RPMBUILD_MIN_VERSION = 4.0d; + + public LinuxRpmBundler() { + super(); + baseResourceLoader = LinuxResources.class; + } + + public static boolean testTool(String toolName, double minVersion) { + try (ByteArrayOutputStream baos = new ByteArrayOutputStream(); + PrintStream ps = new PrintStream(baos)) { + ProcessBuilder pb = new ProcessBuilder(toolName, "--version"); + IOUtils.exec(pb, Log.isDebug(), false, ps); + //not interested in the above's output + String content = new String(baos.toByteArray()); + Pattern pattern = Pattern.compile(" (\\d+\\.\\d+)"); + Matcher matcher = pattern.matcher(content); + + if (matcher.find()) { + String v = matcher.group(1); + double version = Double.parseDouble(v); + return minVersion <= version; + } else { + return false; + } + } catch (Exception e) { + Log.verbose(MessageFormat.format(I18N.getString( + "message.test-for-tool"), toolName, e.getMessage())); + return false; + } + } + + @Override + public boolean validate(Map p) + throws UnsupportedPlatformException, ConfigException { + try { + if (p == 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).doValidate(p); + + // validate license file, if used, exists in the proper place + if (p.containsKey(LICENSE_FILE.getID())) { + List appResourcesList = + APP_RESOURCES_LIST.fetchFrom(p); + for (String license : LICENSE_FILE.fetchFrom(p)) { + boolean found = false; + for (RelativeFileSet appResources : appResourcesList) { + found = found || appResources.contains(license); + } + if (!found) { + throw new ConfigException( + I18N.getString("error.license-missing"), + MessageFormat.format( + I18N.getString("error.license-missing.advice"), + license)); + } + } + } + + // validate presense of required tools + if (!testTool(TOOL_RPMBUILD, TOOL_RPMBUILD_MIN_VERSION)){ + throw new ConfigException( + MessageFormat.format( + I18N.getString("error.cannot-find-rpmbuild"), + TOOL_RPMBUILD_MIN_VERSION), + MessageFormat.format( + I18N.getString("error.cannot-find-rpmbuild.advice"), + TOOL_RPMBUILD_MIN_VERSION)); + } + + // only one mime type per association, at least one file extension + List> associations = + FILE_ASSOCIATIONS.fetchFrom(p); + if (associations != null) { + for (int i = 0; i < associations.size(); i++) { + Map assoc = associations.get(i); + List mimes = FA_CONTENT_TYPE.fetchFrom(assoc); + if (mimes == null || mimes.isEmpty()) { + String msgKey = + "error.no-content-types-for-file-association"; + throw new ConfigException( + MessageFormat.format(I18N.getString(msgKey), i), + I18N.getString(msgKey + ".advice")); + } else if (mimes.size() > 1) { + String msgKey = + "error.no-content-types-for-file-association"; + throw new ConfigException( + MessageFormat.format(I18N.getString(msgKey), i), + I18N.getString(msgKey + ".advice")); + } + } + } + + // bundle name has some restrictions + // the string converter will throw an exception if invalid + BUNDLE_NAME.getStringConverter().apply(BUNDLE_NAME.fetchFrom(p), p); + + return true; + } catch (RuntimeException re) { + if (re.getCause() instanceof ConfigException) { + throw (ConfigException) re.getCause(); + } else { + throw new ConfigException(re); + } + } + } + + private boolean prepareProto(Map p) + throws IOException { + File appImage = StandardBundlerParam.getPredefinedAppImage(p); + 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)); + // 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); + } + return appDir != null; + } + + public File bundle(Map p, File outdir) { + if (!outdir.isDirectory() && !outdir.mkdirs()) { + throw new RuntimeException(MessageFormat.format( + I18N.getString("error.cannot-create-output-dir"), + outdir.getAbsolutePath())); + } + if (!outdir.canWrite()) { + throw new RuntimeException(MessageFormat.format( + I18N.getString("error.cannot-write-to-output-dir"), + outdir.getAbsolutePath())); + } + + File imageDir = RPM_IMAGE_DIR.fetchFrom(p); + try { + + imageDir.mkdirs(); + + if (prepareProto(p) && prepareProjectConfig(p)) { + return buildRPM(p, outdir); + } + return null; + } catch (IOException ex) { + ex.printStackTrace(); + return null; + } finally { + try { + if (imageDir != null && + PREDEFINED_APP_IMAGE.fetchFrom(p) == null && + (PREDEFINED_RUNTIME_IMAGE.fetchFrom(p) == null || + !Arguments.CREATE_JRE_INSTALLER.fetchFrom(p)) && + !Log.isDebug() && + !Log.isVerbose()) { + IOUtils.deleteRecursive(imageDir); + } else if (imageDir != null) { + Log.verbose(MessageFormat.format(I18N.getString( + "message.debug-working-directory"), + imageDir.getAbsolutePath())); + } + } catch (IOException ex) { + // noinspection ReturnInsideFinallyBlock + Log.debug(ex.getMessage()); + return null; + } + } + } + + /* + * set permissions with a string like "rwxr-xr-x" + * + * This cannot be directly backport to 22u which is built with 1.6 + */ + private void setPermissions(File file, String permissions) { + Set filePermissions = + PosixFilePermissions.fromString(permissions); + try { + if (file.exists()) { + Files.setPosixFilePermissions(file.toPath(), filePermissions); + } + } catch (IOException ex) { + Logger.getLogger(LinuxDebBundler.class.getName()).log( + Level.SEVERE, null, ex); + } + } + + private String getLicenseFileString(Map params) { + StringBuilder sb = new StringBuilder(); + for (String f: LICENSE_FILE.fetchFrom(params)) { + if (sb.length() != 0) { + sb.append("\n"); + } + sb.append("%doc "); + sb.append(LINUX_INSTALL_DIR.fetchFrom(params)); + sb.append("/"); + sb.append(APP_FS_NAME.fetchFrom(params)); + sb.append("/app/"); + sb.append(f); + } + return sb.toString(); + } + + private boolean prepareProjectConfig(Map params) + throws IOException { + Map data = createReplacementData(params); + File rootDir = + LinuxAppBundler.getRootDir(RPM_IMAGE_DIR.fetchFrom(params), params); + + // prepare installer icon + File iconTarget = getConfig_IconFile(rootDir, params); + File icon = LinuxAppBundler.ICON_PNG.fetchFrom(params); + if (!Arguments.CREATE_JRE_INSTALLER.fetchFrom(params)) { + if (icon == null || !icon.exists()) { + fetchResource(LinuxAppBundler.BUNDLER_PREFIX + + iconTarget.getName(), + I18N.getString("resource.menu-icon"), + DEFAULT_ICON, + iconTarget, + VERBOSE.fetchFrom(params), + DROP_IN_RESOURCES_ROOT.fetchFrom(params)); + } else { + fetchResource(LinuxAppBundler.BUNDLER_PREFIX + + iconTarget.getName(), + I18N.getString("resource.menu-icon"), + icon, + iconTarget, + VERBOSE.fetchFrom(params), + DROP_IN_RESOURCES_ROOT.fetchFrom(params)); + } + } + + StringBuilder installScripts = new StringBuilder(); + StringBuilder removeScripts = new StringBuilder(); + for (Map secondaryLauncher : + SECONDARY_LAUNCHERS.fetchFrom(params)) { + Map secondaryLauncherData = + createReplacementData(secondaryLauncher); + secondaryLauncherData.put("APPLICATION_FS_NAME", + data.get("APPLICATION_FS_NAME")); + secondaryLauncherData.put("DESKTOP_MIMES", ""); + + // prepare desktop shortcut + Writer w = new BufferedWriter(new FileWriter( + getConfig_DesktopShortcutFile(rootDir, secondaryLauncher))); + String content = preprocessTextResource( + LinuxAppBundler.BUNDLER_PREFIX + + getConfig_DesktopShortcutFile(rootDir, + secondaryLauncher).getName(), + I18N.getString("resource.menu-shortcut-descriptor"), + DEFAULT_DESKTOP_FILE_TEMPLATE, secondaryLauncherData, + VERBOSE.fetchFrom(params), + DROP_IN_RESOURCES_ROOT.fetchFrom(params)); + w.write(content); + w.close(); + + // prepare installer icon + iconTarget = getConfig_IconFile(rootDir, secondaryLauncher); + icon = LinuxAppBundler.ICON_PNG.fetchFrom(secondaryLauncher); + if (icon == null || !icon.exists()) { + fetchResource(LinuxAppBundler.BUNDLER_PREFIX + + iconTarget.getName(), + I18N.getString("resource.menu-icon"), + DEFAULT_ICON, + iconTarget, + VERBOSE.fetchFrom(params), + DROP_IN_RESOURCES_ROOT.fetchFrom(params)); + } else { + fetchResource(LinuxAppBundler.BUNDLER_PREFIX + + iconTarget.getName(), + I18N.getString("resource.menu-icon"), + icon, + iconTarget, + VERBOSE.fetchFrom(params), + DROP_IN_RESOURCES_ROOT.fetchFrom(params)); + } + + // post copying of desktop icon + installScripts.append("xdg-desktop-menu install --novendor "); + installScripts.append(LINUX_INSTALL_DIR.fetchFrom(params)); + installScripts.append("/"); + installScripts.append(data.get("APPLICATION_FS_NAME")); + installScripts.append("/"); + installScripts.append(secondaryLauncherData.get( + "APPLICATION_LAUNCHER_FILENAME")); + installScripts.append(".desktop\n"); + + // preun cleanup of desktop icon + removeScripts.append("xdg-desktop-menu uninstall --novendor "); + removeScripts.append(LINUX_INSTALL_DIR.fetchFrom(params)); + removeScripts.append("/"); + removeScripts.append(data.get("APPLICATION_FS_NAME")); + removeScripts.append("/"); + removeScripts.append(secondaryLauncherData.get( + "APPLICATION_LAUNCHER_FILENAME")); + removeScripts.append(".desktop\n"); + + } + data.put("SECONDARY_LAUNCHERS_INSTALL", installScripts.toString()); + data.put("SECONDARY_LAUNCHERS_REMOVE", removeScripts.toString()); + + StringBuilder cdsScript = new StringBuilder(); + + data.put("APP_CDS_CACHE", cdsScript.toString()); + + List> associations = + FILE_ASSOCIATIONS.fetchFrom(params); + data.put("FILE_ASSOCIATION_INSTALL", ""); + data.put("FILE_ASSOCIATION_REMOVE", ""); + data.put("DESKTOP_MIMES", ""); + if (associations != null) { + String mimeInfoFile = XDG_FILE_PREFIX.fetchFrom(params) + + "-MimeInfo.xml"; + StringBuilder mimeInfo = new StringBuilder( + "\n\n"); + StringBuilder registrations = new StringBuilder(); + StringBuilder deregistrations = new StringBuilder(); + StringBuilder desktopMimes = new StringBuilder("MimeType="); + boolean addedEntry = false; + + for (Map assoc : associations) { + // + // Awesome document + // + // + // + + if (assoc == null) { + continue; + } + + String description = FA_DESCRIPTION.fetchFrom(assoc); + File faIcon = FA_ICON.fetchFrom(assoc); //TODO FA_ICON_PNG + List extensions = FA_EXTENSIONS.fetchFrom(assoc); + if (extensions == null) { + Log.verbose(I18N.getString( + "message.creating-association-with-null-extension")); + } + + List mimes = FA_CONTENT_TYPE.fetchFrom(assoc); + if (mimes == null || mimes.isEmpty()) { + continue; + } + String thisMime = mimes.get(0); + String dashMime = thisMime.replace('/', '-'); + + mimeInfo.append(" \n"); + if (description != null && !description.isEmpty()) { + mimeInfo.append(" ") + .append(description) + .append("\n"); + } + + if (extensions != null) { + for (String ext : extensions) { + mimeInfo.append(" \n"); + } + } + + mimeInfo.append(" \n"); + if (!addedEntry) { + registrations.append("xdg-mime install ") + .append(LINUX_INSTALL_DIR.fetchFrom(params)) + .append("/") + .append(data.get("APPLICATION_FS_NAME")) + .append("/") + .append(mimeInfoFile) + .append("\n"); + + deregistrations.append("xdg-mime uninstall ") + .append(LINUX_INSTALL_DIR.fetchFrom(params)) + .append("/") + .append(data.get("APPLICATION_FS_NAME")) + .append("/") + .append(mimeInfoFile) + .append("\n"); + addedEntry = true; + } else { + desktopMimes.append(";"); + } + desktopMimes.append(thisMime); + + if (faIcon != null && faIcon.exists()) { + int size = getSquareSizeOfImage(faIcon); + + if (size > 0) { + File target = new File(rootDir, + APP_FS_NAME.fetchFrom(params) + + "_fa_" + faIcon.getName()); + IOUtils.copyFile(faIcon, target); + + // xdg-icon-resource install --context mimetypes + // --size 64 awesomeapp_fa_1.png + // application-x.vnd-awesome + registrations.append( + "xdg-icon-resource install " + + "--context mimetypes --size ") + .append(size) + .append(" ") + .append(LINUX_INSTALL_DIR.fetchFrom(params)) + .append("/") + .append(data.get("APPLICATION_FS_NAME")) + .append("/") + .append(target.getName()) + .append(" ") + .append(dashMime) + .append("\n"); + + // xdg-icon-resource uninstall --context mimetypes + // --size 64 awesomeapp_fa_1.png + // application-x.vnd-awesome + deregistrations.append( + "xdg-icon-resource uninstall " + + "--context mimetypes --size ") + .append(size) + .append(" ") + .append(LINUX_INSTALL_DIR.fetchFrom(params)) + .append("/") + .append(data.get("APPLICATION_FS_NAME")) + .append("/") + .append(target.getName()) + .append(" ") + .append(dashMime) + .append("\n"); + } + } + } + mimeInfo.append(""); + + if (addedEntry) { + Writer w = new BufferedWriter(new FileWriter( + new File(rootDir, mimeInfoFile))); + w.write(mimeInfo.toString()); + w.close(); + data.put("FILE_ASSOCIATION_INSTALL", registrations.toString()); + data.put("FILE_ASSOCIATION_REMOVE", deregistrations.toString()); + data.put("DESKTOP_MIMES", desktopMimes.toString()); + } + } + + if (!Arguments.CREATE_JRE_INSTALLER.fetchFrom(params)) { + //prepare desktop shortcut + Writer w = new BufferedWriter(new FileWriter( + getConfig_DesktopShortcutFile(rootDir, params))); + String content = preprocessTextResource( + LinuxAppBundler.BUNDLER_PREFIX + + getConfig_DesktopShortcutFile(rootDir, + params).getName(), + I18N.getString("resource.menu-shortcut-descriptor"), + DEFAULT_DESKTOP_FILE_TEMPLATE, data, + VERBOSE.fetchFrom(params), + DROP_IN_RESOURCES_ROOT.fetchFrom(params)); + w.write(content); + w.close(); + } + + // prepare spec file + Writer w = new BufferedWriter( + new FileWriter(getConfig_SpecFile(params))); + String content = preprocessTextResource( + LinuxAppBundler.BUNDLER_PREFIX + + getConfig_SpecFile(params).getName(), + I18N.getString("resource.rpm-spec-file"), + DEFAULT_SPEC_TEMPLATE, data, + VERBOSE.fetchFrom(params), + DROP_IN_RESOURCES_ROOT.fetchFrom(params)); + w.write(content); + w.close(); + + return true; + } + + private Map createReplacementData( + Map params) { + Map data = new HashMap<>(); + + data.put("APPLICATION_NAME", APP_NAME.fetchFrom(params)); + data.put("APPLICATION_FS_NAME", APP_FS_NAME.fetchFrom(params)); + data.put("APPLICATION_PACKAGE", BUNDLE_NAME.fetchFrom(params)); + data.put("APPLICATION_VENDOR", VENDOR.fetchFrom(params)); + data.put("APPLICATION_VERSION", VERSION.fetchFrom(params)); + data.put("APPLICATION_LAUNCHER_FILENAME", + APP_FS_NAME.fetchFrom(params)); + data.put("INSTALLATION_DIRECTORY", LINUX_INSTALL_DIR.fetchFrom(params)); + data.put("XDG_PREFIX", XDG_FILE_PREFIX.fetchFrom(params)); + data.put("DEPLOY_BUNDLE_CATEGORY", CATEGORY.fetchFrom(params)); + // TODO rpm categories + data.put("APPLICATION_DESCRIPTION", DESCRIPTION.fetchFrom(params)); + data.put("APPLICATION_SUMMARY", TITLE.fetchFrom(params)); + data.put("APPLICATION_LICENSE_TYPE", LICENSE_TYPE.fetchFrom(params)); + data.put("APPLICATION_LICENSE_FILE", getLicenseFileString(params)); + String deps = LINUX_PACKAGE_DEPENDENCIES.fetchFrom(params); + data.put("PACKAGE_DEPENDENCIES", + deps.isEmpty() ? "" : "Requires: " + deps); + data.put("CREATE_JRE_INSTALLER", + Arguments.CREATE_JRE_INSTALLER.fetchFrom(params).toString()); + return data; + } + + private File getConfig_DesktopShortcutFile(File rootDir, + Map params) { + return new File(rootDir, + APP_FS_NAME.fetchFrom(params) + ".desktop"); + } + + private File getConfig_IconFile(File rootDir, + Map params) { + return new File(rootDir, + APP_FS_NAME.fetchFrom(params) + ".png"); + } + + private File getConfig_SpecFile(Map params) { + return new File(RPM_IMAGE_DIR.fetchFrom(params), + APP_FS_NAME.fetchFrom(params) + ".spec"); + } + + private File buildRPM(Map params, + File outdir) throws IOException { + Log.verbose(MessageFormat.format(I18N.getString( + "message.outputting-bundle-location"), + outdir.getAbsolutePath())); + + File broot = new File(BUILD_ROOT.fetchFrom(params), "rmpbuildroot"); + + outdir.mkdirs(); + + //run rpmbuild + ProcessBuilder pb = new ProcessBuilder( + TOOL_RPMBUILD, + "-bb", getConfig_SpecFile(params).getAbsolutePath(), + "--define", "%_sourcedir " + + RPM_IMAGE_DIR.fetchFrom(params).getAbsolutePath(), + // save result to output dir + "--define", "%_rpmdir " + outdir.getAbsolutePath(), + // do not use other system directories to build as current user + "--define", "%_topdir " + broot.getAbsolutePath() + ); + pb = pb.directory(RPM_IMAGE_DIR.fetchFrom(params)); + IOUtils.exec(pb, false); + + if (!Log.isDebug() && !Log.isVerbose()) { + IOUtils.deleteRecursive(broot); + } + + Log.verbose(MessageFormat.format( + I18N.getString("message.output-bundle-location"), + outdir.getAbsolutePath())); + + // presume the result is the ".rpm" file with the newest modified time + // not the best solution, but it is the most reliable + File result = null; + long lastModified = 0; + File[] list = outdir.listFiles(); + if (list != null) { + for (File f : list) { + if (f.getName().endsWith(".rpm") && + f.lastModified() > lastModified) { + result = f; + lastModified = f.lastModified(); + } + } + } + + return result; + } + + @Override + public String getName() { + return I18N.getString("bundler.name"); + } + + @Override + public String getDescription() { + return I18N.getString("bundler.description"); + } + + @Override + public String getID() { + return "rpm"; + } + + @Override + public String getBundleType() { + return "INSTALLER"; + } + + @Override + public Collection> getBundleParameters() { + Collection> results = new LinkedHashSet<>(); + results.addAll(LinuxAppBundler.getAppBundleParameters()); + results.addAll(getRpmBundleParameters()); + return results; + } + + public static Collection> getRpmBundleParameters() { + return Arrays.asList( + BUNDLE_NAME, + CATEGORY, + DESCRIPTION, + LinuxAppBundler.ICON_PNG, + LICENSE_FILE, + LICENSE_TYPE, + TITLE, + VENDOR + ); + } + + @Override + public File execute( + Map params, File outputParentDir) { + return bundle(params, outputParentDir); + } + + @Override + public boolean supported() { + return (Platform.getPlatform() == Platform.LINUX); + } + + public int getSquareSizeOfImage(File f) { + try { + BufferedImage bi = ImageIO.read(f); + if (bi.getWidth() == bi.getHeight()) { + return bi.getWidth(); + } else { + return 0; + } + } catch (Exception e) { + e.printStackTrace(); + return 0; + } + } +} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/builders/linux/LinuxAppImageBuilder.java --- a/src/jdk.jpackager/linux/classes/jdk/jpackager/internal/builders/linux/LinuxAppImageBuilder.java Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,256 +0,0 @@ -/* - * Copyright (c) 2015, 2018, 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.jpackager.internal.builders.linux; - -import jdk.jpackager.internal.BundlerParamInfo; -import jdk.jpackager.internal.IOUtils; -import jdk.jpackager.internal.Log; -import jdk.jpackager.internal.RelativeFileSet; -import jdk.jpackager.internal.StandardBundlerParam; -import jdk.jpackager.internal.resources.linux.LinuxResources; -import jdk.jpackager.internal.builders.AbstractAppImageBuilder; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.io.UncheckedIOException; -import java.io.Writer; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.attribute.PosixFilePermission; -import java.text.MessageFormat; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.ResourceBundle; -import java.util.Set; - -import static jdk.jpackager.internal.StandardBundlerParam.*; - -public class LinuxAppImageBuilder extends AbstractAppImageBuilder { - - private static final ResourceBundle I18N = ResourceBundle.getBundle( - "jdk.jpackager.internal.resources.builders.linux.LinuxAppImageBuilder"); - - protected static final String LINUX_BUNDLER_PREFIX = - BUNDLER_PREFIX + "linux" + File.separator; - private static final String EXECUTABLE_NAME = "JavaAppLauncher"; - private static final String LIBRARY_NAME = "libjpackager.so"; - - private final Path root; - private final Path appDir; - private final Path runtimeDir; - private final Path resourcesDir; - private final Path mdir; - - private final Map params; - - public static final BundlerParamInfo ICON_PNG = - new StandardBundlerParam<>( - I18N.getString("param.icon-png.name"), - I18N.getString("param.icon-png.description"), - "icon.png", - File.class, - params -> { - File f = ICON.fetchFrom(params); - if (f != null && !f.getName().toLowerCase().endsWith(".png")) { - Log.error(MessageFormat.format(I18N.getString( - "message.icon-not-png"), f)); - return null; - } - return f; - }, - (s, p) -> new File(s)); - - public LinuxAppImageBuilder(Map config, Path imageOutDir) - throws IOException { - super(config, - imageOutDir.resolve(APP_NAME.fetchFrom(config) + "/runtime")); - - Objects.requireNonNull(imageOutDir); - - this.root = imageOutDir.resolve(APP_NAME.fetchFrom(config)); - this.appDir = root.resolve("app"); - this.runtimeDir = root.resolve("runtime"); - this.resourcesDir = root.resolve("resources"); - this.mdir = runtimeDir.resolve("lib"); - this.params = new HashMap<>(); - config.entrySet().stream().forEach(e -> params.put( - e.getKey().toString(), e.getValue())); - Files.createDirectories(appDir); - Files.createDirectories(runtimeDir); - Files.createDirectories(resourcesDir); - } - - public LinuxAppImageBuilder(String appName, Path imageOutDir) - throws IOException { - super(null, imageOutDir.resolve(appName)); - - Objects.requireNonNull(imageOutDir); - - this.root = imageOutDir.resolve(appName); - this.appDir = null; - this.runtimeDir = null; - this.resourcesDir = null; - this.mdir = null; - this.params = new HashMap<>(); - } - - private Path destFile(String dir, String filename) { - return runtimeDir.resolve(dir).resolve(filename); - } - - private void writeEntry(InputStream in, Path dstFile) throws IOException { - Files.createDirectories(dstFile.getParent()); - Files.copy(in, dstFile); - } - - private void writeSymEntry(Path dstFile, Path target) throws IOException { - Files.createDirectories(dstFile.getParent()); - Files.createLink(dstFile, target); - } - - /** - * chmod ugo+x file - */ - private void setExecutable(Path file) { - try { - Set perms = - Files.getPosixFilePermissions(file); - perms.add(PosixFilePermission.OWNER_EXECUTE); - perms.add(PosixFilePermission.GROUP_EXECUTE); - perms.add(PosixFilePermission.OTHERS_EXECUTE); - Files.setPosixFilePermissions(file, perms); - } catch (IOException ioe) { - throw new UncheckedIOException(ioe); - } - } - - private static void createUtf8File(File file, String content) - throws IOException { - try (OutputStream fout = new FileOutputStream(file); - Writer output = new OutputStreamWriter(fout, "UTF-8")) { - output.write(content); - } - } - - - // 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 p) { - return new File(outDir, APP_FS_NAME.fetchFrom(p)); - } - - public static String getLauncherName(Map p) { - return APP_FS_NAME.fetchFrom(p); - } - - public static String getLauncherCfgName(Map p) { - return "app/" + APP_FS_NAME.fetchFrom(p) + ".cfg"; - } - - @Override - public InputStream getResourceAsStream(String name) { - return LinuxResources.class.getResourceAsStream(name); - } - - @Override - public void prepareApplicationFiles() throws IOException { - Map originalParams = new HashMap<>(params); - - // create the primary launcher - createLauncherForEntryPoint(params, root); - - // Copy library to the launcher folder - try (InputStream is_lib = getResourceAsStream(LIBRARY_NAME)) { - writeEntry(is_lib, root.resolve(LIBRARY_NAME)); - } - - // create the secondary launchers, if any - List> entryPoints - = StandardBundlerParam.SECONDARY_LAUNCHERS.fetchFrom(params); - for (Map entryPoint : entryPoints) { - Map tmp = new HashMap<>(originalParams); - tmp.putAll(entryPoint); - // remove name.fs that was calculated for main launcher. - // otherwise, wrong launcher name will be selected. - tmp.remove(APP_FS_NAME.getID()); - createLauncherForEntryPoint(tmp, root); - } - - // Copy class path entries to Java folder - copyApplication(); - - // Copy icon to Resources folder - copyIcon(); - } - - @Override - public void prepareServerJreFiles() throws IOException {} - - private void createLauncherForEntryPoint(Map p, - Path rootDir) throws IOException { - // Copy executable to Linux folder - Path executableFile = root.resolve(getLauncherName(p)); - try (InputStream is_launcher = getResourceAsStream("papplauncher")) { - writeEntry(is_launcher, executableFile); - } - - executableFile.toFile().setExecutable(true, false); - executableFile.toFile().setWritable(true, true); - - writeCfgFile(p, root.resolve(getLauncherCfgName(p)).toFile(), - "$APPDIR/runtime"); - } - - private void copyIcon() throws IOException { - File icon = ICON_PNG.fetchFrom(params); - if (icon != null) { - File iconTarget = new File(resourcesDir.toFile(), - APP_FS_NAME.fetchFrom(params) + ".png"); - IOUtils.copyFile(icon, iconTarget); - } - } - - private void copyApplication() throws IOException { - for (RelativeFileSet appResources : - APP_RESOURCES_LIST.fetchFrom(params)) { - if (appResources == null) { - throw new RuntimeException("Null app resources?"); - } - File srcdir = appResources.getBaseDirectory(); - for (String fname : appResources.getIncludedFiles()) { - copyEntry(appDir, srcdir, fname); - } - } - } - -} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/linux/LinuxAppBundler.java --- a/src/jdk.jpackager/linux/classes/jdk/jpackager/internal/linux/LinuxAppBundler.java Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,254 +0,0 @@ -/* - * Copyright (c) 2012, 2018, 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.jpackager.internal.linux; - -import jdk.jpackager.internal.AbstractImageBundler; -import jdk.jpackager.internal.BundlerParamInfo; -import jdk.jpackager.internal.ConfigException; -import jdk.jpackager.internal.IOUtils; -import jdk.jpackager.internal.Log; -import jdk.jpackager.internal.Platform; -import jdk.jpackager.internal.RelativeFileSet; -import jdk.jpackager.internal.StandardBundlerParam; -import jdk.jpackager.internal.Arguments; -import jdk.jpackager.internal.UnsupportedPlatformException; -import jdk.jpackager.internal.bundlers.BundleParams; -import jdk.jpackager.internal.builders.linux.LinuxAppImageBuilder; -import jdk.jpackager.internal.resources.linux.LinuxResources; -import jdk.jpackager.internal.JLinkBundlerHelper; -import jdk.jpackager.internal.builders.AbstractAppImageBuilder; - -import java.io.File; -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URL; -import java.text.MessageFormat; -import java.util.Arrays; -import java.util.Collection; -import java.util.Map; -import java.util.ResourceBundle; - -import static jdk.jpackager.internal.StandardBundlerParam.*; - -public class LinuxAppBundler extends AbstractImageBundler { - - private static final ResourceBundle I18N = ResourceBundle.getBundle( - "jdk.jpackager.internal.resources.linux.LinuxAppBundler"); - - protected static final String LINUX_BUNDLER_PREFIX = - BUNDLER_PREFIX + "linux" + File.separator; - private static final String EXECUTABLE_NAME = "JavaAppLauncher"; - - public static final BundlerParamInfo ICON_PNG = - new StandardBundlerParam<>( - I18N.getString("param.icon-png.name"), - I18N.getString("param.icon-png.description"), - "icon.png", - File.class, - params -> { - File f = ICON.fetchFrom(params); - if (f != null && !f.getName().toLowerCase().endsWith(".png")) { - Log.error(MessageFormat.format( - I18N.getString("message.icon-not-png"), f)); - return null; - } - return f; - }, - (s, p) -> new File(s)); - - public static final BundlerParamInfo LINUX_INSTALL_DIR = - new StandardBundlerParam<>( - I18N.getString("param.linux-install-dir.name"), - I18N.getString("param.linux-install-dir.description"), - "linux-install-dir", - String.class, - params -> { - String dir = INSTALL_DIR.fetchFrom(params); - if (dir != null) { - if (dir.endsWith("/")) { - dir = dir.substring(0, dir.length()-1); - } - return dir; - } - return "/opt"; - }, - (s, p) -> s - ); - - public static final BundlerParamInfo LINUX_PACKAGE_DEPENDENCIES = - new StandardBundlerParam<>( - I18N.getString("param.linux-package-dependencies.name"), - I18N.getString("param.linux-package-dependencies.description"), - Arguments.CLIOptions.LINUX_PACKAGE_DEPENDENCIES.getId(), - String.class, - params -> { - return ""; - }, - (s, p) -> s - ); - - @Override - public boolean validate(Map p) - throws UnsupportedPlatformException, ConfigException { - try { - if (p == null) throw new ConfigException( - I18N.getString("error.parameters-null"), - I18N.getString("error.parameters-null.advice")); - - return doValidate(p); - } catch (RuntimeException re) { - if (re.getCause() instanceof ConfigException) { - throw (ConfigException) re.getCause(); - } else { - throw new ConfigException(re); - } - } - } - - //used by chained bundlers to reuse validation logic - boolean doValidate(Map p) - throws UnsupportedPlatformException, ConfigException { - if (Platform.getPlatform() != Platform.LINUX) { - throw new UnsupportedPlatformException(); - } - - imageBundleValidation(p); - - return true; - } - - // 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 p) { - return new File(outDir, APP_FS_NAME.fetchFrom(p)); - } - - public static String getLauncherCfgName(Map p) { - return "app/" + APP_FS_NAME.fetchFrom(p) +".cfg"; - } - - File doBundle(Map p, File outputDirectory, - boolean dependentTask) { - if (Arguments.CREATE_JRE_INSTALLER.fetchFrom(p)) { - return doJreBundle(p, outputDirectory, dependentTask); - } else { - return doAppBundle(p, outputDirectory, dependentTask); - } - } - - private File doJreBundle(Map p, - File outputDirectory, boolean dependentTask) { - try { - File rootDirectory = createRoot(p, outputDirectory, dependentTask, - APP_FS_NAME.fetchFrom(p), "linuxapp-image-builder"); - AbstractAppImageBuilder appBuilder = new LinuxAppImageBuilder( - APP_NAME.fetchFrom(p), outputDirectory.toPath()); - File predefined = PREDEFINED_RUNTIME_IMAGE.fetchFrom(p); - if (predefined == null ) { - JLinkBundlerHelper.generateServerJre(p, appBuilder); - } else { - return predefined; - } - return rootDirectory; - } catch (Exception ex) { - Log.error("Exception: "+ex); - Log.debug(ex); - return null; - } - } - - private File doAppBundle(Map p, - File outputDirectory, boolean dependentTask) { - try { - File rootDirectory = createRoot(p, outputDirectory, dependentTask, - APP_FS_NAME.fetchFrom(p), "linuxapp-image-builder"); - AbstractAppImageBuilder appBuilder = new LinuxAppImageBuilder(p, - outputDirectory.toPath()); - if (PREDEFINED_RUNTIME_IMAGE.fetchFrom(p) == null ) { - JLinkBundlerHelper.execute(p, appBuilder); - } else { - StandardBundlerParam.copyPredefinedRuntimeImage(p, appBuilder); - } - return rootDirectory; - } catch (Exception ex) { - Log.error("Exception: "+ex); - Log.debug(ex); - return null; - } - } - - @Override - public String getName() { - return I18N.getString("bundler.name"); - } - - @Override - public String getDescription() { - return I18N.getString("bundler.description"); - } - - @Override - public String getID() { - return "linux.app"; - } - - @Override - public String getBundleType() { - return "IMAGE"; - } - - @Override - public Collection> getBundleParameters() { - return getAppBundleParameters(); - } - - public static Collection> getAppBundleParameters() { - return Arrays.asList( - APP_NAME, - APP_RESOURCES, - ARGUMENTS, - CLASSPATH, - JVM_OPTIONS, - JVM_PROPERTIES, - MAIN_CLASS, - MAIN_JAR, - PREFERENCES_ID, - VERSION, - VERBOSE - ); - } - - @Override - public File execute(Map params, - File outputParentDir) { - return doBundle(params, outputParentDir, false); - } - - @Override - public boolean supported() { - return (Platform.getPlatform() == Platform.LINUX); - } -} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/linux/LinuxDebBundler.java --- a/src/jdk.jpackager/linux/classes/jdk/jpackager/internal/linux/LinuxDebBundler.java Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,980 +0,0 @@ -/* - * Copyright (c) 2012, 2018, 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.jpackager.internal.linux; - -import jdk.jpackager.internal.*; -import jdk.jpackager.internal.Arguments; -import jdk.jpackager.internal.bundlers.BundleParams; -import jdk.jpackager.internal.resources.linux.LinuxResources; - -import javax.imageio.ImageIO; -import java.awt.image.BufferedImage; -import java.io.*; -import java.nio.file.Files; -import java.nio.file.attribute.PosixFilePermission; -import java.nio.file.attribute.PosixFilePermissions; -import java.text.MessageFormat; -import java.util.*; -import java.util.logging.Level; -import java.util.logging.Logger; -import java.util.regex.Pattern; - -import static jdk.jpackager.internal.StandardBundlerParam.*; -import static jdk.jpackager.internal.linux.LinuxAppBundler.ICON_PNG; -import static jdk.jpackager.internal.linux.LinuxAppBundler.LINUX_INSTALL_DIR; -import static - jdk.jpackager.internal.linux.LinuxAppBundler.LINUX_PACKAGE_DEPENDENCIES; - -public class LinuxDebBundler extends AbstractBundler { - - private static final ResourceBundle I18N = - ResourceBundle.getBundle( - "jdk.jpackager.internal.resources.linux.LinuxDebBundler"); - - public static final BundlerParamInfo APP_BUNDLER = - new StandardBundlerParam<>( - I18N.getString("param.app-bundler.name"), - I18N.getString("param.app-bundler.description"), - "linux.app.bundler", - LinuxAppBundler.class, - params -> new LinuxAppBundler(), - (s, p) -> null); - - // Debian rules for package naming are used here - // https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Source - // - // Package names must consist only of lower case letters (a-z), - // digits (0-9), plus (+) and minus (-) signs, and periods (.). - // They must be at least two characters long and - // must start with an alphanumeric character. - // - private static final Pattern DEB_BUNDLE_NAME_PATTERN = - Pattern.compile("^[a-z][a-z\\d\\+\\-\\.]+"); - - public static final BundlerParamInfo BUNDLE_NAME = - new StandardBundlerParam<> ( - I18N.getString("param.bundle-name.name"), - I18N.getString("param.bundle-name.description"), - Arguments.CLIOptions.LINUX_BUNDLE_NAME.getId(), - String.class, - params -> { - String nm = APP_NAME.fetchFrom(params); - - if (nm == null) return null; - - // make sure to lower case and spaces/underscores become dashes - nm = nm.toLowerCase().replaceAll("[ _]", "-"); - return nm; - }, - (s, p) -> { - if (!DEB_BUNDLE_NAME_PATTERN.matcher(s).matches()) { - throw new IllegalArgumentException(new ConfigException( - MessageFormat.format(I18N.getString( - "error.invalid-value-for-package-name"), s), - I18N.getString( - "error.invalid-value-for-package-name.advice"))); - } - - return s; - }); - - public static final BundlerParamInfo FULL_PACKAGE_NAME = - new StandardBundlerParam<> ( - I18N.getString("param.full-package-name.name"), - I18N.getString("param.full-package-name.description"), - "linux.deb.fullPackageName", - String.class, - params -> BUNDLE_NAME.fetchFrom(params) + "-" - + VERSION.fetchFrom(params), - (s, p) -> s); - - public static final BundlerParamInfo CONFIG_ROOT = - new StandardBundlerParam<>( - I18N.getString("param.config-root.name"), - I18N.getString("param.config-root.description"), - "configRoot", - File.class, - params -> new File(BUILD_ROOT.fetchFrom(params), "linux"), - (s, p) -> new File(s)); - - public static final BundlerParamInfo DEB_IMAGE_DIR = - new StandardBundlerParam<>( - I18N.getString("param.image-dir.name"), - I18N.getString("param.image-dir.description"), - "linux.deb.imageDir", - File.class, - params -> { - File imagesRoot = IMAGES_ROOT.fetchFrom(params); - if (!imagesRoot.exists()) imagesRoot.mkdirs(); - return new File(new File(imagesRoot, "linux-deb.image"), - FULL_PACKAGE_NAME.fetchFrom(params)); - }, - (s, p) -> new File(s)); - - public static final BundlerParamInfo APP_IMAGE_ROOT = - new StandardBundlerParam<>( - I18N.getString("param.app-image-root.name"), - I18N.getString("param.app-image-root.description"), - "linux.deb.imageRoot", - File.class, - params -> { - File imageDir = DEB_IMAGE_DIR.fetchFrom(params); - return new File(imageDir, LINUX_INSTALL_DIR.fetchFrom(params)); - }, - (s, p) -> new File(s)); - - public static final BundlerParamInfo CONFIG_DIR = - new StandardBundlerParam<>( - I18N.getString("param.config-dir.name"), - I18N.getString("param.config-dir.description"), - "linux.deb.configDir", - File.class, - params -> new File(DEB_IMAGE_DIR.fetchFrom(params), "DEBIAN"), - (s, p) -> new File(s)); - - public static final BundlerParamInfo EMAIL = - new StandardBundlerParam<> ( - I18N.getString("param.maintainer-email.name"), - I18N.getString("param.maintainer-email.description"), - BundleParams.PARAM_EMAIL, - String.class, - params -> "Unknown", - (s, p) -> s); - - public static final BundlerParamInfo MAINTAINER = - new StandardBundlerParam<> ( - I18N.getString("param.maintainer-name.name"), - I18N.getString("param.maintainer-name.description"), - Arguments.CLIOptions.LINUX_DEB_MAINTAINER.getId(), - String.class, - params -> VENDOR.fetchFrom(params) + " <" - + EMAIL.fetchFrom(params) + ">", - (s, p) -> s); - - public static final BundlerParamInfo LICENSE_TEXT = - new StandardBundlerParam<> ( - I18N.getString("param.license-text.name"), - I18N.getString("param.license-text.description"), - "linux.deb.licenseText", - String.class, - params -> { - try { - List licenseFiles = LICENSE_FILE.fetchFrom(params); - - //need to copy license file to the root of linux-app.image - if (licenseFiles.size() > 0) { - String licFileStr = licenseFiles.get(0); - - for (RelativeFileSet rfs : - APP_RESOURCES_LIST.fetchFrom(params)) { - if (rfs.contains(licFileStr)) { - return new String(Files.readAllBytes(( - new File(rfs.getBaseDirectory(), - licFileStr)).toPath())); - } - } - } - } catch (Exception e) { - if (Log.isDebug()) { - e.printStackTrace(); - } - } - return "Unknown"; - }, - (s, p) -> s); - - public static final BundlerParamInfo XDG_FILE_PREFIX = - new StandardBundlerParam<> ( - I18N.getString("param.xdg-prefix.name"), - I18N.getString("param.xdg-prefix.description"), - "linux.xdg-prefix", - String.class, - params -> { - try { - String vendor; - if (params.containsKey(VENDOR.getID())) { - vendor = VENDOR.fetchFrom(params); - } else { - vendor = "jpackager"; - } - String appName = APP_FS_NAME.fetchFrom(params); - - return (appName + "-" + vendor).replaceAll("\\s", ""); - } catch (Exception e) { - if (Log.isDebug()) { - e.printStackTrace(); - } - } - return "unknown-MimeInfo.xml"; - }, - (s, p) -> s); - - private final static String DEFAULT_ICON = "javalogo_white_32.png"; - private final static String DEFAULT_CONTROL_TEMPLATE = "template.control"; - private final static String DEFAULT_PRERM_TEMPLATE = "template.prerm"; - private final static String DEFAULT_PREINSTALL_TEMPLATE = - "template.preinst"; - private final static String DEFAULT_POSTRM_TEMPLATE = "template.postrm"; - private final static String DEFAULT_POSTINSTALL_TEMPLATE = - "template.postinst"; - private final static String DEFAULT_COPYRIGHT_TEMPLATE = - "template.copyright"; - private final static String DEFAULT_DESKTOP_FILE_TEMPLATE = - "template.desktop"; - - public final static String TOOL_DPKG = "dpkg-deb"; - - public LinuxDebBundler() { - super(); - baseResourceLoader = LinuxResources.class; - } - - public static boolean testTool(String toolName, String minVersion) { - try { - ProcessBuilder pb = new ProcessBuilder( - toolName, - "--version"); - // not interested in the output - IOUtils.exec(pb, Log.isDebug(), true); - } catch (Exception e) { - Log.verbose(MessageFormat.format(I18N.getString( - "message.test-for-tool"), toolName, e.getMessage())); - return false; - } - return true; - } - - @Override - public boolean validate(Map p) - throws UnsupportedPlatformException, ConfigException { - try { - if (p == 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).doValidate(p); - - // NOTE: Can we validate that the required tools are available - // before we start? - if (!testTool(TOOL_DPKG, "1")){ - throw new ConfigException(MessageFormat.format( - I18N.getString("error.tool-not-found"), TOOL_DPKG), - I18N.getString("error.tool-not-found.advice")); - } - - - // validate license file, if used, exists in the proper place - if (p.containsKey(LICENSE_FILE.getID())) { - List appResourcesList = - APP_RESOURCES_LIST.fetchFrom(p); - for (String license : LICENSE_FILE.fetchFrom(p)) { - boolean found = false; - for (RelativeFileSet appResources : appResourcesList) { - found = found || appResources.contains(license); - } - if (!found) { - throw new ConfigException( - I18N.getString("error.license-missing"), - MessageFormat.format(I18N.getString( - "error.license-missing.advice"), - license)); - } - } - } else { - Log.verbose(I18N.getString("message.debs-like-licenses")); - } - - // only one mime type per association, at least one file extention - List> associations = - FILE_ASSOCIATIONS.fetchFrom(p); - if (associations != null) { - for (int i = 0; i < associations.size(); i++) { - Map assoc = associations.get(i); - List mimes = FA_CONTENT_TYPE.fetchFrom(assoc); - if (mimes == null || mimes.isEmpty()) { - String msgKey = - "error.no-content-types-for-file-association"; - throw new ConfigException( - MessageFormat.format(I18N.getString(msgKey), i), - I18N.getString(msgKey + ".advise")); - - } else if (mimes.size() > 1) { - String msgKey = - "error.too-many-content-types-for-file-association"; - throw new ConfigException( - MessageFormat.format(I18N.getString(msgKey), i), - I18N.getString(msgKey + ".advise")); - } - } - } - - // bundle name has some restrictions - // the string converter will throw an exception if invalid - BUNDLE_NAME.getStringConverter().apply(BUNDLE_NAME.fetchFrom(p), p); - - return true; - } catch (RuntimeException re) { - if (re.getCause() instanceof ConfigException) { - throw (ConfigException) re.getCause(); - } else { - throw new ConfigException(re); - } - } - } - - private boolean prepareProto(Map p) - throws IOException { - File appImage = StandardBundlerParam.getPredefinedAppImage(p); - 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)); - // 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); - } - return appDir != null; - } - - //@Override - public File bundle(Map p, File outdir) { - if (!outdir.isDirectory() && !outdir.mkdirs()) { - throw new RuntimeException(MessageFormat.format( - I18N.getString("error.cannot-create-output-dir"), - outdir.getAbsolutePath())); - } - if (!outdir.canWrite()) { - throw new RuntimeException(MessageFormat.format( - I18N.getString("error.cannot-write-to-output-dir"), - outdir.getAbsolutePath())); - } - - // we want to create following structure - // - // DEBIAN - // control (file with main package details) - // menu (request to create menu) - // ... other control files if needed .... - // opt (by default) - // AppFolder (this is where app image goes) - // launcher executable - // app - // runtime - - File imageDir = DEB_IMAGE_DIR.fetchFrom(p); - File configDir = CONFIG_DIR.fetchFrom(p); - - try { - - imageDir.mkdirs(); - configDir.mkdirs(); - if (prepareProto(p) && prepareProjectConfig(p)) { - return buildDeb(p, outdir); - } - return null; - } catch (IOException ex) { - ex.printStackTrace(); - return null; - } finally { - try { - if (imageDir != null && - PREDEFINED_APP_IMAGE.fetchFrom(p) == null && - (PREDEFINED_RUNTIME_IMAGE.fetchFrom(p) == null || - !Arguments.CREATE_JRE_INSTALLER.fetchFrom(p)) && - !Log.isDebug() && - !Log.isVerbose()) { - IOUtils.deleteRecursive(imageDir); - } else if (imageDir != null) { - Log.verbose(MessageFormat.format(I18N.getString( - "message.debug-working-directory"), - imageDir.getAbsolutePath())); - } - } catch (IOException ex) { - //noinspection ReturnInsideFinallyBlock - Log.debug(ex.getMessage()); - return null; - } - } - } - - /* - * set permissions with a string like "rwxr-xr-x" - * - * This cannot be directly backport to 22u which is built with 1.6 - */ - private void setPermissions(File file, String permissions) { - Set filePermissions = - PosixFilePermissions.fromString(permissions); - try { - if (file.exists()) { - Files.setPosixFilePermissions(file.toPath(), filePermissions); - } - } catch (IOException ex) { - Logger.getLogger(LinuxDebBundler.class.getName()).log( - Level.SEVERE, null, ex); - } - - } - - private String getArch() { - String arch = System.getProperty("os.arch"); - if ("i386".equals(arch)) - return "i386"; - else - return "amd64"; - } - - private long getInstalledSizeKB(Map params) { - return getInstalledSizeKB(APP_IMAGE_ROOT.fetchFrom(params)) >> 10; - } - - private long getInstalledSizeKB(File dir) { - long count = 0; - File[] children = dir.listFiles(); - if (children != null) { - for (File file : children) { - if (file.isFile()) { - count += file.length(); - } - else if (file.isDirectory()) { - count += getInstalledSizeKB(file); - } - } - } - return count; - } - - private boolean prepareProjectConfig(Map params) - throws IOException { - Map data = createReplacementData(params); - File rootDir = LinuxAppBundler.getRootDir(APP_IMAGE_ROOT.fetchFrom( - params), params); - - File iconTarget = getConfig_IconFile(rootDir, params); - File icon = ICON_PNG.fetchFrom(params); - if (!Arguments.CREATE_JRE_INSTALLER.fetchFrom(params)) { - // prepare installer icon - if (icon == null || !icon.exists()) { - fetchResource(LinuxAppBundler.LINUX_BUNDLER_PREFIX - + iconTarget.getName(), - I18N.getString("resource.menu-icon"), - DEFAULT_ICON, - iconTarget, - VERBOSE.fetchFrom(params), - DROP_IN_RESOURCES_ROOT.fetchFrom(params)); - } else { - fetchResource(LinuxAppBundler.LINUX_BUNDLER_PREFIX - + iconTarget.getName(), - I18N.getString("resource.menu-icon"), - icon, - iconTarget, - VERBOSE.fetchFrom(params), - DROP_IN_RESOURCES_ROOT.fetchFrom(params)); - } - } - - StringBuilder installScripts = new StringBuilder(); - StringBuilder removeScripts = new StringBuilder(); - for (Map secondaryLauncher : - SECONDARY_LAUNCHERS.fetchFrom(params)) { - Map secondaryLauncherData = - createReplacementData(secondaryLauncher); - secondaryLauncherData.put("APPLICATION_FS_NAME", - data.get("APPLICATION_FS_NAME")); - secondaryLauncherData.put("DESKTOP_MIMES", ""); - - if (!Arguments.CREATE_JRE_INSTALLER.fetchFrom(params)) { - // prepare desktop shortcut - Writer w = new BufferedWriter(new FileWriter( - getConfig_DesktopShortcutFile( - rootDir, secondaryLauncher))); - String content = preprocessTextResource( - LinuxAppBundler.LINUX_BUNDLER_PREFIX - + getConfig_DesktopShortcutFile(rootDir, - secondaryLauncher).getName(), - I18N.getString("resource.menu-shortcut-descriptor"), - DEFAULT_DESKTOP_FILE_TEMPLATE, - secondaryLauncherData, - VERBOSE.fetchFrom(params), - DROP_IN_RESOURCES_ROOT.fetchFrom(params)); - w.write(content); - w.close(); - } - - // prepare installer icon - iconTarget = getConfig_IconFile(rootDir, secondaryLauncher); - icon = ICON_PNG.fetchFrom(secondaryLauncher); - if (icon == null || !icon.exists()) { - fetchResource(LinuxAppBundler.LINUX_BUNDLER_PREFIX - + iconTarget.getName(), - I18N.getString("resource.menu-icon"), - DEFAULT_ICON, - iconTarget, - VERBOSE.fetchFrom(params), - DROP_IN_RESOURCES_ROOT.fetchFrom(params)); - } else { - fetchResource(LinuxAppBundler.LINUX_BUNDLER_PREFIX - + iconTarget.getName(), - I18N.getString("resource.menu-icon"), - icon, - iconTarget, - VERBOSE.fetchFrom(params), - DROP_IN_RESOURCES_ROOT.fetchFrom(params)); - } - - // postinst copying of desktop icon - installScripts.append( - " xdg-desktop-menu install --novendor "); - installScripts.append(LINUX_INSTALL_DIR.fetchFrom(params)); - installScripts.append("/"); - installScripts.append(data.get("APPLICATION_FS_NAME")); - installScripts.append("/"); - installScripts.append( - secondaryLauncherData.get("APPLICATION_LAUNCHER_FILENAME")); - installScripts.append(".desktop\n"); - - //postrm cleanup of desktop icon - removeScripts.append( - " xdg-desktop-menu uninstall --novendor "); - removeScripts.append(LINUX_INSTALL_DIR.fetchFrom(params)); - removeScripts.append("/"); - removeScripts.append(data.get("APPLICATION_FS_NAME")); - removeScripts.append("/"); - removeScripts.append( - secondaryLauncherData.get("APPLICATION_LAUNCHER_FILENAME")); - removeScripts.append(".desktop\n"); - } - data.put("SECONDARY_LAUNCHERS_INSTALL", installScripts.toString()); - data.put("SECONDARY_LAUNCHERS_REMOVE", removeScripts.toString()); - - List> associations = - FILE_ASSOCIATIONS.fetchFrom(params); - data.put("FILE_ASSOCIATION_INSTALL", ""); - data.put("FILE_ASSOCIATION_REMOVE", ""); - data.put("DESKTOP_MIMES", ""); - if (associations != null) { - String mimeInfoFile = XDG_FILE_PREFIX.fetchFrom(params) - + "-MimeInfo.xml"; - StringBuilder mimeInfo = new StringBuilder( - "\n\n"); - StringBuilder registrations = new StringBuilder(); - StringBuilder deregistrations = new StringBuilder(); - StringBuilder desktopMimes = new StringBuilder("MimeType="); - boolean addedEntry = false; - - for (Map assoc : associations) { - // - // Awesome document - // - // - // - - if (assoc == null) { - continue; - } - - String description = FA_DESCRIPTION.fetchFrom(assoc); - File faIcon = FA_ICON.fetchFrom(assoc); - List extensions = FA_EXTENSIONS.fetchFrom(assoc); - if (extensions == null) { - Log.error(I18N.getString( - "message.creating-association-with-null-extension")); - } - - List mimes = FA_CONTENT_TYPE.fetchFrom(assoc); - if (mimes == null || mimes.isEmpty()) { - continue; - } - String thisMime = mimes.get(0); - String dashMime = thisMime.replace('/', '-'); - - mimeInfo.append(" \n"); - if (description != null && !description.isEmpty()) { - mimeInfo.append(" ") - .append(description) - .append("\n"); - } - - if (extensions != null) { - for (String ext : extensions) { - mimeInfo.append(" \n"); - } - } - - mimeInfo.append(" \n"); - if (!addedEntry) { - registrations.append(" xdg-mime install ") - .append(LINUX_INSTALL_DIR.fetchFrom(params)) - .append("/") - .append(data.get("APPLICATION_FS_NAME")) - .append("/") - .append(mimeInfoFile) - .append("\n"); - - deregistrations.append(" xdg-mime uninstall ") - .append(LINUX_INSTALL_DIR.fetchFrom(params)) - .append("/") - .append(data.get("APPLICATION_FS_NAME")) - .append("/") - .append(mimeInfoFile) - .append("\n"); - addedEntry = true; - } else { - desktopMimes.append(";"); - } - desktopMimes.append(thisMime); - - if (faIcon != null && faIcon.exists()) { - int size = getSquareSizeOfImage(faIcon); - - if (size > 0) { - File target = new File(rootDir, - APP_FS_NAME.fetchFrom(params) - + "_fa_" + faIcon.getName()); - IOUtils.copyFile(faIcon, target); - - // xdg-icon-resource install --context mimetypes - // --size 64 awesomeapp_fa_1.png - // application-x.vnd-awesome - registrations.append( - " xdg-icon-resource install " - + "--context mimetypes --size ") - .append(size) - .append(" ") - .append(LINUX_INSTALL_DIR.fetchFrom(params)) - .append("/") - .append(data.get("APPLICATION_FS_NAME")) - .append("/") - .append(target.getName()) - .append(" ") - .append(dashMime) - .append("\n"); - - // x dg-icon-resource uninstall --context mimetypes - // --size 64 awesomeapp_fa_1.png - // application-x.vnd-awesome - deregistrations.append( - " xdg-icon-resource uninstall " - + "--context mimetypes --size ") - .append(size) - .append(" ") - .append(LINUX_INSTALL_DIR.fetchFrom(params)) - .append("/") - .append(data.get("APPLICATION_FS_NAME")) - .append("/") - .append(target.getName()) - .append(" ") - .append(dashMime) - .append("\n"); - } - } - } - mimeInfo.append(""); - - if (addedEntry) { - Writer w = new BufferedWriter(new FileWriter( - new File(rootDir, mimeInfoFile))); - w.write(mimeInfo.toString()); - w.close(); - data.put("FILE_ASSOCIATION_INSTALL", registrations.toString()); - data.put("FILE_ASSOCIATION_REMOVE", deregistrations.toString()); - data.put("DESKTOP_MIMES", desktopMimes.toString()); - } - } - - if (!Arguments.CREATE_JRE_INSTALLER.fetchFrom(params)) { - //prepare desktop shortcut - Writer w = new BufferedWriter(new FileWriter( - getConfig_DesktopShortcutFile(rootDir, params))); - String content = preprocessTextResource( - LinuxAppBundler.LINUX_BUNDLER_PREFIX - + getConfig_DesktopShortcutFile( - rootDir, params).getName(), - I18N.getString("resource.menu-shortcut-descriptor"), - DEFAULT_DESKTOP_FILE_TEMPLATE, - data, - VERBOSE.fetchFrom(params), - DROP_IN_RESOURCES_ROOT.fetchFrom(params)); - w.write(content); - w.close(); - } - // prepare control file - Writer w = new BufferedWriter(new FileWriter( - getConfig_ControlFile(params))); - String content = preprocessTextResource( - LinuxAppBundler.LINUX_BUNDLER_PREFIX - + getConfig_ControlFile(params).getName(), - I18N.getString("resource.deb-control-file"), - DEFAULT_CONTROL_TEMPLATE, - data, - VERBOSE.fetchFrom(params), - DROP_IN_RESOURCES_ROOT.fetchFrom(params)); - w.write(content); - w.close(); - - w = new BufferedWriter(new FileWriter( - getConfig_PreinstallFile(params))); - content = preprocessTextResource( - LinuxAppBundler.LINUX_BUNDLER_PREFIX - + getConfig_PreinstallFile(params).getName(), - I18N.getString("resource.deb-preinstall-script"), - DEFAULT_PREINSTALL_TEMPLATE, - data, - VERBOSE.fetchFrom(params), - DROP_IN_RESOURCES_ROOT.fetchFrom(params)); - w.write(content); - w.close(); - setPermissions(getConfig_PreinstallFile(params), "rwxr-xr-x"); - - w = new BufferedWriter(new FileWriter(getConfig_PrermFile(params))); - content = preprocessTextResource( - LinuxAppBundler.LINUX_BUNDLER_PREFIX - + getConfig_PrermFile(params).getName(), - I18N.getString("resource.deb-prerm-script"), - DEFAULT_PRERM_TEMPLATE, - data, - VERBOSE.fetchFrom(params), - DROP_IN_RESOURCES_ROOT.fetchFrom(params)); - w.write(content); - w.close(); - setPermissions(getConfig_PrermFile(params), "rwxr-xr-x"); - - w = new BufferedWriter(new FileWriter( - getConfig_PostinstallFile(params))); - content = preprocessTextResource( - LinuxAppBundler.LINUX_BUNDLER_PREFIX - + getConfig_PostinstallFile(params).getName(), - I18N.getString("resource.deb-postinstall-script"), - DEFAULT_POSTINSTALL_TEMPLATE, - data, - VERBOSE.fetchFrom(params), - DROP_IN_RESOURCES_ROOT.fetchFrom(params)); - w.write(content); - w.close(); - setPermissions(getConfig_PostinstallFile(params), "rwxr-xr-x"); - - w = new BufferedWriter(new FileWriter(getConfig_PostrmFile(params))); - content = preprocessTextResource( - LinuxAppBundler.LINUX_BUNDLER_PREFIX - + getConfig_PostrmFile(params).getName(), - I18N.getString("resource.deb-postrm-script"), - DEFAULT_POSTRM_TEMPLATE, - data, - VERBOSE.fetchFrom(params), - DROP_IN_RESOURCES_ROOT.fetchFrom(params)); - w.write(content); - w.close(); - setPermissions(getConfig_PostrmFile(params), "rwxr-xr-x"); - - w = new BufferedWriter(new FileWriter(getConfig_CopyrightFile(params))); - content = preprocessTextResource( - LinuxAppBundler.LINUX_BUNDLER_PREFIX - + getConfig_CopyrightFile(params).getName(), - I18N.getString("resource.deb-copyright-file"), - DEFAULT_COPYRIGHT_TEMPLATE, - data, - VERBOSE.fetchFrom(params), - DROP_IN_RESOURCES_ROOT.fetchFrom(params)); - w.write(content); - w.close(); - - return true; - } - - private Map createReplacementData( - Map params) { - Map data = new HashMap<>(); - - data.put("APPLICATION_NAME", APP_NAME.fetchFrom(params)); - data.put("APPLICATION_FS_NAME", APP_FS_NAME.fetchFrom(params)); - data.put("APPLICATION_PACKAGE", BUNDLE_NAME.fetchFrom(params)); - data.put("APPLICATION_VENDOR", VENDOR.fetchFrom(params)); - data.put("APPLICATION_MAINTAINER", MAINTAINER.fetchFrom(params)); - data.put("APPLICATION_VERSION", VERSION.fetchFrom(params)); - data.put("APPLICATION_LAUNCHER_FILENAME", - APP_FS_NAME.fetchFrom(params)); - data.put("INSTALLATION_DIRECTORY", LINUX_INSTALL_DIR.fetchFrom(params)); - data.put("XDG_PREFIX", XDG_FILE_PREFIX.fetchFrom(params)); - data.put("DEPLOY_BUNDLE_CATEGORY", CATEGORY.fetchFrom(params)); - data.put("APPLICATION_DESCRIPTION", DESCRIPTION.fetchFrom(params)); - data.put("APPLICATION_SUMMARY", TITLE.fetchFrom(params)); - data.put("APPLICATION_COPYRIGHT", COPYRIGHT.fetchFrom(params)); - data.put("APPLICATION_LICENSE_TEXT", LICENSE_TEXT.fetchFrom(params)); - data.put("APPLICATION_ARCH", getArch()); - data.put("APPLICATION_INSTALLED_SIZE", - Long.toString(getInstalledSizeKB(params))); - String deps = LINUX_PACKAGE_DEPENDENCIES.fetchFrom(params); - data.put("PACKAGE_DEPENDENCIES", - deps.isEmpty() ? "" : "Depends: " + deps); - data.put("CREATE_JRE_INSTALLER", - Arguments.CREATE_JRE_INSTALLER.fetchFrom(params).toString()); - - return data; - } - - private File getConfig_DesktopShortcutFile(File rootDir, - Map params) { - return new File(rootDir, - APP_FS_NAME.fetchFrom(params) + ".desktop"); - } - - private File getConfig_IconFile(File rootDir, - Map params) { - return new File(rootDir, - APP_FS_NAME.fetchFrom(params) + ".png"); - } - - private File getConfig_InitScriptFile(Map params) { - return new File(LinuxAppBundler.getRootDir( - APP_IMAGE_ROOT.fetchFrom(params), params), - BUNDLE_NAME.fetchFrom(params) + ".init"); - } - - private File getConfig_ControlFile(Map params) { - return new File(CONFIG_DIR.fetchFrom(params), "control"); - } - - private File getConfig_PreinstallFile(Map params) { - return new File(CONFIG_DIR.fetchFrom(params), "preinst"); - } - - private File getConfig_PrermFile(Map params) { - return new File(CONFIG_DIR.fetchFrom(params), "prerm"); - } - - private File getConfig_PostinstallFile(Map params) { - return new File(CONFIG_DIR.fetchFrom(params), "postinst"); - } - - private File getConfig_PostrmFile(Map params) { - return new File(CONFIG_DIR.fetchFrom(params), "postrm"); - } - - private File getConfig_CopyrightFile(Map params) { - return new File(CONFIG_DIR.fetchFrom(params), "copyright"); - } - - private File buildDeb(Map params, - File outdir) throws IOException { - File outFile = new File(outdir, - FULL_PACKAGE_NAME.fetchFrom(params)+".deb"); - Log.verbose(MessageFormat.format(I18N.getString( - "message.outputting-to-location"), outFile.getAbsolutePath())); - - outFile.getParentFile().mkdirs(); - - // run dpkg - ProcessBuilder pb = new ProcessBuilder( - "fakeroot", TOOL_DPKG, "-b", - FULL_PACKAGE_NAME.fetchFrom(params), - outFile.getAbsolutePath()); - pb = pb.directory(DEB_IMAGE_DIR.fetchFrom(params).getParentFile()); - IOUtils.exec(pb, false); - - Log.verbose(MessageFormat.format(I18N.getString( - "message.output-to-location"), outFile.getAbsolutePath())); - - return outFile; - } - - @Override - public String getName() { - return I18N.getString("bundler.name"); - } - - @Override - public String getDescription() { - return I18N.getString("bundler.description"); - } - - @Override - public String getID() { - return "deb"; - } - - @Override - public String getBundleType() { - return "INSTALLER"; - } - - @Override - public Collection> getBundleParameters() { - Collection> results = new LinkedHashSet<>(); - results.addAll(LinuxAppBundler.getAppBundleParameters()); - results.addAll(getDebBundleParameters()); - return results; - } - - public static Collection> getDebBundleParameters() { - return Arrays.asList( - BUNDLE_NAME, - COPYRIGHT, - CATEGORY, - DESCRIPTION, - EMAIL, - ICON_PNG, - LICENSE_FILE, - TITLE, - VENDOR - ); - } - - @Override - public File execute(Map params, - File outputParentDir) { - return bundle(params, outputParentDir); - } - - @Override - public boolean supported() { - return (Platform.getPlatform() == Platform.LINUX); - } - - public int getSquareSizeOfImage(File f) { - try { - BufferedImage bi = ImageIO.read(f); - if (bi.getWidth() == bi.getHeight()) { - return bi.getWidth(); - } else { - return 0; - } - } catch (Exception e) { - e.printStackTrace(); - return 0; - } - } -} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/linux/LinuxRpmBundler.java --- a/src/jdk.jpackager/linux/classes/jdk/jpackager/internal/linux/LinuxRpmBundler.java Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,808 +0,0 @@ -/* - * Copyright (c) 2012, 2018, 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.jpackager.internal.linux; - -import jdk.jpackager.internal.*; -import jdk.jpackager.internal.Arguments; -import jdk.jpackager.internal.resources.linux.LinuxResources; - -import javax.imageio.ImageIO; -import java.awt.image.BufferedImage; -import java.io.*; -import java.nio.file.Files; -import java.nio.file.attribute.PosixFilePermission; -import java.nio.file.attribute.PosixFilePermissions; -import java.text.MessageFormat; -import java.util.*; -import java.util.logging.Level; -import java.util.logging.Logger; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import static jdk.jpackager.internal.StandardBundlerParam.*; -import static jdk.jpackager.internal.linux.LinuxAppBundler.LINUX_INSTALL_DIR; -import static - jdk.jpackager.internal.linux.LinuxAppBundler.LINUX_PACKAGE_DEPENDENCIES; - -public class LinuxRpmBundler extends AbstractBundler { - - private static final ResourceBundle I18N = ResourceBundle.getBundle( - "jdk.jpackager.internal.resources.linux.LinuxRpmBundler"); - - public static final BundlerParamInfo APP_BUNDLER = - new StandardBundlerParam<>( - I18N.getString("param.app-bundler.name"), - I18N.getString("param.app-bundler.description"), - "linux.app.bundler", - LinuxAppBundler.class, - params -> new LinuxAppBundler(), - null); - - public static final BundlerParamInfo RPM_IMAGE_DIR = - new StandardBundlerParam<>( - I18N.getString("param.image-dir.name"), - I18N.getString("param.image-dir.description"), - "linux.rpm.imageDir", - File.class, - params -> { - File imagesRoot = IMAGES_ROOT.fetchFrom(params); - if (!imagesRoot.exists()) imagesRoot.mkdirs(); - return new File(imagesRoot, "linux-rpm.image"); - }, - (s, p) -> new File(s)); - - public static final BundlerParamInfo CONFIG_ROOT = - new StandardBundlerParam<>( - I18N.getString("param.config-root.name"), - I18N.getString("param.config-root.description"), - "configRoot", - File.class, - params -> new File(BUILD_ROOT.fetchFrom(params), "linux"), - (s, p) -> new File(s)); - - // Fedora rules for package naming are used here - // https://fedoraproject.org/wiki/Packaging:NamingGuidelines?rd=Packaging/NamingGuidelines - // - // all Fedora packages must be named using only the following ASCII - // characters. These characters are displayed here: - // - // abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._+ - // - private static final Pattern RPM_BUNDLE_NAME_PATTERN = - Pattern.compile("[a-z\\d\\+\\-\\.\\_]+", Pattern.CASE_INSENSITIVE); - - public static final BundlerParamInfo BUNDLE_NAME = - new StandardBundlerParam<> ( - I18N.getString("param.bundle-name.name"), - I18N.getString("param.bundle-name.description"), - Arguments.CLIOptions.LINUX_BUNDLE_NAME.getId(), - String.class, - params -> { - String nm = APP_NAME.fetchFrom(params); - if (nm == null) return null; - - // make sure to lower case and spaces become dashes - nm = nm.toLowerCase().replaceAll("[ ]", "-"); - - return nm; - }, - (s, p) -> { - if (!RPM_BUNDLE_NAME_PATTERN.matcher(s).matches()) { - String msgKey = "error.invalid-value-for-package-name"; - throw new IllegalArgumentException( - new ConfigException(MessageFormat.format( - I18N.getString(msgKey), s), - I18N.getString(msgKey + ".advice"))); - } - - return s; - } - ); - - public static final BundlerParamInfo LICENSE_TYPE = - new StandardBundlerParam<>( - I18N.getString("param.license-type.name"), - I18N.getString("param.license-type.description"), - Arguments.CLIOptions.LINUX_RPM_LICENSE_TYPE.getId(), - String.class, - params -> I18N.getString("param.license-type.default"), - (s, p) -> s - ); - - public static final BundlerParamInfo XDG_FILE_PREFIX = - new StandardBundlerParam<> ( - I18N.getString("param.xdg-prefix.name"), - I18N.getString("param.xdg-prefix.description"), - "linux.xdg-prefix", - String.class, - params -> { - try { - String vendor; - if (params.containsKey(VENDOR.getID())) { - vendor = VENDOR.fetchFrom(params); - } else { - vendor = "jpackager"; - } - String appName = APP_FS_NAME.fetchFrom(params); - - return (vendor + "-" + appName).replaceAll("\\s", ""); - } catch (Exception e) { - if (Log.isDebug()) { - e.printStackTrace(); - } - } - return "unknown-MimeInfo.xml"; - }, - (s, p) -> s); - - private final static String DEFAULT_ICON = "javalogo_white_32.png"; - private final static String DEFAULT_SPEC_TEMPLATE = "template.spec"; - private final static String DEFAULT_DESKTOP_FILE_TEMPLATE = - "template.desktop"; - - public final static String TOOL_RPMBUILD = "rpmbuild"; - public final static double TOOL_RPMBUILD_MIN_VERSION = 4.0d; - - public LinuxRpmBundler() { - super(); - baseResourceLoader = LinuxResources.class; - } - - public static boolean testTool(String toolName, double minVersion) { - try (ByteArrayOutputStream baos = new ByteArrayOutputStream(); - PrintStream ps = new PrintStream(baos)) { - ProcessBuilder pb = new ProcessBuilder(toolName, "--version"); - IOUtils.exec(pb, Log.isDebug(), false, ps); - //not interested in the above's output - String content = new String(baos.toByteArray()); - Pattern pattern = Pattern.compile(" (\\d+\\.\\d+)"); - Matcher matcher = pattern.matcher(content); - - if (matcher.find()) { - String v = matcher.group(1); - double version = Double.parseDouble(v); - return minVersion <= version; - } else { - return false; - } - } catch (Exception e) { - Log.verbose(MessageFormat.format(I18N.getString( - "message.test-for-tool"), toolName, e.getMessage())); - return false; - } - } - - @Override - public boolean validate(Map p) - throws UnsupportedPlatformException, ConfigException { - try { - if (p == 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).doValidate(p); - - // validate license file, if used, exists in the proper place - if (p.containsKey(LICENSE_FILE.getID())) { - List appResourcesList = - APP_RESOURCES_LIST.fetchFrom(p); - for (String license : LICENSE_FILE.fetchFrom(p)) { - boolean found = false; - for (RelativeFileSet appResources : appResourcesList) { - found = found || appResources.contains(license); - } - if (!found) { - throw new ConfigException( - I18N.getString("error.license-missing"), - MessageFormat.format( - I18N.getString("error.license-missing.advice"), - license)); - } - } - } - - // validate presense of required tools - if (!testTool(TOOL_RPMBUILD, TOOL_RPMBUILD_MIN_VERSION)){ - throw new ConfigException( - MessageFormat.format( - I18N.getString("error.cannot-find-rpmbuild"), - TOOL_RPMBUILD_MIN_VERSION), - MessageFormat.format( - I18N.getString("error.cannot-find-rpmbuild.advice"), - TOOL_RPMBUILD_MIN_VERSION)); - } - - // only one mime type per association, at least one file extension - List> associations = - FILE_ASSOCIATIONS.fetchFrom(p); - if (associations != null) { - for (int i = 0; i < associations.size(); i++) { - Map assoc = associations.get(i); - List mimes = FA_CONTENT_TYPE.fetchFrom(assoc); - if (mimes == null || mimes.isEmpty()) { - String msgKey = - "error.no-content-types-for-file-association"; - throw new ConfigException( - MessageFormat.format(I18N.getString(msgKey), i), - I18N.getString(msgKey + ".advice")); - } else if (mimes.size() > 1) { - String msgKey = - "error.no-content-types-for-file-association"; - throw new ConfigException( - MessageFormat.format(I18N.getString(msgKey), i), - I18N.getString(msgKey + ".advice")); - } - } - } - - // bundle name has some restrictions - // the string converter will throw an exception if invalid - BUNDLE_NAME.getStringConverter().apply(BUNDLE_NAME.fetchFrom(p), p); - - return true; - } catch (RuntimeException re) { - if (re.getCause() instanceof ConfigException) { - throw (ConfigException) re.getCause(); - } else { - throw new ConfigException(re); - } - } - } - - private boolean prepareProto(Map p) - throws IOException { - File appImage = StandardBundlerParam.getPredefinedAppImage(p); - 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)); - // 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); - } - return appDir != null; - } - - public File bundle(Map p, File outdir) { - if (!outdir.isDirectory() && !outdir.mkdirs()) { - throw new RuntimeException(MessageFormat.format( - I18N.getString("error.cannot-create-output-dir"), - outdir.getAbsolutePath())); - } - if (!outdir.canWrite()) { - throw new RuntimeException(MessageFormat.format( - I18N.getString("error.cannot-write-to-output-dir"), - outdir.getAbsolutePath())); - } - - File imageDir = RPM_IMAGE_DIR.fetchFrom(p); - try { - - imageDir.mkdirs(); - - if (prepareProto(p) && prepareProjectConfig(p)) { - return buildRPM(p, outdir); - } - return null; - } catch (IOException ex) { - ex.printStackTrace(); - return null; - } finally { - try { - if (imageDir != null && - PREDEFINED_APP_IMAGE.fetchFrom(p) == null && - (PREDEFINED_RUNTIME_IMAGE.fetchFrom(p) == null || - !Arguments.CREATE_JRE_INSTALLER.fetchFrom(p)) && - !Log.isDebug() && - !Log.isVerbose()) { - IOUtils.deleteRecursive(imageDir); - } else if (imageDir != null) { - Log.verbose(MessageFormat.format(I18N.getString( - "message.debug-working-directory"), - imageDir.getAbsolutePath())); - } - } catch (IOException ex) { - // noinspection ReturnInsideFinallyBlock - Log.debug(ex.getMessage()); - return null; - } - } - } - - /* - * set permissions with a string like "rwxr-xr-x" - * - * This cannot be directly backport to 22u which is built with 1.6 - */ - private void setPermissions(File file, String permissions) { - Set filePermissions = - PosixFilePermissions.fromString(permissions); - try { - if (file.exists()) { - Files.setPosixFilePermissions(file.toPath(), filePermissions); - } - } catch (IOException ex) { - Logger.getLogger(LinuxDebBundler.class.getName()).log( - Level.SEVERE, null, ex); - } - } - - private String getLicenseFileString(Map params) { - StringBuilder sb = new StringBuilder(); - for (String f: LICENSE_FILE.fetchFrom(params)) { - if (sb.length() != 0) { - sb.append("\n"); - } - sb.append("%doc "); - sb.append(LINUX_INSTALL_DIR.fetchFrom(params)); - sb.append("/"); - sb.append(APP_FS_NAME.fetchFrom(params)); - sb.append("/app/"); - sb.append(f); - } - return sb.toString(); - } - - private boolean prepareProjectConfig(Map params) - throws IOException { - Map data = createReplacementData(params); - File rootDir = - LinuxAppBundler.getRootDir(RPM_IMAGE_DIR.fetchFrom(params), params); - - // prepare installer icon - File iconTarget = getConfig_IconFile(rootDir, params); - File icon = LinuxAppBundler.ICON_PNG.fetchFrom(params); - if (!Arguments.CREATE_JRE_INSTALLER.fetchFrom(params)) { - if (icon == null || !icon.exists()) { - fetchResource(LinuxAppBundler.LINUX_BUNDLER_PREFIX - + iconTarget.getName(), - I18N.getString("resource.menu-icon"), - DEFAULT_ICON, - iconTarget, - VERBOSE.fetchFrom(params), - DROP_IN_RESOURCES_ROOT.fetchFrom(params)); - } else { - fetchResource(LinuxAppBundler.LINUX_BUNDLER_PREFIX - + iconTarget.getName(), - I18N.getString("resource.menu-icon"), - icon, - iconTarget, - VERBOSE.fetchFrom(params), - DROP_IN_RESOURCES_ROOT.fetchFrom(params)); - } - } - - StringBuilder installScripts = new StringBuilder(); - StringBuilder removeScripts = new StringBuilder(); - for (Map secondaryLauncher : - SECONDARY_LAUNCHERS.fetchFrom(params)) { - Map secondaryLauncherData = - createReplacementData(secondaryLauncher); - secondaryLauncherData.put("APPLICATION_FS_NAME", - data.get("APPLICATION_FS_NAME")); - secondaryLauncherData.put("DESKTOP_MIMES", ""); - - // prepare desktop shortcut - Writer w = new BufferedWriter(new FileWriter( - getConfig_DesktopShortcutFile(rootDir, secondaryLauncher))); - String content = preprocessTextResource( - LinuxAppBundler.LINUX_BUNDLER_PREFIX - + getConfig_DesktopShortcutFile(rootDir, - secondaryLauncher).getName(), - I18N.getString("resource.menu-shortcut-descriptor"), - DEFAULT_DESKTOP_FILE_TEMPLATE, secondaryLauncherData, - VERBOSE.fetchFrom(params), - DROP_IN_RESOURCES_ROOT.fetchFrom(params)); - w.write(content); - w.close(); - - // prepare installer icon - iconTarget = getConfig_IconFile(rootDir, secondaryLauncher); - icon = LinuxAppBundler.ICON_PNG.fetchFrom(secondaryLauncher); - if (icon == null || !icon.exists()) { - fetchResource(LinuxAppBundler.LINUX_BUNDLER_PREFIX - + iconTarget.getName(), - I18N.getString("resource.menu-icon"), - DEFAULT_ICON, - iconTarget, - VERBOSE.fetchFrom(params), - DROP_IN_RESOURCES_ROOT.fetchFrom(params)); - } else { - fetchResource(LinuxAppBundler.LINUX_BUNDLER_PREFIX - + iconTarget.getName(), - I18N.getString("resource.menu-icon"), - icon, - iconTarget, - VERBOSE.fetchFrom(params), - DROP_IN_RESOURCES_ROOT.fetchFrom(params)); - } - - // post copying of desktop icon - installScripts.append("xdg-desktop-menu install --novendor "); - installScripts.append(LINUX_INSTALL_DIR.fetchFrom(params)); - installScripts.append("/"); - installScripts.append(data.get("APPLICATION_FS_NAME")); - installScripts.append("/"); - installScripts.append(secondaryLauncherData.get( - "APPLICATION_LAUNCHER_FILENAME")); - installScripts.append(".desktop\n"); - - // preun cleanup of desktop icon - removeScripts.append("xdg-desktop-menu uninstall --novendor "); - removeScripts.append(LINUX_INSTALL_DIR.fetchFrom(params)); - removeScripts.append("/"); - removeScripts.append(data.get("APPLICATION_FS_NAME")); - removeScripts.append("/"); - removeScripts.append(secondaryLauncherData.get( - "APPLICATION_LAUNCHER_FILENAME")); - removeScripts.append(".desktop\n"); - - } - data.put("SECONDARY_LAUNCHERS_INSTALL", installScripts.toString()); - data.put("SECONDARY_LAUNCHERS_REMOVE", removeScripts.toString()); - - StringBuilder cdsScript = new StringBuilder(); - - data.put("APP_CDS_CACHE", cdsScript.toString()); - - List> associations = - FILE_ASSOCIATIONS.fetchFrom(params); - data.put("FILE_ASSOCIATION_INSTALL", ""); - data.put("FILE_ASSOCIATION_REMOVE", ""); - data.put("DESKTOP_MIMES", ""); - if (associations != null) { - String mimeInfoFile = XDG_FILE_PREFIX.fetchFrom(params) - + "-MimeInfo.xml"; - StringBuilder mimeInfo = new StringBuilder( - "\n\n"); - StringBuilder registrations = new StringBuilder(); - StringBuilder deregistrations = new StringBuilder(); - StringBuilder desktopMimes = new StringBuilder("MimeType="); - boolean addedEntry = false; - - for (Map assoc : associations) { - // - // Awesome document - // - // - // - - if (assoc == null) { - continue; - } - - String description = FA_DESCRIPTION.fetchFrom(assoc); - File faIcon = FA_ICON.fetchFrom(assoc); //TODO FA_ICON_PNG - List extensions = FA_EXTENSIONS.fetchFrom(assoc); - if (extensions == null) { - Log.verbose(I18N.getString( - "message.creating-association-with-null-extension")); - } - - List mimes = FA_CONTENT_TYPE.fetchFrom(assoc); - if (mimes == null || mimes.isEmpty()) { - continue; - } - String thisMime = mimes.get(0); - String dashMime = thisMime.replace('/', '-'); - - mimeInfo.append(" \n"); - if (description != null && !description.isEmpty()) { - mimeInfo.append(" ") - .append(description) - .append("\n"); - } - - if (extensions != null) { - for (String ext : extensions) { - mimeInfo.append(" \n"); - } - } - - mimeInfo.append(" \n"); - if (!addedEntry) { - registrations.append("xdg-mime install ") - .append(LINUX_INSTALL_DIR.fetchFrom(params)) - .append("/") - .append(data.get("APPLICATION_FS_NAME")) - .append("/") - .append(mimeInfoFile) - .append("\n"); - - deregistrations.append("xdg-mime uninstall ") - .append(LINUX_INSTALL_DIR.fetchFrom(params)) - .append("/") - .append(data.get("APPLICATION_FS_NAME")) - .append("/") - .append(mimeInfoFile) - .append("\n"); - addedEntry = true; - } else { - desktopMimes.append(";"); - } - desktopMimes.append(thisMime); - - if (faIcon != null && faIcon.exists()) { - int size = getSquareSizeOfImage(faIcon); - - if (size > 0) { - File target = new File(rootDir, - APP_FS_NAME.fetchFrom(params) - + "_fa_" + faIcon.getName()); - IOUtils.copyFile(faIcon, target); - - // xdg-icon-resource install --context mimetypes - // --size 64 awesomeapp_fa_1.png - // application-x.vnd-awesome - registrations.append( - "xdg-icon-resource install " - + "--context mimetypes --size ") - .append(size) - .append(" ") - .append(LINUX_INSTALL_DIR.fetchFrom(params)) - .append("/") - .append(data.get("APPLICATION_FS_NAME")) - .append("/") - .append(target.getName()) - .append(" ") - .append(dashMime) - .append("\n"); - - // xdg-icon-resource uninstall --context mimetypes - // --size 64 awesomeapp_fa_1.png - // application-x.vnd-awesome - deregistrations.append( - "xdg-icon-resource uninstall " - + "--context mimetypes --size ") - .append(size) - .append(" ") - .append(LINUX_INSTALL_DIR.fetchFrom(params)) - .append("/") - .append(data.get("APPLICATION_FS_NAME")) - .append("/") - .append(target.getName()) - .append(" ") - .append(dashMime) - .append("\n"); - } - } - } - mimeInfo.append(""); - - if (addedEntry) { - Writer w = new BufferedWriter(new FileWriter( - new File(rootDir, mimeInfoFile))); - w.write(mimeInfo.toString()); - w.close(); - data.put("FILE_ASSOCIATION_INSTALL", registrations.toString()); - data.put("FILE_ASSOCIATION_REMOVE", deregistrations.toString()); - data.put("DESKTOP_MIMES", desktopMimes.toString()); - } - } - - if (!Arguments.CREATE_JRE_INSTALLER.fetchFrom(params)) { - //prepare desktop shortcut - Writer w = new BufferedWriter(new FileWriter( - getConfig_DesktopShortcutFile(rootDir, params))); - String content = preprocessTextResource( - LinuxAppBundler.LINUX_BUNDLER_PREFIX - + getConfig_DesktopShortcutFile(rootDir, - params).getName(), - I18N.getString("resource.menu-shortcut-descriptor"), - DEFAULT_DESKTOP_FILE_TEMPLATE, data, - VERBOSE.fetchFrom(params), - DROP_IN_RESOURCES_ROOT.fetchFrom(params)); - w.write(content); - w.close(); - } - - // prepare spec file - Writer w = new BufferedWriter( - new FileWriter(getConfig_SpecFile(params))); - String content = preprocessTextResource( - LinuxAppBundler.LINUX_BUNDLER_PREFIX - + getConfig_SpecFile(params).getName(), - I18N.getString("resource.rpm-spec-file"), - DEFAULT_SPEC_TEMPLATE, data, - VERBOSE.fetchFrom(params), - DROP_IN_RESOURCES_ROOT.fetchFrom(params)); - w.write(content); - w.close(); - - return true; - } - - private Map createReplacementData( - Map params) { - Map data = new HashMap<>(); - - data.put("APPLICATION_NAME", APP_NAME.fetchFrom(params)); - data.put("APPLICATION_FS_NAME", APP_FS_NAME.fetchFrom(params)); - data.put("APPLICATION_PACKAGE", BUNDLE_NAME.fetchFrom(params)); - data.put("APPLICATION_VENDOR", VENDOR.fetchFrom(params)); - data.put("APPLICATION_VERSION", VERSION.fetchFrom(params)); - data.put("APPLICATION_LAUNCHER_FILENAME", - APP_FS_NAME.fetchFrom(params)); - data.put("INSTALLATION_DIRECTORY", LINUX_INSTALL_DIR.fetchFrom(params)); - data.put("XDG_PREFIX", XDG_FILE_PREFIX.fetchFrom(params)); - data.put("DEPLOY_BUNDLE_CATEGORY", CATEGORY.fetchFrom(params)); - // TODO rpm categories - data.put("APPLICATION_DESCRIPTION", DESCRIPTION.fetchFrom(params)); - data.put("APPLICATION_SUMMARY", TITLE.fetchFrom(params)); - data.put("APPLICATION_LICENSE_TYPE", LICENSE_TYPE.fetchFrom(params)); - data.put("APPLICATION_LICENSE_FILE", getLicenseFileString(params)); - String deps = LINUX_PACKAGE_DEPENDENCIES.fetchFrom(params); - data.put("PACKAGE_DEPENDENCIES", - deps.isEmpty() ? "" : "Requires: " + deps); - data.put("CREATE_JRE_INSTALLER", - Arguments.CREATE_JRE_INSTALLER.fetchFrom(params).toString()); - return data; - } - - private File getConfig_DesktopShortcutFile(File rootDir, - Map params) { - return new File(rootDir, - APP_FS_NAME.fetchFrom(params) + ".desktop"); - } - - private File getConfig_IconFile(File rootDir, - Map params) { - return new File(rootDir, - APP_FS_NAME.fetchFrom(params) + ".png"); - } - - private File getConfig_SpecFile(Map params) { - return new File(RPM_IMAGE_DIR.fetchFrom(params), - APP_FS_NAME.fetchFrom(params) + ".spec"); - } - - private File buildRPM(Map params, - File outdir) throws IOException { - Log.verbose(MessageFormat.format(I18N.getString( - "message.outputting-bundle-location"), - outdir.getAbsolutePath())); - - File broot = new File(BUILD_ROOT.fetchFrom(params), "rmpbuildroot"); - - outdir.mkdirs(); - - //run rpmbuild - ProcessBuilder pb = new ProcessBuilder( - TOOL_RPMBUILD, - "-bb", getConfig_SpecFile(params).getAbsolutePath(), - "--define", "%_sourcedir " - + RPM_IMAGE_DIR.fetchFrom(params).getAbsolutePath(), - // save result to output dir - "--define", "%_rpmdir " + outdir.getAbsolutePath(), - // do not use other system directories to build as current user - "--define", "%_topdir " + broot.getAbsolutePath() - ); - pb = pb.directory(RPM_IMAGE_DIR.fetchFrom(params)); - IOUtils.exec(pb, false); - - if (!Log.isDebug() && !Log.isVerbose()) { - IOUtils.deleteRecursive(broot); - } - - Log.verbose(MessageFormat.format( - I18N.getString("message.output-bundle-location"), - outdir.getAbsolutePath())); - - // presume the result is the ".rpm" file with the newest modified time - // not the best solution, but it is the most reliable - File result = null; - long lastModified = 0; - File[] list = outdir.listFiles(); - if (list != null) { - for (File f : list) { - if (f.getName().endsWith(".rpm") && - f.lastModified() > lastModified) { - result = f; - lastModified = f.lastModified(); - } - } - } - - return result; - } - - @Override - public String getName() { - return I18N.getString("bundler.name"); - } - - @Override - public String getDescription() { - return I18N.getString("bundler.description"); - } - - @Override - public String getID() { - return "rpm"; - } - - @Override - public String getBundleType() { - return "INSTALLER"; - } - - @Override - public Collection> getBundleParameters() { - Collection> results = new LinkedHashSet<>(); - results.addAll(LinuxAppBundler.getAppBundleParameters()); - results.addAll(getRpmBundleParameters()); - return results; - } - - public static Collection> getRpmBundleParameters() { - return Arrays.asList( - BUNDLE_NAME, - CATEGORY, - DESCRIPTION, - LinuxAppBundler.ICON_PNG, - LICENSE_FILE, - LICENSE_TYPE, - TITLE, - VENDOR - ); - } - - @Override - public File execute( - Map params, File outputParentDir) { - return bundle(params, outputParentDir); - } - - @Override - public boolean supported() { - return (Platform.getPlatform() == Platform.LINUX); - } - - public int getSquareSizeOfImage(File f) { - try { - BufferedImage bi = ImageIO.read(f); - if (bi.getWidth() == bi.getHeight()) { - return bi.getWidth(); - } else { - return 0; - } - } catch (Exception e) { - e.printStackTrace(); - return 0; - } - } -} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/LinuxAppBundler.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/LinuxAppBundler.properties Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,43 @@ +# +# Copyright (c) 2017, 2018, 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. +# +# + +bundler.name=Linux Application Image +bundler.description=A Directory based image of a linux Application with an optionally co-bundled JRE. Used as a base for the Installer bundlers. + +param.icon-png.name=.png Icon +param.icon-png.description=Icon for the application, in PNG format. + +param.linux-install-dir.name=Linux Installation Directory +param.linux-install-dir.description=Installation directory of the application on Linux. + +param.linux-package-dependencies.name=Linux Package Dependencies +param.linux-package-dependencies.description=Required packages or capabilities for the application. + +error.parameters-null=Parameters map is null. +error.parameters-null.advice=Pass in a non-null parameters map. +error.no-linux-resources=Java Packager does not support Linux. +error.no-linux-resources.advice=Please use the Java Packager that ships with Oracle JDK for Linux. +message.icon-not-png=The specified icon "{0}" is not a PNG file and will not be used. The default icon will be used in it's place. diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/LinuxAppBundler_ja.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/LinuxAppBundler_ja.properties Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,44 @@ +# +# Copyright (c) 2017, 2018, 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. +# +# + +bundler.name=Linux\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30A4\u30E1\u30FC\u30B8 +bundler.description=\u30AA\u30D7\u30B7\u30E7\u30F3\u3067JRE\u304C\u30D0\u30F3\u30C9\u30EB\u3055\u308C\u3066\u3044\u308BLinux\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u30FB\u30D9\u30FC\u30B9\u306E\u30A4\u30E1\u30FC\u30B8\u3002\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9\u30FB\u30D0\u30F3\u30C9\u30E9\u306E\u30D9\u30FC\u30B9\u3068\u3057\u3066\u4F7F\u7528\u3055\u308C\u307E\u3059\u3002 + +param.icon-png.name=.png\u30A2\u30A4\u30B3\u30F3 +param.icon-png.description=PNG\u5F62\u5F0F\u3067\u306E\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u30A2\u30A4\u30B3\u30F3\u3002 + +param.linux-install-dir.name=Linux Installation Directory +param.linux-install-dir.description=Installation directory of the application on Linux. + +param.linux-package-dependencies.name=Linux Package Dependencies +param.linux-package-dependencies.description=Required packages or capabilities for the application. + +error.parameters-null=\u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30DE\u30C3\u30D7\u304Cnull\u3067\u3059\u3002 +error.parameters-null.advice=\u975Enull\u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30DE\u30C3\u30D7\u3067\u6E21\u3057\u3066\u304F\u3060\u3055\u3044\u3002 +error.no-linux-resources=Java\u30D1\u30C3\u30B1\u30FC\u30B8\u30E3\u306FLinux\u3092\u30B5\u30DD\u30FC\u30C8\u3057\u3066\u3044\u307E\u305B\u3093\u3002 +error.no-linux-resources.advice=Oracle JDK for Linux\u306B\u4ED8\u5C5E\u3057\u3066\u3044\u308BJava\u30D1\u30C3\u30B1\u30FC\u30B8\u30E3\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044\u3002 + +message.icon-not-png=\u6307\u5B9A\u3057\u305F\u30A2\u30A4\u30B3\u30F3"{0}"\u306FPNG\u30D5\u30A1\u30A4\u30EB\u3067\u306F\u306A\u304F\u3001\u4F7F\u7528\u3055\u308C\u307E\u305B\u3093\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30A2\u30A4\u30B3\u30F3\u304C\u305D\u306E\u4F4D\u7F6E\u306B\u4F7F\u7528\u3055\u308C\u307E\u3059\u3002 diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/LinuxAppBundler_zh_CN.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/LinuxAppBundler_zh_CN.properties Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,44 @@ +# +# Copyright (c) 2017, 2018, 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. +# +# + +bundler.name=Linux \u5E94\u7528\u7A0B\u5E8F\u6620\u50CF +bundler.description=\u4E00\u4E2A\u57FA\u4E8E\u76EE\u5F55\u7684 linux \u5E94\u7528\u7A0B\u5E8F\u6620\u50CF, \u53EF\u4EE5\u9009\u62E9\u6027\u5730\u5E26\u6709\u5171\u540C\u6253\u5305\u7684 JRE\u3002\u7528\u4F5C\u5B89\u88C5\u7A0B\u5E8F\u6253\u5305\u7A0B\u5E8F\u7684\u57FA\u7840\u3002 + +param.icon-png.name=.png \u56FE\u6807 +param.icon-png.description=\u5E94\u7528\u7A0B\u5E8F\u7684\u56FE\u6807, \u91C7\u7528 PNG \u683C\u5F0F\u3002 + +param.linux-install-dir.name=Linux Installation Directory +param.linux-install-dir.description=Installation directory of the application on Linux. + +param.linux-package-dependencies.name=Linux Package Dependencies +param.linux-package-dependencies.description=Required packages or capabilities for the application. + +error.parameters-null=\u53C2\u6570\u6620\u5C04\u4E3A\u7A7A\u503C\u3002 +error.parameters-null.advice=\u8BF7\u4F20\u5165\u975E\u7A7A\u53C2\u6570\u6620\u5C04\u3002 +error.no-linux-resources=Java \u6253\u5305\u7A0B\u5E8F\u4E0D\u652F\u6301 Linux\u3002 +error.no-linux-resources.advice=\u8BF7\u4F7F\u7528 Oracle JDK for Linux \u4E2D\u9644\u5E26\u7684 Java \u6253\u5305\u7A0B\u5E8F\u3002 + +message.icon-not-png=\u6307\u5B9A\u7684\u56FE\u6807 "{0}" \u4E0D\u662F PNG \u6587\u4EF6, \u4E0D\u4F1A\u4F7F\u7528\u3002\u5C06\u4F7F\u7528\u9ED8\u8BA4\u56FE\u6807\u4EE3\u66FF\u3002 diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/LinuxAppImageBuilder.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/LinuxAppImageBuilder.properties Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,29 @@ +# +# Copyright (c) 2017, 2018, 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. +# + +param.icon-png.name=.png Icon +param.icon-png.description=Icon for the application, in PNG format. + +message.icon-not-png=The specified icon "{0}" is not a PNG file and will not be used. The default icon will be used in it's place. diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/LinuxAppImageBuilder_ja.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/LinuxAppImageBuilder_ja.properties Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,30 @@ +# +# Copyright (c) 2017, 2018, 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. +# +# + +param.icon-png.name=.png\u30A2\u30A4\u30B3\u30F3 +param.icon-png.description=PNG\u5F62\u5F0F\u3067\u306E\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u30A2\u30A4\u30B3\u30F3\u3002 + +message.icon-not-png=\u6307\u5B9A\u3057\u305F\u30A2\u30A4\u30B3\u30F3"{0}"\u306FPNG\u30D5\u30A1\u30A4\u30EB\u3067\u306F\u306A\u304F\u3001\u4F7F\u7528\u3055\u308C\u307E\u305B\u3093\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30A2\u30A4\u30B3\u30F3\u304C\u305D\u306E\u4F4D\u7F6E\u306B\u4F7F\u7528\u3055\u308C\u307E\u3059\u3002 diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/LinuxAppImageBuilder_zh_CN.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/LinuxAppImageBuilder_zh_CN.properties Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,30 @@ +# +# Copyright (c) 2017, 2018, 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. +# +# + +param.icon-png.name=.png \u56FE\u6807 +param.icon-png.description=\u5E94\u7528\u7A0B\u5E8F\u7684\u56FE\u6807, \u91C7\u7528 PNG \u683C\u5F0F\u3002 + +message.icon-not-png=\u6307\u5B9A\u7684\u56FE\u6807 "{0}" \u4E0D\u662F PNG \u6587\u4EF6, \u4E0D\u4F1A\u4F7F\u7528\u3002\u5C06\u4F7F\u7528\u9ED8\u8BA4\u56FE\u6807\u4EE3\u66FF\u3002 diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/LinuxDebBundler.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/LinuxDebBundler.properties Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,108 @@ +# +# Copyright (c) 2017, 2018, 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. +# +# + +bundler.name=DEB Installer +bundler.description=Linux Debian Bundle. + +param.app-bundler.name=DEB Bundler Name +param.app-bundler.description=DEB Bundler Name + +param.bundle-name.name=DEB Bundle Name +param.bundle-name.description=DEB Bundle Name + +param.full-package-name.name=Deb Package Name +param.full-package-name.description=Deb Package Name + +param.image-dir.name=Image Dir +param.image-dir.description=Image Dir + +param.config-root.name=Config Root Dir +param.config-root.description=Config Root Dir + +param.app-image-root.name=Image Root Dir +param.app-image-root.description=Image Root Dir + +param.config-dir.name=Config Dir +param.config-dir.description=Config Dir + +param.maintainer-email.name=DEB Maintainer Email +param.maintainer-email.description=DEB Maintainer Email + +param.maintainer-name.name=DEB Maintainer Name +param.maintainer-name.description=DEB Maintainer Name + +param.license-type.name=License Type +param.license-type.description=License Type + +param.license-text.name=License Content +param.license-text.description=License Content + +param.xdg-prefix.name=Prefix for XDG files (mime, desktop) +param.xdg-prefix.description=Prefix for XDG MimeInfo and Desktop Files. Defaults to -, with spaces dropped. + +resource.deb-control-file=DEB control file +resource.deb-preinstall-script=DEB preinstall script +resource.deb-prerm-script=DEB prerm script +resource.deb-postinstall-script=DEB postinstall script +resource.deb-postrm-script=DEB postrm script +resource.deb-copyright-file=DEB copyright file +resource.deb-init-script=DEB init script +resource.menu-shortcut-descriptor=Menu shortcut descriptor +resource.menu-icon=menu icon + +error.parameters-null=Parameters map is null. +error.parameters-null.advice=Pass in a non-null parameters map. + +error.tool-not-found=Can not find {0}. +error.tool-not-found.advice=Please install required packages. + +error.license-missing=Specified license file is missing. +error.license-missing.advice=Make sure that "{0}" references a file in the app resources, and that it is relative to the basedir "{1}". + +error.launcher-name-too-long=The bundle name "{0}" is too long for a daemon. +error.launcher-name-too-long.advice=Set a bundler argument "{0}" to a bundle name that is shorter than 16 characters. + +error.cannot-create-output-dir=Output directory {0} cannot be created. +error.cannot-write-to-output-dir=Output directory {0} is not writable. + +error.no-content-types-for-file-association=No MIME types were specified for File Association number {0}. +error.no-content-types-for-file-association.advice=For Linux Bundling specify one and only one MIME type for each file association. + +error.too-many-content-types-for-file-association=More than one MIME types was specified for File Association number {0}. +error.too-many-content-types-for-file-association.advice=For Linux Bundling specify one and only one MIME type for each file association. + +error.no-support-for-peruser-daemons=Bundler doesn't support per-user daemons. +error.no-support-for-peruser-daemons.advice=Make sure that the system wide hint is set to true. + +error.invalid-value-for-package-name=Invalid value "{0}" for the package name. +error.invalid-value-for-package-name.advice=Set the "linux.bundleName" parameter to a valid Debian package name. Note that the package names must consist only of lower case letters (a-z), digits (0-9), plus (+) and minus (-) signs, and periods (.). They must be at least two characters long and must start with an alphanumeric character. + +message.test-for-tool=Test for [{0}]. Result\: {1} +message.debug-working-directory=Kept working directory for debug\: {0} +message.outputting-to-location=Generating DEB for installer to\: {0} +message.output-to-location=Package (.deb) saved to\: {0} +message.debs-like-licenses=Debian packages should specify a license. The absence of a license will cause some linux distributions to complain about the quality of the application. +message.creating-association-with-null-extension=Creating association with null extension. diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/LinuxDebBundler_ja.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/LinuxDebBundler_ja.properties Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,108 @@ +# +# Copyright (c) 2017, 2018, 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. +# +# + +bundler.name=DEB\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9 +bundler.description=Linux Debian\u30D0\u30F3\u30C9\u30EB\u3002 + +param.app-bundler.name=DEB Bundler Name +param.app-bundler.description=DEB Bundler Name + +param.bundle-name.name=DEB Bundle Name +param.bundle-name.description=DEB Bundle Name + +param.full-package-name.name=Deb Package Name +param.full-package-name.description=Deb Package Name + +param.image-dir.name=Image Dir +param.image-dir.description=Image Dir + +param.config-root.name=Config Root Dir +param.config-root.description=Config Root Dir + +param.app-image-root.name=Image Root Dir +param.app-image-root.description=Image Root Dir + +param.config-dir.name=Config Dir +param.config-dir.description=Config Dir + +param.maintainer-email.name=DEB Maintainer Email +param.maintainer-email.description=DEB Maintainer Email + +param.maintainer-name.name=DEB Maintainer Name +param.maintainer-name.description=DEB Maintainer Name + +param.license-type.name=License Type +param.license-type.description=License Type + +param.license-text.name=License Content +param.license-text.description=License Content + +param.xdg-prefix.name=XDG\u30D5\u30A1\u30A4\u30EB\u306E\u63A5\u982D\u8F9E(mime\u3001\u30C7\u30B9\u30AF\u30C8\u30C3\u30D7) +param.xdg-prefix.description=XDG MimeInfo\u304A\u3088\u3073\u30C7\u30B9\u30AF\u30C8\u30C3\u30D7\u30FB\u30D5\u30A1\u30A4\u30EB\u306E\u63A5\u982D\u8F9E\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u306F-\u3067\u3042\u308A\u3001\u30B9\u30DA\u30FC\u30B9\u306F\u524A\u9664\u3055\u308C\u307E\u3059\u3002 + +resource.deb-control-file=DEB\u5236\u5FA1\u30D5\u30A1\u30A4\u30EB +resource.deb-preinstall-script=DEB\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u524D\u30B9\u30AF\u30EA\u30D7\u30C8 +resource.deb-prerm-script=DEB prerm\u30B9\u30AF\u30EA\u30D7\u30C8 +resource.deb-postinstall-script=DEB\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u5F8C\u30B9\u30AF\u30EA\u30D7\u30C8 +resource.deb-postrm-script=DEB postrm\u30B9\u30AF\u30EA\u30D7\u30C8 +resource.deb-copyright-file=DEB\u30B3\u30D4\u30FC\u30E9\u30A4\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB +resource.deb-init-script=DEB\u521D\u671F\u5316\u30B9\u30AF\u30EA\u30D7\u30C8 +resource.menu-shortcut-descriptor=\u30E1\u30CB\u30E5\u30FC\u30FB\u30B7\u30E7\u30FC\u30C8\u30AB\u30C3\u30C8\u30FB\u30C7\u30A3\u30B9\u30AF\u30EA\u30D7\u30BF +resource.menu-icon=\u30E1\u30CB\u30E5\u30FC\u30FB\u30A2\u30A4\u30B3\u30F3 + +error.parameters-null=\u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30DE\u30C3\u30D7\u304Cnull\u3067\u3059\u3002 +error.parameters-null.advice=\u975Enull\u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30DE\u30C3\u30D7\u3067\u6E21\u3057\u3066\u304F\u3060\u3055\u3044\u3002 + +error.tool-not-found={0}\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002 +error.tool-not-found.advice=\u5FC5\u8981\u306A\u30D1\u30C3\u30B1\u30FC\u30B8\u3092\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3057\u3066\u304F\u3060\u3055\u3044\u3002 + +error.license-missing=\u6307\u5B9A\u3057\u305F\u30E9\u30A4\u30BB\u30F3\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u304C\u3042\u308A\u307E\u305B\u3093\u3002 +error.license-missing.advice="{0}"\u304C\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30EA\u30BD\u30FC\u30B9\u5185\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u53C2\u7167\u3057\u3001\u30D9\u30FC\u30B9\u30FB\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA"{1}"\u306B\u5BFE\u3057\u3066\u76F8\u5BFE\u7684\u3067\u3042\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002 + +error.launcher-name-too-long=\u30D0\u30F3\u30C9\u30EB\u540D"{0}"\u304C\u3001\u30C7\u30FC\u30E2\u30F3\u306B\u5BFE\u3057\u3066\u9577\u3059\u304E\u307E\u3059\u3002 +error.launcher-name-too-long.advice=\u30D0\u30F3\u30C9\u30E9\u5F15\u6570"{0}"\u309216\u6587\u5B57\u672A\u6E80\u306E\u30D0\u30F3\u30C9\u30EB\u540D\u306B\u8A2D\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002 + +error.cannot-create-output-dir=\u51FA\u529B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA{0}\u3092\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093\u3002 +error.cannot-write-to-output-dir=\u51FA\u529B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA{0}\u306F\u66F8\u8FBC\u307F\u4E0D\u53EF\u3067\u3059\u3002 + +error.no-content-types-for-file-association=\u30D5\u30A1\u30A4\u30EB\u30FB\u30A2\u30BD\u30B7\u30A8\u30FC\u30B7\u30E7\u30F3\u756A\u53F7{0}\u306BMIME\u30BF\u30A4\u30D7\u304C\u6307\u5B9A\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002 +error.no-content-types-for-file-association.advice=Linux\u30D0\u30F3\u30C9\u30EB\u306E\u5834\u5408\u3001\u5404\u30D5\u30A1\u30A4\u30EB\u30FB\u30A2\u30BD\u30B7\u30A8\u30FC\u30B7\u30E7\u30F3\u306BMIME\u30BF\u30A4\u30D7\u30921\u3064\u3060\u3051\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002 + +error.too-many-content-types-for-file-association=\u30D5\u30A1\u30A4\u30EB\u30FB\u30A2\u30BD\u30B7\u30A8\u30FC\u30B7\u30E7\u30F3\u756A\u53F7{0}\u306B\u8907\u6570\u306EMIME\u30BF\u30A4\u30D7\u304C\u6307\u5B9A\u3055\u308C\u307E\u3057\u305F\u3002 +error.too-many-content-types-for-file-association.advice=Linux\u30D0\u30F3\u30C9\u30EB\u306E\u5834\u5408\u3001\u5404\u30D5\u30A1\u30A4\u30EB\u30FB\u30A2\u30BD\u30B7\u30A8\u30FC\u30B7\u30E7\u30F3\u306BMIME\u30BF\u30A4\u30D7\u30921\u3064\u3060\u3051\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002 + +error.no-support-for-peruser-daemons=\u30D0\u30F3\u30C9\u30E9\u306F\u3001\u30E6\u30FC\u30B6\u30FC\u5358\u4F4D\u306E\u30C7\u30FC\u30E2\u30F3\u3092\u30B5\u30DD\u30FC\u30C8\u3057\u3066\u3044\u307E\u305B\u3093\u3002 +error.no-support-for-peruser-daemons.advice=\u30B7\u30B9\u30C6\u30E0\u5168\u4F53\u306E\u30D2\u30F3\u30C8\u304Ctrue\u306B\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002 + +error.invalid-value-for-package-name=\u30D1\u30C3\u30B1\u30FC\u30B8\u540D\u306B\u5BFE\u3057\u3066\u5024"{0}"\u306F\u7121\u52B9\u3067\u3059\u3002 +error.invalid-value-for-package-name.advice="linux.bundleName"\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u6709\u52B9\u306ADebian\u30D1\u30C3\u30B1\u30FC\u30B8\u540D\u306B\u8A2D\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u30D1\u30C3\u30B1\u30FC\u30B8\u540D\u306B\u306F\u3001\u5C0F\u6587\u5B57(a-z)\u3001\u6570\u5B57(0-9)\u3001\u30D7\u30E9\u30B9(+)\u3068\u30DE\u30A4\u30CA\u30B9(-)\u306E\u8A18\u53F7\u304A\u3088\u3073\u30D4\u30EA\u30AA\u30C9(.)\u306E\u307F\u3092\u542B\u3081\u308B\u3088\u3046\u306B\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u9577\u3055\u306F2\u6587\u5B57\u4EE5\u4E0A\u3068\u3057\u3001\u82F1\u6570\u5B57\u3067\u59CB\u3081\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + +message.test-for-tool=[{0}]\u306E\u30C6\u30B9\u30C8\u3002\u7D50\u679C: {1} +message.debug-working-directory=\u30C7\u30D0\u30C3\u30B0\u306E\u4F5C\u696D\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304C\u4FDD\u6301\u3055\u308C\u307E\u3057\u305F: {0} +message.outputting-to-location=\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9\u306EDEB\u3092\u6B21\u306B\u751F\u6210\u3057\u3066\u3044\u307E\u3059: {0} +message.output-to-location=\u30D1\u30C3\u30B1\u30FC\u30B8(.deb)\u306F\u6B21\u306B\u4FDD\u5B58\u3055\u308C\u307E\u3057\u305F: {0} +message.debs-like-licenses=Debian\u30D1\u30C3\u30B1\u30FC\u30B8\u3067\u306F\u30E9\u30A4\u30BB\u30F3\u30B9\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\u30E9\u30A4\u30BB\u30F3\u30B9\u304C\u306A\u3044\u5834\u5408\u3001\u4E00\u90E8\u306ELinux\u30C7\u30A3\u30B9\u30C8\u30EA\u30D3\u30E5\u30FC\u30B7\u30E7\u30F3\u3067\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u54C1\u8CEA\u306B\u554F\u984C\u304C\u767A\u751F\u3059\u308B\u5834\u5408\u304C\u3042\u308A\u307E\u3059\u3002 +message.creating-association-with-null-extension=null\u62E1\u5F35\u5B50\u3068\u306E\u95A2\u9023\u4ED8\u3051\u3092\u4F5C\u6210\u3057\u3066\u3044\u307E\u3059\u3002 diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/LinuxDebBundler_zh_CN.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/LinuxDebBundler_zh_CN.properties Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,108 @@ +# +# Copyright (c) 2017, 2018, 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. +# +# + +bundler.name=DEB \u5B89\u88C5\u7A0B\u5E8F +bundler.description=Linux Debian \u5305\u3002 + +param.app-bundler.name=DEB Bundler Name +param.app-bundler.description=DEB Bundler Name + +param.bundle-name.name=DEB Bundle Name +param.bundle-name.description=DEB Bundle Name + +param.full-package-name.name=Deb Package Name +param.full-package-name.description=Deb Package Name + +param.image-dir.name=Image Dir +param.image-dir.description=Image Dir + +param.config-root.name=Config Root Dir +param.config-root.description=Config Root Dir + +param.app-image-root.name=Image Root Dir +param.app-image-root.description=Image Root Dir + +param.config-dir.name=Config Dir +param.config-dir.description=Config Dir + +param.maintainer-email.name=DEB Maintainer Email +param.maintainer-email.description=DEB Maintainer Email + +param.maintainer-name.name=DEB Maintainer Name +param.maintainer-name.description=DEB Maintainer Name + +param.license-type.name=License Type +param.license-type.description=License Type + +param.license-text.name=License Content +param.license-text.description=License Content + +param.xdg-prefix.name=XDG \u6587\u4EF6 (mime, desktop) \u7684\u524D\u7F00 +param.xdg-prefix.description=XDG MimeInfo \u548C Desktop \u6587\u4EF6\u7684\u524D\u7F00\u3002\u9ED8\u8BA4\u4E3A -, \u4E0D\u542B\u7A7A\u683C\u3002 + +resource.deb-control-file=DEB \u63A7\u5236\u6587\u4EF6 +resource.deb-preinstall-script=DEB \u5B89\u88C5\u524D\u811A\u672C +resource.deb-prerm-script=DEB \u5220\u9664\u524D\u811A\u672C +resource.deb-postinstall-script=DEB \u5B89\u88C5\u540E\u811A\u672C +resource.deb-postrm-script=DEB \u5220\u9664\u540E\u811A\u672C +resource.deb-copyright-file=DEB \u7248\u6743\u6587\u4EF6 +resource.deb-init-script=DEB \u521D\u59CB\u5316\u811A\u672C +resource.menu-shortcut-descriptor=\u83DC\u5355\u5FEB\u6377\u65B9\u5F0F\u63CF\u8FF0\u7B26 +resource.menu-icon=\u83DC\u5355\u56FE\u6807 + +error.parameters-null=\u53C2\u6570\u6620\u5C04\u4E3A\u7A7A\u503C\u3002 +error.parameters-null.advice=\u8BF7\u4F20\u5165\u975E\u7A7A\u53C2\u6570\u6620\u5C04\u3002 + +error.tool-not-found=\u627E\u4E0D\u5230{0}\u3002 +error.tool-not-found.advice=\u8BF7\u5B89\u88C5\u6240\u9700\u7684\u7A0B\u5E8F\u5305\u3002 + +error.license-missing=\u7F3A\u5C11\u6307\u5B9A\u7684\u8BB8\u53EF\u8BC1\u6587\u4EF6\u3002 +error.license-missing.advice=\u8BF7\u786E\u4FDD "{0}" \u5F15\u7528\u5E94\u7528\u7A0B\u5E8F\u8D44\u6E90\u4E2D\u7684\u6587\u4EF6, \u5E76\u4E14\u4F7F\u7528\u57FA\u76EE\u5F55 "{1}" \u7684\u76F8\u5BF9\u76EE\u5F55\u3002 + +error.launcher-name-too-long=\u5B88\u62A4\u7A0B\u5E8F\u7684\u5305\u540D "{0}" \u592A\u957F\u3002 +error.launcher-name-too-long.advice=\u5C06\u6253\u5305\u7A0B\u5E8F\u53C2\u6570 "{0}" \u8BBE\u7F6E\u4E3A\u5C11\u4E8E 16 \u4E2A\u5B57\u7B26\u7684\u5305\u540D\u3002 + +error.cannot-create-output-dir=\u65E0\u6CD5\u521B\u5EFA\u8F93\u51FA\u76EE\u5F55 {0}\u3002 +error.cannot-write-to-output-dir=\u8F93\u51FA\u76EE\u5F55 {0} \u4E0D\u53EF\u5199\u3002 + +error.no-content-types-for-file-association=\u6CA1\u6709\u4E3A\u6587\u4EF6\u5173\u8054\u53F7{0}\u6307\u5B9A MIME \u7C7B\u578B\u3002 +error.no-content-types-for-file-association.advice=\u5BF9\u4E8E Linux \u6253\u5305, \u8BF7\u4E3A\u6BCF\u4E2A\u6587\u4EF6\u5173\u8054\u6307\u5B9A\u4E00\u4E2A\u4E14\u4EC5\u6307\u5B9A\u4E00\u4E2A MIME \u7C7B\u578B\u3002 + +error.too-many-content-types-for-file-association=\u4E3A\u6587\u4EF6\u5173\u8054\u53F7{0}\u6307\u5B9A\u4E86\u591A\u4E2A MIME \u7C7B\u578B\u3002 +error.too-many-content-types-for-file-association.advice=\u5BF9\u4E8E Linux \u6253\u5305, \u8BF7\u4E3A\u6BCF\u4E2A\u6587\u4EF6\u5173\u8054\u6307\u5B9A\u4E00\u4E2A\u4E14\u4EC5\u6307\u5B9A\u4E00\u4E2A MIME \u7C7B\u578B\u3002 + +error.no-support-for-peruser-daemons=\u6253\u5305\u7A0B\u5E8F\u4E0D\u652F\u6301\u6BCF\u7528\u6237\u5B88\u62A4\u7A0B\u5E8F\u3002 +error.no-support-for-peruser-daemons.advice=\u786E\u4FDD\u7CFB\u7EDF\u8303\u56F4\u63D0\u793A\u8BBE\u7F6E\u4E3A\u201C\u771F\u201D\u3002 + +error.invalid-value-for-package-name=\u7A0B\u5E8F\u5305\u540D\u79F0\u7684\u503C "{0}" \u65E0\u6548\u3002 +error.invalid-value-for-package-name.advice=\u5C06 "linux.bundleName" \u53C2\u6570\u8BBE\u7F6E\u4E3A\u6709\u6548\u7684 Debian \u7A0B\u5E8F\u5305\u540D\u79F0\u3002\u8BF7\u6CE8\u610F, \u7A0B\u5E8F\u5305\u540D\u79F0\u53EA\u80FD\u5305\u542B\u5C0F\u5199\u5B57\u6BCD (a-z), \u6570\u5B57 (0-9), \u52A0\u53F7 (+) \u548C\u51CF\u53F7 (-) \u4EE5\u53CA\u53E5\u70B9 (.)\u3002\u540D\u79F0\u957F\u5EA6\u5FC5\u987B\u81F3\u5C11\u4E3A\u4E24\u4E2A\u5B57\u7B26\u5E76\u4E14\u5FC5\u987B\u4EE5\u5B57\u6BCD\u6570\u5B57\u5B57\u7B26\u5F00\u5934\u3002 + +message.test-for-tool=[{0}] \u7684\u6D4B\u8BD5\u3002\u7ED3\u679C: {1} +message.debug-working-directory=\u7528\u4E8E\u8C03\u8BD5\u7684\u5DF2\u4FDD\u7559\u5DE5\u4F5C\u76EE\u5F55: {0} +message.outputting-to-location=\u6B63\u5728\u4E3A\u5B89\u88C5\u7A0B\u5E8F\u751F\u6210 DEB, \u4F4D\u7F6E: {0} +message.output-to-location=\u7A0B\u5E8F\u5305 (.deb) \u5DF2\u4FDD\u5B58\u5230: {0} +message.debs-like-licenses=Debian \u7A0B\u5E8F\u5305\u5E94\u6307\u5B9A\u8BB8\u53EF\u8BC1\u3002\u7F3A\u5C11\u8BB8\u53EF\u8BC1\u5C06\u5BFC\u81F4\u67D0\u4E9B Linux \u5206\u53D1\u6295\u8BC9\u5E94\u7528\u7A0B\u5E8F\u8D28\u91CF\u3002 +message.creating-association-with-null-extension=\u6B63\u5728\u4F7F\u7528\u7A7A\u6269\u5C55\u540D\u521B\u5EFA\u5173\u8054\u3002 diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/LinuxResources.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/LinuxResources.java Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2011, 2018, 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.jpackager.internal.resources; + +public class LinuxResources { + +} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/LinuxRpmBundler.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/LinuxRpmBundler.properties Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,83 @@ +# +# Copyright (c) 2017, 2018, 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. +# +# + +bundler.name=RPM Bundle +bundler.description=Redhat Package Manager (RPM) bundler. + +param.app-bundler.name=RPM Bundler +param.app-bundler.description=RPM Bundler + +param.image-dir.name=Image Dir +param.image-dir.description=Image Dir + +param.bundle-name.name=RPM Bundle +param.bundle-name.description=RPM Bundle + +param.config-root.name=Config Root Dir +param.config-root.description=Config Root Dir + +param.xdg-prefix.name=Prefix for XDG files (mime, desktop) +param.xdg-prefix.description=Prefix for XDG MimeInfo and Desktop Files. Defaults to -, with spaces dropped. + +param.license-type.name=License Type +param.license-type.description=License Type for RPM package. +param.license-type.default=Unknown + +resource.rpm-spec-file=RPM spec file +resource.rpm-init-script=RPM init script +resource.menu-shortcut-descriptor=Menu shortcut descriptor +resource.menu-icon=menu icon + +error.parameters-null=Parameters map is null. +error.parameters-null.advice=Pass in a non-null parameters map. + +error.cannot-find-rpmbuild=Can not find rpmbuild {0} or newer. +error.cannot-find-rpmbuild.advice=\ Install packages needed to build RPM, version {0} or newer. + +error.license-missing=Specified license file is missing. +error.license-missing.advice=Make sure that "{0}" references a file in the app resources, and that it is relative file reference. + +error.cannot-create-output-dir=Output directory {0} cannot be created. +error.cannot-write-to-output-dir=Output directory {0} is not writable. + +error.no-content-types-for-file-association=No MIME types were specified for File Association number {0}. +error.no-content-types-for-file-association.advice=For Linux Bundling specify one and only one MIME type for each file association. + +error.too-many-content-types-for-file-association=More than one MIME types was specified for File Association number {0}. +error.too-many-content-types-for-file-association.advice=For Linux Bundling specify one and only one MIME type for each file association. + +error.no-support-for-peruser-daemons=Bundler doesn't support per-user daemons. +error.no-support-for-peruser-daemons.advice=Make sure that the system wide hint is set to true. + +error.invalid-value-for-package-name=Invalid value "{0}" for the package name. +error.invalid-value-for-package-name.advice=Set the "linux.bundleName" parameter to a valid RPM package name. Note that the packages must be named using only the following ASCII characters: abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._+ + +message.test-for-tool=Test for [{0}]. Result\: {1} +message.one-shortcut-required=At least one type of shortcut is required. Enabling menu shortcut. +message.debug-working-directory=Kept working directory for debug\: {0} +message.outputting-bundle-location=Generating RPM for installer to\: {0} +message.output-bundle-location=Package (.rpm) saved to\: {0} +message.creating-association-with-null-extension=Creating association with null extension. diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/LinuxRpmBundler_ja.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/LinuxRpmBundler_ja.properties Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,79 @@ +# +# Copyright (c) 2017, 2018, 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. +# +# + +bundler.name=RPM\u30D0\u30F3\u30C9\u30EB +bundler.description=RedHat Package Manager (RPM)\u306E\u30D0\u30F3\u30C9\u30E9\u3002 + +param.app-bundler.name=RPM Bundler +param.app-bundler.description=RPM Bundler + +param.image-dir.name=Image Dir +param.image-dir.description=Image Dir + +param.bundle-name.name=RPM Bundle +param.bundle-name.description=RPM Bundle + +param.config-root.name=Config Root Dir +param.config-root.description=Config Root Dir + +param.xdg-prefix.name=XDG\u30D5\u30A1\u30A4\u30EB\u306E\u63A5\u982D\u8F9E(mime\u3001\u30C7\u30B9\u30AF\u30C8\u30C3\u30D7) +param.xdg-prefix.description=XDG MimeInfo\u304A\u3088\u3073\u30C7\u30B9\u30AF\u30C8\u30C3\u30D7\u30FB\u30D5\u30A1\u30A4\u30EB\u306E\u63A5\u982D\u8F9E\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u306F-\u3067\u3042\u308A\u3001\u30B9\u30DA\u30FC\u30B9\u306F\u524A\u9664\u3055\u308C\u307E\u3059\u3002 + +resource.rpm-spec-file=RPM\u4ED5\u69D8\u30D5\u30A1\u30A4\u30EB +resource.rpm-init-script=RPM\u521D\u671F\u5316\u30B9\u30AF\u30EA\u30D7\u30C8 +resource.menu-shortcut-descriptor=\u30E1\u30CB\u30E5\u30FC\u30FB\u30B7\u30E7\u30FC\u30C8\u30AB\u30C3\u30C8\u30FB\u30C7\u30A3\u30B9\u30AF\u30EA\u30D7\u30BF +resource.menu-icon=\u30E1\u30CB\u30E5\u30FC\u30FB\u30A2\u30A4\u30B3\u30F3 + +error.parameters-null=\u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30DE\u30C3\u30D7\u304Cnull\u3067\u3059\u3002 +error.parameters-null.advice=\u975Enull\u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30DE\u30C3\u30D7\u3067\u6E21\u3057\u3066\u304F\u3060\u3055\u3044\u3002 + +error.cannot-find-rpmbuild=rpmbuild {0}\u307E\u305F\u306F\u305D\u308C\u4EE5\u964D\u306E\u3082\u306E\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002 +error.cannot-find-rpmbuild.advice=\ \u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u30FB\u30D1\u30C3\u30B1\u30FC\u30B8\u306F\u30D0\u30FC\u30B8\u30E7\u30F3{0}\u4EE5\u964D\u306ERPM\u3092\u30D3\u30EB\u30C9\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + +error.license-missing=\u6307\u5B9A\u3057\u305F\u30E9\u30A4\u30BB\u30F3\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u304C\u3042\u308A\u307E\u305B\u3093\u3002 +error.license-missing.advice="{0}"\u304C\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30EA\u30BD\u30FC\u30B9\u5185\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u53C2\u7167\u3057\u3001\u76F8\u5BFE\u30D5\u30A1\u30A4\u30EB\u53C2\u7167\u3067\u3042\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002 + +error.cannot-create-output-dir=\u51FA\u529B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA{0}\u3092\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093\u3002 +error.cannot-write-to-output-dir=\u51FA\u529B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA{0}\u306F\u66F8\u8FBC\u307F\u4E0D\u53EF\u3067\u3059\u3002 + +error.no-content-types-for-file-association=\u30D5\u30A1\u30A4\u30EB\u30FB\u30A2\u30BD\u30B7\u30A8\u30FC\u30B7\u30E7\u30F3\u756A\u53F7{0}\u306BMIME\u30BF\u30A4\u30D7\u304C\u6307\u5B9A\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002 +error.no-content-types-for-file-association.advice=Linux\u30D0\u30F3\u30C9\u30EB\u306E\u5834\u5408\u3001\u5404\u30D5\u30A1\u30A4\u30EB\u30FB\u30A2\u30BD\u30B7\u30A8\u30FC\u30B7\u30E7\u30F3\u306BMIME\u30BF\u30A4\u30D7\u30921\u3064\u3060\u3051\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002 + +error.too-many-content-types-for-file-association=\u30D5\u30A1\u30A4\u30EB\u30FB\u30A2\u30BD\u30B7\u30A8\u30FC\u30B7\u30E7\u30F3\u756A\u53F7{0}\u306B\u8907\u6570\u306EMIME\u30BF\u30A4\u30D7\u304C\u6307\u5B9A\u3055\u308C\u307E\u3057\u305F\u3002 +error.too-many-content-types-for-file-association.advice=Linux\u30D0\u30F3\u30C9\u30EB\u306E\u5834\u5408\u3001\u5404\u30D5\u30A1\u30A4\u30EB\u30FB\u30A2\u30BD\u30B7\u30A8\u30FC\u30B7\u30E7\u30F3\u306BMIME\u30BF\u30A4\u30D7\u30921\u3064\u3060\u3051\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002 + +error.no-support-for-peruser-daemons=\u30D0\u30F3\u30C9\u30E9\u306F\u3001\u30E6\u30FC\u30B6\u30FC\u5358\u4F4D\u306E\u30C7\u30FC\u30E2\u30F3\u3092\u30B5\u30DD\u30FC\u30C8\u3057\u3066\u3044\u307E\u305B\u3093\u3002 +error.no-support-for-peruser-daemons.advice=\u30B7\u30B9\u30C6\u30E0\u5168\u4F53\u306E\u30D2\u30F3\u30C8\u304Ctrue\u306B\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002 + +error.invalid-value-for-package-name=\u30D1\u30C3\u30B1\u30FC\u30B8\u540D\u306B\u5BFE\u3057\u3066\u5024"{0}"\u306F\u7121\u52B9\u3067\u3059\u3002 +error.invalid-value-for-package-name.advice="linux.bundleName"\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u6709\u52B9\u306ARPM\u30D1\u30C3\u30B1\u30FC\u30B8\u540D\u306B\u8A2D\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u30D1\u30C3\u30B1\u30FC\u30B8\u540D\u306F\u3001\u6B21\u306EASCII\u6587\u5B57\u306E\u307F\u3092\u4F7F\u7528\u3057\u3066\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059: abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._+ + +message.test-for-tool=[{0}]\u306E\u30C6\u30B9\u30C8\u3002\u7D50\u679C: {1} +message.one-shortcut-required=\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u30B7\u30E7\u30FC\u30C8\u30AB\u30C3\u30C8\u30FB\u30BF\u30A4\u30D7\u304C\u5FC5\u8981\u3067\u3059\u3002\u30E1\u30CB\u30E5\u30FC\u30FB\u30B7\u30E7\u30FC\u30C8\u30AB\u30C3\u30C8\u3092\u6709\u52B9\u5316\u3057\u3066\u3044\u307E\u3059\u3002 +message.debug-working-directory=\u30C7\u30D0\u30C3\u30B0\u306E\u4F5C\u696D\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304C\u4FDD\u6301\u3055\u308C\u307E\u3057\u305F: {0} +message.outputting-bundle-location=\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9\u306ERPM\u3092\u6B21\u306B\u751F\u6210\u3057\u3066\u3044\u307E\u3059: {0} +message.output-bundle-location=\u30D1\u30C3\u30B1\u30FC\u30B8(.rpm)\u306F\u6B21\u306B\u4FDD\u5B58\u3055\u308C\u307E\u3057\u305F: {0} +message.creating-association-with-null-extension=null\u62E1\u5F35\u5B50\u3068\u306E\u95A2\u9023\u4ED8\u3051\u3092\u4F5C\u6210\u3057\u3066\u3044\u307E\u3059\u3002 diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/LinuxRpmBundler_zh_CN.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/LinuxRpmBundler_zh_CN.properties Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,79 @@ +# +# Copyright (c) 2017, 2018, 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. +# +# + +bundler.name=RPM \u5305 +bundler.description=Redhat Package Manager (RPM) \u6253\u5305\u7A0B\u5E8F\u3002 + +param.app-bundler.name=RPM Bundler +param.app-bundler.description=RPM Bundler + +param.image-dir.name=Image Dir +param.image-dir.description=Image Dir + +param.bundle-name.name=RPM Bundle +param.bundle-name.description=RPM Bundle + +param.config-root.name=Config Root Dir +param.config-root.description=Config Root Dir + +param.xdg-prefix.name=XDG \u6587\u4EF6 (mime, desktop) \u7684\u524D\u7F00 +param.xdg-prefix.description=XDG MimeInfo \u548C Desktop \u6587\u4EF6\u7684\u524D\u7F00\u3002\u9ED8\u8BA4\u4E3A -, \u4E0D\u542B\u7A7A\u683C\u3002 + +resource.rpm-spec-file=RPM \u89C4\u8303\u6587\u4EF6 +resource.rpm-init-script=RPM \u521D\u59CB\u5316\u811A\u672C +resource.menu-shortcut-descriptor=\u83DC\u5355\u5FEB\u6377\u65B9\u5F0F\u63CF\u8FF0\u7B26 +resource.menu-icon=\u83DC\u5355\u56FE\u6807 + +error.parameters-null=\u53C2\u6570\u6620\u5C04\u4E3A\u7A7A\u503C\u3002 +error.parameters-null.advice=\u8BF7\u4F20\u5165\u975E\u7A7A\u53C2\u6570\u6620\u5C04\u3002 + +error.cannot-find-rpmbuild=\u627E\u4E0D\u5230 rpmbuild {0} \u6216\u66F4\u65B0\u7248\u672C\u3002 +error.cannot-find-rpmbuild.advice=\ \u8BF7\u5B89\u88C5\u6784\u5EFA RPM \u7248\u672C {0} \u6216\u66F4\u65B0\u7248\u672C\u6240\u9700\u7684\u7A0B\u5E8F\u5305\u3002 + +error.license-missing=\u7F3A\u5C11\u6307\u5B9A\u7684\u8BB8\u53EF\u8BC1\u6587\u4EF6\u3002 +error.license-missing.advice=\u786E\u4FDD "{0}" \u5F15\u7528\u5E94\u7528\u7A0B\u5E8F\u8D44\u6E90\u4E2D\u7684\u6587\u4EF6, \u5E76\u4E14\u662F\u76F8\u5BF9\u6587\u4EF6\u5F15\u7528\u3002 + +error.cannot-create-output-dir=\u65E0\u6CD5\u521B\u5EFA\u8F93\u51FA\u76EE\u5F55 {0}\u3002 +error.cannot-write-to-output-dir=\u8F93\u51FA\u76EE\u5F55 {0} \u4E0D\u53EF\u5199\u3002 + +error.no-content-types-for-file-association=\u6CA1\u6709\u4E3A\u6587\u4EF6\u5173\u8054\u53F7{0}\u6307\u5B9A MIME \u7C7B\u578B\u3002 +error.no-content-types-for-file-association.advice=\u5BF9\u4E8E Linux \u6253\u5305, \u8BF7\u4E3A\u6BCF\u4E2A\u6587\u4EF6\u5173\u8054\u6307\u5B9A\u4E00\u4E2A\u4E14\u4EC5\u6307\u5B9A\u4E00\u4E2A MIME \u7C7B\u578B\u3002 + +error.too-many-content-types-for-file-association=\u4E3A\u6587\u4EF6\u5173\u8054\u53F7{0}\u6307\u5B9A\u4E86\u591A\u4E2A MIME \u7C7B\u578B\u3002 +error.too-many-content-types-for-file-association.advice=\u5BF9\u4E8E Linux \u6253\u5305, \u8BF7\u4E3A\u6BCF\u4E2A\u6587\u4EF6\u5173\u8054\u6307\u5B9A\u4E00\u4E2A\u4E14\u4EC5\u6307\u5B9A\u4E00\u4E2A MIME \u7C7B\u578B\u3002 + +error.no-support-for-peruser-daemons=\u6253\u5305\u7A0B\u5E8F\u4E0D\u652F\u6301\u6BCF\u7528\u6237\u5B88\u62A4\u7A0B\u5E8F\u3002 +error.no-support-for-peruser-daemons.advice=\u786E\u4FDD\u7CFB\u7EDF\u8303\u56F4\u63D0\u793A\u8BBE\u7F6E\u4E3A\u201C\u771F\u201D\u3002 + +error.invalid-value-for-package-name=\u7A0B\u5E8F\u5305\u540D\u79F0\u7684\u503C "{0}" \u65E0\u6548\u3002 +error.invalid-value-for-package-name.advice=\u5C06 "linux.bundleName" \u53C2\u6570\u8BBE\u7F6E\u4E3A\u6709\u6548\u7684 RPM \u7A0B\u5E8F\u5305\u540D\u79F0\u3002\u8BF7\u6CE8\u610F, \u7A0B\u5E8F\u5305\u540D\u79F0\u53EA\u80FD\u4F7F\u7528\u4EE5\u4E0B ASCII \u5B57\u7B26: abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._+ + +message.test-for-tool=[{0}] \u7684\u6D4B\u8BD5\u3002\u7ED3\u679C: {1} +message.one-shortcut-required=\u81F3\u5C11\u9700\u8981\u4E00\u79CD\u7C7B\u578B\u7684\u5FEB\u6377\u65B9\u5F0F\u3002\u6B63\u5728\u542F\u7528\u83DC\u5355\u5FEB\u6377\u65B9\u5F0F\u3002 +message.debug-working-directory=\u7528\u4E8E\u8C03\u8BD5\u7684\u5DF2\u4FDD\u7559\u5DE5\u4F5C\u76EE\u5F55: {0} +message.outputting-bundle-location=\u6B63\u5728\u4E3A\u5B89\u88C5\u7A0B\u5E8F\u751F\u6210 RPM, \u4F4D\u7F6E: {0} +message.output-bundle-location=\u7A0B\u5E8F\u5305 (.rpm) \u5DF2\u4FDD\u5B58\u5230: {0} +message.creating-association-with-null-extension=\u6B63\u5728\u4F7F\u7528\u7A7A\u6269\u5C55\u540D\u521B\u5EFA\u5173\u8054\u3002 diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/builders/linux/LinuxAppImageBuilder.properties --- a/src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/builders/linux/LinuxAppImageBuilder.properties Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -# -# Copyright (c) 2017, 2018, 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. -# - -param.icon-png.name=.png Icon -param.icon-png.description=Icon for the application, in PNG format. - -message.icon-not-png=The specified icon "{0}" is not a PNG file and will not be used. The default icon will be used in it's place. diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/builders/linux/LinuxAppImageBuilder_ja.properties --- a/src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/builders/linux/LinuxAppImageBuilder_ja.properties Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -# -# Copyright (c) 2017, 2018, 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. -# -# - -param.icon-png.name=.png\u30A2\u30A4\u30B3\u30F3 -param.icon-png.description=PNG\u5F62\u5F0F\u3067\u306E\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u30A2\u30A4\u30B3\u30F3\u3002 - -message.icon-not-png=\u6307\u5B9A\u3057\u305F\u30A2\u30A4\u30B3\u30F3"{0}"\u306FPNG\u30D5\u30A1\u30A4\u30EB\u3067\u306F\u306A\u304F\u3001\u4F7F\u7528\u3055\u308C\u307E\u305B\u3093\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30A2\u30A4\u30B3\u30F3\u304C\u305D\u306E\u4F4D\u7F6E\u306B\u4F7F\u7528\u3055\u308C\u307E\u3059\u3002 diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/builders/linux/LinuxAppImageBuilder_zh_CN.properties --- a/src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/builders/linux/LinuxAppImageBuilder_zh_CN.properties Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -# -# Copyright (c) 2017, 2018, 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. -# -# - -param.icon-png.name=.png \u56FE\u6807 -param.icon-png.description=\u5E94\u7528\u7A0B\u5E8F\u7684\u56FE\u6807, \u91C7\u7528 PNG \u683C\u5F0F\u3002 - -message.icon-not-png=\u6307\u5B9A\u7684\u56FE\u6807 "{0}" \u4E0D\u662F PNG \u6587\u4EF6, \u4E0D\u4F1A\u4F7F\u7528\u3002\u5C06\u4F7F\u7528\u9ED8\u8BA4\u56FE\u6807\u4EE3\u66FF\u3002 diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/javalogo_white_16.png Binary file src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/javalogo_white_16.png has changed diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/javalogo_white_32.png Binary file src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/javalogo_white_32.png has changed diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/javalogo_white_48.png Binary file src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/javalogo_white_48.png has changed diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/linux/LinuxAppBundler.properties --- a/src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/linux/LinuxAppBundler.properties Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -# -# Copyright (c) 2017, 2018, 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. -# -# - -bundler.name=Linux Application Image -bundler.description=A Directory based image of a linux Application with an optionally co-bundled JRE. Used as a base for the Installer bundlers. - -param.icon-png.name=.png Icon -param.icon-png.description=Icon for the application, in PNG format. - -param.linux-install-dir.name=Linux Installation Directory -param.linux-install-dir.description=Installation directory of the application on Linux. - -param.linux-package-dependencies.name=Linux Package Dependencies -param.linux-package-dependencies.description=Required packages or capabilities for the application. - -error.parameters-null=Parameters map is null. -error.parameters-null.advice=Pass in a non-null parameters map. -error.no-linux-resources=Java Packager does not support Linux. -error.no-linux-resources.advice=Please use the Java Packager that ships with Oracle JDK for Linux. -message.icon-not-png=The specified icon "{0}" is not a PNG file and will not be used. The default icon will be used in it's place. diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/linux/LinuxAppBundler_ja.properties --- a/src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/linux/LinuxAppBundler_ja.properties Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -# -# Copyright (c) 2017, 2018, 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. -# -# - -bundler.name=Linux\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30A4\u30E1\u30FC\u30B8 -bundler.description=\u30AA\u30D7\u30B7\u30E7\u30F3\u3067JRE\u304C\u30D0\u30F3\u30C9\u30EB\u3055\u308C\u3066\u3044\u308BLinux\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u30FB\u30D9\u30FC\u30B9\u306E\u30A4\u30E1\u30FC\u30B8\u3002\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9\u30FB\u30D0\u30F3\u30C9\u30E9\u306E\u30D9\u30FC\u30B9\u3068\u3057\u3066\u4F7F\u7528\u3055\u308C\u307E\u3059\u3002 - -param.icon-png.name=.png\u30A2\u30A4\u30B3\u30F3 -param.icon-png.description=PNG\u5F62\u5F0F\u3067\u306E\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u30A2\u30A4\u30B3\u30F3\u3002 - -param.linux-install-dir.name=Linux Installation Directory -param.linux-install-dir.description=Installation directory of the application on Linux. - -param.linux-package-dependencies.name=Linux Package Dependencies -param.linux-package-dependencies.description=Required packages or capabilities for the application. - -error.parameters-null=\u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30DE\u30C3\u30D7\u304Cnull\u3067\u3059\u3002 -error.parameters-null.advice=\u975Enull\u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30DE\u30C3\u30D7\u3067\u6E21\u3057\u3066\u304F\u3060\u3055\u3044\u3002 -error.no-linux-resources=Java\u30D1\u30C3\u30B1\u30FC\u30B8\u30E3\u306FLinux\u3092\u30B5\u30DD\u30FC\u30C8\u3057\u3066\u3044\u307E\u305B\u3093\u3002 -error.no-linux-resources.advice=Oracle JDK for Linux\u306B\u4ED8\u5C5E\u3057\u3066\u3044\u308BJava\u30D1\u30C3\u30B1\u30FC\u30B8\u30E3\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044\u3002 - -message.icon-not-png=\u6307\u5B9A\u3057\u305F\u30A2\u30A4\u30B3\u30F3"{0}"\u306FPNG\u30D5\u30A1\u30A4\u30EB\u3067\u306F\u306A\u304F\u3001\u4F7F\u7528\u3055\u308C\u307E\u305B\u3093\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30A2\u30A4\u30B3\u30F3\u304C\u305D\u306E\u4F4D\u7F6E\u306B\u4F7F\u7528\u3055\u308C\u307E\u3059\u3002 diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/linux/LinuxAppBundler_zh_CN.properties --- a/src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/linux/LinuxAppBundler_zh_CN.properties Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -# -# Copyright (c) 2017, 2018, 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. -# -# - -bundler.name=Linux \u5E94\u7528\u7A0B\u5E8F\u6620\u50CF -bundler.description=\u4E00\u4E2A\u57FA\u4E8E\u76EE\u5F55\u7684 linux \u5E94\u7528\u7A0B\u5E8F\u6620\u50CF, \u53EF\u4EE5\u9009\u62E9\u6027\u5730\u5E26\u6709\u5171\u540C\u6253\u5305\u7684 JRE\u3002\u7528\u4F5C\u5B89\u88C5\u7A0B\u5E8F\u6253\u5305\u7A0B\u5E8F\u7684\u57FA\u7840\u3002 - -param.icon-png.name=.png \u56FE\u6807 -param.icon-png.description=\u5E94\u7528\u7A0B\u5E8F\u7684\u56FE\u6807, \u91C7\u7528 PNG \u683C\u5F0F\u3002 - -param.linux-install-dir.name=Linux Installation Directory -param.linux-install-dir.description=Installation directory of the application on Linux. - -param.linux-package-dependencies.name=Linux Package Dependencies -param.linux-package-dependencies.description=Required packages or capabilities for the application. - -error.parameters-null=\u53C2\u6570\u6620\u5C04\u4E3A\u7A7A\u503C\u3002 -error.parameters-null.advice=\u8BF7\u4F20\u5165\u975E\u7A7A\u53C2\u6570\u6620\u5C04\u3002 -error.no-linux-resources=Java \u6253\u5305\u7A0B\u5E8F\u4E0D\u652F\u6301 Linux\u3002 -error.no-linux-resources.advice=\u8BF7\u4F7F\u7528 Oracle JDK for Linux \u4E2D\u9644\u5E26\u7684 Java \u6253\u5305\u7A0B\u5E8F\u3002 - -message.icon-not-png=\u6307\u5B9A\u7684\u56FE\u6807 "{0}" \u4E0D\u662F PNG \u6587\u4EF6, \u4E0D\u4F1A\u4F7F\u7528\u3002\u5C06\u4F7F\u7528\u9ED8\u8BA4\u56FE\u6807\u4EE3\u66FF\u3002 diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/linux/LinuxDebBundler.properties --- a/src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/linux/LinuxDebBundler.properties Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,108 +0,0 @@ -# -# Copyright (c) 2017, 2018, 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. -# -# - -bundler.name=DEB Installer -bundler.description=Linux Debian Bundle. - -param.app-bundler.name=DEB Bundler Name -param.app-bundler.description=DEB Bundler Name - -param.bundle-name.name=DEB Bundle Name -param.bundle-name.description=DEB Bundle Name - -param.full-package-name.name=Deb Package Name -param.full-package-name.description=Deb Package Name - -param.image-dir.name=Image Dir -param.image-dir.description=Image Dir - -param.config-root.name=Config Root Dir -param.config-root.description=Config Root Dir - -param.app-image-root.name=Image Root Dir -param.app-image-root.description=Image Root Dir - -param.config-dir.name=Config Dir -param.config-dir.description=Config Dir - -param.maintainer-email.name=DEB Maintainer Email -param.maintainer-email.description=DEB Maintainer Email - -param.maintainer-name.name=DEB Maintainer Name -param.maintainer-name.description=DEB Maintainer Name - -param.license-type.name=License Type -param.license-type.description=License Type - -param.license-text.name=License Content -param.license-text.description=License Content - -param.xdg-prefix.name=Prefix for XDG files (mime, desktop) -param.xdg-prefix.description=Prefix for XDG MimeInfo and Desktop Files. Defaults to -, with spaces dropped. - -resource.deb-control-file=DEB control file -resource.deb-preinstall-script=DEB preinstall script -resource.deb-prerm-script=DEB prerm script -resource.deb-postinstall-script=DEB postinstall script -resource.deb-postrm-script=DEB postrm script -resource.deb-copyright-file=DEB copyright file -resource.deb-init-script=DEB init script -resource.menu-shortcut-descriptor=Menu shortcut descriptor -resource.menu-icon=menu icon - -error.parameters-null=Parameters map is null. -error.parameters-null.advice=Pass in a non-null parameters map. - -error.tool-not-found=Can not find {0}. -error.tool-not-found.advice=Please install required packages. - -error.license-missing=Specified license file is missing. -error.license-missing.advice=Make sure that "{0}" references a file in the app resources, and that it is relative to the basedir "{1}". - -error.launcher-name-too-long=The bundle name "{0}" is too long for a daemon. -error.launcher-name-too-long.advice=Set a bundler argument "{0}" to a bundle name that is shorter than 16 characters. - -error.cannot-create-output-dir=Output directory {0} cannot be created. -error.cannot-write-to-output-dir=Output directory {0} is not writable. - -error.no-content-types-for-file-association=No MIME types were specified for File Association number {0}. -error.no-content-types-for-file-association.advice=For Linux Bundling specify one and only one MIME type for each file association. - -error.too-many-content-types-for-file-association=More than one MIME types was specified for File Association number {0}. -error.too-many-content-types-for-file-association.advice=For Linux Bundling specify one and only one MIME type for each file association. - -error.no-support-for-peruser-daemons=Bundler doesn't support per-user daemons. -error.no-support-for-peruser-daemons.advice=Make sure that the system wide hint is set to true. - -error.invalid-value-for-package-name=Invalid value "{0}" for the package name. -error.invalid-value-for-package-name.advice=Set the "linux.bundleName" parameter to a valid Debian package name. Note that the package names must consist only of lower case letters (a-z), digits (0-9), plus (+) and minus (-) signs, and periods (.). They must be at least two characters long and must start with an alphanumeric character. - -message.test-for-tool=Test for [{0}]. Result\: {1} -message.debug-working-directory=Kept working directory for debug\: {0} -message.outputting-to-location=Generating DEB for installer to\: {0} -message.output-to-location=Package (.deb) saved to\: {0} -message.debs-like-licenses=Debian packages should specify a license. The absence of a license will cause some linux distributions to complain about the quality of the application. -message.creating-association-with-null-extension=Creating association with null extension. diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/linux/LinuxDebBundler_ja.properties --- a/src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/linux/LinuxDebBundler_ja.properties Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,108 +0,0 @@ -# -# Copyright (c) 2017, 2018, 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. -# -# - -bundler.name=DEB\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9 -bundler.description=Linux Debian\u30D0\u30F3\u30C9\u30EB\u3002 - -param.app-bundler.name=DEB Bundler Name -param.app-bundler.description=DEB Bundler Name - -param.bundle-name.name=DEB Bundle Name -param.bundle-name.description=DEB Bundle Name - -param.full-package-name.name=Deb Package Name -param.full-package-name.description=Deb Package Name - -param.image-dir.name=Image Dir -param.image-dir.description=Image Dir - -param.config-root.name=Config Root Dir -param.config-root.description=Config Root Dir - -param.app-image-root.name=Image Root Dir -param.app-image-root.description=Image Root Dir - -param.config-dir.name=Config Dir -param.config-dir.description=Config Dir - -param.maintainer-email.name=DEB Maintainer Email -param.maintainer-email.description=DEB Maintainer Email - -param.maintainer-name.name=DEB Maintainer Name -param.maintainer-name.description=DEB Maintainer Name - -param.license-type.name=License Type -param.license-type.description=License Type - -param.license-text.name=License Content -param.license-text.description=License Content - -param.xdg-prefix.name=XDG\u30D5\u30A1\u30A4\u30EB\u306E\u63A5\u982D\u8F9E(mime\u3001\u30C7\u30B9\u30AF\u30C8\u30C3\u30D7) -param.xdg-prefix.description=XDG MimeInfo\u304A\u3088\u3073\u30C7\u30B9\u30AF\u30C8\u30C3\u30D7\u30FB\u30D5\u30A1\u30A4\u30EB\u306E\u63A5\u982D\u8F9E\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u306F-\u3067\u3042\u308A\u3001\u30B9\u30DA\u30FC\u30B9\u306F\u524A\u9664\u3055\u308C\u307E\u3059\u3002 - -resource.deb-control-file=DEB\u5236\u5FA1\u30D5\u30A1\u30A4\u30EB -resource.deb-preinstall-script=DEB\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u524D\u30B9\u30AF\u30EA\u30D7\u30C8 -resource.deb-prerm-script=DEB prerm\u30B9\u30AF\u30EA\u30D7\u30C8 -resource.deb-postinstall-script=DEB\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u5F8C\u30B9\u30AF\u30EA\u30D7\u30C8 -resource.deb-postrm-script=DEB postrm\u30B9\u30AF\u30EA\u30D7\u30C8 -resource.deb-copyright-file=DEB\u30B3\u30D4\u30FC\u30E9\u30A4\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB -resource.deb-init-script=DEB\u521D\u671F\u5316\u30B9\u30AF\u30EA\u30D7\u30C8 -resource.menu-shortcut-descriptor=\u30E1\u30CB\u30E5\u30FC\u30FB\u30B7\u30E7\u30FC\u30C8\u30AB\u30C3\u30C8\u30FB\u30C7\u30A3\u30B9\u30AF\u30EA\u30D7\u30BF -resource.menu-icon=\u30E1\u30CB\u30E5\u30FC\u30FB\u30A2\u30A4\u30B3\u30F3 - -error.parameters-null=\u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30DE\u30C3\u30D7\u304Cnull\u3067\u3059\u3002 -error.parameters-null.advice=\u975Enull\u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30DE\u30C3\u30D7\u3067\u6E21\u3057\u3066\u304F\u3060\u3055\u3044\u3002 - -error.tool-not-found={0}\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002 -error.tool-not-found.advice=\u5FC5\u8981\u306A\u30D1\u30C3\u30B1\u30FC\u30B8\u3092\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3057\u3066\u304F\u3060\u3055\u3044\u3002 - -error.license-missing=\u6307\u5B9A\u3057\u305F\u30E9\u30A4\u30BB\u30F3\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u304C\u3042\u308A\u307E\u305B\u3093\u3002 -error.license-missing.advice="{0}"\u304C\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30EA\u30BD\u30FC\u30B9\u5185\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u53C2\u7167\u3057\u3001\u30D9\u30FC\u30B9\u30FB\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA"{1}"\u306B\u5BFE\u3057\u3066\u76F8\u5BFE\u7684\u3067\u3042\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002 - -error.launcher-name-too-long=\u30D0\u30F3\u30C9\u30EB\u540D"{0}"\u304C\u3001\u30C7\u30FC\u30E2\u30F3\u306B\u5BFE\u3057\u3066\u9577\u3059\u304E\u307E\u3059\u3002 -error.launcher-name-too-long.advice=\u30D0\u30F3\u30C9\u30E9\u5F15\u6570"{0}"\u309216\u6587\u5B57\u672A\u6E80\u306E\u30D0\u30F3\u30C9\u30EB\u540D\u306B\u8A2D\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002 - -error.cannot-create-output-dir=\u51FA\u529B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA{0}\u3092\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093\u3002 -error.cannot-write-to-output-dir=\u51FA\u529B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA{0}\u306F\u66F8\u8FBC\u307F\u4E0D\u53EF\u3067\u3059\u3002 - -error.no-content-types-for-file-association=\u30D5\u30A1\u30A4\u30EB\u30FB\u30A2\u30BD\u30B7\u30A8\u30FC\u30B7\u30E7\u30F3\u756A\u53F7{0}\u306BMIME\u30BF\u30A4\u30D7\u304C\u6307\u5B9A\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002 -error.no-content-types-for-file-association.advice=Linux\u30D0\u30F3\u30C9\u30EB\u306E\u5834\u5408\u3001\u5404\u30D5\u30A1\u30A4\u30EB\u30FB\u30A2\u30BD\u30B7\u30A8\u30FC\u30B7\u30E7\u30F3\u306BMIME\u30BF\u30A4\u30D7\u30921\u3064\u3060\u3051\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002 - -error.too-many-content-types-for-file-association=\u30D5\u30A1\u30A4\u30EB\u30FB\u30A2\u30BD\u30B7\u30A8\u30FC\u30B7\u30E7\u30F3\u756A\u53F7{0}\u306B\u8907\u6570\u306EMIME\u30BF\u30A4\u30D7\u304C\u6307\u5B9A\u3055\u308C\u307E\u3057\u305F\u3002 -error.too-many-content-types-for-file-association.advice=Linux\u30D0\u30F3\u30C9\u30EB\u306E\u5834\u5408\u3001\u5404\u30D5\u30A1\u30A4\u30EB\u30FB\u30A2\u30BD\u30B7\u30A8\u30FC\u30B7\u30E7\u30F3\u306BMIME\u30BF\u30A4\u30D7\u30921\u3064\u3060\u3051\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002 - -error.no-support-for-peruser-daemons=\u30D0\u30F3\u30C9\u30E9\u306F\u3001\u30E6\u30FC\u30B6\u30FC\u5358\u4F4D\u306E\u30C7\u30FC\u30E2\u30F3\u3092\u30B5\u30DD\u30FC\u30C8\u3057\u3066\u3044\u307E\u305B\u3093\u3002 -error.no-support-for-peruser-daemons.advice=\u30B7\u30B9\u30C6\u30E0\u5168\u4F53\u306E\u30D2\u30F3\u30C8\u304Ctrue\u306B\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002 - -error.invalid-value-for-package-name=\u30D1\u30C3\u30B1\u30FC\u30B8\u540D\u306B\u5BFE\u3057\u3066\u5024"{0}"\u306F\u7121\u52B9\u3067\u3059\u3002 -error.invalid-value-for-package-name.advice="linux.bundleName"\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u6709\u52B9\u306ADebian\u30D1\u30C3\u30B1\u30FC\u30B8\u540D\u306B\u8A2D\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u30D1\u30C3\u30B1\u30FC\u30B8\u540D\u306B\u306F\u3001\u5C0F\u6587\u5B57(a-z)\u3001\u6570\u5B57(0-9)\u3001\u30D7\u30E9\u30B9(+)\u3068\u30DE\u30A4\u30CA\u30B9(-)\u306E\u8A18\u53F7\u304A\u3088\u3073\u30D4\u30EA\u30AA\u30C9(.)\u306E\u307F\u3092\u542B\u3081\u308B\u3088\u3046\u306B\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u9577\u3055\u306F2\u6587\u5B57\u4EE5\u4E0A\u3068\u3057\u3001\u82F1\u6570\u5B57\u3067\u59CB\u3081\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 - -message.test-for-tool=[{0}]\u306E\u30C6\u30B9\u30C8\u3002\u7D50\u679C: {1} -message.debug-working-directory=\u30C7\u30D0\u30C3\u30B0\u306E\u4F5C\u696D\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304C\u4FDD\u6301\u3055\u308C\u307E\u3057\u305F: {0} -message.outputting-to-location=\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9\u306EDEB\u3092\u6B21\u306B\u751F\u6210\u3057\u3066\u3044\u307E\u3059: {0} -message.output-to-location=\u30D1\u30C3\u30B1\u30FC\u30B8(.deb)\u306F\u6B21\u306B\u4FDD\u5B58\u3055\u308C\u307E\u3057\u305F: {0} -message.debs-like-licenses=Debian\u30D1\u30C3\u30B1\u30FC\u30B8\u3067\u306F\u30E9\u30A4\u30BB\u30F3\u30B9\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\u30E9\u30A4\u30BB\u30F3\u30B9\u304C\u306A\u3044\u5834\u5408\u3001\u4E00\u90E8\u306ELinux\u30C7\u30A3\u30B9\u30C8\u30EA\u30D3\u30E5\u30FC\u30B7\u30E7\u30F3\u3067\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u54C1\u8CEA\u306B\u554F\u984C\u304C\u767A\u751F\u3059\u308B\u5834\u5408\u304C\u3042\u308A\u307E\u3059\u3002 -message.creating-association-with-null-extension=null\u62E1\u5F35\u5B50\u3068\u306E\u95A2\u9023\u4ED8\u3051\u3092\u4F5C\u6210\u3057\u3066\u3044\u307E\u3059\u3002 diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/linux/LinuxDebBundler_zh_CN.properties --- a/src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/linux/LinuxDebBundler_zh_CN.properties Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,108 +0,0 @@ -# -# Copyright (c) 2017, 2018, 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. -# -# - -bundler.name=DEB \u5B89\u88C5\u7A0B\u5E8F -bundler.description=Linux Debian \u5305\u3002 - -param.app-bundler.name=DEB Bundler Name -param.app-bundler.description=DEB Bundler Name - -param.bundle-name.name=DEB Bundle Name -param.bundle-name.description=DEB Bundle Name - -param.full-package-name.name=Deb Package Name -param.full-package-name.description=Deb Package Name - -param.image-dir.name=Image Dir -param.image-dir.description=Image Dir - -param.config-root.name=Config Root Dir -param.config-root.description=Config Root Dir - -param.app-image-root.name=Image Root Dir -param.app-image-root.description=Image Root Dir - -param.config-dir.name=Config Dir -param.config-dir.description=Config Dir - -param.maintainer-email.name=DEB Maintainer Email -param.maintainer-email.description=DEB Maintainer Email - -param.maintainer-name.name=DEB Maintainer Name -param.maintainer-name.description=DEB Maintainer Name - -param.license-type.name=License Type -param.license-type.description=License Type - -param.license-text.name=License Content -param.license-text.description=License Content - -param.xdg-prefix.name=XDG \u6587\u4EF6 (mime, desktop) \u7684\u524D\u7F00 -param.xdg-prefix.description=XDG MimeInfo \u548C Desktop \u6587\u4EF6\u7684\u524D\u7F00\u3002\u9ED8\u8BA4\u4E3A -, \u4E0D\u542B\u7A7A\u683C\u3002 - -resource.deb-control-file=DEB \u63A7\u5236\u6587\u4EF6 -resource.deb-preinstall-script=DEB \u5B89\u88C5\u524D\u811A\u672C -resource.deb-prerm-script=DEB \u5220\u9664\u524D\u811A\u672C -resource.deb-postinstall-script=DEB \u5B89\u88C5\u540E\u811A\u672C -resource.deb-postrm-script=DEB \u5220\u9664\u540E\u811A\u672C -resource.deb-copyright-file=DEB \u7248\u6743\u6587\u4EF6 -resource.deb-init-script=DEB \u521D\u59CB\u5316\u811A\u672C -resource.menu-shortcut-descriptor=\u83DC\u5355\u5FEB\u6377\u65B9\u5F0F\u63CF\u8FF0\u7B26 -resource.menu-icon=\u83DC\u5355\u56FE\u6807 - -error.parameters-null=\u53C2\u6570\u6620\u5C04\u4E3A\u7A7A\u503C\u3002 -error.parameters-null.advice=\u8BF7\u4F20\u5165\u975E\u7A7A\u53C2\u6570\u6620\u5C04\u3002 - -error.tool-not-found=\u627E\u4E0D\u5230{0}\u3002 -error.tool-not-found.advice=\u8BF7\u5B89\u88C5\u6240\u9700\u7684\u7A0B\u5E8F\u5305\u3002 - -error.license-missing=\u7F3A\u5C11\u6307\u5B9A\u7684\u8BB8\u53EF\u8BC1\u6587\u4EF6\u3002 -error.license-missing.advice=\u8BF7\u786E\u4FDD "{0}" \u5F15\u7528\u5E94\u7528\u7A0B\u5E8F\u8D44\u6E90\u4E2D\u7684\u6587\u4EF6, \u5E76\u4E14\u4F7F\u7528\u57FA\u76EE\u5F55 "{1}" \u7684\u76F8\u5BF9\u76EE\u5F55\u3002 - -error.launcher-name-too-long=\u5B88\u62A4\u7A0B\u5E8F\u7684\u5305\u540D "{0}" \u592A\u957F\u3002 -error.launcher-name-too-long.advice=\u5C06\u6253\u5305\u7A0B\u5E8F\u53C2\u6570 "{0}" \u8BBE\u7F6E\u4E3A\u5C11\u4E8E 16 \u4E2A\u5B57\u7B26\u7684\u5305\u540D\u3002 - -error.cannot-create-output-dir=\u65E0\u6CD5\u521B\u5EFA\u8F93\u51FA\u76EE\u5F55 {0}\u3002 -error.cannot-write-to-output-dir=\u8F93\u51FA\u76EE\u5F55 {0} \u4E0D\u53EF\u5199\u3002 - -error.no-content-types-for-file-association=\u6CA1\u6709\u4E3A\u6587\u4EF6\u5173\u8054\u53F7{0}\u6307\u5B9A MIME \u7C7B\u578B\u3002 -error.no-content-types-for-file-association.advice=\u5BF9\u4E8E Linux \u6253\u5305, \u8BF7\u4E3A\u6BCF\u4E2A\u6587\u4EF6\u5173\u8054\u6307\u5B9A\u4E00\u4E2A\u4E14\u4EC5\u6307\u5B9A\u4E00\u4E2A MIME \u7C7B\u578B\u3002 - -error.too-many-content-types-for-file-association=\u4E3A\u6587\u4EF6\u5173\u8054\u53F7{0}\u6307\u5B9A\u4E86\u591A\u4E2A MIME \u7C7B\u578B\u3002 -error.too-many-content-types-for-file-association.advice=\u5BF9\u4E8E Linux \u6253\u5305, \u8BF7\u4E3A\u6BCF\u4E2A\u6587\u4EF6\u5173\u8054\u6307\u5B9A\u4E00\u4E2A\u4E14\u4EC5\u6307\u5B9A\u4E00\u4E2A MIME \u7C7B\u578B\u3002 - -error.no-support-for-peruser-daemons=\u6253\u5305\u7A0B\u5E8F\u4E0D\u652F\u6301\u6BCF\u7528\u6237\u5B88\u62A4\u7A0B\u5E8F\u3002 -error.no-support-for-peruser-daemons.advice=\u786E\u4FDD\u7CFB\u7EDF\u8303\u56F4\u63D0\u793A\u8BBE\u7F6E\u4E3A\u201C\u771F\u201D\u3002 - -error.invalid-value-for-package-name=\u7A0B\u5E8F\u5305\u540D\u79F0\u7684\u503C "{0}" \u65E0\u6548\u3002 -error.invalid-value-for-package-name.advice=\u5C06 "linux.bundleName" \u53C2\u6570\u8BBE\u7F6E\u4E3A\u6709\u6548\u7684 Debian \u7A0B\u5E8F\u5305\u540D\u79F0\u3002\u8BF7\u6CE8\u610F, \u7A0B\u5E8F\u5305\u540D\u79F0\u53EA\u80FD\u5305\u542B\u5C0F\u5199\u5B57\u6BCD (a-z), \u6570\u5B57 (0-9), \u52A0\u53F7 (+) \u548C\u51CF\u53F7 (-) \u4EE5\u53CA\u53E5\u70B9 (.)\u3002\u540D\u79F0\u957F\u5EA6\u5FC5\u987B\u81F3\u5C11\u4E3A\u4E24\u4E2A\u5B57\u7B26\u5E76\u4E14\u5FC5\u987B\u4EE5\u5B57\u6BCD\u6570\u5B57\u5B57\u7B26\u5F00\u5934\u3002 - -message.test-for-tool=[{0}] \u7684\u6D4B\u8BD5\u3002\u7ED3\u679C: {1} -message.debug-working-directory=\u7528\u4E8E\u8C03\u8BD5\u7684\u5DF2\u4FDD\u7559\u5DE5\u4F5C\u76EE\u5F55: {0} -message.outputting-to-location=\u6B63\u5728\u4E3A\u5B89\u88C5\u7A0B\u5E8F\u751F\u6210 DEB, \u4F4D\u7F6E: {0} -message.output-to-location=\u7A0B\u5E8F\u5305 (.deb) \u5DF2\u4FDD\u5B58\u5230: {0} -message.debs-like-licenses=Debian \u7A0B\u5E8F\u5305\u5E94\u6307\u5B9A\u8BB8\u53EF\u8BC1\u3002\u7F3A\u5C11\u8BB8\u53EF\u8BC1\u5C06\u5BFC\u81F4\u67D0\u4E9B Linux \u5206\u53D1\u6295\u8BC9\u5E94\u7528\u7A0B\u5E8F\u8D28\u91CF\u3002 -message.creating-association-with-null-extension=\u6B63\u5728\u4F7F\u7528\u7A7A\u6269\u5C55\u540D\u521B\u5EFA\u5173\u8054\u3002 diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/linux/LinuxResources.java --- a/src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/linux/LinuxResources.java Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2011, 2018, 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.jpackager.internal.resources.linux; - -public class LinuxResources { - -} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/linux/LinuxRpmBundler.properties --- a/src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/linux/LinuxRpmBundler.properties Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,83 +0,0 @@ -# -# Copyright (c) 2017, 2018, 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. -# -# - -bundler.name=RPM Bundle -bundler.description=Redhat Package Manager (RPM) bundler. - -param.app-bundler.name=RPM Bundler -param.app-bundler.description=RPM Bundler - -param.image-dir.name=Image Dir -param.image-dir.description=Image Dir - -param.bundle-name.name=RPM Bundle -param.bundle-name.description=RPM Bundle - -param.config-root.name=Config Root Dir -param.config-root.description=Config Root Dir - -param.xdg-prefix.name=Prefix for XDG files (mime, desktop) -param.xdg-prefix.description=Prefix for XDG MimeInfo and Desktop Files. Defaults to -, with spaces dropped. - -param.license-type.name=License Type -param.license-type.description=License Type for RPM package. -param.license-type.default=Unknown - -resource.rpm-spec-file=RPM spec file -resource.rpm-init-script=RPM init script -resource.menu-shortcut-descriptor=Menu shortcut descriptor -resource.menu-icon=menu icon - -error.parameters-null=Parameters map is null. -error.parameters-null.advice=Pass in a non-null parameters map. - -error.cannot-find-rpmbuild=Can not find rpmbuild {0} or newer. -error.cannot-find-rpmbuild.advice=\ Install packages needed to build RPM, version {0} or newer. - -error.license-missing=Specified license file is missing. -error.license-missing.advice=Make sure that "{0}" references a file in the app resources, and that it is relative file reference. - -error.cannot-create-output-dir=Output directory {0} cannot be created. -error.cannot-write-to-output-dir=Output directory {0} is not writable. - -error.no-content-types-for-file-association=No MIME types were specified for File Association number {0}. -error.no-content-types-for-file-association.advice=For Linux Bundling specify one and only one MIME type for each file association. - -error.too-many-content-types-for-file-association=More than one MIME types was specified for File Association number {0}. -error.too-many-content-types-for-file-association.advice=For Linux Bundling specify one and only one MIME type for each file association. - -error.no-support-for-peruser-daemons=Bundler doesn't support per-user daemons. -error.no-support-for-peruser-daemons.advice=Make sure that the system wide hint is set to true. - -error.invalid-value-for-package-name=Invalid value "{0}" for the package name. -error.invalid-value-for-package-name.advice=Set the "linux.bundleName" parameter to a valid RPM package name. Note that the packages must be named using only the following ASCII characters: abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._+ - -message.test-for-tool=Test for [{0}]. Result\: {1} -message.one-shortcut-required=At least one type of shortcut is required. Enabling menu shortcut. -message.debug-working-directory=Kept working directory for debug\: {0} -message.outputting-bundle-location=Generating RPM for installer to\: {0} -message.output-bundle-location=Package (.rpm) saved to\: {0} -message.creating-association-with-null-extension=Creating association with null extension. diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/linux/LinuxRpmBundler_ja.properties --- a/src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/linux/LinuxRpmBundler_ja.properties Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +0,0 @@ -# -# Copyright (c) 2017, 2018, 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. -# -# - -bundler.name=RPM\u30D0\u30F3\u30C9\u30EB -bundler.description=RedHat Package Manager (RPM)\u306E\u30D0\u30F3\u30C9\u30E9\u3002 - -param.app-bundler.name=RPM Bundler -param.app-bundler.description=RPM Bundler - -param.image-dir.name=Image Dir -param.image-dir.description=Image Dir - -param.bundle-name.name=RPM Bundle -param.bundle-name.description=RPM Bundle - -param.config-root.name=Config Root Dir -param.config-root.description=Config Root Dir - -param.xdg-prefix.name=XDG\u30D5\u30A1\u30A4\u30EB\u306E\u63A5\u982D\u8F9E(mime\u3001\u30C7\u30B9\u30AF\u30C8\u30C3\u30D7) -param.xdg-prefix.description=XDG MimeInfo\u304A\u3088\u3073\u30C7\u30B9\u30AF\u30C8\u30C3\u30D7\u30FB\u30D5\u30A1\u30A4\u30EB\u306E\u63A5\u982D\u8F9E\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u306F-\u3067\u3042\u308A\u3001\u30B9\u30DA\u30FC\u30B9\u306F\u524A\u9664\u3055\u308C\u307E\u3059\u3002 - -resource.rpm-spec-file=RPM\u4ED5\u69D8\u30D5\u30A1\u30A4\u30EB -resource.rpm-init-script=RPM\u521D\u671F\u5316\u30B9\u30AF\u30EA\u30D7\u30C8 -resource.menu-shortcut-descriptor=\u30E1\u30CB\u30E5\u30FC\u30FB\u30B7\u30E7\u30FC\u30C8\u30AB\u30C3\u30C8\u30FB\u30C7\u30A3\u30B9\u30AF\u30EA\u30D7\u30BF -resource.menu-icon=\u30E1\u30CB\u30E5\u30FC\u30FB\u30A2\u30A4\u30B3\u30F3 - -error.parameters-null=\u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30DE\u30C3\u30D7\u304Cnull\u3067\u3059\u3002 -error.parameters-null.advice=\u975Enull\u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30DE\u30C3\u30D7\u3067\u6E21\u3057\u3066\u304F\u3060\u3055\u3044\u3002 - -error.cannot-find-rpmbuild=rpmbuild {0}\u307E\u305F\u306F\u305D\u308C\u4EE5\u964D\u306E\u3082\u306E\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002 -error.cannot-find-rpmbuild.advice=\ \u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u30FB\u30D1\u30C3\u30B1\u30FC\u30B8\u306F\u30D0\u30FC\u30B8\u30E7\u30F3{0}\u4EE5\u964D\u306ERPM\u3092\u30D3\u30EB\u30C9\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 - -error.license-missing=\u6307\u5B9A\u3057\u305F\u30E9\u30A4\u30BB\u30F3\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u304C\u3042\u308A\u307E\u305B\u3093\u3002 -error.license-missing.advice="{0}"\u304C\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30EA\u30BD\u30FC\u30B9\u5185\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u53C2\u7167\u3057\u3001\u76F8\u5BFE\u30D5\u30A1\u30A4\u30EB\u53C2\u7167\u3067\u3042\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002 - -error.cannot-create-output-dir=\u51FA\u529B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA{0}\u3092\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093\u3002 -error.cannot-write-to-output-dir=\u51FA\u529B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA{0}\u306F\u66F8\u8FBC\u307F\u4E0D\u53EF\u3067\u3059\u3002 - -error.no-content-types-for-file-association=\u30D5\u30A1\u30A4\u30EB\u30FB\u30A2\u30BD\u30B7\u30A8\u30FC\u30B7\u30E7\u30F3\u756A\u53F7{0}\u306BMIME\u30BF\u30A4\u30D7\u304C\u6307\u5B9A\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002 -error.no-content-types-for-file-association.advice=Linux\u30D0\u30F3\u30C9\u30EB\u306E\u5834\u5408\u3001\u5404\u30D5\u30A1\u30A4\u30EB\u30FB\u30A2\u30BD\u30B7\u30A8\u30FC\u30B7\u30E7\u30F3\u306BMIME\u30BF\u30A4\u30D7\u30921\u3064\u3060\u3051\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002 - -error.too-many-content-types-for-file-association=\u30D5\u30A1\u30A4\u30EB\u30FB\u30A2\u30BD\u30B7\u30A8\u30FC\u30B7\u30E7\u30F3\u756A\u53F7{0}\u306B\u8907\u6570\u306EMIME\u30BF\u30A4\u30D7\u304C\u6307\u5B9A\u3055\u308C\u307E\u3057\u305F\u3002 -error.too-many-content-types-for-file-association.advice=Linux\u30D0\u30F3\u30C9\u30EB\u306E\u5834\u5408\u3001\u5404\u30D5\u30A1\u30A4\u30EB\u30FB\u30A2\u30BD\u30B7\u30A8\u30FC\u30B7\u30E7\u30F3\u306BMIME\u30BF\u30A4\u30D7\u30921\u3064\u3060\u3051\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002 - -error.no-support-for-peruser-daemons=\u30D0\u30F3\u30C9\u30E9\u306F\u3001\u30E6\u30FC\u30B6\u30FC\u5358\u4F4D\u306E\u30C7\u30FC\u30E2\u30F3\u3092\u30B5\u30DD\u30FC\u30C8\u3057\u3066\u3044\u307E\u305B\u3093\u3002 -error.no-support-for-peruser-daemons.advice=\u30B7\u30B9\u30C6\u30E0\u5168\u4F53\u306E\u30D2\u30F3\u30C8\u304Ctrue\u306B\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002 - -error.invalid-value-for-package-name=\u30D1\u30C3\u30B1\u30FC\u30B8\u540D\u306B\u5BFE\u3057\u3066\u5024"{0}"\u306F\u7121\u52B9\u3067\u3059\u3002 -error.invalid-value-for-package-name.advice="linux.bundleName"\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u6709\u52B9\u306ARPM\u30D1\u30C3\u30B1\u30FC\u30B8\u540D\u306B\u8A2D\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u30D1\u30C3\u30B1\u30FC\u30B8\u540D\u306F\u3001\u6B21\u306EASCII\u6587\u5B57\u306E\u307F\u3092\u4F7F\u7528\u3057\u3066\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059: abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._+ - -message.test-for-tool=[{0}]\u306E\u30C6\u30B9\u30C8\u3002\u7D50\u679C: {1} -message.one-shortcut-required=\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u30B7\u30E7\u30FC\u30C8\u30AB\u30C3\u30C8\u30FB\u30BF\u30A4\u30D7\u304C\u5FC5\u8981\u3067\u3059\u3002\u30E1\u30CB\u30E5\u30FC\u30FB\u30B7\u30E7\u30FC\u30C8\u30AB\u30C3\u30C8\u3092\u6709\u52B9\u5316\u3057\u3066\u3044\u307E\u3059\u3002 -message.debug-working-directory=\u30C7\u30D0\u30C3\u30B0\u306E\u4F5C\u696D\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304C\u4FDD\u6301\u3055\u308C\u307E\u3057\u305F: {0} -message.outputting-bundle-location=\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9\u306ERPM\u3092\u6B21\u306B\u751F\u6210\u3057\u3066\u3044\u307E\u3059: {0} -message.output-bundle-location=\u30D1\u30C3\u30B1\u30FC\u30B8(.rpm)\u306F\u6B21\u306B\u4FDD\u5B58\u3055\u308C\u307E\u3057\u305F: {0} -message.creating-association-with-null-extension=null\u62E1\u5F35\u5B50\u3068\u306E\u95A2\u9023\u4ED8\u3051\u3092\u4F5C\u6210\u3057\u3066\u3044\u307E\u3059\u3002 diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/linux/LinuxRpmBundler_zh_CN.properties --- a/src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/linux/LinuxRpmBundler_zh_CN.properties Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +0,0 @@ -# -# Copyright (c) 2017, 2018, 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. -# -# - -bundler.name=RPM \u5305 -bundler.description=Redhat Package Manager (RPM) \u6253\u5305\u7A0B\u5E8F\u3002 - -param.app-bundler.name=RPM Bundler -param.app-bundler.description=RPM Bundler - -param.image-dir.name=Image Dir -param.image-dir.description=Image Dir - -param.bundle-name.name=RPM Bundle -param.bundle-name.description=RPM Bundle - -param.config-root.name=Config Root Dir -param.config-root.description=Config Root Dir - -param.xdg-prefix.name=XDG \u6587\u4EF6 (mime, desktop) \u7684\u524D\u7F00 -param.xdg-prefix.description=XDG MimeInfo \u548C Desktop \u6587\u4EF6\u7684\u524D\u7F00\u3002\u9ED8\u8BA4\u4E3A -, \u4E0D\u542B\u7A7A\u683C\u3002 - -resource.rpm-spec-file=RPM \u89C4\u8303\u6587\u4EF6 -resource.rpm-init-script=RPM \u521D\u59CB\u5316\u811A\u672C -resource.menu-shortcut-descriptor=\u83DC\u5355\u5FEB\u6377\u65B9\u5F0F\u63CF\u8FF0\u7B26 -resource.menu-icon=\u83DC\u5355\u56FE\u6807 - -error.parameters-null=\u53C2\u6570\u6620\u5C04\u4E3A\u7A7A\u503C\u3002 -error.parameters-null.advice=\u8BF7\u4F20\u5165\u975E\u7A7A\u53C2\u6570\u6620\u5C04\u3002 - -error.cannot-find-rpmbuild=\u627E\u4E0D\u5230 rpmbuild {0} \u6216\u66F4\u65B0\u7248\u672C\u3002 -error.cannot-find-rpmbuild.advice=\ \u8BF7\u5B89\u88C5\u6784\u5EFA RPM \u7248\u672C {0} \u6216\u66F4\u65B0\u7248\u672C\u6240\u9700\u7684\u7A0B\u5E8F\u5305\u3002 - -error.license-missing=\u7F3A\u5C11\u6307\u5B9A\u7684\u8BB8\u53EF\u8BC1\u6587\u4EF6\u3002 -error.license-missing.advice=\u786E\u4FDD "{0}" \u5F15\u7528\u5E94\u7528\u7A0B\u5E8F\u8D44\u6E90\u4E2D\u7684\u6587\u4EF6, \u5E76\u4E14\u662F\u76F8\u5BF9\u6587\u4EF6\u5F15\u7528\u3002 - -error.cannot-create-output-dir=\u65E0\u6CD5\u521B\u5EFA\u8F93\u51FA\u76EE\u5F55 {0}\u3002 -error.cannot-write-to-output-dir=\u8F93\u51FA\u76EE\u5F55 {0} \u4E0D\u53EF\u5199\u3002 - -error.no-content-types-for-file-association=\u6CA1\u6709\u4E3A\u6587\u4EF6\u5173\u8054\u53F7{0}\u6307\u5B9A MIME \u7C7B\u578B\u3002 -error.no-content-types-for-file-association.advice=\u5BF9\u4E8E Linux \u6253\u5305, \u8BF7\u4E3A\u6BCF\u4E2A\u6587\u4EF6\u5173\u8054\u6307\u5B9A\u4E00\u4E2A\u4E14\u4EC5\u6307\u5B9A\u4E00\u4E2A MIME \u7C7B\u578B\u3002 - -error.too-many-content-types-for-file-association=\u4E3A\u6587\u4EF6\u5173\u8054\u53F7{0}\u6307\u5B9A\u4E86\u591A\u4E2A MIME \u7C7B\u578B\u3002 -error.too-many-content-types-for-file-association.advice=\u5BF9\u4E8E Linux \u6253\u5305, \u8BF7\u4E3A\u6BCF\u4E2A\u6587\u4EF6\u5173\u8054\u6307\u5B9A\u4E00\u4E2A\u4E14\u4EC5\u6307\u5B9A\u4E00\u4E2A MIME \u7C7B\u578B\u3002 - -error.no-support-for-peruser-daemons=\u6253\u5305\u7A0B\u5E8F\u4E0D\u652F\u6301\u6BCF\u7528\u6237\u5B88\u62A4\u7A0B\u5E8F\u3002 -error.no-support-for-peruser-daemons.advice=\u786E\u4FDD\u7CFB\u7EDF\u8303\u56F4\u63D0\u793A\u8BBE\u7F6E\u4E3A\u201C\u771F\u201D\u3002 - -error.invalid-value-for-package-name=\u7A0B\u5E8F\u5305\u540D\u79F0\u7684\u503C "{0}" \u65E0\u6548\u3002 -error.invalid-value-for-package-name.advice=\u5C06 "linux.bundleName" \u53C2\u6570\u8BBE\u7F6E\u4E3A\u6709\u6548\u7684 RPM \u7A0B\u5E8F\u5305\u540D\u79F0\u3002\u8BF7\u6CE8\u610F, \u7A0B\u5E8F\u5305\u540D\u79F0\u53EA\u80FD\u4F7F\u7528\u4EE5\u4E0B ASCII \u5B57\u7B26: abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._+ - -message.test-for-tool=[{0}] \u7684\u6D4B\u8BD5\u3002\u7ED3\u679C: {1} -message.one-shortcut-required=\u81F3\u5C11\u9700\u8981\u4E00\u79CD\u7C7B\u578B\u7684\u5FEB\u6377\u65B9\u5F0F\u3002\u6B63\u5728\u542F\u7528\u83DC\u5355\u5FEB\u6377\u65B9\u5F0F\u3002 -message.debug-working-directory=\u7528\u4E8E\u8C03\u8BD5\u7684\u5DF2\u4FDD\u7559\u5DE5\u4F5C\u76EE\u5F55: {0} -message.outputting-bundle-location=\u6B63\u5728\u4E3A\u5B89\u88C5\u7A0B\u5E8F\u751F\u6210 RPM, \u4F4D\u7F6E: {0} -message.output-bundle-location=\u7A0B\u5E8F\u5305 (.rpm) \u5DF2\u4FDD\u5B58\u5230: {0} -message.creating-association-with-null-extension=\u6B63\u5728\u4F7F\u7528\u7A7A\u6269\u5C55\u540D\u521B\u5EFA\u5173\u8054\u3002 diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/linux/javalogo_white_16.png Binary file src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/linux/javalogo_white_16.png has changed diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/linux/javalogo_white_32.png Binary file src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/linux/javalogo_white_32.png has changed diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/linux/javalogo_white_48.png Binary file src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/linux/javalogo_white_48.png has changed diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/linux/template.control --- a/src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/linux/template.control Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -Package: APPLICATION_PACKAGE -Version: APPLICATION_VERSION -Section: unknown -Maintainer: APPLICATION_MAINTAINER -Priority: optional -Architecture: APPLICATION_ARCH -Provides: APPLICATION_PACKAGE -Description: APPLICATION_SUMMARY -Installed-Size: APPLICATION_INSTALLED_SIZE -PACKAGE_DEPENDENCIES diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/linux/template.copyright --- a/src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/linux/template.copyright Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ - -Copyright: - - APPLICATION_COPYRIGHT - -License: - - APPLICATION_LICENSE_TEXT diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/linux/template.desktop --- a/src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/linux/template.desktop Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ -[Desktop Entry] -Name=APPLICATION_NAME -Comment=APPLICATION_SUMMARY -Exec=INSTALLATION_DIRECTORY/APPLICATION_FS_NAME/APPLICATION_LAUNCHER_FILENAME -Icon=INSTALLATION_DIRECTORY/APPLICATION_FS_NAME/APPLICATION_LAUNCHER_FILENAME.png -Terminal=false -Type=Application -Categories=DEPLOY_BUNDLE_CATEGORY -DESKTOP_MIMES diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/linux/template.postinst --- a/src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/linux/template.postinst Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,61 +0,0 @@ -#!/bin/sh -# postinst script for APPLICATION_NAME -# -# see: dh_installdeb(1) - -set -e - -# summary of how this script can be called: -# * `configure' -# * `abort-upgrade' -# * `abort-remove' `in-favour' -# -# * `abort-remove' -# * `abort-deconfigure' `in-favour' -# `removing' -# -# for details, see http://www.debian.org/doc/debian-policy/ or -# the debian-policy package - -case "$1" in - configure) - if [ "CREATE_JRE_INSTALLER" != "true" ]; then - echo Adding shortcut to the menu -SECONDARY_LAUNCHERS_INSTALL - xdg-desktop-menu install --novendor INSTALLATION_DIRECTORY/APPLICATION_FS_NAME/APPLICATION_LAUNCHER_FILENAME.desktop -FILE_ASSOCIATION_INSTALL - fi - if [ "SERVICE_HINT" = "true" ]; then - echo Installing daemon - cp INSTALLATION_DIRECTORY/APPLICATION_FS_NAME/APPLICATION_PACKAGE.init /etc/init.d/APPLICATION_PACKAGE - - if [ -x "/etc/init.d/APPLICATION_PACKAGE" ]; then - update-rc.d APPLICATION_PACKAGE defaults - - if [ "START_ON_INSTALL" = "true" ]; then - if which invoke-rc.d >/dev/null 2>&1; then - invoke-rc.d APPLICATION_PACKAGE start - else - /etc/init.d/APPLICATION_PACKAGE start - fi - fi - fi - - fi - ;; - - abort-upgrade|abort-remove|abort-deconfigure) - ;; - - *) - echo "postinst called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - -# dh_installdeb will replace this with shell code automatically -# generated by other debhelper scripts. - -#DEBHELPER# - -exit 0 diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/linux/template.postrm --- a/src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/linux/template.postrm Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -#!/bin/sh -# postrm script for APPLICATION_NAME -# -# see: dh_installdeb(1) - -set -e - -# summary of how this script can be called: -# * `remove' -# * `purge' -# * `upgrade' -# * `failed-upgrade' -# * `abort-install' -# * `abort-install' -# * `abort-upgrade' -# * `disappear' -# -# for details, see http://www.debian.org/doc/debian-policy/ or -# the debian-policy package - -case "$1" in - purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) - if [ "$1" = "purge" ] ; then - if [ "SERVICE_HINT" = "true" ]; then - echo Uninstalling daemon - rm -f /etc/init.d/APPLICATION_PACKAGE - - update-rc.d APPLICATION_PACKAGE remove - fi - fi - ;; - - *) - echo "postrm called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - -# dh_installdeb will replace this with shell code automatically -# generated by other debhelper scripts. - -#DEBHELPER# - -exit 0 diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/linux/template.preinst --- a/src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/linux/template.preinst Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ -#!/bin/sh -# preinst script for APPLICATION_NAME -# -# see: dh_installdeb(1) - -set -e - -# summary of how this script can be called: -# * `install' -# * `install' -# * `upgrade' -# * `abort-upgrade' -# for details, see http://www.debian.org/doc/debian-policy/ or -# the debian-policy package - - -case "$1" in - install|upgrade) - ;; - - abort-upgrade) - ;; - - *) - echo "preinst called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - -# dh_installdeb will replace this with shell code automatically -# generated by other debhelper scripts. - -#DEBHELPER# - -exit 0 diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/linux/template.prerm --- a/src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/linux/template.prerm Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -#!/bin/sh -# prerm script for APPLICATION_NAME -# -# see: dh_installdeb(1) - -set -e - -# summary of how this script can be called: -# * `remove' -# * `upgrade' -# * `failed-upgrade' -# * `remove' `in-favour' -# * `deconfigure' `in-favour' -# `removing' -# -# for details, see http://www.debian.org/doc/debian-policy/ or -# the debian-policy package - - -case "$1" in - remove|upgrade|deconfigure) - if [ "CREATE_JRE_INSTALLER" != "true" ]; then - echo Removing shortcut -SECONDARY_LAUNCHERS_REMOVE - xdg-desktop-menu uninstall --novendor INSTALLATION_DIRECTORY/APPLICATION_FS_NAME/APPLICATION_LAUNCHER_FILENAME.desktop -FILE_ASSOCIATION_REMOVE - fi - ;; - - failed-upgrade) - ;; - - *) - echo "prerm called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - -# dh_installdeb will replace this with shell code automatically -# generated by other debhelper scripts. - -#DEBHELPER# - -exit 0 - diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/linux/template.spec --- a/src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/linux/template.spec Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ -Summary: APPLICATION_SUMMARY -Name: APPLICATION_PACKAGE -Version: APPLICATION_VERSION -Release: 1 -License: APPLICATION_LICENSE_TYPE -Vendor: APPLICATION_VENDOR -Prefix: INSTALLATION_DIRECTORY -Provides: APPLICATION_PACKAGE -Autoprov: 0 -Autoreq: 0 -PACKAGE_DEPENDENCIES - -#avoid ARCH subfolder -%define _rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm - -#comment line below to enable effective jar compression -#it could easily get your package size from 40 to 15Mb but -#build time will substantially increase and it may require unpack200/system java to install -%define __jar_repack %{nil} - -%description -APPLICATION_DESCRIPTION - -%prep - -%build - -%install -rm -rf %{buildroot} -mkdir -p %{buildroot}INSTALLATION_DIRECTORY -cp -r %{_sourcedir}/APPLICATION_FS_NAME %{buildroot}INSTALLATION_DIRECTORY - -%files -APPLICATION_LICENSE_FILE -INSTALLATION_DIRECTORY/APPLICATION_FS_NAME - -%post -if [ "CREATE_JRE_INSTALLER" != "true" ]; then -SECONDARY_LAUNCHERS_INSTALL - xdg-desktop-menu install --novendor INSTALLATION_DIRECTORY/APPLICATION_FS_NAME/APPLICATION_LAUNCHER_FILENAME.desktop -FILE_ASSOCIATION_INSTALL -fi - -%preun -if [ "CREATE_JRE_INSTALLER" != "true" ]; then -SECONDARY_LAUNCHERS_REMOVE - xdg-desktop-menu uninstall --novendor INSTALLATION_DIRECTORY/APPLICATION_FS_NAME/APPLICATION_LAUNCHER_FILENAME.desktop -FILE_ASSOCIATION_REMOVE -fi -if [ "SERVICE_HINT" = "true" ]; then - if [ -x "/etc/init.d/APPLICATION_PACKAGE" ]; then - if [ "STOP_ON_UNINSTALL" = "true" ]; then - /etc/init.d/APPLICATION_PACKAGE stop - fi - /sbin/chkconfig --del APPLICATION_PACKAGE - rm -f /etc/init.d/APPLICATION_PACKAGE - fi -fi - -%clean diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/template.control --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/template.control Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,10 @@ +Package: APPLICATION_PACKAGE +Version: APPLICATION_VERSION +Section: unknown +Maintainer: APPLICATION_MAINTAINER +Priority: optional +Architecture: APPLICATION_ARCH +Provides: APPLICATION_PACKAGE +Description: APPLICATION_SUMMARY +Installed-Size: APPLICATION_INSTALLED_SIZE +PACKAGE_DEPENDENCIES diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/template.copyright --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/template.copyright Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,8 @@ + +Copyright: + + APPLICATION_COPYRIGHT + +License: + + APPLICATION_LICENSE_TEXT diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/template.desktop --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/template.desktop Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,9 @@ +[Desktop Entry] +Name=APPLICATION_NAME +Comment=APPLICATION_SUMMARY +Exec=INSTALLATION_DIRECTORY/APPLICATION_FS_NAME/APPLICATION_LAUNCHER_FILENAME +Icon=INSTALLATION_DIRECTORY/APPLICATION_FS_NAME/APPLICATION_LAUNCHER_FILENAME.png +Terminal=false +Type=Application +Categories=DEPLOY_BUNDLE_CATEGORY +DESKTOP_MIMES diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/template.postinst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/template.postinst Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,61 @@ +#!/bin/sh +# postinst script for APPLICATION_NAME +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-remove' +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +case "$1" in + configure) + if [ "CREATE_JRE_INSTALLER" != "true" ]; then + echo Adding shortcut to the menu +SECONDARY_LAUNCHERS_INSTALL + xdg-desktop-menu install --novendor INSTALLATION_DIRECTORY/APPLICATION_FS_NAME/APPLICATION_LAUNCHER_FILENAME.desktop +FILE_ASSOCIATION_INSTALL + fi + if [ "SERVICE_HINT" = "true" ]; then + echo Installing daemon + cp INSTALLATION_DIRECTORY/APPLICATION_FS_NAME/APPLICATION_PACKAGE.init /etc/init.d/APPLICATION_PACKAGE + + if [ -x "/etc/init.d/APPLICATION_PACKAGE" ]; then + update-rc.d APPLICATION_PACKAGE defaults + + if [ "START_ON_INSTALL" = "true" ]; then + if which invoke-rc.d >/dev/null 2>&1; then + invoke-rc.d APPLICATION_PACKAGE start + else + /etc/init.d/APPLICATION_PACKAGE start + fi + fi + fi + + fi + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/template.postrm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/template.postrm Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,44 @@ +#!/bin/sh +# postrm script for APPLICATION_NAME +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +case "$1" in + purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + if [ "$1" = "purge" ] ; then + if [ "SERVICE_HINT" = "true" ]; then + echo Uninstalling daemon + rm -f /etc/init.d/APPLICATION_PACKAGE + + update-rc.d APPLICATION_PACKAGE remove + fi + fi + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/template.preinst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/template.preinst Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,35 @@ +#!/bin/sh +# preinst script for APPLICATION_NAME +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `install' +# * `install' +# * `upgrade' +# * `abort-upgrade' +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + install|upgrade) + ;; + + abort-upgrade) + ;; + + *) + echo "preinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/template.prerm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/template.prerm Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,45 @@ +#!/bin/sh +# prerm script for APPLICATION_NAME +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `upgrade' +# * `failed-upgrade' +# * `remove' `in-favour' +# * `deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + remove|upgrade|deconfigure) + if [ "CREATE_JRE_INSTALLER" != "true" ]; then + echo Removing shortcut +SECONDARY_LAUNCHERS_REMOVE + xdg-desktop-menu uninstall --novendor INSTALLATION_DIRECTORY/APPLICATION_FS_NAME/APPLICATION_LAUNCHER_FILENAME.desktop +FILE_ASSOCIATION_REMOVE + fi + ;; + + failed-upgrade) + ;; + + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/template.spec --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/linux/classes/jdk/jpackager/internal/resources/template.spec Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,60 @@ +Summary: APPLICATION_SUMMARY +Name: APPLICATION_PACKAGE +Version: APPLICATION_VERSION +Release: 1 +License: APPLICATION_LICENSE_TYPE +Vendor: APPLICATION_VENDOR +Prefix: INSTALLATION_DIRECTORY +Provides: APPLICATION_PACKAGE +Autoprov: 0 +Autoreq: 0 +PACKAGE_DEPENDENCIES + +#avoid ARCH subfolder +%define _rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm + +#comment line below to enable effective jar compression +#it could easily get your package size from 40 to 15Mb but +#build time will substantially increase and it may require unpack200/system java to install +%define __jar_repack %{nil} + +%description +APPLICATION_DESCRIPTION + +%prep + +%build + +%install +rm -rf %{buildroot} +mkdir -p %{buildroot}INSTALLATION_DIRECTORY +cp -r %{_sourcedir}/APPLICATION_FS_NAME %{buildroot}INSTALLATION_DIRECTORY + +%files +APPLICATION_LICENSE_FILE +INSTALLATION_DIRECTORY/APPLICATION_FS_NAME + +%post +if [ "CREATE_JRE_INSTALLER" != "true" ]; then +SECONDARY_LAUNCHERS_INSTALL + xdg-desktop-menu install --novendor INSTALLATION_DIRECTORY/APPLICATION_FS_NAME/APPLICATION_LAUNCHER_FILENAME.desktop +FILE_ASSOCIATION_INSTALL +fi + +%preun +if [ "CREATE_JRE_INSTALLER" != "true" ]; then +SECONDARY_LAUNCHERS_REMOVE + xdg-desktop-menu uninstall --novendor INSTALLATION_DIRECTORY/APPLICATION_FS_NAME/APPLICATION_LAUNCHER_FILENAME.desktop +FILE_ASSOCIATION_REMOVE +fi +if [ "SERVICE_HINT" = "true" ]; then + if [ -x "/etc/init.d/APPLICATION_PACKAGE" ]; then + if [ "STOP_ON_UNINSTALL" = "true" ]; then + /etc/init.d/APPLICATION_PACKAGE stop + fi + /sbin/chkconfig --del APPLICATION_PACKAGE + rm -f /etc/init.d/APPLICATION_PACKAGE + fi +fi + +%clean diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/linux/classes/module-info.java.extra --- a/src/jdk.jpackager/linux/classes/module-info.java.extra Wed Nov 21 13:53:17 2018 -0500 +++ b/src/jdk.jpackager/linux/classes/module-info.java.extra Wed Nov 21 17:50:46 2018 -0500 @@ -23,10 +23,8 @@ * questions. */ +provides jdk.jpackager.internal.Bundler with + jdk.jpackager.internal.LinuxAppBundler, + jdk.jpackager.internal.LinuxDebBundler, + jdk.jpackager.internal.LinuxRpmBundler; -provides jdk.jpackager.internal.Bundler with - jdk.jpackager.internal.linux.LinuxAppBundler, - jdk.jpackager.internal.linux.LinuxDebBundler, - jdk.jpackager.internal.linux.LinuxRpmBundler; - - diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/MacAppBundler.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/MacAppBundler.java Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,477 @@ +/* + * Copyright (c) 2012, 2018, 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.jpackager.internal; + +import jdk.jpackager.internal.AbstractImageBundler; +import jdk.jpackager.internal.BundlerParamInfo; +import jdk.jpackager.internal.ConfigException; +import jdk.jpackager.internal.EnumeratedBundlerParam; +import jdk.jpackager.internal.IOUtils; +import jdk.jpackager.internal.Log; +import jdk.jpackager.internal.Platform; +import jdk.jpackager.internal.StandardBundlerParam; +import jdk.jpackager.internal.Arguments; +import jdk.jpackager.internal.UnsupportedPlatformException; +import jdk.jpackager.internal.MacAppImageBuilder; +import jdk.jpackager.internal.resources.MacResources; +import jdk.jpackager.internal.JLinkBundlerHelper; + +import java.io.File; +import java.io.IOException; +import java.math.BigInteger; +import java.text.MessageFormat; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; +import java.util.Optional; +import java.util.ResourceBundle; + +import static jdk.jpackager.internal.StandardBundlerParam.*; +import static jdk.jpackager.internal.MacBaseInstallerBundler.*; +import jdk.jpackager.internal.AbstractAppImageBuilder; + +public class MacAppBundler extends AbstractImageBundler { + + private static final ResourceBundle I18N = + ResourceBundle.getBundle( + "jdk.jpackager.internal.resources.MacAppBundler"); + + private static final String TEMPLATE_BUNDLE_ICON = "GenericApp.icns"; + + private static Map getMacCategories() { + Map map = new HashMap<>(); + map.put("Business", "public.app-category.business"); + map.put("Developer Tools", "public.app-category.developer-tools"); + map.put("Education", "public.app-category.education"); + map.put("Entertainment", "public.app-category.entertainment"); + map.put("Finance", "public.app-category.finance"); + map.put("Games", "public.app-category.games"); + map.put("Graphics & Design", "public.app-category.graphics-design"); + map.put("Healthcare & Fitness", + "public.app-category.healthcare-fitness"); + map.put("Lifestyle", "public.app-category.lifestyle"); + map.put("Medical", "public.app-category.medical"); + map.put("Music", "public.app-category.music"); + map.put("News", "public.app-category.news"); + map.put("Photography", "public.app-category.photography"); + map.put("Productivity", "public.app-category.productivity"); + map.put("Reference", "public.app-category.reference"); + map.put("Social Networking", "public.app-category.social-networking"); + map.put("Sports", "public.app-category.sports"); + map.put("Travel", "public.app-category.travel"); + map.put("Utilities", "public.app-category.utilities"); + map.put("Video", "public.app-category.video"); + map.put("Weather", "public.app-category.weather"); + + map.put("Action Games", "public.app-category.action-games"); + map.put("Adventure Games", "public.app-category.adventure-games"); + map.put("Arcade Games", "public.app-category.arcade-games"); + map.put("Board Games", "public.app-category.board-games"); + map.put("Card Games", "public.app-category.card-games"); + map.put("Casino Games", "public.app-category.casino-games"); + map.put("Dice Games", "public.app-category.dice-games"); + map.put("Educational Games", "public.app-category.educational-games"); + map.put("Family Games", "public.app-category.family-games"); + map.put("Kids Games", "public.app-category.kids-games"); + map.put("Music Games", "public.app-category.music-games"); + map.put("Puzzle Games", "public.app-category.puzzle-games"); + map.put("Racing Games", "public.app-category.racing-games"); + map.put("Role Playing Games", "public.app-category.role-playing-games"); + map.put("Simulation Games", "public.app-category.simulation-games"); + map.put("Sports Games", "public.app-category.sports-games"); + map.put("Strategy Games", "public.app-category.strategy-games"); + map.put("Trivia Games", "public.app-category.trivia-games"); + map.put("Word Games", "public.app-category.word-games"); + + return map; + } + + public static final EnumeratedBundlerParam MAC_CATEGORY = + new EnumeratedBundlerParam<>( + I18N.getString("param.category-name"), + I18N.getString("param.category-name.description"), + Arguments.CLIOptions.MAC_APP_STORE_CATEGORY.getId(), + String.class, + params -> params.containsKey(CATEGORY.getID()) + ? CATEGORY.fetchFrom(params) + : "Unknown", + (s, p) -> s, + getMacCategories(), + false //strict - for MacStoreBundler this should be strict + ); + + public static final BundlerParamInfo MAC_CF_BUNDLE_NAME = + new StandardBundlerParam<>( + I18N.getString("param.cfbundle-name.name"), + I18N.getString("param.cfbundle-name.description"), + Arguments.CLIOptions.MAC_BUNDLE_NAME.getId(), + String.class, + params -> null, + (s, p) -> s); + + public static final BundlerParamInfo MAC_CF_BUNDLE_IDENTIFIER = + new StandardBundlerParam<>( + I18N.getString("param.cfbundle-identifier.name"), + I18N.getString("param.cfbundle-identifier.description"), + Arguments.CLIOptions.MAC_BUNDLE_IDENTIFIER.getId(), + String.class, + IDENTIFIER::fetchFrom, + (s, p) -> s); + + public static final BundlerParamInfo MAC_CF_BUNDLE_VERSION = + new StandardBundlerParam<>( + I18N.getString("param.cfbundle-version.name"), + I18N.getString("param.cfbundle-version.description"), + "mac.CFBundleVersion", + String.class, + p -> { + String s = VERSION.fetchFrom(p); + if (validCFBundleVersion(s)) { + return s; + } else { + return "100"; + } + }, + (s, p) -> s); + + public static final BundlerParamInfo CONFIG_ROOT = + new StandardBundlerParam<>( + I18N.getString("param.config-root.name"), + I18N.getString("param.config-root.description"), + "configRoot", + File.class, + params -> { + File configRoot = + new File(BUILD_ROOT.fetchFrom(params), "macosx"); + configRoot.mkdirs(); + return configRoot; + }, + (s, p) -> new File(s)); + + public static final BundlerParamInfo DEFAULT_ICNS_ICON = + new StandardBundlerParam<>( + I18N.getString("param.default-icon-icns"), + I18N.getString("param.default-icon-icns.description"), + ".mac.default.icns", + String.class, + params -> TEMPLATE_BUNDLE_ICON, + (s, p) -> s); + + public static final BundlerParamInfo DEVELOPER_ID_APP_SIGNING_KEY = + new StandardBundlerParam<>( + I18N.getString("param.signing-key-developer-id-app.name"), + I18N.getString("param.signing-key-developer-id-app.description"), + "mac.signing-key-developer-id-app", + String.class, + params -> { + String result = MacBaseInstallerBundler.findKey( + "Developer ID Application: " + + SIGNING_KEY_USER.fetchFrom(params), + SIGNING_KEYCHAIN.fetchFrom(params), + VERBOSE.fetchFrom(params)); + if (result != null) { + MacCertificate certificate = new MacCertificate(result, + VERBOSE.fetchFrom(params)); + + if (!certificate.isValid()) { + Log.error(MessageFormat.format(I18N.getString( + "error.certificate.expired"), result)); + } + } + + return result; + }, + (s, p) -> s); + + public static final BundlerParamInfo BUNDLE_ID_SIGNING_PREFIX = + new StandardBundlerParam<>( + I18N.getString("param.bundle-id-signing-prefix.name"), + I18N.getString("param.bundle-id-signing-prefix.description"), + Arguments.CLIOptions.MAC_BUNDLE_SIGNING_PREFIX.getId(), + String.class, + params -> IDENTIFIER.fetchFrom(params) + ".", + (s, p) -> s); + + public static final BundlerParamInfo ICON_ICNS = + new StandardBundlerParam<>( + I18N.getString("param.icon-icns.name"), + I18N.getString("param.icon-icns.description"), + "icon.icns", + File.class, + params -> { + File f = ICON.fetchFrom(params); + if (f != null && !f.getName().toLowerCase().endsWith(".icns")) { + Log.error(MessageFormat.format( + I18N.getString("message.icon-not-icns"), f)); + return null; + } + return f; + }, + (s, p) -> new File(s)); + + public MacAppBundler() { + super(); + baseResourceLoader = MacResources.class; + } + + public static boolean validCFBundleVersion(String v) { + // CFBundleVersion (String - iOS, OS X) specifies the build version + // number of the bundle, which identifies an iteration (released or + // unreleased) of the bundle. The build version number should be a + // string comprised of three non-negative, period-separated integers + // with the first integer being greater than zero. The string should + // only contain numeric (0-9) and period (.) characters. Leading zeros + // are truncated from each integer and will be ignored (that is, + // 1.02.3 is equivalent to 1.2.3). This key is not localizable. + + if (v == null) { + return false; + } + + String p[] = v.split("\\."); + if (p.length > 3 || p.length < 1) { + Log.verbose(I18N.getString( + "message.version-string-too-many-components")); + return false; + } + + try { + BigInteger n = new BigInteger(p[0]); + if (BigInteger.ONE.compareTo(n) > 0) { + Log.verbose(I18N.getString( + "message.version-string-first-number-not-zero")); + return false; + } + if (p.length > 1) { + n = new BigInteger(p[1]); + if (BigInteger.ZERO.compareTo(n) > 0) { + Log.verbose(I18N.getString( + "message.version-string-no-negative-numbers")); + return false; + } + } + if (p.length > 2) { + n = new BigInteger(p[2]); + if (BigInteger.ZERO.compareTo(n) > 0) { + Log.verbose(I18N.getString( + "message.version-string-no-negative-numbers")); + return false; + } + } + } catch (NumberFormatException ne) { + Log.verbose(I18N.getString("message.version-string-numbers-only")); + Log.verbose(ne); + return false; + } + + return true; + } + + @Override + public boolean validate(Map params) + throws UnsupportedPlatformException, ConfigException { + try { + return doValidate(params); + } catch (RuntimeException re) { + if (re.getCause() instanceof ConfigException) { + throw (ConfigException) re.getCause(); + } else { + throw new ConfigException(re); + } + } + } + + // to be used by chained bundlers, e.g. by EXE bundler to avoid + // skipping validation if p.type does not include "image" + public boolean doValidate(Map p) + throws UnsupportedPlatformException, ConfigException { + if (Platform.getPlatform() != Platform.MAC) { + throw new UnsupportedPlatformException(); + } + + imageBundleValidation(p); + + if (StandardBundlerParam.getPredefinedAppImage(p) != null) { + return true; + } + + // validate short version + if (!validCFBundleVersion(MAC_CF_BUNDLE_VERSION.fetchFrom(p))) { + throw new ConfigException( + I18N.getString("error.invalid-cfbundle-version"), + I18N.getString("error.invalid-cfbundle-version.advice")); + } + + // 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); + if (signingIdentity == null) { + throw new ConfigException( + I18N.getString("error.explicit-sign-no-cert"), + I18N.getString("error.explicit-sign-no-cert.advice")); + } + } + + return true; + } + + private File getConfig_InfoPlist(Map params) { + return new File(CONFIG_ROOT.fetchFrom(params), "Info.plist"); + } + + private File getConfig_Icon(Map params) { + return new File(CONFIG_ROOT.fetchFrom(params), + APP_NAME.fetchFrom(params) + ".icns"); + } + + File doBundle(Map p, File outputDirectory, + boolean dependentTask) { + if (Arguments.CREATE_JRE_INSTALLER.fetchFrom(p)) { + return doJreBundle(p, outputDirectory, dependentTask); + } else { + return doAppBundle(p, outputDirectory, dependentTask); + } + } + + File doJreBundle(Map p, + File outputDirectory, boolean dependentTask) { + try { + File rootDirectory = createRoot(p, outputDirectory, dependentTask, + APP_NAME.fetchFrom(p), "macapp-image-builder"); + AbstractAppImageBuilder appBuilder = new MacAppImageBuilder(p, + APP_NAME.fetchFrom(p), outputDirectory.toPath()); + File predefined = PREDEFINED_RUNTIME_IMAGE.fetchFrom(p); + if (predefined == null ) { + JLinkBundlerHelper.generateServerJre(p, appBuilder); + } else { + return predefined; + } + return rootDirectory; + } catch (Exception ex) { + Log.error("Exception: "+ex); + Log.verbose(ex); + return null; + } + } + + File doAppBundle(Map p, File outputDirectory, + boolean dependentTask) { + try { + File rootDirectory = createRoot(p, outputDirectory, dependentTask, + APP_NAME.fetchFrom(p) + ".app", "macapp-image-builder"); + AbstractAppImageBuilder appBuilder = + new MacAppImageBuilder(p, outputDirectory.toPath()); + if (PREDEFINED_RUNTIME_IMAGE.fetchFrom(p) == null ) { + JLinkBundlerHelper.execute(p, appBuilder); + } else { + StandardBundlerParam.copyPredefinedRuntimeImage(p, appBuilder); + } + return rootDirectory; + } catch (Exception ex) { + Log.error("Exception: "+ex); + Log.verbose(ex); + return null; + } + } + + public void cleanupConfigFiles(Map params) { + if (Log.isDebug() || Log.isVerbose()) { + return; + } + + if (CONFIG_ROOT.fetchFrom(params) != null) { + getConfig_Icon(params).delete(); + getConfig_InfoPlist(params).delete(); + } + } + + ///////////////////////////////////////////////////////////////////////// + // Implement Bundler + ///////////////////////////////////////////////////////////////////////// + + @Override + public String getName() { + return I18N.getString("bundler.name"); + } + + @Override + public String getDescription() { + return I18N.getString("bundler.description"); + } + + @Override + public String getID() { + return "mac.app"; + } + + @Override + public String getBundleType() { + return "IMAGE"; + } + + @Override + public Collection> getBundleParameters() { + return getAppBundleParameters(); + } + + public static Collection> getAppBundleParameters() { + return Arrays.asList( + APP_NAME, + APP_RESOURCES, + ARGUMENTS, + BUNDLE_ID_SIGNING_PREFIX, + CLASSPATH, + DEVELOPER_ID_APP_SIGNING_KEY, + ICON_ICNS, + JVM_OPTIONS, + MAC_CATEGORY, + MAC_CF_BUNDLE_IDENTIFIER, + MAC_CF_BUNDLE_NAME, + MAC_CF_BUNDLE_VERSION, + MAIN_CLASS, + MAIN_JAR, + PREFERENCES_ID, + SIGNING_KEYCHAIN, + VERSION, + VERBOSE + ); + } + + + @Override + public File execute(Map params, + File outputParentDir) { + return doBundle(params, outputParentDir, false); + } + + @Override + public boolean supported() { + return Platform.getPlatform() == Platform.MAC; + } + +} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/MacAppImageBuilder.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/MacAppImageBuilder.java Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,1001 @@ +/* + * Copyright (c) 2015, 2018, 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.jpackager.internal; + +import jdk.jpackager.internal.BundlerParamInfo; +import jdk.jpackager.internal.IOUtils; +import jdk.jpackager.internal.Log; +import jdk.jpackager.internal.Platform; +import jdk.jpackager.internal.RelativeFileSet; +import jdk.jpackager.internal.StandardBundlerParam; +import jdk.jpackager.internal.Arguments; +import jdk.jpackager.internal.resources.MacResources; +import jdk.jpackager.internal.AbstractAppImageBuilder; + +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.FileWriter; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.UncheckedIOException; +import java.io.Writer; +import java.math.BigInteger; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.attribute.PosixFilePermission; +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.EnumSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.ResourceBundle; +import java.util.Set; +import java.util.concurrent.atomic.AtomicReference; +import java.util.function.Consumer; + +import static jdk.jpackager.internal.StandardBundlerParam.*; +import static jdk.jpackager.internal.MacBaseInstallerBundler.*; +import static jdk.jpackager.internal.MacAppBundler.*; + +public class MacAppImageBuilder extends AbstractAppImageBuilder { + + private static final ResourceBundle I18N = + ResourceBundle.getBundle( + "jdk.jpackager.internal.resources.MacAppImageBuilder"); + + private static final String EXECUTABLE_NAME = "JavaAppLauncher"; + private static final String LIBRARY_NAME = "libjpackager.dylib"; + private static final String TEMPLATE_BUNDLE_ICON = "GenericApp.icns"; + private static final String OS_TYPE_CODE = "APPL"; + private static final String TEMPLATE_INFO_PLIST_LITE = + "Info-lite.plist.template"; + private static final String TEMPLATE_RUNTIME_INFO_PLIST = + "Runtime-Info.plist.template"; + + private final Path root; + private final Path contentsDir; + private final Path javaDir; + private final Path resourcesDir; + private final Path macOSDir; + private final Path runtimeDir; + private final Path runtimeRoot; + private final Path mdir; + + private final Map params; + + private static List keyChains; + + public static final BundlerParamInfo + MAC_CONFIGURE_LAUNCHER_IN_PLIST = new StandardBundlerParam<>( + I18N.getString("param.configure-launcher-in-plist"), + I18N.getString( + "param.configure-launcher-in-plist.description"), + "mac.configure-launcher-in-plist", + Boolean.class, + params -> Boolean.FALSE, + (s, p) -> Boolean.valueOf(s)); + + public static final BundlerParamInfo MAC_CATEGORY = + new StandardBundlerParam<>( + I18N.getString("param.category-name"), + I18N.getString("param.category-name.description"), + "mac.category", + String.class, + CATEGORY::fetchFrom, + (s, p) -> s + ); + + public static final BundlerParamInfo MAC_CF_BUNDLE_NAME = + new StandardBundlerParam<>( + I18N.getString("param.cfbundle-name.name"), + I18N.getString("param.cfbundle-name.description"), + "mac.CFBundleName", + String.class, + params -> null, + (s, p) -> s); + + public static final BundlerParamInfo MAC_CF_BUNDLE_IDENTIFIER = + new StandardBundlerParam<>( + I18N.getString("param.cfbundle-identifier.name"), + I18N.getString("param.cfbundle-identifier.description"), + Arguments.CLIOptions.MAC_BUNDLE_IDENTIFIER.getId(), + String.class, + IDENTIFIER::fetchFrom, + (s, p) -> s); + + public static final BundlerParamInfo MAC_CF_BUNDLE_VERSION = + new StandardBundlerParam<>( + I18N.getString("param.cfbundle-version.name"), + I18N.getString("param.cfbundle-version.description"), + "mac.CFBundleVersion", + String.class, + p -> { + String s = VERSION.fetchFrom(p); + if (validCFBundleVersion(s)) { + return s; + } else { + return "100"; + } + }, + (s, p) -> s); + + public static final BundlerParamInfo CONFIG_ROOT = + new StandardBundlerParam<>( + I18N.getString("param.config-root.name"), + I18N.getString("param.config-root.description"), + "configRoot", + File.class, + params -> { + File configRoot = + new File(BUILD_ROOT.fetchFrom(params), "macosx"); + configRoot.mkdirs(); + return configRoot; + }, + (s, p) -> new File(s)); + + public static final BundlerParamInfo DEFAULT_ICNS_ICON = + new StandardBundlerParam<>( + I18N.getString("param.default-icon-icns"), + I18N.getString("param.default-icon-icns.description"), + ".mac.default.icns", + String.class, + params -> TEMPLATE_BUNDLE_ICON, + (s, p) -> s); + + public static final BundlerParamInfo ICON_ICNS = + new StandardBundlerParam<>( + I18N.getString("param.icon-icns.name"), + I18N.getString("param.icon-icns.description"), + "icon.icns", + File.class, + params -> { + File f = ICON.fetchFrom(params); + if (f != null && !f.getName().toLowerCase().endsWith(".icns")) { + Log.error(MessageFormat.format( + I18N.getString("message.icon-not-icns"), f)); + return null; + } + return f; + }, + (s, p) -> new File(s)); + + public static final StandardBundlerParam SIGN_BUNDLE = + new StandardBundlerParam<>( + I18N.getString("param.sign-bundle.name"), + I18N.getString("param.sign-bundle.description"), + Arguments.CLIOptions.MAC_SIGN.getId(), + Boolean.class, + params -> false, + // valueOf(null) is false, we actually do want null in some cases + (s, p) -> (s == null || "null".equalsIgnoreCase(s)) ? + null : Boolean.valueOf(s) + ); + + public MacAppImageBuilder(Map config, Path imageOutDir) + throws IOException { + super(config, imageOutDir.resolve(APP_NAME.fetchFrom(config) + + ".app/Contents/PlugIns/Java.runtime/Contents/Home")); + + Objects.requireNonNull(imageOutDir); + + this.params = config; + this.root = imageOutDir.resolve(APP_NAME.fetchFrom(params) + ".app"); + this.contentsDir = root.resolve("Contents"); + this.javaDir = contentsDir.resolve("Java"); + this.resourcesDir = contentsDir.resolve("Resources"); + this.macOSDir = contentsDir.resolve("MacOS"); + this.runtimeDir = contentsDir.resolve("PlugIns/Java.runtime"); + this.runtimeRoot = runtimeDir.resolve("Contents/Home"); + this.mdir = runtimeRoot.resolve("lib"); + Files.createDirectories(javaDir); + Files.createDirectories(resourcesDir); + Files.createDirectories(macOSDir); + Files.createDirectories(runtimeDir); + } + + public MacAppImageBuilder(Map config, String jreName, + Path imageOutDir) throws IOException { + super(null, imageOutDir.resolve(jreName + "/Contents/Home")); + + Objects.requireNonNull(imageOutDir); + + this.params = config; + this.root = imageOutDir.resolve(jreName ); + this.contentsDir = root.resolve("Contents"); + this.javaDir = null; + this.resourcesDir = null; + this.macOSDir = null; + this.runtimeDir = this.root; + this.runtimeRoot = runtimeDir.resolve("Contents/Home"); + this.mdir = runtimeRoot.resolve("lib"); + + Files.createDirectories(runtimeDir); + } + + private void writeEntry(InputStream in, Path dstFile) throws IOException { + Files.createDirectories(dstFile.getParent()); + Files.copy(in, dstFile); + } + + // chmod ugo+x file + private void setExecutable(Path file) { + try { + Set perms = + Files.getPosixFilePermissions(file); + perms.add(PosixFilePermission.OWNER_EXECUTE); + perms.add(PosixFilePermission.GROUP_EXECUTE); + perms.add(PosixFilePermission.OTHERS_EXECUTE); + Files.setPosixFilePermissions(file, perms); + } catch (IOException ioe) { + throw new UncheckedIOException(ioe); + } + } + + private static void createUtf8File(File file, String content) + throws IOException { + try (OutputStream fout = new FileOutputStream(file); + Writer output = new OutputStreamWriter(fout, "UTF-8")) { + output.write(content); + } + } + + public static boolean validCFBundleVersion(String v) { + // CFBundleVersion (String - iOS, OS X) specifies the build version + // number of the bundle, which identifies an iteration (released or + // unreleased) of the bundle. The build version number should be a + // string comprised of three non-negative, period-separated integers + // with the first integer being greater than zero. The string should + // only contain numeric (0-9) and period (.) characters. Leading zeros + // are truncated from each integer and will be ignored (that is, + // 1.02.3 is equivalent to 1.2.3). This key is not localizable. + + if (v == null) { + return false; + } + + String p[] = v.split("\\."); + if (p.length > 3 || p.length < 1) { + Log.verbose(I18N.getString( + "message.version-string-too-many-components")); + return false; + } + + try { + BigInteger n = new BigInteger(p[0]); + if (BigInteger.ONE.compareTo(n) > 0) { + Log.verbose(I18N.getString( + "message.version-string-first-number-not-zero")); + return false; + } + if (p.length > 1) { + n = new BigInteger(p[1]); + if (BigInteger.ZERO.compareTo(n) > 0) { + Log.verbose(I18N.getString( + "message.version-string-no-negative-numbers")); + return false; + } + } + if (p.length > 2) { + n = new BigInteger(p[2]); + if (BigInteger.ZERO.compareTo(n) > 0) { + Log.verbose(I18N.getString( + "message.version-string-no-negative-numbers")); + return false; + } + } + } catch (NumberFormatException ne) { + Log.verbose(I18N.getString("message.version-string-numbers-only")); + Log.verbose(ne); + return false; + } + + return true; + } + + @Override + public InputStream getResourceAsStream(String name) { + return MacResources.class.getResourceAsStream(name); + } + + @Override + public void prepareApplicationFiles() throws IOException { + Map originalParams = new HashMap<>(params); + // Generate PkgInfo + File pkgInfoFile = new File(contentsDir.toFile(), "PkgInfo"); + pkgInfoFile.createNewFile(); + writePkgInfo(pkgInfoFile); + + Path executable = macOSDir.resolve(getLauncherName(params)); + + // create the main app launcher + try (InputStream is_launcher = getResourceAsStream("papplauncher"); + InputStream is_lib = getResourceAsStream(LIBRARY_NAME)) { + // Copy executable and library to MacOS folder + writeEntry(is_launcher, executable); + writeEntry(is_lib, macOSDir.resolve(LIBRARY_NAME)); + } + executable.toFile().setExecutable(true, false); + // generate main app launcher config file + File cfg = new File(root.toFile(), getLauncherCfgName(params)); + writeCfgFile(params, cfg, "$APPDIR/PlugIns/Java.runtime"); + + // create secondary app launcher(s) and config file(s) + List> entryPoints = + StandardBundlerParam.SECONDARY_LAUNCHERS.fetchFrom(params); + for (Map entryPoint : entryPoints) { + Map tmp = new HashMap<>(originalParams); + tmp.putAll(entryPoint); + + // add executable for secondary launcher + Path secondaryExecutable = macOSDir.resolve(getLauncherName(tmp)); + try (InputStream is = getResourceAsStream("papplauncher");) { + writeEntry(is, secondaryExecutable); + } + secondaryExecutable.toFile().setExecutable(true, false); + + // add config file for secondary launcher + cfg = new File(root.toFile(), getLauncherCfgName(tmp)); + writeCfgFile(tmp, cfg, "$APPDIR/PlugIns/Java.runtime"); + } + + // Copy class path entries to Java folder + copyClassPathEntries(javaDir); + + /*********** Take care of "config" files *******/ + File icon = ICON_ICNS.fetchFrom(params); + InputStream in = locateResource( + "package/macosx/" + APP_NAME.fetchFrom(params) + ".icns", + "icon", + DEFAULT_ICNS_ICON.fetchFrom(params), + icon, + VERBOSE.fetchFrom(params), + DROP_IN_RESOURCES_ROOT.fetchFrom(params)); + Files.copy(in, + resourcesDir.resolve(APP_NAME.fetchFrom(params) + ".icns")); + + // copy file association icons + for (Map fa : FILE_ASSOCIATIONS.fetchFrom(params)) { + File f = FA_ICON.fetchFrom(fa); + if (f != null && f.exists()) { + try (InputStream in2 = new FileInputStream(f)) { + Files.copy(in2, resourcesDir.resolve(f.getName())); + } + + } + } + + copyRuntimeFiles(); + sign(); + } + + @Override + public void prepareServerJreFiles() throws IOException { + copyRuntimeFiles(); + sign(); + } + + private void copyRuntimeFiles() throws IOException { + // Generate Info.plist + writeInfoPlist(contentsDir.resolve("Info.plist").toFile()); + + // generate java runtime info.plist + writeRuntimeInfoPlist( + runtimeDir.resolve("Contents/Info.plist").toFile()); + + // copy library + Path runtimeMacOSDir = Files.createDirectories( + runtimeDir.resolve("Contents/MacOS")); + + // JDK 9, 10, and 11 have extra '/jli/' subdir + Path jli = runtimeRoot.resolve("lib/libjli.dylib"); + if (!Files.exists(jli)) { + jli = runtimeRoot.resolve("lib/jli/libjli.dylib"); + } + + Files.copy(jli, runtimeMacOSDir.resolve("libjli.dylib")); + } + + private void sign() throws IOException { + if (Optional.ofNullable( + SIGN_BUNDLE.fetchFrom(params)).orElse(Boolean.TRUE)) { + try { + addNewKeychain(params); + } catch (InterruptedException e) { + Log.error(e.getMessage()); + } + String signingIdentity = + DEVELOPER_ID_APP_SIGNING_KEY.fetchFrom(params); + if (signingIdentity != null) { + signAppBundle(params, root, signingIdentity, + BUNDLE_ID_SIGNING_PREFIX.fetchFrom(params), null, null); + } + restoreKeychainList(params); + } + } + + private String getLauncherName(Map params) { + if (APP_NAME.fetchFrom(params) != null) { + return APP_NAME.fetchFrom(params); + } else { + return MAIN_CLASS.fetchFrom(params); + } + } + + public static String getLauncherCfgName(Map p) { + return "Contents/Java/" + APP_NAME.fetchFrom(p) + ".cfg"; + } + + private void copyClassPathEntries(Path javaDirectory) throws IOException { + List resourcesList = + APP_RESOURCES_LIST.fetchFrom(params); + if (resourcesList == null) { + throw new RuntimeException( + I18N.getString("message.null-classpath")); + } + + for (RelativeFileSet classPath : resourcesList) { + File srcdir = classPath.getBaseDirectory(); + for (String fname : classPath.getIncludedFiles()) { + copyEntry(javaDirectory, srcdir, fname); + } + } + } + + private String getBundleName(Map params) { + if (MAC_CF_BUNDLE_NAME.fetchFrom(params) != null) { + String bn = MAC_CF_BUNDLE_NAME.fetchFrom(params); + if (bn.length() > 16) { + Log.error(MessageFormat.format(I18N.getString( + "message.bundle-name-too-long-warning"), + MAC_CF_BUNDLE_NAME.getID(), bn)); + } + return MAC_CF_BUNDLE_NAME.fetchFrom(params); + } else if (APP_NAME.fetchFrom(params) != null) { + return APP_NAME.fetchFrom(params); + } else { + String nm = MAIN_CLASS.fetchFrom(params); + if (nm.length() > 16) { + nm = nm.substring(0, 16); + } + return nm; + } + } + + private void writeRuntimeInfoPlist(File file) throws IOException { + Map data = new HashMap<>(); + String identifier = Arguments.CREATE_JRE_INSTALLER.fetchFrom(params) ? + MAC_CF_BUNDLE_IDENTIFIER.fetchFrom(params) : + "com.oracle.java." + MAC_CF_BUNDLE_IDENTIFIER.fetchFrom(params); + data.put("CF_BUNDLE_IDENTIFIER", identifier); + String name = Arguments.CREATE_JRE_INSTALLER.fetchFrom(params) ? + getBundleName(params): "Java Runtime Image"; + data.put("CF_BUNDLE_NAME", name); + data.put("CF_BUNDLE_VERSION", VERSION.fetchFrom(params)); + data.put("CF_BUNDLE_SHORT_VERSION_STRING", VERSION.fetchFrom(params)); + + Writer w = new BufferedWriter(new FileWriter(file)); + w.write(preprocessTextResource( + "package/macosx/Runtime-Info.plist", + I18N.getString("resource.runtime-info-plist"), + TEMPLATE_RUNTIME_INFO_PLIST, + data, + VERBOSE.fetchFrom(params), + DROP_IN_RESOURCES_ROOT.fetchFrom(params))); + w.close(); + } + + private void writeInfoPlist(File file) throws IOException { + Log.verbose(MessageFormat.format(I18N.getString( + "message.preparing-info-plist"), file.getAbsolutePath())); + + //prepare config for exe + //Note: do not need CFBundleDisplayName if we don't support localization + Map data = new HashMap<>(); + data.put("DEPLOY_ICON_FILE", APP_NAME.fetchFrom(params) + ".icns"); + data.put("DEPLOY_BUNDLE_IDENTIFIER", + MAC_CF_BUNDLE_IDENTIFIER.fetchFrom(params)); + data.put("DEPLOY_BUNDLE_NAME", + getBundleName(params)); + data.put("DEPLOY_BUNDLE_COPYRIGHT", + COPYRIGHT.fetchFrom(params) != null ? + COPYRIGHT.fetchFrom(params) : "Unknown"); + data.put("DEPLOY_LAUNCHER_NAME", getLauncherName(params)); + data.put("DEPLOY_JAVA_RUNTIME_NAME", "$APPDIR/PlugIns/Java.runtime"); + data.put("DEPLOY_BUNDLE_SHORT_VERSION", + VERSION.fetchFrom(params) != null ? + VERSION.fetchFrom(params) : "1.0.0"); + data.put("DEPLOY_BUNDLE_CFBUNDLE_VERSION", + MAC_CF_BUNDLE_VERSION.fetchFrom(params) != null ? + MAC_CF_BUNDLE_VERSION.fetchFrom(params) : "100"); + data.put("DEPLOY_BUNDLE_CATEGORY", MAC_CATEGORY.fetchFrom(params)); + + boolean hasMainJar = MAIN_JAR.fetchFrom(params) != null; + boolean hasMainModule = + StandardBundlerParam.MODULE.fetchFrom(params) != null; + + if (hasMainJar) { + data.put("DEPLOY_MAIN_JAR_NAME", MAIN_JAR.fetchFrom(params). + getIncludedFiles().iterator().next()); + } + else if (hasMainModule) { + data.put("DEPLOY_MODULE_NAME", + StandardBundlerParam.MODULE.fetchFrom(params)); + } + + data.put("DEPLOY_PREFERENCES_ID", + PREFERENCES_ID.fetchFrom(params).toLowerCase()); + + StringBuilder sb = new StringBuilder(); + List jvmOptions = JVM_OPTIONS.fetchFrom(params); + + String newline = ""; //So we don't add extra line after last append + for (String o : jvmOptions) { + sb.append(newline).append( + " ").append(o).append(""); + newline = "\n"; + } + + Map jvmProps = JVM_PROPERTIES.fetchFrom(params); + for (Map.Entry entry : jvmProps.entrySet()) { + sb.append(newline) + .append(" -D") + .append(entry.getKey()) + .append("=") + .append(entry.getValue()) + .append(""); + newline = "\n"; + } + + data.put("DEPLOY_JVM_OPTIONS", sb.toString()); + + sb = new StringBuilder(); + List args = ARGUMENTS.fetchFrom(params); + newline = ""; + // So we don't add unneccessary extra line after last append + + for (String o : args) { + sb.append(newline).append(" ").append(o).append( + ""); + newline = "\n"; + } + data.put("DEPLOY_ARGUMENTS", sb.toString()); + + newline = ""; + + data.put("DEPLOY_LAUNCHER_CLASS", MAIN_CLASS.fetchFrom(params)); + + StringBuilder macroedPath = new StringBuilder(); + for (String s : CLASSPATH.fetchFrom(params).split("[ ;:]+")) { + macroedPath.append(s); + macroedPath.append(":"); + } + macroedPath.deleteCharAt(macroedPath.length() - 1); + + data.put("DEPLOY_APP_CLASSPATH", macroedPath.toString()); + + StringBuilder bundleDocumentTypes = new StringBuilder(); + StringBuilder exportedTypes = new StringBuilder(); + for (Map + fileAssociation : FILE_ASSOCIATIONS.fetchFrom(params)) { + + List extensions = FA_EXTENSIONS.fetchFrom(fileAssociation); + + if (extensions == null) { + Log.verbose(I18N.getString( + "message.creating-association-with-null-extension")); + } + + List mimeTypes = FA_CONTENT_TYPE.fetchFrom(fileAssociation); + String itemContentType = MAC_CF_BUNDLE_IDENTIFIER.fetchFrom(params) + + "." + ((extensions == null || extensions.isEmpty()) + ? "mime" : extensions.get(0)); + String description = FA_DESCRIPTION.fetchFrom(fileAssociation); + File icon = FA_ICON.fetchFrom(fileAssociation); //TODO FA_ICON_ICNS + + bundleDocumentTypes.append(" \n") + .append(" LSItemContentTypes\n") + .append(" \n") + .append(" ") + .append(itemContentType) + .append("\n") + .append(" \n") + .append("\n") + .append(" CFBundleTypeName\n") + .append(" ") + .append(description) + .append("\n") + .append("\n") + .append(" LSHandlerRank\n") + .append(" Owner\n") + // TODO make a bundler arg + .append("\n") + .append(" CFBundleTypeRole\n") + .append(" Editor\n") + // TODO make a bundler arg + .append("\n") + .append(" LSIsAppleDefaultForType\n") + .append(" \n") + // TODO make a bundler arg + .append("\n"); + + if (icon != null && icon.exists()) { + bundleDocumentTypes + .append(" CFBundleTypeIconFile\n") + .append(" ") + .append(icon.getName()) + .append("\n"); + } + bundleDocumentTypes.append(" \n"); + + exportedTypes.append(" \n") + .append(" UTTypeIdentifier\n") + .append(" ") + .append(itemContentType) + .append("\n") + .append("\n") + .append(" UTTypeDescription\n") + .append(" ") + .append(description) + .append("\n") + .append(" UTTypeConformsTo\n") + .append(" \n") + .append(" public.data\n") + //TODO expose this? + .append(" \n") + .append("\n"); + + if (icon != null && icon.exists()) { + exportedTypes.append(" UTTypeIconFile\n") + .append(" ") + .append(icon.getName()) + .append("\n") + .append("\n"); + } + + exportedTypes.append("\n") + .append(" UTTypeTagSpecification\n") + .append(" \n") + // TODO expose via param? .append( + // " com.apple.ostype\n"); + // TODO expose via param? .append( + // " ABCD\n") + .append("\n"); + + if (extensions != null && !extensions.isEmpty()) { + exportedTypes.append( + " public.filename-extension\n") + .append(" \n"); + + for (String ext : extensions) { + exportedTypes.append(" ") + .append(ext) + .append("\n"); + } + exportedTypes.append(" \n"); + } + if (mimeTypes != null && !mimeTypes.isEmpty()) { + exportedTypes.append(" public.mime-type\n") + .append(" \n"); + + for (String mime : mimeTypes) { + exportedTypes.append(" ") + .append(mime) + .append("\n"); + } + exportedTypes.append(" \n"); + } + exportedTypes.append(" \n") + .append(" \n"); + } + String associationData; + if (bundleDocumentTypes.length() > 0) { + associationData = + "\n CFBundleDocumentTypes\n \n" + + bundleDocumentTypes.toString() + + " \n\n" + + " UTExportedTypeDeclarations\n \n" + + exportedTypes.toString() + + " \n"; + } else { + associationData = ""; + } + data.put("DEPLOY_FILE_ASSOCIATIONS", associationData); + + + Writer w = new BufferedWriter(new FileWriter(file)); + w.write(preprocessTextResource( + // BUNDLER_PREFIX + getConfig_InfoPlist(params).getName(), + "package/Info.plist", + I18N.getString("resource.app-info-plist"), + TEMPLATE_INFO_PLIST_LITE, + data, VERBOSE.fetchFrom(params), + DROP_IN_RESOURCES_ROOT.fetchFrom(params))); + w.close(); + } + + private void writePkgInfo(File file) throws IOException { + //hardcoded as it does not seem we need to change it ever + String signature = "????"; + + try (Writer out = new BufferedWriter(new FileWriter(file))) { + out.write(OS_TYPE_CODE + signature); + out.flush(); + } + } + + public static void addNewKeychain(Map params) + throws IOException, InterruptedException { + if (Platform.getMajorVersion() < 10 || + (Platform.getMajorVersion() == 10 && + Platform.getMinorVersion() < 12)) { + // we need this for OS X 10.12+ + return; + } + + String keyChain = SIGNING_KEYCHAIN.fetchFrom(params); + if (keyChain == null || keyChain.isEmpty()) { + return; + } + + // get current keychain list + String keyChainPath = new File (keyChain).getAbsolutePath().toString(); + List keychainList = new ArrayList<>(); + int ret = IOUtils.getProcessOutput( + keychainList, "security", "list-keychains"); + if (ret != 0) { + Log.error(I18N.getString("message.keychain.error")); + return; + } + + boolean contains = keychainList.stream().anyMatch( + str -> str.trim().equals("\""+keyChainPath.trim()+"\"")); + if (contains) { + // keychain is already added in the search list + return; + } + + keyChains = new ArrayList<>(); + // remove " + keychainList.forEach((String s) -> { + String path = s.trim(); + if (path.startsWith("\"") && path.endsWith("\"")) { + path = path.substring(1, path.length()-1); + } + keyChains.add(path); + }); + + List args = new ArrayList<>(); + args.add("security"); + args.add("list-keychains"); + args.add("-s"); + + args.addAll(keyChains); + args.add(keyChain); + + ProcessBuilder pb = new ProcessBuilder(args); + IOUtils.exec(pb, false); + } + + public static void restoreKeychainList(Map params) + throws IOException{ + if (Platform.getMajorVersion() < 10 || + (Platform.getMajorVersion() == 10 && + Platform.getMinorVersion() < 12)) { + // we need this for OS X 10.12+ + return; + } + + if (keyChains == null || keyChains.isEmpty()) { + return; + } + + List args = new ArrayList<>(); + args.add("security"); + args.add("list-keychains"); + args.add("-s"); + + args.addAll(keyChains); + + ProcessBuilder pb = new ProcessBuilder(args); + IOUtils.exec(pb, false); + } + + public static void signAppBundle( + Map params, Path appLocation, + String signingIdentity, String identifierPrefix, + String entitlementsFile, String inheritedEntitlements) + throws IOException { + AtomicReference toThrow = new AtomicReference<>(); + String appExecutable = "/Contents/MacOS/" + APP_NAME.fetchFrom(params); + String keyChain = SIGNING_KEYCHAIN.fetchFrom(params); + + // sign all dylibs and jars + Files.walk(appLocation) + // fix permissions + .peek(path -> { + try { + Set pfp = + Files.getPosixFilePermissions(path); + if (!pfp.contains(PosixFilePermission.OWNER_WRITE)) { + pfp = EnumSet.copyOf(pfp); + pfp.add(PosixFilePermission.OWNER_WRITE); + Files.setPosixFilePermissions(path, pfp); + } + } catch (IOException e) { + Log.debug(e); + } + }) + .filter(p -> Files.isRegularFile(p) && + !(p.toString().contains("/Contents/MacOS/libjli.dylib") + || p.toString().contains( + "/Contents/MacOS/JavaAppletPlugin") + || p.toString().endsWith(appExecutable)) + ).forEach(p -> { + //noinspection ThrowableResultOfMethodCallIgnored + if (toThrow.get() != null) return; + + // If p is a symlink then skip the signing process. + if (Files.isSymbolicLink(p)) { + if (VERBOSE.fetchFrom(params)) { + Log.verbose(MessageFormat.format(I18N.getString( + "message.ignoring.symlink"), p.toString())); + } + } + else { + List args = new ArrayList<>(); + args.addAll(Arrays.asList("codesign", + "-s", signingIdentity, // sign with this key + "--prefix", identifierPrefix, + // use the identifier as a prefix + "-vvvv")); + if (entitlementsFile != null && + (p.toString().endsWith(".jar") + || p.toString().endsWith(".dylib"))) { + args.add("--entitlements"); + args.add(entitlementsFile); // entitlements + } else if (inheritedEntitlements != null && + Files.isExecutable(p)) { + args.add("--entitlements"); + args.add(inheritedEntitlements); + // inherited entitlements for executable processes + } + if (keyChain != null && !keyChain.isEmpty()) { + args.add("--keychain"); + args.add(keyChain); + } + args.add(p.toString()); + + try { + Set oldPermissions = + Files.getPosixFilePermissions(p); + File f = p.toFile(); + f.setWritable(true, true); + + ProcessBuilder pb = new ProcessBuilder(args); + IOUtils.exec(pb, false); + + Files.setPosixFilePermissions(p, oldPermissions); + } catch (IOException ioe) { + toThrow.set(ioe); + } + } + }); + + IOException ioe = toThrow.get(); + if (ioe != null) { + throw ioe; + } + + // sign all plugins and frameworks + Consumer signIdentifiedByPList = path -> { + //noinspection ThrowableResultOfMethodCallIgnored + if (toThrow.get() != null) return; + + try { + List args = new ArrayList<>(); + args.addAll(Arrays.asList("codesign", + "-s", signingIdentity, // sign with this key + "--prefix", identifierPrefix, + // use the identifier as a prefix + "-vvvv")); + if (keyChain != null && !keyChain.isEmpty()) { + args.add("--keychain"); + args.add(keyChain); + } + args.add(path.toString()); + ProcessBuilder pb = new ProcessBuilder(args); + IOUtils.exec(pb, false); + + args = new ArrayList<>(); + args.addAll(Arrays.asList("codesign", + "-s", signingIdentity, // sign with this key + "--prefix", identifierPrefix, + // use the identifier as a prefix + "-vvvv")); + if (keyChain != null && !keyChain.isEmpty()) { + args.add("--keychain"); + args.add(keyChain); + } + args.add(path.toString() + + "/Contents/_CodeSignature/CodeResources"); + pb = new ProcessBuilder(args); + IOUtils.exec(pb, false); + } catch (IOException e) { + toThrow.set(e); + } + }; + + Path pluginsPath = appLocation.resolve("Contents/PlugIns"); + if (Files.isDirectory(pluginsPath)) { + Files.list(pluginsPath) + .forEach(signIdentifiedByPList); + + ioe = toThrow.get(); + if (ioe != null) { + throw ioe; + } + } + Path frameworkPath = appLocation.resolve("Contents/Frameworks"); + if (Files.isDirectory(frameworkPath)) { + Files.list(frameworkPath) + .forEach(signIdentifiedByPList); + + ioe = toThrow.get(); + if (ioe != null) { + throw ioe; + } + } + + // sign the app itself + List args = new ArrayList<>(); + args.addAll(Arrays.asList("codesign", + "-s", signingIdentity, // sign with this key + "-vvvv")); // super verbose output + if (entitlementsFile != null) { + args.add("--entitlements"); + args.add(entitlementsFile); // entitlements + } + if (keyChain != null && !keyChain.isEmpty()) { + args.add("--keychain"); + args.add(keyChain); + } + args.add(appLocation.toString()); + + ProcessBuilder pb = + new ProcessBuilder(args.toArray(new String[args.size()])); + IOUtils.exec(pb, false); + } + +} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/MacAppStoreBundler.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/MacAppStoreBundler.java Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,429 @@ +/* + * Copyright (c) 2014, 2018, 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.jpackager.internal; + +import jdk.jpackager.internal.BundlerParamInfo; +import jdk.jpackager.internal.StandardBundlerParam; +import jdk.jpackager.internal.Arguments; +import jdk.jpackager.internal.Log; +import jdk.jpackager.internal.ConfigException; +import jdk.jpackager.internal.IOUtils; +import jdk.jpackager.internal.Platform; +import jdk.jpackager.internal.UnsupportedPlatformException; +import jdk.jpackager.internal.MacAppImageBuilder; +import jdk.jpackager.internal.resources.MacResources; + +import java.io.File; +import java.io.IOException; +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.ResourceBundle; + +import static jdk.jpackager.internal.StandardBundlerParam.*; +import static jdk.jpackager.internal.MacAppBundler.*; + +public class MacAppStoreBundler extends MacBaseInstallerBundler { + + private static final ResourceBundle I18N = + ResourceBundle.getBundle( + "jdk.jpackager.internal.resources.MacAppStoreBundler"); + + private static final String TEMPLATE_BUNDLE_ICON_HIDPI = + "GenericAppHiDPI.icns"; + private final static String DEFAULT_ENTITLEMENTS = + "MacAppStore.entitlements"; + private final static String DEFAULT_INHERIT_ENTITLEMENTS = + "MacAppStore_Inherit.entitlements"; + + public static final BundlerParamInfo MAC_APP_STORE_APP_SIGNING_KEY = + new StandardBundlerParam<>( + I18N.getString("param.signing-key-app.name"), + I18N.getString("param.signing-key-app.description"), + "mac.signing-key-app", + String.class, + params -> { + String result = MacBaseInstallerBundler.findKey( + "3rd Party Mac Developer Application: " + + SIGNING_KEY_USER.fetchFrom(params), + SIGNING_KEYCHAIN.fetchFrom(params), + VERBOSE.fetchFrom(params)); + if (result != null) { + MacCertificate certificate = new MacCertificate(result, + VERBOSE.fetchFrom(params)); + + if (!certificate.isValid()) { + Log.error(MessageFormat.format( + I18N.getString("error.certificate.expired"), + result)); + } + } + + return result; + }, + (s, p) -> s); + + public static final BundlerParamInfo MAC_APP_STORE_PKG_SIGNING_KEY = + new StandardBundlerParam<>( + I18N.getString("param.signing-key-pkg.name"), + I18N.getString("param.signing-key-pkg.description"), + "mac.signing-key-pkg", + String.class, + params -> { + String result = MacBaseInstallerBundler.findKey( + "3rd Party Mac Developer Installer: " + + SIGNING_KEY_USER.fetchFrom(params), + SIGNING_KEYCHAIN.fetchFrom(params), + VERBOSE.fetchFrom(params)); + + if (result != null) { + MacCertificate certificate = new MacCertificate( + result, VERBOSE.fetchFrom(params)); + + if (!certificate.isValid()) { + Log.error(MessageFormat.format( + I18N.getString("error.certificate.expired"), + result)); + } + } + + return result; + }, + (s, p) -> s); + + public static final StandardBundlerParam MAC_APP_STORE_ENTITLEMENTS = + new StandardBundlerParam<>( + I18N.getString("param.mac-app-store-entitlements.name"), + I18N.getString("param.mac-app-store-entitlements.description"), + Arguments.CLIOptions.MAC_APP_STORE_ENTITLEMENTS.getId(), + File.class, + params -> null, + (s, p) -> new File(s)); + + public static final BundlerParamInfo INSTALLER_SUFFIX = + new StandardBundlerParam<> ( + I18N.getString("param.installer-suffix.name"), + I18N.getString("param.installer-suffix.description"), + "mac.app-store.installerName.suffix", + String.class, + params -> "-MacAppStore", + (s, p) -> s); + + public MacAppStoreBundler() { + super(); + baseResourceLoader = MacResources.class; + } + + //@Override + public File bundle(Map p, File outdir) { + Log.verbose(MessageFormat.format(I18N.getString( + "message.building-bundle"), APP_NAME.fetchFrom(p))); + if (!outdir.isDirectory() && !outdir.mkdirs()) { + throw new RuntimeException(MessageFormat.format(I18N.getString( + "error.cannot-create-output-dir"), + outdir.getAbsolutePath())); + } + if (!outdir.canWrite()) { + throw new RuntimeException(MessageFormat.format(I18N.getString( + "error.cannot-write-to-output-dir"), + outdir.getAbsolutePath())); + } + + // 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); + + // now we create the app + File appImageDir = APP_IMAGE_BUILD_ROOT.fetchFrom(p); + try { + appImageDir.mkdirs(); + + try { + MacAppImageBuilder.addNewKeychain(p); + } 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); + + prepareEntitlements(p); + + 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 inheritEntitlements = + getConfig_Inherit_Entitlements(p).toString(); + + MacAppImageBuilder.signAppBundle(p, appLocation.toPath(), + signingIdentity, identifierPrefix, + entitlementsFile, inheritEntitlements); + MacAppImageBuilder.restoreKeychainList(p); + + ProcessBuilder pb; + + // create the final pkg file + File finalPKG = new File(outdir, INSTALLER_NAME.fetchFrom(p) + + INSTALLER_SUFFIX.fetchFrom(p) + + ".pkg"); + outdir.mkdirs(); + + String installIdentify = + MAC_APP_STORE_PKG_SIGNING_KEY.fetchFrom(p); + + List buildOptions = new ArrayList<>(); + buildOptions.add("productbuild"); + buildOptions.add("--component"); + buildOptions.add(appLocation.toString()); + buildOptions.add("/Applications"); + buildOptions.add("--sign"); + buildOptions.add(installIdentify); + buildOptions.add("--product"); + buildOptions.add(appLocation + "/Contents/Info.plist"); + String keychainName = SIGNING_KEYCHAIN.fetchFrom(p); + if (keychainName != null && !keychainName.isEmpty()) { + buildOptions.add("--keychain"); + buildOptions.add(keychainName); + } + buildOptions.add(finalPKG.getAbsolutePath()); + + pb = new ProcessBuilder(buildOptions); + + IOUtils.exec(pb, false); + return finalPKG; + } catch (Exception ex) { + Log.error("App Store Ready Bundle failed : " + ex.getMessage()); + Log.verbose(ex); + return null; + } finally { + try { + if (appImageDir != null && + PREDEFINED_APP_IMAGE.fetchFrom(p) == null && + (PREDEFINED_RUNTIME_IMAGE.fetchFrom(p) == null || + !Arguments.CREATE_JRE_INSTALLER.fetchFrom(p)) && + !Log.isDebug() && + !Log.isVerbose()) { + IOUtils.deleteRecursive(appImageDir); + } else if (appImageDir != null) { + Log.verbose(MessageFormat.format(I18N.getString( + "mesasge.intermediate-bundle-location"), + appImageDir.getAbsolutePath())); + } + + //cleanup + cleanupConfigFiles(p); + } catch (IOException ex) { + //noinspection ReturnInsideFinallyBlock + Log.debug(ex.getMessage()); + return null; + } + } + } + + protected void cleanupConfigFiles(Map params) { + if (Log.isDebug() || Log.isVerbose()) { + return; + } + + if (getConfig_Entitlements(params) != null) { + getConfig_Entitlements(params).delete(); + } + if (getConfig_Inherit_Entitlements(params) != null) { + getConfig_Inherit_Entitlements(params).delete(); + } + if (PREDEFINED_APP_IMAGE.fetchFrom(params) == null) { + APP_BUNDLER.fetchFrom(params).cleanupConfigFiles(params); + } + } + + private File getConfig_Entitlements(Map params) { + return new File(CONFIG_ROOT.fetchFrom(params), + APP_NAME.fetchFrom(params) + ".entitlements"); + } + + private File getConfig_Inherit_Entitlements( + Map params) { + return new File(CONFIG_ROOT.fetchFrom(params), + APP_NAME.fetchFrom(params) + "_Inherit.entitlements"); + } + + private void prepareEntitlements(Map params) + throws IOException { + File entitlements = MAC_APP_STORE_ENTITLEMENTS.fetchFrom(params); + if (entitlements == null || !entitlements.exists()) { + fetchResource(getEntitlementsFileName(params), + I18N.getString("resource.mac-app-store-entitlements"), + DEFAULT_ENTITLEMENTS, + getConfig_Entitlements(params), + VERBOSE.fetchFrom(params), + DROP_IN_RESOURCES_ROOT.fetchFrom(params)); + } else { + fetchResource(getEntitlementsFileName(params), + I18N.getString("resource.mac-app-store-entitlements"), + entitlements, + getConfig_Entitlements(params), + VERBOSE.fetchFrom(params), + DROP_IN_RESOURCES_ROOT.fetchFrom(params)); + } + fetchResource(getInheritEntitlementsFileName(params), + I18N.getString("resource.mac-app-store-inherit-entitlements"), + DEFAULT_INHERIT_ENTITLEMENTS, + getConfig_Inherit_Entitlements(params), + VERBOSE.fetchFrom(params), + DROP_IN_RESOURCES_ROOT.fetchFrom(params)); + } + + private String getEntitlementsFileName(Map params) { + return BUNDLER_PREFIX + APP_NAME.fetchFrom(params) + ".entitlements"; + } + + private String getInheritEntitlementsFileName( + Map params) { + return BUNDLER_PREFIX + APP_NAME.fetchFrom(params) + + "_Inherit.entitlements"; + } + + + /////////////////////////////////////////////////////////////////////// + // Implement Bundler + /////////////////////////////////////////////////////////////////////// + + @Override + public String getName() { + return I18N.getString("bundler.name"); + } + + @Override + public String getDescription() { + return I18N.getString("bundler.description"); + } + + @Override + public String getID() { + return "mac.appStore"; + } + + @Override + public Collection> getBundleParameters() { + Collection> results = new LinkedHashSet<>(); + results.addAll(getAppBundleParameters()); + results.addAll(getMacAppStoreBundleParameters()); + return results; + } + + public Collection> getMacAppStoreBundleParameters() { + Collection> results = new LinkedHashSet<>(); + + results.addAll(getAppBundleParameters()); + results.remove(DEVELOPER_ID_APP_SIGNING_KEY); + results.addAll(Arrays.asList( + INSTALLER_SUFFIX, + MAC_APP_STORE_APP_SIGNING_KEY, + MAC_APP_STORE_ENTITLEMENTS, + MAC_APP_STORE_PKG_SIGNING_KEY, + SIGNING_KEYCHAIN + )); + + return results; + } + + @Override + public boolean validate(Map params) + throws UnsupportedPlatformException, ConfigException { + try { + if (Platform.getPlatform() != Platform.MAC) { + throw new UnsupportedPlatformException(); + } + + if (params == null) { + throw new ConfigException( + I18N.getString("error.parameters-null"), + I18N.getString("error.parameters-null.advice")); + } + + // hdiutil is always available so there's no need to test for + // availability. + // run basic validation to ensure requirements are met + + // TODO Mac App Store apps cannot use the system runtime + + // we are not interested in return code, only possible exception + validateAppImageAndBundeler(params); + + // reject explicitly set to not sign + if (!Optional.ofNullable(MacAppImageBuilder. + SIGN_BUNDLE.fetchFrom(params)).orElse(Boolean.TRUE)) { + throw new ConfigException( + I18N.getString("error.must-sign-app-store"), + I18N.getString("error.must-sign-app-store.advice")); + } + + // make sure we have settings for signatures + if (MAC_APP_STORE_APP_SIGNING_KEY.fetchFrom(params) == null) { + throw new ConfigException( + I18N.getString("error.no-app-signing-key"), + I18N.getString("error.no-app-signing-key.advice")); + } + if (MAC_APP_STORE_PKG_SIGNING_KEY.fetchFrom(params) == null) { + throw new ConfigException( + I18N.getString("error.no-pkg-signing-key"), + I18N.getString("error.no-pkg-signing-key.advice")); + } + + // things we could check... + // check the icons, make sure it has hidpi icons + // check the category, + // make sure it fits in the list apple has provided + // validate bundle identifier is reverse dns + // check for \a+\.\a+\.. + + return true; + } catch (RuntimeException re) { + if (re.getCause() instanceof ConfigException) { + throw (ConfigException) re.getCause(); + } else { + throw new ConfigException(re); + } + } + } + + @Override + public File execute(Map params, + File outputParentDir) { + return bundle(params, outputParentDir); + } + + @Override + public boolean supported() { + return !Arguments.isJreInstaller() && + Platform.getPlatform() == Platform.MAC; + } +} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/MacBaseInstallerBundler.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/MacBaseInstallerBundler.java Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,247 @@ +/* + * Copyright (c) 2014, 2018, 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.jpackager.internal; + +import jdk.jpackager.internal.AbstractBundler; +import jdk.jpackager.internal.BundlerParamInfo; +import jdk.jpackager.internal.StandardBundlerParam; +import jdk.jpackager.internal.Arguments; +import jdk.jpackager.internal.Log; +import jdk.jpackager.internal.ConfigException; +import jdk.jpackager.internal.IOUtils; +import jdk.jpackager.internal.Platform; +import jdk.jpackager.internal.UnsupportedPlatformException; + +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.PrintStream; +import java.nio.file.Files; +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.ResourceBundle; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static jdk.jpackager.internal.StandardBundlerParam.*; + +public abstract class MacBaseInstallerBundler extends AbstractBundler { + + private static final ResourceBundle I18N = + ResourceBundle.getBundle( + "jdk.jpackager.internal.resources.MacBaseInstallerBundler"); + + // This could be generalized more to be for any type of Image Bundler + public static final BundlerParamInfo APP_BUNDLER = + new StandardBundlerParam<>( + I18N.getString("param.app-bundler.name"), + I18N.getString("param.app-bundle.description"), + "mac.app.bundler", + MacAppBundler.class, + params -> new MacAppBundler(), + (s, p) -> null); + + public final BundlerParamInfo APP_IMAGE_BUILD_ROOT = + new StandardBundlerParam<>( + I18N.getString("param.app-image-build-root.name"), + I18N.getString("param.app-image-build-root.description"), + "mac.app.imageRoot", + File.class, + params -> { + File imageDir = IMAGES_ROOT.fetchFrom(params); + if (!imageDir.exists()) imageDir.mkdirs(); + try { + return Files.createTempDirectory( + imageDir.toPath(), "image-").toFile(); + } catch (IOException e) { + return new File(imageDir, getID()+ ".image"); + } + }, + (s, p) -> new File(s)); + + public static final BundlerParamInfo CONFIG_ROOT = + new StandardBundlerParam<>( + I18N.getString("param.config-root.name"), + I18N.getString("param.config-root.description"), + "configRoot", + File.class, + params -> { + File imagesRoot = + new File(BUILD_ROOT.fetchFrom(params), "macosx"); + imagesRoot.mkdirs(); + return imagesRoot; + }, + (s, p) -> null); + + public static final BundlerParamInfo SIGNING_KEY_USER = + new StandardBundlerParam<>( + I18N.getString("param.signing-key-name.name"), + I18N.getString("param.signing-key-name.description"), + Arguments.CLIOptions.MAC_SIGNING_KEY_NAME.getId(), + String.class, + params -> "", + null); + + public static final BundlerParamInfo SIGNING_KEYCHAIN = + new StandardBundlerParam<>( + I18N.getString("param.signing-keychain.name"), + I18N.getString("param.signing-keychain.description"), + Arguments.CLIOptions.MAC_SIGNING_KEYCHAIN.getId(), + String.class, + params -> "", + null); + + public static final BundlerParamInfo INSTALLER_NAME = + new StandardBundlerParam<> ( + I18N.getString("param.installer-name.name"), + I18N.getString("param.installer-name.description"), + "mac.installerName", + String.class, + params -> { + String nm = APP_NAME.fetchFrom(params); + if (nm == null) return null; + + String version = VERSION.fetchFrom(params); + if (version == null) { + return nm; + } else { + return nm + "-" + version; + } + }, + (s, p) -> s); + + protected void validateAppImageAndBundeler( + Map params) + throws ConfigException, UnsupportedPlatformException { + if (PREDEFINED_APP_IMAGE.fetchFrom(params) != null) { + File applicationImage = PREDEFINED_APP_IMAGE.fetchFrom(params); + if (!applicationImage.exists()) { + throw new ConfigException( + MessageFormat.format(I18N.getString( + "message.app-image-dir-does-not-exist"), + PREDEFINED_APP_IMAGE.getID(), + applicationImage.toString()), + MessageFormat.format(I18N.getString( + "message.app-image-dir-does-not-exist.advice"), + PREDEFINED_APP_IMAGE.getID())); + } + if (APP_NAME.fetchFrom(params) == null) { + throw new ConfigException( + I18N.getString("message.app-image-requires-app-name"), + I18N.getString( + "message.app-image-requires-app-name.advice")); + } + if (IDENTIFIER.fetchFrom(params) == null) { + throw new ConfigException( + I18N.getString("message.app-image-requires-identifier"), + I18N.getString( + "message.app-image-requires-identifier.advice")); + } + } else { + APP_BUNDLER.fetchFrom(params).doValidate(params); + } + } + + protected File prepareAppBundle( + Map p, boolean pkg) { + File predefinedImage = StandardBundlerParam.getPredefinedAppImage(p); + if (predefinedImage != null) { + return predefinedImage; + } + File appImageRoot = APP_IMAGE_BUILD_ROOT.fetchFrom(p); + if (pkg) { + // create pkg in dmg + return new MacPkgBundler().bundle(p, appImageRoot); + } else { + return APP_BUNDLER.fetchFrom(p).doBundle(p, appImageRoot, true); + } + } + + @Override + public Collection> getBundleParameters() { + Collection> results = new LinkedHashSet<>(); + + results.addAll(MacAppBundler.getAppBundleParameters()); + results.addAll(Arrays.asList( + APP_BUNDLER, + CONFIG_ROOT, + APP_IMAGE_BUILD_ROOT, + PREDEFINED_APP_IMAGE + )); + + return results; + } + + @Override + public String getBundleType() { + return "INSTALLER"; + } + + public static String findKey(String key, String keychainName, + boolean verbose) { + if (Platform.getPlatform() != Platform.MAC) { + return null; + } + + try (ByteArrayOutputStream baos = new ByteArrayOutputStream(); + PrintStream ps = new PrintStream(baos)) { + List searchOptions = new ArrayList<>(); + searchOptions.add("security"); + searchOptions.add("find-certificate"); + searchOptions.add("-c"); + searchOptions.add(key); + searchOptions.add("-a"); + if (keychainName != null && !keychainName.isEmpty()) { + searchOptions.add(keychainName); + } + + ProcessBuilder pb = new ProcessBuilder(searchOptions); + + IOUtils.exec(pb, verbose, false, ps); + Pattern p = Pattern.compile("\"alis\"=\"([^\"]+)\""); + Matcher m = p.matcher(baos.toString()); + if (!m.find()) { + Log.error("Did not find a key matching '" + key + "'"); + return null; + } + String matchedKey = m.group(1); + if (m.find()) { + Log.error("Found more than one key matching '" + key + "'"); + return null; + } + Log.debug("Using key '" + matchedKey + "'"); + return matchedKey; + } catch (IOException ioe) { + Log.verbose(ioe); + return null; + } + } +} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/MacCertificate.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/MacCertificate.java Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,166 @@ +/* + * Copyright (c) 2016, 2018, 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.jpackager.internal; + +import jdk.jpackager.internal.IOUtils; +import jdk.jpackager.internal.Log; + +import java.io.BufferedOutputStream; +import java.io.BufferedReader; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.PrintStream; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import java.util.Locale; + +final public class MacCertificate { + private final String certificate; + private final boolean verbose; + + public MacCertificate(String certificate) { + this.certificate = certificate; + this.verbose = false; + } + + public MacCertificate(String certificate, boolean verbose) { + this.certificate = certificate; + this.verbose = verbose; + } + + public boolean isValid() { + return verifyCertificate(this.certificate, verbose); + } + + private static File findCertificate(String certificate, boolean verbose) { + File result = null; + + List args = new ArrayList<>(); + args.add("security"); + args.add("find-certificate"); + args.add("-c"); + args.add(certificate); + args.add("-a"); + args.add("-p"); + + try (ByteArrayOutputStream baos = new ByteArrayOutputStream(); + PrintStream ps = new PrintStream(baos)) { + ProcessBuilder security = new ProcessBuilder(args); + IOUtils.exec(security, verbose, false, ps); + + File output = File.createTempFile("tempfile", ".tmp"); + PrintStream p = new PrintStream( + new BufferedOutputStream( + new FileOutputStream(output, true))); + BufferedReader bfReader = new BufferedReader( + new InputStreamReader( + new ByteArrayInputStream(baos.toByteArray()))); + String line = null; + + while((line = bfReader.readLine()) != null){ + p.println(line); + } + + p.close(); + result = output; + } + catch (IOException ignored) {} + + return result; + } + + private static Date findCertificateDate(String filename, boolean verbose) { + Date result = null; + + List args = new ArrayList<>(); + args.add("/usr/bin/openssl"); + args.add("x509"); + args.add("-noout"); + args.add("-enddate"); + args.add("-in"); + args.add(filename); + + try (ByteArrayOutputStream baos = new ByteArrayOutputStream(); + PrintStream ps = new PrintStream(baos)) { + ProcessBuilder security = new ProcessBuilder(args); + IOUtils.exec(security, verbose, false, ps); + String output = baos.toString(); + output = output.substring(output.indexOf("=") + 1); + DateFormat df = new SimpleDateFormat( + "MMM dd kk:mm:ss yyyy z", Locale.ENGLISH); + result = df.parse(output); + } catch (IOException | ParseException ex) { + Log.debug(ex); + } + + return result; + } + + private static boolean verifyCertificate( + String certificate, boolean verbose) { + boolean result = false; + + try { + File file = null; + Date certificateDate = null; + + try { + file = findCertificate(certificate, verbose); + + if (file != null) { + certificateDate = findCertificateDate( + file.getCanonicalPath(), verbose); + } + } + finally { + if (file != null) { + file.delete(); + } + } + + if (certificateDate != null) { + Calendar c = Calendar.getInstance(); + Date today = c.getTime(); + + if (certificateDate.after(today)) { + result = true; + } + } + } + catch (IOException ignored) {} + + return result; + } +} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/MacDmgBundler.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/MacDmgBundler.java Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,580 @@ +/* + * Copyright (c) 2012, 2018, 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.jpackager.internal; + +import jdk.jpackager.internal.*; +import jdk.jpackager.internal.IOUtils; +import jdk.jpackager.internal.resources.MacResources; +import jdk.jpackager.internal.Arguments; + +import java.io.*; +import java.nio.file.Files; +import java.text.MessageFormat; +import java.util.*; + +import static jdk.jpackager.internal.StandardBundlerParam.*; + +public class MacDmgBundler extends MacBaseInstallerBundler { + + private static final ResourceBundle I18N = + ResourceBundle.getBundle( + "jdk.jpackager.internal.resources.MacDmgBundler"); + + static final String DEFAULT_BACKGROUND_IMAGE="background_dmg.png"; + static final String DEFAULT_DMG_SETUP_SCRIPT="DMGsetup.scpt"; + static final String TEMPLATE_BUNDLE_ICON = "GenericApp.icns"; + + static final String DEFAULT_LICENSE_PLIST="lic_template.plist"; + + public static final BundlerParamInfo INSTALLER_SUFFIX = + new StandardBundlerParam<> ( + I18N.getString("param.installer-suffix.name"), + I18N.getString("param.installer-suffix.description"), + "mac.dmg.installerName.suffix", + String.class, + params -> "", + (s, p) -> s); + + public MacDmgBundler() { + super(); + baseResourceLoader = MacResources.class; + } + + public File bundle(Map params, File outdir) { + Log.verbose(MessageFormat.format(I18N.getString("message.building-dmg"), + APP_NAME.fetchFrom(params))); + if (!outdir.isDirectory() && !outdir.mkdirs()) { + throw new RuntimeException(MessageFormat.format( + I18N.getString("error.cannot-create-output-dir"), + outdir.getAbsolutePath())); + } + if (!outdir.canWrite()) { + throw new RuntimeException(MessageFormat.format( + I18N.getString("error.cannot-write-to-output-dir"), + outdir.getAbsolutePath())); + } + + File appImageDir = APP_IMAGE_BUILD_ROOT.fetchFrom(params); + try { + appImageDir.mkdirs(); + + if (prepareAppBundle(params, true) != null && + prepareConfigFiles(params)) { + File configScript = getConfig_Script(params); + if (configScript.exists()) { + Log.verbose(MessageFormat.format( + I18N.getString("message.running-script"), + configScript.getAbsolutePath())); + IOUtils.run("bash", configScript, false); + } + + return buildDMG(params, outdir); + } + return null; + } catch (IOException ex) { + Log.verbose(ex); + return null; + } finally { + try { + if (appImageDir != null && + PREDEFINED_APP_IMAGE.fetchFrom(params) == null && + (PREDEFINED_RUNTIME_IMAGE.fetchFrom(params) == null || + !Arguments.CREATE_JRE_INSTALLER.fetchFrom(params)) && + !Log.isDebug() && + !Log.isVerbose()) { + IOUtils.deleteRecursive(appImageDir); + } else if (appImageDir != null) { + Log.verbose(MessageFormat.format(I18N.getString( + "message.intermediate-image-location"), + appImageDir.getAbsolutePath())); + } + + //cleanup + cleanupConfigFiles(params); + } catch (IOException ex) { + Log.debug(ex); + //noinspection ReturnInsideFinallyBlock + return null; + } + } + } + + //remove + protected void cleanupConfigFiles(Map params) { + if (Log.isDebug() || Log.isVerbose()) { + return; + } + + if (getConfig_VolumeBackground(params) != null) { + getConfig_VolumeBackground(params).delete(); + } + if (getConfig_VolumeIcon(params) != null) { + getConfig_VolumeIcon(params).delete(); + } + if (getConfig_VolumeScript(params) != null) { + getConfig_VolumeScript(params).delete(); + } + if (getConfig_Script(params) != null) { + getConfig_Script(params).delete(); + } + if (getConfig_LicenseFile(params) != null) { + getConfig_LicenseFile(params).delete(); + } + APP_BUNDLER.fetchFrom(params).cleanupConfigFiles(params); + } + + private static final String hdiutil = "/usr/bin/hdiutil"; + + private void prepareDMGSetupScript(String volumeName, + Map p) throws IOException { + File dmgSetup = getConfig_VolumeScript(p); + Log.verbose(MessageFormat.format( + I18N.getString("message.preparing-dmg-setup"), + dmgSetup.getAbsolutePath())); + + //prepare config for exe + Map data = new HashMap<>(); + data.put("DEPLOY_ACTUAL_VOLUME_NAME", volumeName); + data.put("DEPLOY_APPLICATION_NAME", APP_NAME.fetchFrom(p)); + + data.put("DEPLOY_INSTALL_LOCATION", "(path to desktop folder)"); + data.put("DEPLOY_INSTALL_NAME", "Desktop"); + + Writer w = new BufferedWriter(new FileWriter(dmgSetup)); + w.write(preprocessTextResource( + MacAppBundler.BUNDLER_PREFIX + dmgSetup.getName(), + I18N.getString("resource.dmg-setup-script"), + DEFAULT_DMG_SETUP_SCRIPT, data, VERBOSE.fetchFrom(p), + DROP_IN_RESOURCES_ROOT.fetchFrom(p))); + w.close(); + } + + private File getConfig_VolumeScript(Map params) { + return new File(CONFIG_ROOT.fetchFrom(params), + APP_NAME.fetchFrom(params) + "-dmg-setup.scpt"); + } + + private File getConfig_VolumeBackground( + Map params) { + return new File(CONFIG_ROOT.fetchFrom(params), + APP_NAME.fetchFrom(params) + "-background.png"); + } + + private File getConfig_VolumeIcon(Map params) { + return new File(CONFIG_ROOT.fetchFrom(params), + APP_NAME.fetchFrom(params) + "-volume.icns"); + } + + private File getConfig_LicenseFile(Map params) { + return new File(CONFIG_ROOT.fetchFrom(params), + APP_NAME.fetchFrom(params) + "-license.plist"); + } + + private void prepareLicense(Map params) { + try { + File licFile = null; + + List licFiles = LICENSE_FILE.fetchFrom(params); + if (licFiles.isEmpty()) { + return; + } + String licFileStr = licFiles.get(0); + + for (RelativeFileSet rfs : APP_RESOURCES_LIST.fetchFrom(params)) { + if (rfs.contains(licFileStr)) { + licFile = new File(rfs.getBaseDirectory(), licFileStr); + break; + } + } + + if (licFile == null) { + // this is NPE protection, + // validate should have already caught it's absence + Log.error("Licence file is null"); + return; + } + + byte[] licenseContentOriginal = Files.readAllBytes(licFile.toPath()); + String licenseInBase64 = + Base64.getEncoder().encodeToString(licenseContentOriginal); + + Map data = new HashMap<>(); + data.put("APPLICATION_LICENSE_TEXT", licenseInBase64); + + Writer w = new BufferedWriter( + new FileWriter(getConfig_LicenseFile(params))); + w.write(preprocessTextResource( + MacAppBundler.BUNDLER_PREFIX + + getConfig_LicenseFile(params).getName(), + I18N.getString("resource.license-setup"), + DEFAULT_LICENSE_PLIST, data, VERBOSE.fetchFrom(params), + DROP_IN_RESOURCES_ROOT.fetchFrom(params))); + w.close(); + + } catch (IOException ex) { + Log.verbose(ex); + } + } + + private boolean prepareConfigFiles(Map params) + throws IOException { + File bgTarget = getConfig_VolumeBackground(params); + fetchResource(MacAppBundler.BUNDLER_PREFIX + bgTarget.getName(), + I18N.getString("resource.dmg-background"), + DEFAULT_BACKGROUND_IMAGE, + bgTarget, + VERBOSE.fetchFrom(params), + DROP_IN_RESOURCES_ROOT.fetchFrom(params)); + + File iconTarget = getConfig_VolumeIcon(params); + if (MacAppBundler.ICON_ICNS.fetchFrom(params) == null || + !MacAppBundler.ICON_ICNS.fetchFrom(params).exists()) { + fetchResource( + MacAppBundler.BUNDLER_PREFIX + iconTarget.getName(), + I18N.getString("resource.volume-icon"), + TEMPLATE_BUNDLE_ICON, + iconTarget, + VERBOSE.fetchFrom(params), + DROP_IN_RESOURCES_ROOT.fetchFrom(params)); + } else { + fetchResource( + MacAppBundler.BUNDLER_PREFIX + iconTarget.getName(), + I18N.getString("resource.volume-icon"), + MacAppBundler.ICON_ICNS.fetchFrom(params), + iconTarget, + VERBOSE.fetchFrom(params), + DROP_IN_RESOURCES_ROOT.fetchFrom(params)); + } + + + fetchResource(MacAppBundler.BUNDLER_PREFIX + + getConfig_Script(params).getName(), + I18N.getString("resource.post-install-script"), + (String) null, + getConfig_Script(params), + VERBOSE.fetchFrom(params), + DROP_IN_RESOURCES_ROOT.fetchFrom(params)); + + prepareLicense(params); + + // In theory we need to extract name from results of attach command + // However, this will be a problem for customization as name will + // possibly change every time and developer will not be able to fix it + // As we are using tmp dir chance we get "different" name are low => + // Use fixed name we used for bundle + prepareDMGSetupScript(APP_NAME.fetchFrom(params), params); + + return true; + } + + // name of post-image script + private File getConfig_Script(Map params) { + return new File(CONFIG_ROOT.fetchFrom(params), + APP_NAME.fetchFrom(params) + "-post-image.sh"); + } + + // Location of SetFile utility may be different depending on MacOS version + // We look for several known places and if none of them work will + // try ot find it + private String findSetFileUtility() { + String typicalPaths[] = {"/Developer/Tools/SetFile", + "/usr/bin/SetFile", "/Developer/usr/bin/SetFile"}; + + for (String path: typicalPaths) { + File f = new File(path); + if (f.exists() && f.canExecute()) { + return path; + } + } + + // generic find attempt + try { + ProcessBuilder pb = new ProcessBuilder("xcrun", "-find", "SetFile"); + Process p = pb.start(); + InputStreamReader isr = new InputStreamReader(p.getInputStream()); + BufferedReader br = new BufferedReader(isr); + String lineRead = br.readLine(); + if (lineRead != null) { + File f = new File(lineRead); + if (f.exists() && f.canExecute()) { + return f.getAbsolutePath(); + } + } + } catch (IOException ignored) {} + + return null; + } + + private File buildDMG( + Map p, File outdir) + throws IOException { + File imagesRoot = IMAGES_ROOT.fetchFrom(p); + 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 srcFolder = APP_IMAGE_BUILD_ROOT.fetchFrom(p); + File predefinedImage = StandardBundlerParam.getPredefinedAppImage(p); + if (predefinedImage != null) { + srcFolder = predefinedImage; + } + + Log.verbose(MessageFormat.format(I18N.getString( + "message.creating-dmg-file"), finalDMG.getAbsolutePath())); + + protoDMG.delete(); + if (finalDMG.exists() && !finalDMG.delete()) { + throw new IOException(MessageFormat.format(I18N.getString( + "message.dmg-cannot-be-overwritten"), + finalDMG.getAbsolutePath())); + } + + protoDMG.getParentFile().mkdirs(); + finalDMG.getParentFile().mkdirs(); + + String hdiUtilVerbosityFlag = Log.isDebug() ? "-verbose" : "-quiet"; + + // create temp image + ProcessBuilder pb = new ProcessBuilder( + hdiutil, + "create", + hdiUtilVerbosityFlag, + "-srcfolder", srcFolder.getAbsolutePath(), + "-volname", APP_NAME.fetchFrom(p), + "-ov", protoDMG.getAbsolutePath(), + "-fs", "HFS+", + "-format", "UDRW"); + IOUtils.exec(pb, false); + + // mount temp image + pb = new ProcessBuilder( + hdiutil, + "attach", + protoDMG.getAbsolutePath(), + hdiUtilVerbosityFlag, + "-mountroot", imagesRoot.getAbsolutePath()); + IOUtils.exec(pb, false); + + File mountedRoot = + new File(imagesRoot.getAbsolutePath(), APP_NAME.fetchFrom(p)); + + // volume icon + File volumeIconFile = new File(mountedRoot, ".VolumeIcon.icns"); + IOUtils.copyFile(getConfig_VolumeIcon(p), + volumeIconFile); + + pb = new ProcessBuilder("osascript", + getConfig_VolumeScript(p).getAbsolutePath()); + IOUtils.exec(pb, false); + + // Indicate that we want a custom icon + // NB: attributes of the root directory are ignored + // when creating the volume + // Therefore we have to do this after we mount image + String setFileUtility = findSetFileUtility(); + if (setFileUtility != null) { + //can not find utility => keep going without icon + try { + volumeIconFile.setWritable(true); + // The "creator" attribute on a file is a legacy attribute + // but it seems Finder excepts these bytes to be + // "icnC" for the volume icon + // http://endrift.com/blog/2010/06/14/dmg-files-volume-icons-cli + // (might not work on Mac 10.13 with old XCode) + pb = new ProcessBuilder( + setFileUtility, + "-c", "icnC", + volumeIconFile.getAbsolutePath()); + IOUtils.exec(pb, false); + volumeIconFile.setReadOnly(); + + pb = new ProcessBuilder( + setFileUtility, + "-a", "C", + mountedRoot.getAbsolutePath()); + IOUtils.exec(pb, false); + } catch (IOException ex) { + Log.error(ex.getMessage()); + Log.verbose("Cannot enable custom icon using SetFile utility"); + } + } else { + Log.verbose( + "Skip enabling custom icon as SetFile utility is not found"); + } + + // Detach the temporary image + pb = new ProcessBuilder( + hdiutil, + "detach", + hdiUtilVerbosityFlag, + mountedRoot.getAbsolutePath()); + IOUtils.exec(pb, false); + + // Compress it to a new image + pb = new ProcessBuilder( + hdiutil, + "convert", + protoDMG.getAbsolutePath(), + hdiUtilVerbosityFlag, + "-format", "UDZO", + "-o", finalDMG.getAbsolutePath()); + IOUtils.exec(pb, false); + + //add license if needed + if (getConfig_LicenseFile(p).exists()) { + //hdiutil unflatten your_image_file.dmg + pb = new ProcessBuilder( + hdiutil, + "unflatten", + finalDMG.getAbsolutePath() + ); + IOUtils.exec(pb, false); + + //add license + pb = new ProcessBuilder( + hdiutil, + "udifrez", + finalDMG.getAbsolutePath(), + "-xml", + getConfig_LicenseFile(p).getAbsolutePath() + ); + IOUtils.exec(pb, false); + + //hdiutil flatten your_image_file.dmg + pb = new ProcessBuilder( + hdiutil, + "flatten", + finalDMG.getAbsolutePath() + ); + IOUtils.exec(pb, false); + + } + + //Delete the temporary image + protoDMG.delete(); + + Log.verbose(MessageFormat.format(I18N.getString( + "message.output-to-location"), + APP_NAME.fetchFrom(p), finalDMG.getAbsolutePath())); + + return finalDMG; + } + + + ////////////////////////////////////////////////////////////////////////// + // Implement Bundler + ////////////////////////////////////////////////////////////////////////// + + @Override + public String getName() { + return I18N.getString("bundler.name"); + } + + @Override + public String getDescription() { + return I18N.getString("bundler.description"); + } + + @Override + public String getID() { + return "dmg"; + } + + @Override + public Collection> getBundleParameters() { + Collection> results = new LinkedHashSet<>(); + results.addAll(MacAppBundler.getAppBundleParameters()); + results.addAll(getDMGBundleParameters()); + return results; + } + + public Collection> getDMGBundleParameters() { + Collection> results = new LinkedHashSet<>(); + + results.addAll(MacAppBundler.getAppBundleParameters()); + results.addAll(Arrays.asList( + INSTALLER_SUFFIX, + LICENSE_FILE + )); + + return results; + } + + + @Override + public boolean validate(Map params) + throws UnsupportedPlatformException, ConfigException { + try { + 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 + validateAppImageAndBundeler(params); + + // validate license file, if used, exists in the proper place + if (params.containsKey(LICENSE_FILE.getID())) { + List appResourcesList = + APP_RESOURCES_LIST.fetchFrom(params); + for (String license : LICENSE_FILE.fetchFrom(params)) { + boolean found = false; + for (RelativeFileSet appResources : appResourcesList) { + found = found || appResources.contains(license); + } + if (!found) { + throw new ConfigException( + I18N.getString("error.license-missing"), + MessageFormat.format(I18N.getString( + "error.license-missing.advice"), license)); + } + } + } + + return true; + } catch (RuntimeException re) { + if (re.getCause() instanceof ConfigException) { + throw (ConfigException) re.getCause(); + } else { + throw new ConfigException(re); + } + } + } + + @Override + public File execute( + Map params, File outputParentDir) { + return bundle(params, outputParentDir); + } + + @Override + public boolean supported() { + return Platform.getPlatform() == Platform.MAC; + } +} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/MacPkgBundler.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/MacPkgBundler.java Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,609 @@ +/* + * Copyright (c) 2014, 2018, 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.jpackager.internal; + +import jdk.jpackager.internal.BundlerParamInfo; +import jdk.jpackager.internal.StandardBundlerParam; +import jdk.jpackager.internal.Log; +import jdk.jpackager.internal.ConfigException; +import jdk.jpackager.internal.IOUtils; +import jdk.jpackager.internal.Platform; +import jdk.jpackager.internal.RelativeFileSet; +import jdk.jpackager.internal.UnsupportedPlatformException; +import jdk.jpackager.internal.resources.MacResources; +import jdk.jpackager.internal.MacAppImageBuilder; +import jdk.jpackager.internal.Arguments; + +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.io.PrintStream; +import java.io.Writer; +import java.net.URLEncoder; +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.ResourceBundle; + +import static jdk.jpackager.internal.StandardBundlerParam.*; +import static + jdk.jpackager.internal.MacBaseInstallerBundler.SIGNING_KEYCHAIN; +import static + jdk.jpackager.internal.MacBaseInstallerBundler.SIGNING_KEY_USER; + +public class MacPkgBundler extends MacBaseInstallerBundler { + + private static final ResourceBundle I18N = ResourceBundle.getBundle( + "jdk.jpackager.internal.resources.MacPkgBundler"); + + private static final String DEFAULT_BACKGROUND_IMAGE = "background_pkg.png"; + + private static final String TEMPLATE_PREINSTALL_SCRIPT = + "preinstall.template"; + private static final String TEMPLATE_POSTINSTALL_SCRIPT = + "postinstall.template"; + + private static final BundlerParamInfo PACKAGES_ROOT = + new StandardBundlerParam<>( + I18N.getString("param.packages-root.name"), + I18N.getString("param.packages-root.description"), + "mac.pkg.packagesRoot", + File.class, + params -> { + File packagesRoot = + new File(BUILD_ROOT.fetchFrom(params), "packages"); + packagesRoot.mkdirs(); + return packagesRoot; + }, + (s, p) -> new File(s)); + + + protected final BundlerParamInfo SCRIPTS_DIR = + new StandardBundlerParam<>( + I18N.getString("param.scripts-dir.name"), + I18N.getString("param.scripts-dir.description"), + "mac.pkg.scriptsDir", + File.class, + params -> { + File scriptsDir = + new File(CONFIG_ROOT.fetchFrom(params), "scripts"); + scriptsDir.mkdirs(); + return scriptsDir; + }, + (s, p) -> new File(s)); + + public static final + BundlerParamInfo DEVELOPER_ID_INSTALLER_SIGNING_KEY = + new StandardBundlerParam<>( + I18N.getString("param.signing-key-developer-id-installer.name"), + I18N.getString( + "param.signing-key-developer-id-installer.description"), + "mac.signing-key-developer-id-installer", + String.class, + params -> { + String result = MacBaseInstallerBundler.findKey( + "Developer ID Installer: " + + SIGNING_KEY_USER.fetchFrom(params), + SIGNING_KEYCHAIN.fetchFrom(params), + VERBOSE.fetchFrom(params)); + if (result != null) { + MacCertificate certificate = new MacCertificate( + result, VERBOSE.fetchFrom(params)); + + if (!certificate.isValid()) { + Log.error(MessageFormat.format( + I18N.getString("error.certificate.expired"), + result)); + } + } + + return result; + }, + (s, p) -> s); + + public static final BundlerParamInfo MAC_INSTALL_DIR = + new StandardBundlerParam<>( + I18N.getString("param.mac-install-dir.name"), + I18N.getString("param.mac-install-dir.description"), + "mac-install-dir", + String.class, + params -> { + String dir = INSTALL_DIR.fetchFrom(params); + return (dir != null) ? dir : "/Applications"; + }, + (s, p) -> s + ); + + public static final BundlerParamInfo INSTALLER_SUFFIX = + new StandardBundlerParam<> ( + I18N.getString("param.installer-suffix.name"), + I18N.getString("param.installer-suffix.description"), + "mac.pkg.installerName.suffix", + String.class, + params -> "", + (s, p) -> s); + + public MacPkgBundler() { + super(); + baseResourceLoader = MacResources.class; + } + + public File bundle(Map params, File outdir) { + Log.verbose(MessageFormat.format(I18N.getString("message.building-pkg"), + APP_NAME.fetchFrom(params))); + if (!outdir.isDirectory() && !outdir.mkdirs()) { + throw new RuntimeException(MessageFormat.format( + I18N.getString("error.cannot-create-output-dir"), + outdir.getAbsolutePath())); + } + if (!outdir.canWrite()) { + throw new RuntimeException(MessageFormat.format( + I18N.getString("error.cannot-write-to-output-dir"), + outdir.getAbsolutePath())); + } + + File appImageDir = null; + try { + appImageDir = prepareAppBundle(params, false); + + if (appImageDir != null && prepareConfigFiles(params)) { + + File configScript = getConfig_Script(params); + if (configScript.exists()) { + Log.verbose(MessageFormat.format(I18N.getString( + "message.running-script"), + configScript.getAbsolutePath())); + IOUtils.run("bash", configScript, false); + } + + return createPKG(params, outdir, appImageDir); + } + return null; + } catch (IOException ex) { + Log.verbose(ex); + return null; + } finally { + try { + if (appImageDir != null && + PREDEFINED_APP_IMAGE.fetchFrom(params) == null && + (PREDEFINED_RUNTIME_IMAGE.fetchFrom(params) == null || + !Arguments.CREATE_JRE_INSTALLER.fetchFrom(params)) && + !Log.isDebug() && + !Log.isVerbose()) { + IOUtils.deleteRecursive(appImageDir); + } else if (appImageDir != null) { + Log.verbose(MessageFormat.format(I18N.getString( + "message.intermediate-image-location"), + appImageDir.getAbsolutePath())); + } + + // cleanup + cleanupConfigFiles(params); + } catch (IOException ex) { + Log.debug(ex); + // noinspection ReturnInsideFinallyBlock + return null; + } + } + } + + private File getPackages_AppPackage(Map params) { + return new File(PACKAGES_ROOT.fetchFrom(params), + APP_FS_NAME.fetchFrom(params) + "-app.pkg"); + } + + private File getPackages_DaemonPackage(Map params) { + return new File(PACKAGES_ROOT.fetchFrom(params), + APP_FS_NAME.fetchFrom(params) + "-daemon.pkg"); + } + + private void cleanupPackagesFiles(Map params) { + if (Log.isDebug() || Log.isVerbose()) { + return; + } + + if (getPackages_AppPackage(params) != null) { + getPackages_AppPackage(params).delete(); + } + if (getPackages_DaemonPackage(params) != null) { + getPackages_DaemonPackage(params).delete(); + } + } + + private File getConfig_DistributionXMLFile( + Map params) { + return new File(CONFIG_ROOT.fetchFrom(params), "distribution.dist"); + } + + private File getConfig_BackgroundImage(Map params) { + return new File(CONFIG_ROOT.fetchFrom(params), + APP_NAME.fetchFrom(params) + "-background.png"); + } + + private File getScripts_PreinstallFile(Map params) { + return new File(SCRIPTS_DIR.fetchFrom(params), "preinstall"); + } + + private File getScripts_PostinstallFile( + Map params) { + return new File(SCRIPTS_DIR.fetchFrom(params), "postinstall"); + } + + private void cleanupConfigFiles(Map params) { + if (Log.isDebug() || Log.isVerbose()) { + return; + } + + if (getConfig_DistributionXMLFile(params) != null) { + getConfig_DistributionXMLFile(params).delete(); + } + if (getConfig_BackgroundImage(params) != null) { + getConfig_BackgroundImage(params).delete(); + } + } + + private String getAppIdentifier(Map params) { + return IDENTIFIER.fetchFrom(params); + } + + private String getDaemonIdentifier(Map params) { + return IDENTIFIER.fetchFrom(params) + ".daemon"; + } + + private void preparePackageScripts(Map params) + throws IOException { + Log.verbose(I18N.getString("message.preparing-scripts")); + + Map data = new HashMap<>(); + + data.put("DEPLOY_DAEMON_IDENTIFIER", getDaemonIdentifier(params)); + data.put("DEPLOY_LAUNCHD_PLIST_FILE", + IDENTIFIER.fetchFrom(params).toLowerCase() + ".launchd.plist"); + + Writer w = new BufferedWriter( + new FileWriter(getScripts_PreinstallFile(params))); + String content = preprocessTextResource(MacAppBundler.BUNDLER_PREFIX + + getScripts_PreinstallFile(params).getName(), + I18N.getString("resource.pkg-preinstall-script"), + TEMPLATE_PREINSTALL_SCRIPT, + data, + VERBOSE.fetchFrom(params), + DROP_IN_RESOURCES_ROOT.fetchFrom(params)); + w.write(content); + w.close(); + getScripts_PreinstallFile(params).setExecutable(true, false); + + w = new BufferedWriter( + new FileWriter(getScripts_PostinstallFile(params))); + content = preprocessTextResource(MacAppBundler.BUNDLER_PREFIX + + getScripts_PostinstallFile(params).getName(), + I18N.getString("resource.pkg-postinstall-script"), + TEMPLATE_POSTINSTALL_SCRIPT, + data, + VERBOSE.fetchFrom(params), + DROP_IN_RESOURCES_ROOT.fetchFrom(params)); + w.write(content); + w.close(); + getScripts_PostinstallFile(params).setExecutable(true, false); + } + + private void prepareDistributionXMLFile(Map params) + throws IOException { + File f = getConfig_DistributionXMLFile(params); + + Log.verbose(MessageFormat.format(I18N.getString( + "message.preparing-distribution-dist"), f.getAbsolutePath())); + + PrintStream out = new PrintStream(f); + + out.println( + ""); + out.println(""); + + out.println("" + APP_NAME.fetchFrom(params) + ""); + out.println(""); + + if (!LICENSE_FILE.fetchFrom(params).isEmpty()) { + File licFile = null; + + List licFiles = LICENSE_FILE.fetchFrom(params); + if (licFiles.isEmpty()) { + return; + } + String licFileStr = licFiles.get(0); + + for (RelativeFileSet rfs : APP_RESOURCES_LIST.fetchFrom(params)) { + if (rfs.contains(licFileStr)) { + licFile = new File(rfs.getBaseDirectory(), licFileStr); + break; + } + } + + // this is NPE protection, validate should have caught it's absence + // so we don't complain or throw an error + if (licFile != null) { + out.println(""); + } + } + + /* + * Note that the content of the distribution file + * below is generated by productbuild --synthesize + */ + + String appId = getAppIdentifier(params); + String daemonId = getDaemonIdentifier(params); + + out.println(""); + + out.println(""); + out.println(""); + out.println(" "); + out.println(" "); + out.println(" "); + out.println(""); + out.println(""); + out.println(""); + out.println(" "); + out.println(""); + out.println("" + + URLEncoder.encode(getPackages_AppPackage(params).getName(), + "UTF-8") + ""); + + out.println(""); + + out.close(); + } + + private boolean prepareConfigFiles(Map params) + throws IOException { + File imageTarget = getConfig_BackgroundImage(params); + fetchResource(MacAppBundler.BUNDLER_PREFIX + imageTarget.getName(), + I18N.getString("resource.pkg-background-image"), + DEFAULT_BACKGROUND_IMAGE, + imageTarget, + VERBOSE.fetchFrom(params), + DROP_IN_RESOURCES_ROOT.fetchFrom(params)); + + prepareDistributionXMLFile(params); + + fetchResource(MacAppBundler.BUNDLER_PREFIX + + getConfig_Script(params).getName(), + I18N.getString("resource.post-install-script"), + (String) null, + getConfig_Script(params), + VERBOSE.fetchFrom(params), + DROP_IN_RESOURCES_ROOT.fetchFrom(params)); + + return true; + } + + // name of post-image script + private File getConfig_Script(Map params) { + return new File(CONFIG_ROOT.fetchFrom(params), + APP_NAME.fetchFrom(params) + "-post-image.sh"); + } + + private File createPKG(Map params, + File outdir, File appLocation) { + // generic find attempt + try { + File appPKG = getPackages_AppPackage(params); + + // build application package + ProcessBuilder pb = new ProcessBuilder("pkgbuild", + "--component", + appLocation.toString(), + "--install-location", + MAC_INSTALL_DIR.fetchFrom(params), + appPKG.getAbsolutePath()); + IOUtils.exec(pb, false); + + // build final package + File finalPKG = new File(outdir, INSTALLER_NAME.fetchFrom(params) + + INSTALLER_SUFFIX.fetchFrom(params) + + ".pkg"); + outdir.mkdirs(); + + List commandLine = new ArrayList<>(); + commandLine.add("productbuild"); + + commandLine.add("--resources"); + commandLine.add(CONFIG_ROOT.fetchFrom(params).getAbsolutePath()); + + // maybe sign + if (Optional.ofNullable(MacAppImageBuilder. + SIGN_BUNDLE.fetchFrom(params)).orElse(Boolean.TRUE)) { + if (Platform.getMajorVersion() > 10 || + (Platform.getMajorVersion() == 10 && + Platform.getMinorVersion() >= 12)) { + // we need this for OS X 10.12+ + Log.verbose(I18N.getString("message.signing.pkg")); + } + + String signingIdentity = + DEVELOPER_ID_INSTALLER_SIGNING_KEY.fetchFrom(params); + if (signingIdentity != null) { + commandLine.add("--sign"); + commandLine.add(signingIdentity); + } + + String keychainName = SIGNING_KEYCHAIN.fetchFrom(params); + if (keychainName != null && !keychainName.isEmpty()) { + commandLine.add("--keychain"); + commandLine.add(keychainName); + } + } + + commandLine.add("--distribution"); + commandLine.add( + getConfig_DistributionXMLFile(params).getAbsolutePath()); + commandLine.add("--package-path"); + commandLine.add(PACKAGES_ROOT.fetchFrom(params).getAbsolutePath()); + + commandLine.add(finalPKG.getAbsolutePath()); + + pb = new ProcessBuilder(commandLine); + IOUtils.exec(pb, false); + + return finalPKG; + } catch (Exception ignored) { + Log.verbose(ignored); + return null; + } finally { + cleanupPackagesFiles(params); + cleanupConfigFiles(params); + } + } + + ////////////////////////////////////////////////////////////////////////// + // Implement Bundler + ////////////////////////////////////////////////////////////////////////// + + @Override + public String getName() { + return I18N.getString("bundler.name"); + } + + @Override + public String getDescription() { + return I18N.getString("bundler.description"); + } + + @Override + public String getID() { + return "pkg"; + } + + @Override + public Collection> getBundleParameters() { + Collection> results = new LinkedHashSet<>(); + results.addAll(MacAppBundler.getAppBundleParameters()); + results.addAll(getPKGBundleParameters()); + return results; + } + + public Collection> getPKGBundleParameters() { + Collection> results = new LinkedHashSet<>(); + + results.addAll(MacAppBundler.getAppBundleParameters()); + results.addAll(Arrays.asList( + DEVELOPER_ID_INSTALLER_SIGNING_KEY, + // IDENTIFIER, + INSTALLER_SUFFIX, + LICENSE_FILE, + // SERVICE_HINT, + SIGNING_KEYCHAIN)); + + return results; + } + + @Override + public boolean validate(Map params) + throws UnsupportedPlatformException, ConfigException { + try { + 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 + validateAppImageAndBundeler(params); + + // validate license file, if used, exists in the proper place + if (params.containsKey(LICENSE_FILE.getID())) { + List appResourcesList = + APP_RESOURCES_LIST.fetchFrom(params); + for (String license : LICENSE_FILE.fetchFrom(params)) { + boolean found = false; + for (RelativeFileSet appResources : appResourcesList) { + found = found || appResources.contains(license); + } + if (!found) { + throw new ConfigException( + I18N.getString("error.license-missing"), + MessageFormat.format( + I18N.getString("error.license-missing.advice"), + license)); + } + } + } + + // reject explicitly set sign to true and no valid signature key + if (Optional.ofNullable(MacAppImageBuilder. + SIGN_BUNDLE.fetchFrom(params)).orElse(Boolean.FALSE)) { + String signingIdentity = + DEVELOPER_ID_INSTALLER_SIGNING_KEY.fetchFrom(params); + if (signingIdentity == null) { + throw new ConfigException( + I18N.getString("error.explicit-sign-no-cert"), + I18N.getString( + "error.explicit-sign-no-cert.advice")); + } + } + + // hdiutil is always available so there's no need + // to test for availability. + + return true; + } catch (RuntimeException re) { + if (re.getCause() instanceof ConfigException) { + throw (ConfigException) re.getCause(); + } else { + throw new ConfigException(re); + } + } + } + + @Override + public File execute( + Map params, File outputParentDir) { + return bundle(params, outputParentDir); + } + + @Override + public boolean supported() { + return Platform.getPlatform() == Platform.MAC; + } + +} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/builders/mac/MacAppImageBuilder.java --- a/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/builders/mac/MacAppImageBuilder.java Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1001 +0,0 @@ -/* - * Copyright (c) 2015, 2018, 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.jpackager.internal.builders.mac; - -import jdk.jpackager.internal.BundlerParamInfo; -import jdk.jpackager.internal.IOUtils; -import jdk.jpackager.internal.Log; -import jdk.jpackager.internal.Platform; -import jdk.jpackager.internal.RelativeFileSet; -import jdk.jpackager.internal.StandardBundlerParam; -import jdk.jpackager.internal.Arguments; -import jdk.jpackager.internal.resources.mac.MacResources; -import jdk.jpackager.internal.builders.AbstractAppImageBuilder; - -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.FileWriter; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.io.UncheckedIOException; -import java.io.Writer; -import java.math.BigInteger; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.attribute.PosixFilePermission; -import java.text.MessageFormat; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.EnumSet; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import java.util.ResourceBundle; -import java.util.Set; -import java.util.concurrent.atomic.AtomicReference; -import java.util.function.Consumer; - -import static jdk.jpackager.internal.StandardBundlerParam.*; -import static jdk.jpackager.internal.mac.MacBaseInstallerBundler.*; -import static jdk.jpackager.internal.mac.MacAppBundler.*; - -public class MacAppImageBuilder extends AbstractAppImageBuilder { - - private static final ResourceBundle I18N = - ResourceBundle.getBundle( - "jdk.jpackager.internal.resources.builders.mac.MacAppImageBuilder"); - - private static final String EXECUTABLE_NAME = "JavaAppLauncher"; - private static final String LIBRARY_NAME = "libjpackager.dylib"; - private static final String TEMPLATE_BUNDLE_ICON = "GenericApp.icns"; - private static final String OS_TYPE_CODE = "APPL"; - private static final String TEMPLATE_INFO_PLIST_LITE = - "Info-lite.plist.template"; - private static final String TEMPLATE_RUNTIME_INFO_PLIST = - "Runtime-Info.plist.template"; - - private final Path root; - private final Path contentsDir; - private final Path javaDir; - private final Path resourcesDir; - private final Path macOSDir; - private final Path runtimeDir; - private final Path runtimeRoot; - private final Path mdir; - - private final Map params; - - private static List keyChains; - - public static final BundlerParamInfo - MAC_CONFIGURE_LAUNCHER_IN_PLIST = new StandardBundlerParam<>( - I18N.getString("param.configure-launcher-in-plist"), - I18N.getString( - "param.configure-launcher-in-plist.description"), - "mac.configure-launcher-in-plist", - Boolean.class, - params -> Boolean.FALSE, - (s, p) -> Boolean.valueOf(s)); - - public static final BundlerParamInfo MAC_CATEGORY = - new StandardBundlerParam<>( - I18N.getString("param.category-name"), - I18N.getString("param.category-name.description"), - "mac.category", - String.class, - CATEGORY::fetchFrom, - (s, p) -> s - ); - - public static final BundlerParamInfo MAC_CF_BUNDLE_NAME = - new StandardBundlerParam<>( - I18N.getString("param.cfbundle-name.name"), - I18N.getString("param.cfbundle-name.description"), - "mac.CFBundleName", - String.class, - params -> null, - (s, p) -> s); - - public static final BundlerParamInfo MAC_CF_BUNDLE_IDENTIFIER = - new StandardBundlerParam<>( - I18N.getString("param.cfbundle-identifier.name"), - I18N.getString("param.cfbundle-identifier.description"), - Arguments.CLIOptions.MAC_BUNDLE_IDENTIFIER.getId(), - String.class, - IDENTIFIER::fetchFrom, - (s, p) -> s); - - public static final BundlerParamInfo MAC_CF_BUNDLE_VERSION = - new StandardBundlerParam<>( - I18N.getString("param.cfbundle-version.name"), - I18N.getString("param.cfbundle-version.description"), - "mac.CFBundleVersion", - String.class, - p -> { - String s = VERSION.fetchFrom(p); - if (validCFBundleVersion(s)) { - return s; - } else { - return "100"; - } - }, - (s, p) -> s); - - public static final BundlerParamInfo CONFIG_ROOT = - new StandardBundlerParam<>( - I18N.getString("param.config-root.name"), - I18N.getString("param.config-root.description"), - "configRoot", - File.class, - params -> { - File configRoot = - new File(BUILD_ROOT.fetchFrom(params), "macosx"); - configRoot.mkdirs(); - return configRoot; - }, - (s, p) -> new File(s)); - - public static final BundlerParamInfo DEFAULT_ICNS_ICON = - new StandardBundlerParam<>( - I18N.getString("param.default-icon-icns"), - I18N.getString("param.default-icon-icns.description"), - ".mac.default.icns", - String.class, - params -> TEMPLATE_BUNDLE_ICON, - (s, p) -> s); - - public static final BundlerParamInfo ICON_ICNS = - new StandardBundlerParam<>( - I18N.getString("param.icon-icns.name"), - I18N.getString("param.icon-icns.description"), - "icon.icns", - File.class, - params -> { - File f = ICON.fetchFrom(params); - if (f != null && !f.getName().toLowerCase().endsWith(".icns")) { - Log.error(MessageFormat.format( - I18N.getString("message.icon-not-icns"), f)); - return null; - } - return f; - }, - (s, p) -> new File(s)); - - public static final StandardBundlerParam SIGN_BUNDLE = - new StandardBundlerParam<>( - I18N.getString("param.sign-bundle.name"), - I18N.getString("param.sign-bundle.description"), - Arguments.CLIOptions.MAC_SIGN.getId(), - Boolean.class, - params -> false, - // valueOf(null) is false, we actually do want null in some cases - (s, p) -> (s == null || "null".equalsIgnoreCase(s)) ? - null : Boolean.valueOf(s) - ); - - public MacAppImageBuilder(Map config, Path imageOutDir) - throws IOException { - super(config, imageOutDir.resolve(APP_NAME.fetchFrom(config) - + ".app/Contents/PlugIns/Java.runtime/Contents/Home")); - - Objects.requireNonNull(imageOutDir); - - this.params = config; - this.root = imageOutDir.resolve(APP_NAME.fetchFrom(params) + ".app"); - this.contentsDir = root.resolve("Contents"); - this.javaDir = contentsDir.resolve("Java"); - this.resourcesDir = contentsDir.resolve("Resources"); - this.macOSDir = contentsDir.resolve("MacOS"); - this.runtimeDir = contentsDir.resolve("PlugIns/Java.runtime"); - this.runtimeRoot = runtimeDir.resolve("Contents/Home"); - this.mdir = runtimeRoot.resolve("lib"); - Files.createDirectories(javaDir); - Files.createDirectories(resourcesDir); - Files.createDirectories(macOSDir); - Files.createDirectories(runtimeDir); - } - - public MacAppImageBuilder(Map config, String jreName, - Path imageOutDir) throws IOException { - super(null, imageOutDir.resolve(jreName + "/Contents/Home")); - - Objects.requireNonNull(imageOutDir); - - this.params = config; - this.root = imageOutDir.resolve(jreName ); - this.contentsDir = root.resolve("Contents"); - this.javaDir = null; - this.resourcesDir = null; - this.macOSDir = null; - this.runtimeDir = this.root; - this.runtimeRoot = runtimeDir.resolve("Contents/Home"); - this.mdir = runtimeRoot.resolve("lib"); - - Files.createDirectories(runtimeDir); - } - - private void writeEntry(InputStream in, Path dstFile) throws IOException { - Files.createDirectories(dstFile.getParent()); - Files.copy(in, dstFile); - } - - // chmod ugo+x file - private void setExecutable(Path file) { - try { - Set perms = - Files.getPosixFilePermissions(file); - perms.add(PosixFilePermission.OWNER_EXECUTE); - perms.add(PosixFilePermission.GROUP_EXECUTE); - perms.add(PosixFilePermission.OTHERS_EXECUTE); - Files.setPosixFilePermissions(file, perms); - } catch (IOException ioe) { - throw new UncheckedIOException(ioe); - } - } - - private static void createUtf8File(File file, String content) - throws IOException { - try (OutputStream fout = new FileOutputStream(file); - Writer output = new OutputStreamWriter(fout, "UTF-8")) { - output.write(content); - } - } - - public static boolean validCFBundleVersion(String v) { - // CFBundleVersion (String - iOS, OS X) specifies the build version - // number of the bundle, which identifies an iteration (released or - // unreleased) of the bundle. The build version number should be a - // string comprised of three non-negative, period-separated integers - // with the first integer being greater than zero. The string should - // only contain numeric (0-9) and period (.) characters. Leading zeros - // are truncated from each integer and will be ignored (that is, - // 1.02.3 is equivalent to 1.2.3). This key is not localizable. - - if (v == null) { - return false; - } - - String p[] = v.split("\\."); - if (p.length > 3 || p.length < 1) { - Log.verbose(I18N.getString( - "message.version-string-too-many-components")); - return false; - } - - try { - BigInteger n = new BigInteger(p[0]); - if (BigInteger.ONE.compareTo(n) > 0) { - Log.verbose(I18N.getString( - "message.version-string-first-number-not-zero")); - return false; - } - if (p.length > 1) { - n = new BigInteger(p[1]); - if (BigInteger.ZERO.compareTo(n) > 0) { - Log.verbose(I18N.getString( - "message.version-string-no-negative-numbers")); - return false; - } - } - if (p.length > 2) { - n = new BigInteger(p[2]); - if (BigInteger.ZERO.compareTo(n) > 0) { - Log.verbose(I18N.getString( - "message.version-string-no-negative-numbers")); - return false; - } - } - } catch (NumberFormatException ne) { - Log.verbose(I18N.getString("message.version-string-numbers-only")); - Log.verbose(ne); - return false; - } - - return true; - } - - @Override - public InputStream getResourceAsStream(String name) { - return MacResources.class.getResourceAsStream(name); - } - - @Override - public void prepareApplicationFiles() throws IOException { - Map originalParams = new HashMap<>(params); - // Generate PkgInfo - File pkgInfoFile = new File(contentsDir.toFile(), "PkgInfo"); - pkgInfoFile.createNewFile(); - writePkgInfo(pkgInfoFile); - - Path executable = macOSDir.resolve(getLauncherName(params)); - - // create the main app launcher - try (InputStream is_launcher = getResourceAsStream("papplauncher"); - InputStream is_lib = getResourceAsStream(LIBRARY_NAME)) { - // Copy executable and library to MacOS folder - writeEntry(is_launcher, executable); - writeEntry(is_lib, macOSDir.resolve(LIBRARY_NAME)); - } - executable.toFile().setExecutable(true, false); - // generate main app launcher config file - File cfg = new File(root.toFile(), getLauncherCfgName(params)); - writeCfgFile(params, cfg, "$APPDIR/PlugIns/Java.runtime"); - - // create secondary app launcher(s) and config file(s) - List> entryPoints = - StandardBundlerParam.SECONDARY_LAUNCHERS.fetchFrom(params); - for (Map entryPoint : entryPoints) { - Map tmp = new HashMap<>(originalParams); - tmp.putAll(entryPoint); - - // add executable for secondary launcher - Path secondaryExecutable = macOSDir.resolve(getLauncherName(tmp)); - try (InputStream is = getResourceAsStream("papplauncher");) { - writeEntry(is, secondaryExecutable); - } - secondaryExecutable.toFile().setExecutable(true, false); - - // add config file for secondary launcher - cfg = new File(root.toFile(), getLauncherCfgName(tmp)); - writeCfgFile(tmp, cfg, "$APPDIR/PlugIns/Java.runtime"); - } - - // Copy class path entries to Java folder - copyClassPathEntries(javaDir); - - /*********** Take care of "config" files *******/ - File icon = ICON_ICNS.fetchFrom(params); - InputStream in = locateResource( - "package/macosx/" + APP_NAME.fetchFrom(params) + ".icns", - "icon", - DEFAULT_ICNS_ICON.fetchFrom(params), - icon, - VERBOSE.fetchFrom(params), - DROP_IN_RESOURCES_ROOT.fetchFrom(params)); - Files.copy(in, - resourcesDir.resolve(APP_NAME.fetchFrom(params) + ".icns")); - - // copy file association icons - for (Map fa : FILE_ASSOCIATIONS.fetchFrom(params)) { - File f = FA_ICON.fetchFrom(fa); - if (f != null && f.exists()) { - try (InputStream in2 = new FileInputStream(f)) { - Files.copy(in2, resourcesDir.resolve(f.getName())); - } - - } - } - - copyRuntimeFiles(); - sign(); - } - - @Override - public void prepareServerJreFiles() throws IOException { - copyRuntimeFiles(); - sign(); - } - - private void copyRuntimeFiles() throws IOException { - // Generate Info.plist - writeInfoPlist(contentsDir.resolve("Info.plist").toFile()); - - // generate java runtime info.plist - writeRuntimeInfoPlist( - runtimeDir.resolve("Contents/Info.plist").toFile()); - - // copy library - Path runtimeMacOSDir = Files.createDirectories( - runtimeDir.resolve("Contents/MacOS")); - - // JDK 9, 10, and 11 have extra '/jli/' subdir - Path jli = runtimeRoot.resolve("lib/libjli.dylib"); - if (!Files.exists(jli)) { - jli = runtimeRoot.resolve("lib/jli/libjli.dylib"); - } - - Files.copy(jli, runtimeMacOSDir.resolve("libjli.dylib")); - } - - private void sign() throws IOException { - if (Optional.ofNullable( - SIGN_BUNDLE.fetchFrom(params)).orElse(Boolean.TRUE)) { - try { - addNewKeychain(params); - } catch (InterruptedException e) { - Log.error(e.getMessage()); - } - String signingIdentity = - DEVELOPER_ID_APP_SIGNING_KEY.fetchFrom(params); - if (signingIdentity != null) { - signAppBundle(params, root, signingIdentity, - BUNDLE_ID_SIGNING_PREFIX.fetchFrom(params), null, null); - } - restoreKeychainList(params); - } - } - - private String getLauncherName(Map params) { - if (APP_NAME.fetchFrom(params) != null) { - return APP_NAME.fetchFrom(params); - } else { - return MAIN_CLASS.fetchFrom(params); - } - } - - public static String getLauncherCfgName(Map p) { - return "Contents/Java/" + APP_NAME.fetchFrom(p) + ".cfg"; - } - - private void copyClassPathEntries(Path javaDirectory) throws IOException { - List resourcesList = - APP_RESOURCES_LIST.fetchFrom(params); - if (resourcesList == null) { - throw new RuntimeException( - I18N.getString("message.null-classpath")); - } - - for (RelativeFileSet classPath : resourcesList) { - File srcdir = classPath.getBaseDirectory(); - for (String fname : classPath.getIncludedFiles()) { - copyEntry(javaDirectory, srcdir, fname); - } - } - } - - private String getBundleName(Map params) { - if (MAC_CF_BUNDLE_NAME.fetchFrom(params) != null) { - String bn = MAC_CF_BUNDLE_NAME.fetchFrom(params); - if (bn.length() > 16) { - Log.error(MessageFormat.format(I18N.getString( - "message.bundle-name-too-long-warning"), - MAC_CF_BUNDLE_NAME.getID(), bn)); - } - return MAC_CF_BUNDLE_NAME.fetchFrom(params); - } else if (APP_NAME.fetchFrom(params) != null) { - return APP_NAME.fetchFrom(params); - } else { - String nm = MAIN_CLASS.fetchFrom(params); - if (nm.length() > 16) { - nm = nm.substring(0, 16); - } - return nm; - } - } - - private void writeRuntimeInfoPlist(File file) throws IOException { - Map data = new HashMap<>(); - String identifier = Arguments.CREATE_JRE_INSTALLER.fetchFrom(params) ? - MAC_CF_BUNDLE_IDENTIFIER.fetchFrom(params) : - "com.oracle.java." + MAC_CF_BUNDLE_IDENTIFIER.fetchFrom(params); - data.put("CF_BUNDLE_IDENTIFIER", identifier); - String name = Arguments.CREATE_JRE_INSTALLER.fetchFrom(params) ? - getBundleName(params): "Java Runtime Image"; - data.put("CF_BUNDLE_NAME", name); - data.put("CF_BUNDLE_VERSION", VERSION.fetchFrom(params)); - data.put("CF_BUNDLE_SHORT_VERSION_STRING", VERSION.fetchFrom(params)); - - Writer w = new BufferedWriter(new FileWriter(file)); - w.write(preprocessTextResource( - "package/macosx/Runtime-Info.plist", - I18N.getString("resource.runtime-info-plist"), - TEMPLATE_RUNTIME_INFO_PLIST, - data, - VERBOSE.fetchFrom(params), - DROP_IN_RESOURCES_ROOT.fetchFrom(params))); - w.close(); - } - - private void writeInfoPlist(File file) throws IOException { - Log.verbose(MessageFormat.format(I18N.getString( - "message.preparing-info-plist"), file.getAbsolutePath())); - - //prepare config for exe - //Note: do not need CFBundleDisplayName if we don't support localization - Map data = new HashMap<>(); - data.put("DEPLOY_ICON_FILE", APP_NAME.fetchFrom(params) + ".icns"); - data.put("DEPLOY_BUNDLE_IDENTIFIER", - MAC_CF_BUNDLE_IDENTIFIER.fetchFrom(params)); - data.put("DEPLOY_BUNDLE_NAME", - getBundleName(params)); - data.put("DEPLOY_BUNDLE_COPYRIGHT", - COPYRIGHT.fetchFrom(params) != null ? - COPYRIGHT.fetchFrom(params) : "Unknown"); - data.put("DEPLOY_LAUNCHER_NAME", getLauncherName(params)); - data.put("DEPLOY_JAVA_RUNTIME_NAME", "$APPDIR/PlugIns/Java.runtime"); - data.put("DEPLOY_BUNDLE_SHORT_VERSION", - VERSION.fetchFrom(params) != null ? - VERSION.fetchFrom(params) : "1.0.0"); - data.put("DEPLOY_BUNDLE_CFBUNDLE_VERSION", - MAC_CF_BUNDLE_VERSION.fetchFrom(params) != null ? - MAC_CF_BUNDLE_VERSION.fetchFrom(params) : "100"); - data.put("DEPLOY_BUNDLE_CATEGORY", MAC_CATEGORY.fetchFrom(params)); - - boolean hasMainJar = MAIN_JAR.fetchFrom(params) != null; - boolean hasMainModule = - StandardBundlerParam.MODULE.fetchFrom(params) != null; - - if (hasMainJar) { - data.put("DEPLOY_MAIN_JAR_NAME", MAIN_JAR.fetchFrom(params). - getIncludedFiles().iterator().next()); - } - else if (hasMainModule) { - data.put("DEPLOY_MODULE_NAME", - StandardBundlerParam.MODULE.fetchFrom(params)); - } - - data.put("DEPLOY_PREFERENCES_ID", - PREFERENCES_ID.fetchFrom(params).toLowerCase()); - - StringBuilder sb = new StringBuilder(); - List jvmOptions = JVM_OPTIONS.fetchFrom(params); - - String newline = ""; //So we don't add extra line after last append - for (String o : jvmOptions) { - sb.append(newline).append( - " ").append(o).append(""); - newline = "\n"; - } - - Map jvmProps = JVM_PROPERTIES.fetchFrom(params); - for (Map.Entry entry : jvmProps.entrySet()) { - sb.append(newline) - .append(" -D") - .append(entry.getKey()) - .append("=") - .append(entry.getValue()) - .append(""); - newline = "\n"; - } - - data.put("DEPLOY_JVM_OPTIONS", sb.toString()); - - sb = new StringBuilder(); - List args = ARGUMENTS.fetchFrom(params); - newline = ""; - // So we don't add unneccessary extra line after last append - - for (String o : args) { - sb.append(newline).append(" ").append(o).append( - ""); - newline = "\n"; - } - data.put("DEPLOY_ARGUMENTS", sb.toString()); - - newline = ""; - - data.put("DEPLOY_LAUNCHER_CLASS", MAIN_CLASS.fetchFrom(params)); - - StringBuilder macroedPath = new StringBuilder(); - for (String s : CLASSPATH.fetchFrom(params).split("[ ;:]+")) { - macroedPath.append(s); - macroedPath.append(":"); - } - macroedPath.deleteCharAt(macroedPath.length() - 1); - - data.put("DEPLOY_APP_CLASSPATH", macroedPath.toString()); - - StringBuilder bundleDocumentTypes = new StringBuilder(); - StringBuilder exportedTypes = new StringBuilder(); - for (Map - fileAssociation : FILE_ASSOCIATIONS.fetchFrom(params)) { - - List extensions = FA_EXTENSIONS.fetchFrom(fileAssociation); - - if (extensions == null) { - Log.verbose(I18N.getString( - "message.creating-association-with-null-extension")); - } - - List mimeTypes = FA_CONTENT_TYPE.fetchFrom(fileAssociation); - String itemContentType = MAC_CF_BUNDLE_IDENTIFIER.fetchFrom(params) - + "." + ((extensions == null || extensions.isEmpty()) - ? "mime" : extensions.get(0)); - String description = FA_DESCRIPTION.fetchFrom(fileAssociation); - File icon = FA_ICON.fetchFrom(fileAssociation); //TODO FA_ICON_ICNS - - bundleDocumentTypes.append(" \n") - .append(" LSItemContentTypes\n") - .append(" \n") - .append(" ") - .append(itemContentType) - .append("\n") - .append(" \n") - .append("\n") - .append(" CFBundleTypeName\n") - .append(" ") - .append(description) - .append("\n") - .append("\n") - .append(" LSHandlerRank\n") - .append(" Owner\n") - // TODO make a bundler arg - .append("\n") - .append(" CFBundleTypeRole\n") - .append(" Editor\n") - // TODO make a bundler arg - .append("\n") - .append(" LSIsAppleDefaultForType\n") - .append(" \n") - // TODO make a bundler arg - .append("\n"); - - if (icon != null && icon.exists()) { - bundleDocumentTypes - .append(" CFBundleTypeIconFile\n") - .append(" ") - .append(icon.getName()) - .append("\n"); - } - bundleDocumentTypes.append(" \n"); - - exportedTypes.append(" \n") - .append(" UTTypeIdentifier\n") - .append(" ") - .append(itemContentType) - .append("\n") - .append("\n") - .append(" UTTypeDescription\n") - .append(" ") - .append(description) - .append("\n") - .append(" UTTypeConformsTo\n") - .append(" \n") - .append(" public.data\n") - //TODO expose this? - .append(" \n") - .append("\n"); - - if (icon != null && icon.exists()) { - exportedTypes.append(" UTTypeIconFile\n") - .append(" ") - .append(icon.getName()) - .append("\n") - .append("\n"); - } - - exportedTypes.append("\n") - .append(" UTTypeTagSpecification\n") - .append(" \n") - // TODO expose via param? .append( - // " com.apple.ostype\n"); - // TODO expose via param? .append( - // " ABCD\n") - .append("\n"); - - if (extensions != null && !extensions.isEmpty()) { - exportedTypes.append( - " public.filename-extension\n") - .append(" \n"); - - for (String ext : extensions) { - exportedTypes.append(" ") - .append(ext) - .append("\n"); - } - exportedTypes.append(" \n"); - } - if (mimeTypes != null && !mimeTypes.isEmpty()) { - exportedTypes.append(" public.mime-type\n") - .append(" \n"); - - for (String mime : mimeTypes) { - exportedTypes.append(" ") - .append(mime) - .append("\n"); - } - exportedTypes.append(" \n"); - } - exportedTypes.append(" \n") - .append(" \n"); - } - String associationData; - if (bundleDocumentTypes.length() > 0) { - associationData = - "\n CFBundleDocumentTypes\n \n" - + bundleDocumentTypes.toString() - + " \n\n" - + " UTExportedTypeDeclarations\n \n" - + exportedTypes.toString() - + " \n"; - } else { - associationData = ""; - } - data.put("DEPLOY_FILE_ASSOCIATIONS", associationData); - - - Writer w = new BufferedWriter(new FileWriter(file)); - w.write(preprocessTextResource( - //MAC_BUNDLER_PREFIX + getConfig_InfoPlist(params).getName(), - "package/macosx/Info.plist", - I18N.getString("resource.app-info-plist"), - TEMPLATE_INFO_PLIST_LITE, - data, VERBOSE.fetchFrom(params), - DROP_IN_RESOURCES_ROOT.fetchFrom(params))); - w.close(); - } - - private void writePkgInfo(File file) throws IOException { - //hardcoded as it does not seem we need to change it ever - String signature = "????"; - - try (Writer out = new BufferedWriter(new FileWriter(file))) { - out.write(OS_TYPE_CODE + signature); - out.flush(); - } - } - - public static void addNewKeychain(Map params) - throws IOException, InterruptedException { - if (Platform.getMajorVersion() < 10 || - (Platform.getMajorVersion() == 10 && - Platform.getMinorVersion() < 12)) { - // we need this for OS X 10.12+ - return; - } - - String keyChain = SIGNING_KEYCHAIN.fetchFrom(params); - if (keyChain == null || keyChain.isEmpty()) { - return; - } - - // get current keychain list - String keyChainPath = new File (keyChain).getAbsolutePath().toString(); - List keychainList = new ArrayList<>(); - int ret = IOUtils.getProcessOutput( - keychainList, "security", "list-keychains"); - if (ret != 0) { - Log.error(I18N.getString("message.keychain.error")); - return; - } - - boolean contains = keychainList.stream().anyMatch( - str -> str.trim().equals("\""+keyChainPath.trim()+"\"")); - if (contains) { - // keychain is already added in the search list - return; - } - - keyChains = new ArrayList<>(); - // remove " - keychainList.forEach((String s) -> { - String path = s.trim(); - if (path.startsWith("\"") && path.endsWith("\"")) { - path = path.substring(1, path.length()-1); - } - keyChains.add(path); - }); - - List args = new ArrayList<>(); - args.add("security"); - args.add("list-keychains"); - args.add("-s"); - - args.addAll(keyChains); - args.add(keyChain); - - ProcessBuilder pb = new ProcessBuilder(args); - IOUtils.exec(pb, false); - } - - public static void restoreKeychainList(Map params) - throws IOException{ - if (Platform.getMajorVersion() < 10 || - (Platform.getMajorVersion() == 10 && - Platform.getMinorVersion() < 12)) { - // we need this for OS X 10.12+ - return; - } - - if (keyChains == null || keyChains.isEmpty()) { - return; - } - - List args = new ArrayList<>(); - args.add("security"); - args.add("list-keychains"); - args.add("-s"); - - args.addAll(keyChains); - - ProcessBuilder pb = new ProcessBuilder(args); - IOUtils.exec(pb, false); - } - - public static void signAppBundle( - Map params, Path appLocation, - String signingIdentity, String identifierPrefix, - String entitlementsFile, String inheritedEntitlements) - throws IOException { - AtomicReference toThrow = new AtomicReference<>(); - String appExecutable = "/Contents/MacOS/" + APP_NAME.fetchFrom(params); - String keyChain = SIGNING_KEYCHAIN.fetchFrom(params); - - // sign all dylibs and jars - Files.walk(appLocation) - // fix permissions - .peek(path -> { - try { - Set pfp = - Files.getPosixFilePermissions(path); - if (!pfp.contains(PosixFilePermission.OWNER_WRITE)) { - pfp = EnumSet.copyOf(pfp); - pfp.add(PosixFilePermission.OWNER_WRITE); - Files.setPosixFilePermissions(path, pfp); - } - } catch (IOException e) { - Log.debug(e); - } - }) - .filter(p -> Files.isRegularFile(p) && - !(p.toString().contains("/Contents/MacOS/libjli.dylib") - || p.toString().contains( - "/Contents/MacOS/JavaAppletPlugin") - || p.toString().endsWith(appExecutable)) - ).forEach(p -> { - //noinspection ThrowableResultOfMethodCallIgnored - if (toThrow.get() != null) return; - - // If p is a symlink then skip the signing process. - if (Files.isSymbolicLink(p)) { - if (VERBOSE.fetchFrom(params)) { - Log.verbose(MessageFormat.format(I18N.getString( - "message.ignoring.symlink"), p.toString())); - } - } - else { - List args = new ArrayList<>(); - args.addAll(Arrays.asList("codesign", - "-s", signingIdentity, // sign with this key - "--prefix", identifierPrefix, - // use the identifier as a prefix - "-vvvv")); - if (entitlementsFile != null && - (p.toString().endsWith(".jar") - || p.toString().endsWith(".dylib"))) { - args.add("--entitlements"); - args.add(entitlementsFile); // entitlements - } else if (inheritedEntitlements != null && - Files.isExecutable(p)) { - args.add("--entitlements"); - args.add(inheritedEntitlements); - // inherited entitlements for executable processes - } - if (keyChain != null && !keyChain.isEmpty()) { - args.add("--keychain"); - args.add(keyChain); - } - args.add(p.toString()); - - try { - Set oldPermissions = - Files.getPosixFilePermissions(p); - File f = p.toFile(); - f.setWritable(true, true); - - ProcessBuilder pb = new ProcessBuilder(args); - IOUtils.exec(pb, false); - - Files.setPosixFilePermissions(p, oldPermissions); - } catch (IOException ioe) { - toThrow.set(ioe); - } - } - }); - - IOException ioe = toThrow.get(); - if (ioe != null) { - throw ioe; - } - - // sign all plugins and frameworks - Consumer signIdentifiedByPList = path -> { - //noinspection ThrowableResultOfMethodCallIgnored - if (toThrow.get() != null) return; - - try { - List args = new ArrayList<>(); - args.addAll(Arrays.asList("codesign", - "-s", signingIdentity, // sign with this key - "--prefix", identifierPrefix, - // use the identifier as a prefix - "-vvvv")); - if (keyChain != null && !keyChain.isEmpty()) { - args.add("--keychain"); - args.add(keyChain); - } - args.add(path.toString()); - ProcessBuilder pb = new ProcessBuilder(args); - IOUtils.exec(pb, false); - - args = new ArrayList<>(); - args.addAll(Arrays.asList("codesign", - "-s", signingIdentity, // sign with this key - "--prefix", identifierPrefix, - // use the identifier as a prefix - "-vvvv")); - if (keyChain != null && !keyChain.isEmpty()) { - args.add("--keychain"); - args.add(keyChain); - } - args.add(path.toString() - + "/Contents/_CodeSignature/CodeResources"); - pb = new ProcessBuilder(args); - IOUtils.exec(pb, false); - } catch (IOException e) { - toThrow.set(e); - } - }; - - Path pluginsPath = appLocation.resolve("Contents/PlugIns"); - if (Files.isDirectory(pluginsPath)) { - Files.list(pluginsPath) - .forEach(signIdentifiedByPList); - - ioe = toThrow.get(); - if (ioe != null) { - throw ioe; - } - } - Path frameworkPath = appLocation.resolve("Contents/Frameworks"); - if (Files.isDirectory(frameworkPath)) { - Files.list(frameworkPath) - .forEach(signIdentifiedByPList); - - ioe = toThrow.get(); - if (ioe != null) { - throw ioe; - } - } - - // sign the app itself - List args = new ArrayList<>(); - args.addAll(Arrays.asList("codesign", - "-s", signingIdentity, // sign with this key - "-vvvv")); // super verbose output - if (entitlementsFile != null) { - args.add("--entitlements"); - args.add(entitlementsFile); // entitlements - } - if (keyChain != null && !keyChain.isEmpty()) { - args.add("--keychain"); - args.add(keyChain); - } - args.add(appLocation.toString()); - - ProcessBuilder pb = - new ProcessBuilder(args.toArray(new String[args.size()])); - IOUtils.exec(pb, false); - } - -} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/mac/MacAppBundler.java --- a/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/mac/MacAppBundler.java Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,480 +0,0 @@ -/* - * Copyright (c) 2012, 2018, 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.jpackager.internal.mac; - -import jdk.jpackager.internal.AbstractImageBundler; -import jdk.jpackager.internal.BundlerParamInfo; -import jdk.jpackager.internal.ConfigException; -import jdk.jpackager.internal.EnumeratedBundlerParam; -import jdk.jpackager.internal.IOUtils; -import jdk.jpackager.internal.Log; -import jdk.jpackager.internal.Platform; -import jdk.jpackager.internal.StandardBundlerParam; -import jdk.jpackager.internal.Arguments; -import jdk.jpackager.internal.UnsupportedPlatformException; -import jdk.jpackager.internal.builders.mac.MacAppImageBuilder; -import jdk.jpackager.internal.resources.mac.MacResources; -import jdk.jpackager.internal.JLinkBundlerHelper; - -import java.io.File; -import java.io.IOException; -import java.math.BigInteger; -import java.text.MessageFormat; -import java.util.Arrays; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; -import java.util.Optional; -import java.util.ResourceBundle; - -import static jdk.jpackager.internal.StandardBundlerParam.*; -import static jdk.jpackager.internal.mac.MacBaseInstallerBundler.*; -import jdk.jpackager.internal.builders.AbstractAppImageBuilder; - -public class MacAppBundler extends AbstractImageBundler { - - private static final ResourceBundle I18N = - ResourceBundle.getBundle( - "jdk.jpackager.internal.resources.mac.MacAppBundler"); - - public final static String MAC_BUNDLER_PREFIX = - BUNDLER_PREFIX + "macosx" + File.separator; - - private static final String TEMPLATE_BUNDLE_ICON = "GenericApp.icns"; - - private static Map getMacCategories() { - Map map = new HashMap<>(); - map.put("Business", "public.app-category.business"); - map.put("Developer Tools", "public.app-category.developer-tools"); - map.put("Education", "public.app-category.education"); - map.put("Entertainment", "public.app-category.entertainment"); - map.put("Finance", "public.app-category.finance"); - map.put("Games", "public.app-category.games"); - map.put("Graphics & Design", "public.app-category.graphics-design"); - map.put("Healthcare & Fitness", - "public.app-category.healthcare-fitness"); - map.put("Lifestyle", "public.app-category.lifestyle"); - map.put("Medical", "public.app-category.medical"); - map.put("Music", "public.app-category.music"); - map.put("News", "public.app-category.news"); - map.put("Photography", "public.app-category.photography"); - map.put("Productivity", "public.app-category.productivity"); - map.put("Reference", "public.app-category.reference"); - map.put("Social Networking", "public.app-category.social-networking"); - map.put("Sports", "public.app-category.sports"); - map.put("Travel", "public.app-category.travel"); - map.put("Utilities", "public.app-category.utilities"); - map.put("Video", "public.app-category.video"); - map.put("Weather", "public.app-category.weather"); - - map.put("Action Games", "public.app-category.action-games"); - map.put("Adventure Games", "public.app-category.adventure-games"); - map.put("Arcade Games", "public.app-category.arcade-games"); - map.put("Board Games", "public.app-category.board-games"); - map.put("Card Games", "public.app-category.card-games"); - map.put("Casino Games", "public.app-category.casino-games"); - map.put("Dice Games", "public.app-category.dice-games"); - map.put("Educational Games", "public.app-category.educational-games"); - map.put("Family Games", "public.app-category.family-games"); - map.put("Kids Games", "public.app-category.kids-games"); - map.put("Music Games", "public.app-category.music-games"); - map.put("Puzzle Games", "public.app-category.puzzle-games"); - map.put("Racing Games", "public.app-category.racing-games"); - map.put("Role Playing Games", "public.app-category.role-playing-games"); - map.put("Simulation Games", "public.app-category.simulation-games"); - map.put("Sports Games", "public.app-category.sports-games"); - map.put("Strategy Games", "public.app-category.strategy-games"); - map.put("Trivia Games", "public.app-category.trivia-games"); - map.put("Word Games", "public.app-category.word-games"); - - return map; - } - - public static final EnumeratedBundlerParam MAC_CATEGORY = - new EnumeratedBundlerParam<>( - I18N.getString("param.category-name"), - I18N.getString("param.category-name.description"), - Arguments.CLIOptions.MAC_APP_STORE_CATEGORY.getId(), - String.class, - params -> params.containsKey(CATEGORY.getID()) - ? CATEGORY.fetchFrom(params) - : "Unknown", - (s, p) -> s, - getMacCategories(), - false //strict - for MacStoreBundler this should be strict - ); - - public static final BundlerParamInfo MAC_CF_BUNDLE_NAME = - new StandardBundlerParam<>( - I18N.getString("param.cfbundle-name.name"), - I18N.getString("param.cfbundle-name.description"), - Arguments.CLIOptions.MAC_BUNDLE_NAME.getId(), - String.class, - params -> null, - (s, p) -> s); - - public static final BundlerParamInfo MAC_CF_BUNDLE_IDENTIFIER = - new StandardBundlerParam<>( - I18N.getString("param.cfbundle-identifier.name"), - I18N.getString("param.cfbundle-identifier.description"), - Arguments.CLIOptions.MAC_BUNDLE_IDENTIFIER.getId(), - String.class, - IDENTIFIER::fetchFrom, - (s, p) -> s); - - public static final BundlerParamInfo MAC_CF_BUNDLE_VERSION = - new StandardBundlerParam<>( - I18N.getString("param.cfbundle-version.name"), - I18N.getString("param.cfbundle-version.description"), - "mac.CFBundleVersion", - String.class, - p -> { - String s = VERSION.fetchFrom(p); - if (validCFBundleVersion(s)) { - return s; - } else { - return "100"; - } - }, - (s, p) -> s); - - public static final BundlerParamInfo CONFIG_ROOT = - new StandardBundlerParam<>( - I18N.getString("param.config-root.name"), - I18N.getString("param.config-root.description"), - "configRoot", - File.class, - params -> { - File configRoot = - new File(BUILD_ROOT.fetchFrom(params), "macosx"); - configRoot.mkdirs(); - return configRoot; - }, - (s, p) -> new File(s)); - - public static final BundlerParamInfo DEFAULT_ICNS_ICON = - new StandardBundlerParam<>( - I18N.getString("param.default-icon-icns"), - I18N.getString("param.default-icon-icns.description"), - ".mac.default.icns", - String.class, - params -> TEMPLATE_BUNDLE_ICON, - (s, p) -> s); - - public static final BundlerParamInfo DEVELOPER_ID_APP_SIGNING_KEY = - new StandardBundlerParam<>( - I18N.getString("param.signing-key-developer-id-app.name"), - I18N.getString("param.signing-key-developer-id-app.description"), - "mac.signing-key-developer-id-app", - String.class, - params -> { - String result = MacBaseInstallerBundler.findKey( - "Developer ID Application: " - + SIGNING_KEY_USER.fetchFrom(params), - SIGNING_KEYCHAIN.fetchFrom(params), - VERBOSE.fetchFrom(params)); - if (result != null) { - MacCertificate certificate = new MacCertificate(result, - VERBOSE.fetchFrom(params)); - - if (!certificate.isValid()) { - Log.error(MessageFormat.format(I18N.getString( - "error.certificate.expired"), result)); - } - } - - return result; - }, - (s, p) -> s); - - public static final BundlerParamInfo BUNDLE_ID_SIGNING_PREFIX = - new StandardBundlerParam<>( - I18N.getString("param.bundle-id-signing-prefix.name"), - I18N.getString("param.bundle-id-signing-prefix.description"), - Arguments.CLIOptions.MAC_BUNDLE_SIGNING_PREFIX.getId(), - String.class, - params -> IDENTIFIER.fetchFrom(params) + ".", - (s, p) -> s); - - public static final BundlerParamInfo ICON_ICNS = - new StandardBundlerParam<>( - I18N.getString("param.icon-icns.name"), - I18N.getString("param.icon-icns.description"), - "icon.icns", - File.class, - params -> { - File f = ICON.fetchFrom(params); - if (f != null && !f.getName().toLowerCase().endsWith(".icns")) { - Log.error(MessageFormat.format( - I18N.getString("message.icon-not-icns"), f)); - return null; - } - return f; - }, - (s, p) -> new File(s)); - - public MacAppBundler() { - super(); - baseResourceLoader = MacResources.class; - } - - public static boolean validCFBundleVersion(String v) { - // CFBundleVersion (String - iOS, OS X) specifies the build version - // number of the bundle, which identifies an iteration (released or - // unreleased) of the bundle. The build version number should be a - // string comprised of three non-negative, period-separated integers - // with the first integer being greater than zero. The string should - // only contain numeric (0-9) and period (.) characters. Leading zeros - // are truncated from each integer and will be ignored (that is, - // 1.02.3 is equivalent to 1.2.3). This key is not localizable. - - if (v == null) { - return false; - } - - String p[] = v.split("\\."); - if (p.length > 3 || p.length < 1) { - Log.verbose(I18N.getString( - "message.version-string-too-many-components")); - return false; - } - - try { - BigInteger n = new BigInteger(p[0]); - if (BigInteger.ONE.compareTo(n) > 0) { - Log.verbose(I18N.getString( - "message.version-string-first-number-not-zero")); - return false; - } - if (p.length > 1) { - n = new BigInteger(p[1]); - if (BigInteger.ZERO.compareTo(n) > 0) { - Log.verbose(I18N.getString( - "message.version-string-no-negative-numbers")); - return false; - } - } - if (p.length > 2) { - n = new BigInteger(p[2]); - if (BigInteger.ZERO.compareTo(n) > 0) { - Log.verbose(I18N.getString( - "message.version-string-no-negative-numbers")); - return false; - } - } - } catch (NumberFormatException ne) { - Log.verbose(I18N.getString("message.version-string-numbers-only")); - Log.verbose(ne); - return false; - } - - return true; - } - - @Override - public boolean validate(Map params) - throws UnsupportedPlatformException, ConfigException { - try { - return doValidate(params); - } catch (RuntimeException re) { - if (re.getCause() instanceof ConfigException) { - throw (ConfigException) re.getCause(); - } else { - throw new ConfigException(re); - } - } - } - - // to be used by chained bundlers, e.g. by EXE bundler to avoid - // skipping validation if p.type does not include "image" - public boolean doValidate(Map p) - throws UnsupportedPlatformException, ConfigException { - if (Platform.getPlatform() != Platform.MAC) { - throw new UnsupportedPlatformException(); - } - - imageBundleValidation(p); - - if (StandardBundlerParam.getPredefinedAppImage(p) != null) { - return true; - } - - // validate short version - if (!validCFBundleVersion(MAC_CF_BUNDLE_VERSION.fetchFrom(p))) { - throw new ConfigException( - I18N.getString("error.invalid-cfbundle-version"), - I18N.getString("error.invalid-cfbundle-version.advice")); - } - - // 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); - if (signingIdentity == null) { - throw new ConfigException( - I18N.getString("error.explicit-sign-no-cert"), - I18N.getString("error.explicit-sign-no-cert.advice")); - } - } - - return true; - } - - private File getConfig_InfoPlist(Map params) { - return new File(CONFIG_ROOT.fetchFrom(params), "Info.plist"); - } - - private File getConfig_Icon(Map params) { - return new File(CONFIG_ROOT.fetchFrom(params), - APP_NAME.fetchFrom(params) + ".icns"); - } - - File doBundle(Map p, File outputDirectory, - boolean dependentTask) { - if (Arguments.CREATE_JRE_INSTALLER.fetchFrom(p)) { - return doJreBundle(p, outputDirectory, dependentTask); - } else { - return doAppBundle(p, outputDirectory, dependentTask); - } - } - - File doJreBundle(Map p, - File outputDirectory, boolean dependentTask) { - try { - File rootDirectory = createRoot(p, outputDirectory, dependentTask, - APP_NAME.fetchFrom(p), "macapp-image-builder"); - AbstractAppImageBuilder appBuilder = new MacAppImageBuilder(p, - APP_NAME.fetchFrom(p), outputDirectory.toPath()); - File predefined = PREDEFINED_RUNTIME_IMAGE.fetchFrom(p); - if (predefined == null ) { - JLinkBundlerHelper.generateServerJre(p, appBuilder); - } else { - return predefined; - } - return rootDirectory; - } catch (Exception ex) { - Log.error("Exception: "+ex); - Log.verbose(ex); - return null; - } - } - - File doAppBundle(Map p, File outputDirectory, - boolean dependentTask) { - try { - File rootDirectory = createRoot(p, outputDirectory, dependentTask, - APP_NAME.fetchFrom(p) + ".app", "macapp-image-builder"); - AbstractAppImageBuilder appBuilder = - new MacAppImageBuilder(p, outputDirectory.toPath()); - if (PREDEFINED_RUNTIME_IMAGE.fetchFrom(p) == null ) { - JLinkBundlerHelper.execute(p, appBuilder); - } else { - StandardBundlerParam.copyPredefinedRuntimeImage(p, appBuilder); - } - return rootDirectory; - } catch (Exception ex) { - Log.error("Exception: "+ex); - Log.verbose(ex); - return null; - } - } - - public void cleanupConfigFiles(Map params) { - if (Log.isDebug() || Log.isVerbose()) { - return; - } - - if (CONFIG_ROOT.fetchFrom(params) != null) { - getConfig_Icon(params).delete(); - getConfig_InfoPlist(params).delete(); - } - } - - ///////////////////////////////////////////////////////////////////////// - // Implement Bundler - ///////////////////////////////////////////////////////////////////////// - - @Override - public String getName() { - return I18N.getString("bundler.name"); - } - - @Override - public String getDescription() { - return I18N.getString("bundler.description"); - } - - @Override - public String getID() { - return "mac.app"; - } - - @Override - public String getBundleType() { - return "IMAGE"; - } - - @Override - public Collection> getBundleParameters() { - return getAppBundleParameters(); - } - - public static Collection> getAppBundleParameters() { - return Arrays.asList( - APP_NAME, - APP_RESOURCES, - ARGUMENTS, - BUNDLE_ID_SIGNING_PREFIX, - CLASSPATH, - DEVELOPER_ID_APP_SIGNING_KEY, - ICON_ICNS, - JVM_OPTIONS, - MAC_CATEGORY, - MAC_CF_BUNDLE_IDENTIFIER, - MAC_CF_BUNDLE_NAME, - MAC_CF_BUNDLE_VERSION, - MAIN_CLASS, - MAIN_JAR, - PREFERENCES_ID, - SIGNING_KEYCHAIN, - VERSION, - VERBOSE - ); - } - - - @Override - public File execute(Map params, - File outputParentDir) { - return doBundle(params, outputParentDir, false); - } - - @Override - public boolean supported() { - return Platform.getPlatform() == Platform.MAC; - } - -} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/mac/MacAppStoreBundler.java --- a/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/mac/MacAppStoreBundler.java Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,429 +0,0 @@ -/* - * Copyright (c) 2014, 2018, 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.jpackager.internal.mac; - -import jdk.jpackager.internal.BundlerParamInfo; -import jdk.jpackager.internal.StandardBundlerParam; -import jdk.jpackager.internal.Arguments; -import jdk.jpackager.internal.Log; -import jdk.jpackager.internal.ConfigException; -import jdk.jpackager.internal.IOUtils; -import jdk.jpackager.internal.Platform; -import jdk.jpackager.internal.UnsupportedPlatformException; -import jdk.jpackager.internal.builders.mac.MacAppImageBuilder; -import jdk.jpackager.internal.resources.mac.MacResources; - -import java.io.File; -import java.io.IOException; -import java.text.MessageFormat; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.ResourceBundle; - -import static jdk.jpackager.internal.StandardBundlerParam.*; -import static jdk.jpackager.internal.mac.MacAppBundler.*; - -public class MacAppStoreBundler extends MacBaseInstallerBundler { - - private static final ResourceBundle I18N = - ResourceBundle.getBundle( - "jdk.jpackager.internal.resources.mac.MacAppStoreBundler"); - - private static final String TEMPLATE_BUNDLE_ICON_HIDPI = - "GenericAppHiDPI.icns"; - private final static String DEFAULT_ENTITLEMENTS = - "MacAppStore.entitlements"; - private final static String DEFAULT_INHERIT_ENTITLEMENTS = - "MacAppStore_Inherit.entitlements"; - - public static final BundlerParamInfo MAC_APP_STORE_APP_SIGNING_KEY = - new StandardBundlerParam<>( - I18N.getString("param.signing-key-app.name"), - I18N.getString("param.signing-key-app.description"), - "mac.signing-key-app", - String.class, - params -> { - String result = MacBaseInstallerBundler.findKey( - "3rd Party Mac Developer Application: " + - SIGNING_KEY_USER.fetchFrom(params), - SIGNING_KEYCHAIN.fetchFrom(params), - VERBOSE.fetchFrom(params)); - if (result != null) { - MacCertificate certificate = new MacCertificate(result, - VERBOSE.fetchFrom(params)); - - if (!certificate.isValid()) { - Log.error(MessageFormat.format( - I18N.getString("error.certificate.expired"), - result)); - } - } - - return result; - }, - (s, p) -> s); - - public static final BundlerParamInfo MAC_APP_STORE_PKG_SIGNING_KEY = - new StandardBundlerParam<>( - I18N.getString("param.signing-key-pkg.name"), - I18N.getString("param.signing-key-pkg.description"), - "mac.signing-key-pkg", - String.class, - params -> { - String result = MacBaseInstallerBundler.findKey( - "3rd Party Mac Developer Installer: " + - SIGNING_KEY_USER.fetchFrom(params), - SIGNING_KEYCHAIN.fetchFrom(params), - VERBOSE.fetchFrom(params)); - - if (result != null) { - MacCertificate certificate = new MacCertificate( - result, VERBOSE.fetchFrom(params)); - - if (!certificate.isValid()) { - Log.error(MessageFormat.format( - I18N.getString("error.certificate.expired"), - result)); - } - } - - return result; - }, - (s, p) -> s); - - public static final StandardBundlerParam MAC_APP_STORE_ENTITLEMENTS = - new StandardBundlerParam<>( - I18N.getString("param.mac-app-store-entitlements.name"), - I18N.getString("param.mac-app-store-entitlements.description"), - Arguments.CLIOptions.MAC_APP_STORE_ENTITLEMENTS.getId(), - File.class, - params -> null, - (s, p) -> new File(s)); - - public static final BundlerParamInfo INSTALLER_SUFFIX = - new StandardBundlerParam<> ( - I18N.getString("param.installer-suffix.name"), - I18N.getString("param.installer-suffix.description"), - "mac.app-store.installerName.suffix", - String.class, - params -> "-MacAppStore", - (s, p) -> s); - - public MacAppStoreBundler() { - super(); - baseResourceLoader = MacResources.class; - } - - //@Override - public File bundle(Map p, File outdir) { - Log.verbose(MessageFormat.format(I18N.getString( - "message.building-bundle"), APP_NAME.fetchFrom(p))); - if (!outdir.isDirectory() && !outdir.mkdirs()) { - throw new RuntimeException(MessageFormat.format(I18N.getString( - "error.cannot-create-output-dir"), - outdir.getAbsolutePath())); - } - if (!outdir.canWrite()) { - throw new RuntimeException(MessageFormat.format(I18N.getString( - "error.cannot-write-to-output-dir"), - outdir.getAbsolutePath())); - } - - // 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); - - // now we create the app - File appImageDir = APP_IMAGE_BUILD_ROOT.fetchFrom(p); - try { - appImageDir.mkdirs(); - - try { - MacAppImageBuilder.addNewKeychain(p); - } 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); - - prepareEntitlements(p); - - 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 inheritEntitlements = - getConfig_Inherit_Entitlements(p).toString(); - - MacAppImageBuilder.signAppBundle(p, appLocation.toPath(), - signingIdentity, identifierPrefix, - entitlementsFile, inheritEntitlements); - MacAppImageBuilder.restoreKeychainList(p); - - ProcessBuilder pb; - - // create the final pkg file - File finalPKG = new File(outdir, INSTALLER_NAME.fetchFrom(p) - + INSTALLER_SUFFIX.fetchFrom(p) - + ".pkg"); - outdir.mkdirs(); - - String installIdentify = - MAC_APP_STORE_PKG_SIGNING_KEY.fetchFrom(p); - - List buildOptions = new ArrayList<>(); - buildOptions.add("productbuild"); - buildOptions.add("--component"); - buildOptions.add(appLocation.toString()); - buildOptions.add("/Applications"); - buildOptions.add("--sign"); - buildOptions.add(installIdentify); - buildOptions.add("--product"); - buildOptions.add(appLocation + "/Contents/Info.plist"); - String keychainName = SIGNING_KEYCHAIN.fetchFrom(p); - if (keychainName != null && !keychainName.isEmpty()) { - buildOptions.add("--keychain"); - buildOptions.add(keychainName); - } - buildOptions.add(finalPKG.getAbsolutePath()); - - pb = new ProcessBuilder(buildOptions); - - IOUtils.exec(pb, false); - return finalPKG; - } catch (Exception ex) { - Log.error("App Store Ready Bundle failed : " + ex.getMessage()); - Log.verbose(ex); - return null; - } finally { - try { - if (appImageDir != null && - PREDEFINED_APP_IMAGE.fetchFrom(p) == null && - (PREDEFINED_RUNTIME_IMAGE.fetchFrom(p) == null || - !Arguments.CREATE_JRE_INSTALLER.fetchFrom(p)) && - !Log.isDebug() && - !Log.isVerbose()) { - IOUtils.deleteRecursive(appImageDir); - } else if (appImageDir != null) { - Log.verbose(MessageFormat.format(I18N.getString( - "mesasge.intermediate-bundle-location"), - appImageDir.getAbsolutePath())); - } - - //cleanup - cleanupConfigFiles(p); - } catch (IOException ex) { - //noinspection ReturnInsideFinallyBlock - Log.debug(ex.getMessage()); - return null; - } - } - } - - protected void cleanupConfigFiles(Map params) { - if (Log.isDebug() || Log.isVerbose()) { - return; - } - - if (getConfig_Entitlements(params) != null) { - getConfig_Entitlements(params).delete(); - } - if (getConfig_Inherit_Entitlements(params) != null) { - getConfig_Inherit_Entitlements(params).delete(); - } - if (PREDEFINED_APP_IMAGE.fetchFrom(params) == null) { - APP_BUNDLER.fetchFrom(params).cleanupConfigFiles(params); - } - } - - private File getConfig_Entitlements(Map params) { - return new File(CONFIG_ROOT.fetchFrom(params), - APP_NAME.fetchFrom(params) + ".entitlements"); - } - - private File getConfig_Inherit_Entitlements( - Map params) { - return new File(CONFIG_ROOT.fetchFrom(params), - APP_NAME.fetchFrom(params) + "_Inherit.entitlements"); - } - - private void prepareEntitlements(Map params) - throws IOException { - File entitlements = MAC_APP_STORE_ENTITLEMENTS.fetchFrom(params); - if (entitlements == null || !entitlements.exists()) { - fetchResource(getEntitlementsFileName(params), - I18N.getString("resource.mac-app-store-entitlements"), - DEFAULT_ENTITLEMENTS, - getConfig_Entitlements(params), - VERBOSE.fetchFrom(params), - DROP_IN_RESOURCES_ROOT.fetchFrom(params)); - } else { - fetchResource(getEntitlementsFileName(params), - I18N.getString("resource.mac-app-store-entitlements"), - entitlements, - getConfig_Entitlements(params), - VERBOSE.fetchFrom(params), - DROP_IN_RESOURCES_ROOT.fetchFrom(params)); - } - fetchResource(getInheritEntitlementsFileName(params), - I18N.getString("resource.mac-app-store-inherit-entitlements"), - DEFAULT_INHERIT_ENTITLEMENTS, - getConfig_Inherit_Entitlements(params), - VERBOSE.fetchFrom(params), - DROP_IN_RESOURCES_ROOT.fetchFrom(params)); - } - - private String getEntitlementsFileName(Map params) { - return MAC_BUNDLER_PREFIX+ APP_NAME.fetchFrom(params) + ".entitlements"; - } - - private String getInheritEntitlementsFileName( - Map params) { - return MAC_BUNDLER_PREFIX + APP_NAME.fetchFrom(params) - + "_Inherit.entitlements"; - } - - - /////////////////////////////////////////////////////////////////////// - // Implement Bundler - /////////////////////////////////////////////////////////////////////// - - @Override - public String getName() { - return I18N.getString("bundler.name"); - } - - @Override - public String getDescription() { - return I18N.getString("bundler.description"); - } - - @Override - public String getID() { - return "mac.appStore"; - } - - @Override - public Collection> getBundleParameters() { - Collection> results = new LinkedHashSet<>(); - results.addAll(getAppBundleParameters()); - results.addAll(getMacAppStoreBundleParameters()); - return results; - } - - public Collection> getMacAppStoreBundleParameters() { - Collection> results = new LinkedHashSet<>(); - - results.addAll(getAppBundleParameters()); - results.remove(DEVELOPER_ID_APP_SIGNING_KEY); - results.addAll(Arrays.asList( - INSTALLER_SUFFIX, - MAC_APP_STORE_APP_SIGNING_KEY, - MAC_APP_STORE_ENTITLEMENTS, - MAC_APP_STORE_PKG_SIGNING_KEY, - SIGNING_KEYCHAIN - )); - - return results; - } - - @Override - public boolean validate(Map params) - throws UnsupportedPlatformException, ConfigException { - try { - if (Platform.getPlatform() != Platform.MAC) { - throw new UnsupportedPlatformException(); - } - - if (params == null) { - throw new ConfigException( - I18N.getString("error.parameters-null"), - I18N.getString("error.parameters-null.advice")); - } - - // hdiutil is always available so there's no need to test for - // availability. - // run basic validation to ensure requirements are met - - // TODO Mac App Store apps cannot use the system runtime - - // we are not interested in return code, only possible exception - validateAppImageAndBundeler(params); - - // reject explicitly set to not sign - if (!Optional.ofNullable(MacAppImageBuilder. - SIGN_BUNDLE.fetchFrom(params)).orElse(Boolean.TRUE)) { - throw new ConfigException( - I18N.getString("error.must-sign-app-store"), - I18N.getString("error.must-sign-app-store.advice")); - } - - // make sure we have settings for signatures - if (MAC_APP_STORE_APP_SIGNING_KEY.fetchFrom(params) == null) { - throw new ConfigException( - I18N.getString("error.no-app-signing-key"), - I18N.getString("error.no-app-signing-key.advice")); - } - if (MAC_APP_STORE_PKG_SIGNING_KEY.fetchFrom(params) == null) { - throw new ConfigException( - I18N.getString("error.no-pkg-signing-key"), - I18N.getString("error.no-pkg-signing-key.advice")); - } - - // things we could check... - // check the icons, make sure it has hidpi icons - // check the category, - // make sure it fits in the list apple has provided - // validate bundle identifier is reverse dns - // check for \a+\.\a+\.. - - return true; - } catch (RuntimeException re) { - if (re.getCause() instanceof ConfigException) { - throw (ConfigException) re.getCause(); - } else { - throw new ConfigException(re); - } - } - } - - @Override - public File execute(Map params, - File outputParentDir) { - return bundle(params, outputParentDir); - } - - @Override - public boolean supported() { - return !Arguments.isJreInstaller() && - Platform.getPlatform() == Platform.MAC; - } -} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/mac/MacBaseInstallerBundler.java --- a/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/mac/MacBaseInstallerBundler.java Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,247 +0,0 @@ -/* - * Copyright (c) 2014, 2018, 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.jpackager.internal.mac; - -import jdk.jpackager.internal.AbstractBundler; -import jdk.jpackager.internal.BundlerParamInfo; -import jdk.jpackager.internal.StandardBundlerParam; -import jdk.jpackager.internal.Arguments; -import jdk.jpackager.internal.Log; -import jdk.jpackager.internal.ConfigException; -import jdk.jpackager.internal.IOUtils; -import jdk.jpackager.internal.Platform; -import jdk.jpackager.internal.UnsupportedPlatformException; - -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.IOException; -import java.io.PrintStream; -import java.nio.file.Files; -import java.text.MessageFormat; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.ResourceBundle; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import static jdk.jpackager.internal.StandardBundlerParam.*; - -public abstract class MacBaseInstallerBundler extends AbstractBundler { - - private static final ResourceBundle I18N = - ResourceBundle.getBundle( - "jdk.jpackager.internal.resources.mac.MacBaseInstallerBundler"); - - // This could be generalized more to be for any type of Image Bundler - public static final BundlerParamInfo APP_BUNDLER = - new StandardBundlerParam<>( - I18N.getString("param.app-bundler.name"), - I18N.getString("param.app-bundle.description"), - "mac.app.bundler", - MacAppBundler.class, - params -> new MacAppBundler(), - (s, p) -> null); - - public final BundlerParamInfo APP_IMAGE_BUILD_ROOT = - new StandardBundlerParam<>( - I18N.getString("param.app-image-build-root.name"), - I18N.getString("param.app-image-build-root.description"), - "mac.app.imageRoot", - File.class, - params -> { - File imageDir = IMAGES_ROOT.fetchFrom(params); - if (!imageDir.exists()) imageDir.mkdirs(); - try { - return Files.createTempDirectory( - imageDir.toPath(), "image-").toFile(); - } catch (IOException e) { - return new File(imageDir, getID()+ ".image"); - } - }, - (s, p) -> new File(s)); - - public static final BundlerParamInfo CONFIG_ROOT = - new StandardBundlerParam<>( - I18N.getString("param.config-root.name"), - I18N.getString("param.config-root.description"), - "configRoot", - File.class, - params -> { - File imagesRoot = - new File(BUILD_ROOT.fetchFrom(params), "macosx"); - imagesRoot.mkdirs(); - return imagesRoot; - }, - (s, p) -> null); - - public static final BundlerParamInfo SIGNING_KEY_USER = - new StandardBundlerParam<>( - I18N.getString("param.signing-key-name.name"), - I18N.getString("param.signing-key-name.description"), - Arguments.CLIOptions.MAC_SIGNING_KEY_NAME.getId(), - String.class, - params -> "", - null); - - public static final BundlerParamInfo SIGNING_KEYCHAIN = - new StandardBundlerParam<>( - I18N.getString("param.signing-keychain.name"), - I18N.getString("param.signing-keychain.description"), - Arguments.CLIOptions.MAC_SIGNING_KEYCHAIN.getId(), - String.class, - params -> "", - null); - - public static final BundlerParamInfo INSTALLER_NAME = - new StandardBundlerParam<> ( - I18N.getString("param.installer-name.name"), - I18N.getString("param.installer-name.description"), - "mac.installerName", - String.class, - params -> { - String nm = APP_NAME.fetchFrom(params); - if (nm == null) return null; - - String version = VERSION.fetchFrom(params); - if (version == null) { - return nm; - } else { - return nm + "-" + version; - } - }, - (s, p) -> s); - - protected void validateAppImageAndBundeler( - Map params) - throws ConfigException, UnsupportedPlatformException { - if (PREDEFINED_APP_IMAGE.fetchFrom(params) != null) { - File applicationImage = PREDEFINED_APP_IMAGE.fetchFrom(params); - if (!applicationImage.exists()) { - throw new ConfigException( - MessageFormat.format(I18N.getString( - "message.app-image-dir-does-not-exist"), - PREDEFINED_APP_IMAGE.getID(), - applicationImage.toString()), - MessageFormat.format(I18N.getString( - "message.app-image-dir-does-not-exist.advice"), - PREDEFINED_APP_IMAGE.getID())); - } - if (APP_NAME.fetchFrom(params) == null) { - throw new ConfigException( - I18N.getString("message.app-image-requires-app-name"), - I18N.getString( - "message.app-image-requires-app-name.advice")); - } - if (IDENTIFIER.fetchFrom(params) == null) { - throw new ConfigException( - I18N.getString("message.app-image-requires-identifier"), - I18N.getString( - "message.app-image-requires-identifier.advice")); - } - } else { - APP_BUNDLER.fetchFrom(params).doValidate(params); - } - } - - protected File prepareAppBundle( - Map p, boolean pkg) { - File predefinedImage = StandardBundlerParam.getPredefinedAppImage(p); - if (predefinedImage != null) { - return predefinedImage; - } - File appImageRoot = APP_IMAGE_BUILD_ROOT.fetchFrom(p); - if (pkg) { - // create pkg in dmg - return new MacPkgBundler().bundle(p, appImageRoot); - } else { - return APP_BUNDLER.fetchFrom(p).doBundle(p, appImageRoot, true); - } - } - - @Override - public Collection> getBundleParameters() { - Collection> results = new LinkedHashSet<>(); - - results.addAll(MacAppBundler.getAppBundleParameters()); - results.addAll(Arrays.asList( - APP_BUNDLER, - CONFIG_ROOT, - APP_IMAGE_BUILD_ROOT, - PREDEFINED_APP_IMAGE - )); - - return results; - } - - @Override - public String getBundleType() { - return "INSTALLER"; - } - - public static String findKey(String key, String keychainName, - boolean verbose) { - if (Platform.getPlatform() != Platform.MAC) { - return null; - } - - try (ByteArrayOutputStream baos = new ByteArrayOutputStream(); - PrintStream ps = new PrintStream(baos)) { - List searchOptions = new ArrayList<>(); - searchOptions.add("security"); - searchOptions.add("find-certificate"); - searchOptions.add("-c"); - searchOptions.add(key); - searchOptions.add("-a"); - if (keychainName != null && !keychainName.isEmpty()) { - searchOptions.add(keychainName); - } - - ProcessBuilder pb = new ProcessBuilder(searchOptions); - - IOUtils.exec(pb, verbose, false, ps); - Pattern p = Pattern.compile("\"alis\"=\"([^\"]+)\""); - Matcher m = p.matcher(baos.toString()); - if (!m.find()) { - Log.error("Did not find a key matching '" + key + "'"); - return null; - } - String matchedKey = m.group(1); - if (m.find()) { - Log.error("Found more than one key matching '" + key + "'"); - return null; - } - Log.debug("Using key '" + matchedKey + "'"); - return matchedKey; - } catch (IOException ioe) { - Log.verbose(ioe); - return null; - } - } -} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/mac/MacCertificate.java --- a/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/mac/MacCertificate.java Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,166 +0,0 @@ -/* - * Copyright (c) 2016, 2018, 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.jpackager.internal.mac; - -import jdk.jpackager.internal.IOUtils; -import jdk.jpackager.internal.Log; - -import java.io.BufferedOutputStream; -import java.io.BufferedReader; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.PrintStream; -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.List; -import java.util.Locale; - -final public class MacCertificate { - private final String certificate; - private final boolean verbose; - - public MacCertificate(String certificate) { - this.certificate = certificate; - this.verbose = false; - } - - public MacCertificate(String certificate, boolean verbose) { - this.certificate = certificate; - this.verbose = verbose; - } - - public boolean isValid() { - return verifyCertificate(this.certificate, verbose); - } - - private static File findCertificate(String certificate, boolean verbose) { - File result = null; - - List args = new ArrayList<>(); - args.add("security"); - args.add("find-certificate"); - args.add("-c"); - args.add(certificate); - args.add("-a"); - args.add("-p"); - - try (ByteArrayOutputStream baos = new ByteArrayOutputStream(); - PrintStream ps = new PrintStream(baos)) { - ProcessBuilder security = new ProcessBuilder(args); - IOUtils.exec(security, verbose, false, ps); - - File output = File.createTempFile("tempfile", ".tmp"); - PrintStream p = new PrintStream( - new BufferedOutputStream( - new FileOutputStream(output, true))); - BufferedReader bfReader = new BufferedReader( - new InputStreamReader( - new ByteArrayInputStream(baos.toByteArray()))); - String line = null; - - while((line = bfReader.readLine()) != null){ - p.println(line); - } - - p.close(); - result = output; - } - catch (IOException ignored) {} - - return result; - } - - private static Date findCertificateDate(String filename, boolean verbose) { - Date result = null; - - List args = new ArrayList<>(); - args.add("/usr/bin/openssl"); - args.add("x509"); - args.add("-noout"); - args.add("-enddate"); - args.add("-in"); - args.add(filename); - - try (ByteArrayOutputStream baos = new ByteArrayOutputStream(); - PrintStream ps = new PrintStream(baos)) { - ProcessBuilder security = new ProcessBuilder(args); - IOUtils.exec(security, verbose, false, ps); - String output = baos.toString(); - output = output.substring(output.indexOf("=") + 1); - DateFormat df = new SimpleDateFormat( - "MMM dd kk:mm:ss yyyy z", Locale.ENGLISH); - result = df.parse(output); - } catch (IOException | ParseException ex) { - Log.debug(ex); - } - - return result; - } - - private static boolean verifyCertificate( - String certificate, boolean verbose) { - boolean result = false; - - try { - File file = null; - Date certificateDate = null; - - try { - file = findCertificate(certificate, verbose); - - if (file != null) { - certificateDate = findCertificateDate( - file.getCanonicalPath(), verbose); - } - } - finally { - if (file != null) { - file.delete(); - } - } - - if (certificateDate != null) { - Calendar c = Calendar.getInstance(); - Date today = c.getTime(); - - if (certificateDate.after(today)) { - result = true; - } - } - } - catch (IOException ignored) {} - - return result; - } -} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/mac/MacDmgBundler.java --- a/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/mac/MacDmgBundler.java Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,580 +0,0 @@ -/* - * Copyright (c) 2012, 2018, 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.jpackager.internal.mac; - -import jdk.jpackager.internal.*; -import jdk.jpackager.internal.IOUtils; -import jdk.jpackager.internal.resources.mac.MacResources; -import jdk.jpackager.internal.Arguments; - -import java.io.*; -import java.nio.file.Files; -import java.text.MessageFormat; -import java.util.*; - -import static jdk.jpackager.internal.StandardBundlerParam.*; - -public class MacDmgBundler extends MacBaseInstallerBundler { - - private static final ResourceBundle I18N = - ResourceBundle.getBundle( - "jdk.jpackager.internal.resources.mac.MacDmgBundler"); - - static final String DEFAULT_BACKGROUND_IMAGE="background_dmg.png"; - static final String DEFAULT_DMG_SETUP_SCRIPT="DMGsetup.scpt"; - static final String TEMPLATE_BUNDLE_ICON = "GenericApp.icns"; - - static final String DEFAULT_LICENSE_PLIST="lic_template.plist"; - - public static final BundlerParamInfo INSTALLER_SUFFIX = - new StandardBundlerParam<> ( - I18N.getString("param.installer-suffix.name"), - I18N.getString("param.installer-suffix.description"), - "mac.dmg.installerName.suffix", - String.class, - params -> "", - (s, p) -> s); - - public MacDmgBundler() { - super(); - baseResourceLoader = MacResources.class; - } - - public File bundle(Map params, File outdir) { - Log.verbose(MessageFormat.format(I18N.getString("message.building-dmg"), - APP_NAME.fetchFrom(params))); - if (!outdir.isDirectory() && !outdir.mkdirs()) { - throw new RuntimeException(MessageFormat.format( - I18N.getString("error.cannot-create-output-dir"), - outdir.getAbsolutePath())); - } - if (!outdir.canWrite()) { - throw new RuntimeException(MessageFormat.format( - I18N.getString("error.cannot-write-to-output-dir"), - outdir.getAbsolutePath())); - } - - File appImageDir = APP_IMAGE_BUILD_ROOT.fetchFrom(params); - try { - appImageDir.mkdirs(); - - if (prepareAppBundle(params, true) != null && - prepareConfigFiles(params)) { - File configScript = getConfig_Script(params); - if (configScript.exists()) { - Log.verbose(MessageFormat.format( - I18N.getString("message.running-script"), - configScript.getAbsolutePath())); - IOUtils.run("bash", configScript, false); - } - - return buildDMG(params, outdir); - } - return null; - } catch (IOException ex) { - Log.verbose(ex); - return null; - } finally { - try { - if (appImageDir != null && - PREDEFINED_APP_IMAGE.fetchFrom(params) == null && - (PREDEFINED_RUNTIME_IMAGE.fetchFrom(params) == null || - !Arguments.CREATE_JRE_INSTALLER.fetchFrom(params)) && - !Log.isDebug() && - !Log.isVerbose()) { - IOUtils.deleteRecursive(appImageDir); - } else if (appImageDir != null) { - Log.verbose(MessageFormat.format(I18N.getString( - "message.intermediate-image-location"), - appImageDir.getAbsolutePath())); - } - - //cleanup - cleanupConfigFiles(params); - } catch (IOException ex) { - Log.debug(ex); - //noinspection ReturnInsideFinallyBlock - return null; - } - } - } - - //remove - protected void cleanupConfigFiles(Map params) { - if (Log.isDebug() || Log.isVerbose()) { - return; - } - - if (getConfig_VolumeBackground(params) != null) { - getConfig_VolumeBackground(params).delete(); - } - if (getConfig_VolumeIcon(params) != null) { - getConfig_VolumeIcon(params).delete(); - } - if (getConfig_VolumeScript(params) != null) { - getConfig_VolumeScript(params).delete(); - } - if (getConfig_Script(params) != null) { - getConfig_Script(params).delete(); - } - if (getConfig_LicenseFile(params) != null) { - getConfig_LicenseFile(params).delete(); - } - APP_BUNDLER.fetchFrom(params).cleanupConfigFiles(params); - } - - private static final String hdiutil = "/usr/bin/hdiutil"; - - private void prepareDMGSetupScript(String volumeName, - Map p) throws IOException { - File dmgSetup = getConfig_VolumeScript(p); - Log.verbose(MessageFormat.format( - I18N.getString("message.preparing-dmg-setup"), - dmgSetup.getAbsolutePath())); - - //prepare config for exe - Map data = new HashMap<>(); - data.put("DEPLOY_ACTUAL_VOLUME_NAME", volumeName); - data.put("DEPLOY_APPLICATION_NAME", APP_NAME.fetchFrom(p)); - - data.put("DEPLOY_INSTALL_LOCATION", "(path to desktop folder)"); - data.put("DEPLOY_INSTALL_NAME", "Desktop"); - - Writer w = new BufferedWriter(new FileWriter(dmgSetup)); - w.write(preprocessTextResource( - MacAppBundler.MAC_BUNDLER_PREFIX + dmgSetup.getName(), - I18N.getString("resource.dmg-setup-script"), - DEFAULT_DMG_SETUP_SCRIPT, data, VERBOSE.fetchFrom(p), - DROP_IN_RESOURCES_ROOT.fetchFrom(p))); - w.close(); - } - - private File getConfig_VolumeScript(Map params) { - return new File(CONFIG_ROOT.fetchFrom(params), - APP_NAME.fetchFrom(params) + "-dmg-setup.scpt"); - } - - private File getConfig_VolumeBackground( - Map params) { - return new File(CONFIG_ROOT.fetchFrom(params), - APP_NAME.fetchFrom(params) + "-background.png"); - } - - private File getConfig_VolumeIcon(Map params) { - return new File(CONFIG_ROOT.fetchFrom(params), - APP_NAME.fetchFrom(params) + "-volume.icns"); - } - - private File getConfig_LicenseFile(Map params) { - return new File(CONFIG_ROOT.fetchFrom(params), - APP_NAME.fetchFrom(params) + "-license.plist"); - } - - private void prepareLicense(Map params) { - try { - File licFile = null; - - List licFiles = LICENSE_FILE.fetchFrom(params); - if (licFiles.isEmpty()) { - return; - } - String licFileStr = licFiles.get(0); - - for (RelativeFileSet rfs : APP_RESOURCES_LIST.fetchFrom(params)) { - if (rfs.contains(licFileStr)) { - licFile = new File(rfs.getBaseDirectory(), licFileStr); - break; - } - } - - if (licFile == null) { - // this is NPE protection, - // validate should have already caught it's absence - Log.error("Licence file is null"); - return; - } - - byte[] licenseContentOriginal = Files.readAllBytes(licFile.toPath()); - String licenseInBase64 = - Base64.getEncoder().encodeToString(licenseContentOriginal); - - Map data = new HashMap<>(); - data.put("APPLICATION_LICENSE_TEXT", licenseInBase64); - - Writer w = new BufferedWriter( - new FileWriter(getConfig_LicenseFile(params))); - w.write(preprocessTextResource( - MacAppBundler.MAC_BUNDLER_PREFIX - + getConfig_LicenseFile(params).getName(), - I18N.getString("resource.license-setup"), - DEFAULT_LICENSE_PLIST, data, VERBOSE.fetchFrom(params), - DROP_IN_RESOURCES_ROOT.fetchFrom(params))); - w.close(); - - } catch (IOException ex) { - Log.verbose(ex); - } - } - - private boolean prepareConfigFiles(Map params) - throws IOException { - File bgTarget = getConfig_VolumeBackground(params); - fetchResource(MacAppBundler.MAC_BUNDLER_PREFIX + bgTarget.getName(), - I18N.getString("resource.dmg-background"), - DEFAULT_BACKGROUND_IMAGE, - bgTarget, - VERBOSE.fetchFrom(params), - DROP_IN_RESOURCES_ROOT.fetchFrom(params)); - - File iconTarget = getConfig_VolumeIcon(params); - if (MacAppBundler.ICON_ICNS.fetchFrom(params) == null || - !MacAppBundler.ICON_ICNS.fetchFrom(params).exists()) { - fetchResource( - MacAppBundler.MAC_BUNDLER_PREFIX + iconTarget.getName(), - I18N.getString("resource.volume-icon"), - TEMPLATE_BUNDLE_ICON, - iconTarget, - VERBOSE.fetchFrom(params), - DROP_IN_RESOURCES_ROOT.fetchFrom(params)); - } else { - fetchResource( - MacAppBundler.MAC_BUNDLER_PREFIX + iconTarget.getName(), - I18N.getString("resource.volume-icon"), - MacAppBundler.ICON_ICNS.fetchFrom(params), - iconTarget, - VERBOSE.fetchFrom(params), - DROP_IN_RESOURCES_ROOT.fetchFrom(params)); - } - - - fetchResource(MacAppBundler.MAC_BUNDLER_PREFIX - + getConfig_Script(params).getName(), - I18N.getString("resource.post-install-script"), - (String) null, - getConfig_Script(params), - VERBOSE.fetchFrom(params), - DROP_IN_RESOURCES_ROOT.fetchFrom(params)); - - prepareLicense(params); - - // In theory we need to extract name from results of attach command - // However, this will be a problem for customization as name will - // possibly change every time and developer will not be able to fix it - // As we are using tmp dir chance we get "different" name are low => - // Use fixed name we used for bundle - prepareDMGSetupScript(APP_NAME.fetchFrom(params), params); - - return true; - } - - // name of post-image script - private File getConfig_Script(Map params) { - return new File(CONFIG_ROOT.fetchFrom(params), - APP_NAME.fetchFrom(params) + "-post-image.sh"); - } - - // Location of SetFile utility may be different depending on MacOS version - // We look for several known places and if none of them work will - // try ot find it - private String findSetFileUtility() { - String typicalPaths[] = {"/Developer/Tools/SetFile", - "/usr/bin/SetFile", "/Developer/usr/bin/SetFile"}; - - for (String path: typicalPaths) { - File f = new File(path); - if (f.exists() && f.canExecute()) { - return path; - } - } - - // generic find attempt - try { - ProcessBuilder pb = new ProcessBuilder("xcrun", "-find", "SetFile"); - Process p = pb.start(); - InputStreamReader isr = new InputStreamReader(p.getInputStream()); - BufferedReader br = new BufferedReader(isr); - String lineRead = br.readLine(); - if (lineRead != null) { - File f = new File(lineRead); - if (f.exists() && f.canExecute()) { - return f.getAbsolutePath(); - } - } - } catch (IOException ignored) {} - - return null; - } - - private File buildDMG( - Map p, File outdir) - throws IOException { - File imagesRoot = IMAGES_ROOT.fetchFrom(p); - 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 srcFolder = APP_IMAGE_BUILD_ROOT.fetchFrom(p); - File predefinedImage = StandardBundlerParam.getPredefinedAppImage(p); - if (predefinedImage != null) { - srcFolder = predefinedImage; - } - - Log.verbose(MessageFormat.format(I18N.getString( - "message.creating-dmg-file"), finalDMG.getAbsolutePath())); - - protoDMG.delete(); - if (finalDMG.exists() && !finalDMG.delete()) { - throw new IOException(MessageFormat.format(I18N.getString( - "message.dmg-cannot-be-overwritten"), - finalDMG.getAbsolutePath())); - } - - protoDMG.getParentFile().mkdirs(); - finalDMG.getParentFile().mkdirs(); - - String hdiUtilVerbosityFlag = Log.isDebug() ? "-verbose" : "-quiet"; - - // create temp image - ProcessBuilder pb = new ProcessBuilder( - hdiutil, - "create", - hdiUtilVerbosityFlag, - "-srcfolder", srcFolder.getAbsolutePath(), - "-volname", APP_NAME.fetchFrom(p), - "-ov", protoDMG.getAbsolutePath(), - "-fs", "HFS+", - "-format", "UDRW"); - IOUtils.exec(pb, false); - - // mount temp image - pb = new ProcessBuilder( - hdiutil, - "attach", - protoDMG.getAbsolutePath(), - hdiUtilVerbosityFlag, - "-mountroot", imagesRoot.getAbsolutePath()); - IOUtils.exec(pb, false); - - File mountedRoot = - new File(imagesRoot.getAbsolutePath(), APP_NAME.fetchFrom(p)); - - // volume icon - File volumeIconFile = new File(mountedRoot, ".VolumeIcon.icns"); - IOUtils.copyFile(getConfig_VolumeIcon(p), - volumeIconFile); - - pb = new ProcessBuilder("osascript", - getConfig_VolumeScript(p).getAbsolutePath()); - IOUtils.exec(pb, false); - - // Indicate that we want a custom icon - // NB: attributes of the root directory are ignored - // when creating the volume - // Therefore we have to do this after we mount image - String setFileUtility = findSetFileUtility(); - if (setFileUtility != null) { - //can not find utility => keep going without icon - try { - volumeIconFile.setWritable(true); - // The "creator" attribute on a file is a legacy attribute - // but it seems Finder excepts these bytes to be - // "icnC" for the volume icon - // http://endrift.com/blog/2010/06/14/dmg-files-volume-icons-cli - // (might not work on Mac 10.13 with old XCode) - pb = new ProcessBuilder( - setFileUtility, - "-c", "icnC", - volumeIconFile.getAbsolutePath()); - IOUtils.exec(pb, false); - volumeIconFile.setReadOnly(); - - pb = new ProcessBuilder( - setFileUtility, - "-a", "C", - mountedRoot.getAbsolutePath()); - IOUtils.exec(pb, false); - } catch (IOException ex) { - Log.error(ex.getMessage()); - Log.verbose("Cannot enable custom icon using SetFile utility"); - } - } else { - Log.verbose( - "Skip enabling custom icon as SetFile utility is not found"); - } - - // Detach the temporary image - pb = new ProcessBuilder( - hdiutil, - "detach", - hdiUtilVerbosityFlag, - mountedRoot.getAbsolutePath()); - IOUtils.exec(pb, false); - - // Compress it to a new image - pb = new ProcessBuilder( - hdiutil, - "convert", - protoDMG.getAbsolutePath(), - hdiUtilVerbosityFlag, - "-format", "UDZO", - "-o", finalDMG.getAbsolutePath()); - IOUtils.exec(pb, false); - - //add license if needed - if (getConfig_LicenseFile(p).exists()) { - //hdiutil unflatten your_image_file.dmg - pb = new ProcessBuilder( - hdiutil, - "unflatten", - finalDMG.getAbsolutePath() - ); - IOUtils.exec(pb, false); - - //add license - pb = new ProcessBuilder( - hdiutil, - "udifrez", - finalDMG.getAbsolutePath(), - "-xml", - getConfig_LicenseFile(p).getAbsolutePath() - ); - IOUtils.exec(pb, false); - - //hdiutil flatten your_image_file.dmg - pb = new ProcessBuilder( - hdiutil, - "flatten", - finalDMG.getAbsolutePath() - ); - IOUtils.exec(pb, false); - - } - - //Delete the temporary image - protoDMG.delete(); - - Log.verbose(MessageFormat.format(I18N.getString( - "message.output-to-location"), - APP_NAME.fetchFrom(p), finalDMG.getAbsolutePath())); - - return finalDMG; - } - - - ////////////////////////////////////////////////////////////////////////// - // Implement Bundler - ////////////////////////////////////////////////////////////////////////// - - @Override - public String getName() { - return I18N.getString("bundler.name"); - } - - @Override - public String getDescription() { - return I18N.getString("bundler.description"); - } - - @Override - public String getID() { - return "dmg"; - } - - @Override - public Collection> getBundleParameters() { - Collection> results = new LinkedHashSet<>(); - results.addAll(MacAppBundler.getAppBundleParameters()); - results.addAll(getDMGBundleParameters()); - return results; - } - - public Collection> getDMGBundleParameters() { - Collection> results = new LinkedHashSet<>(); - - results.addAll(MacAppBundler.getAppBundleParameters()); - results.addAll(Arrays.asList( - INSTALLER_SUFFIX, - LICENSE_FILE - )); - - return results; - } - - - @Override - public boolean validate(Map params) - throws UnsupportedPlatformException, ConfigException { - try { - 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 - validateAppImageAndBundeler(params); - - // validate license file, if used, exists in the proper place - if (params.containsKey(LICENSE_FILE.getID())) { - List appResourcesList = - APP_RESOURCES_LIST.fetchFrom(params); - for (String license : LICENSE_FILE.fetchFrom(params)) { - boolean found = false; - for (RelativeFileSet appResources : appResourcesList) { - found = found || appResources.contains(license); - } - if (!found) { - throw new ConfigException( - I18N.getString("error.license-missing"), - MessageFormat.format(I18N.getString( - "error.license-missing.advice"), license)); - } - } - } - - return true; - } catch (RuntimeException re) { - if (re.getCause() instanceof ConfigException) { - throw (ConfigException) re.getCause(); - } else { - throw new ConfigException(re); - } - } - } - - @Override - public File execute( - Map params, File outputParentDir) { - return bundle(params, outputParentDir); - } - - @Override - public boolean supported() { - return Platform.getPlatform() == Platform.MAC; - } -} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/mac/MacPkgBundler.java --- a/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/mac/MacPkgBundler.java Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,612 +0,0 @@ -/* - * Copyright (c) 2014, 2018, 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.jpackager.internal.mac; - -import jdk.jpackager.internal.BundlerParamInfo; -import jdk.jpackager.internal.StandardBundlerParam; -import jdk.jpackager.internal.Log; -import jdk.jpackager.internal.ConfigException; -import jdk.jpackager.internal.IOUtils; -import jdk.jpackager.internal.Platform; -import jdk.jpackager.internal.RelativeFileSet; -import jdk.jpackager.internal.UnsupportedPlatformException; -import jdk.jpackager.internal.resources.mac.MacResources; -import jdk.jpackager.internal.builders.mac.MacAppImageBuilder; -import jdk.jpackager.internal.Arguments; - -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; -import java.io.PrintStream; -import java.io.Writer; -import java.net.URLEncoder; -import java.text.MessageFormat; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.HashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.ResourceBundle; - -import static jdk.jpackager.internal.StandardBundlerParam.*; -import static - jdk.jpackager.internal.mac.MacBaseInstallerBundler.SIGNING_KEYCHAIN; -import static - jdk.jpackager.internal.mac.MacBaseInstallerBundler.SIGNING_KEY_USER; - -public class MacPkgBundler extends MacBaseInstallerBundler { - - private static final ResourceBundle I18N = ResourceBundle.getBundle( - "jdk.jpackager.internal.resources.mac.MacPkgBundler"); - - public final static String MAC_BUNDLER_PREFIX = - BUNDLER_PREFIX + "macosx" + File.separator; - - private static final String DEFAULT_BACKGROUND_IMAGE = "background_pkg.png"; - - private static final String TEMPLATE_PREINSTALL_SCRIPT = - "preinstall.template"; - private static final String TEMPLATE_POSTINSTALL_SCRIPT = - "postinstall.template"; - - private static final BundlerParamInfo PACKAGES_ROOT = - new StandardBundlerParam<>( - I18N.getString("param.packages-root.name"), - I18N.getString("param.packages-root.description"), - "mac.pkg.packagesRoot", - File.class, - params -> { - File packagesRoot = - new File(BUILD_ROOT.fetchFrom(params), "packages"); - packagesRoot.mkdirs(); - return packagesRoot; - }, - (s, p) -> new File(s)); - - - protected final BundlerParamInfo SCRIPTS_DIR = - new StandardBundlerParam<>( - I18N.getString("param.scripts-dir.name"), - I18N.getString("param.scripts-dir.description"), - "mac.pkg.scriptsDir", - File.class, - params -> { - File scriptsDir = - new File(CONFIG_ROOT.fetchFrom(params), "scripts"); - scriptsDir.mkdirs(); - return scriptsDir; - }, - (s, p) -> new File(s)); - - public static final - BundlerParamInfo DEVELOPER_ID_INSTALLER_SIGNING_KEY = - new StandardBundlerParam<>( - I18N.getString("param.signing-key-developer-id-installer.name"), - I18N.getString( - "param.signing-key-developer-id-installer.description"), - "mac.signing-key-developer-id-installer", - String.class, - params -> { - String result = MacBaseInstallerBundler.findKey( - "Developer ID Installer: " - + SIGNING_KEY_USER.fetchFrom(params), - SIGNING_KEYCHAIN.fetchFrom(params), - VERBOSE.fetchFrom(params)); - if (result != null) { - MacCertificate certificate = new MacCertificate( - result, VERBOSE.fetchFrom(params)); - - if (!certificate.isValid()) { - Log.error(MessageFormat.format( - I18N.getString("error.certificate.expired"), - result)); - } - } - - return result; - }, - (s, p) -> s); - - public static final BundlerParamInfo MAC_INSTALL_DIR = - new StandardBundlerParam<>( - I18N.getString("param.mac-install-dir.name"), - I18N.getString("param.mac-install-dir.description"), - "mac-install-dir", - String.class, - params -> { - String dir = INSTALL_DIR.fetchFrom(params); - return (dir != null) ? dir : "/Applications"; - }, - (s, p) -> s - ); - - public static final BundlerParamInfo INSTALLER_SUFFIX = - new StandardBundlerParam<> ( - I18N.getString("param.installer-suffix.name"), - I18N.getString("param.installer-suffix.description"), - "mac.pkg.installerName.suffix", - String.class, - params -> "", - (s, p) -> s); - - public MacPkgBundler() { - super(); - baseResourceLoader = MacResources.class; - } - - public File bundle(Map params, File outdir) { - Log.verbose(MessageFormat.format(I18N.getString("message.building-pkg"), - APP_NAME.fetchFrom(params))); - if (!outdir.isDirectory() && !outdir.mkdirs()) { - throw new RuntimeException(MessageFormat.format( - I18N.getString("error.cannot-create-output-dir"), - outdir.getAbsolutePath())); - } - if (!outdir.canWrite()) { - throw new RuntimeException(MessageFormat.format( - I18N.getString("error.cannot-write-to-output-dir"), - outdir.getAbsolutePath())); - } - - File appImageDir = null; - try { - appImageDir = prepareAppBundle(params, false); - - if (appImageDir != null && prepareConfigFiles(params)) { - - File configScript = getConfig_Script(params); - if (configScript.exists()) { - Log.verbose(MessageFormat.format(I18N.getString( - "message.running-script"), - configScript.getAbsolutePath())); - IOUtils.run("bash", configScript, false); - } - - return createPKG(params, outdir, appImageDir); - } - return null; - } catch (IOException ex) { - Log.verbose(ex); - return null; - } finally { - try { - if (appImageDir != null && - PREDEFINED_APP_IMAGE.fetchFrom(params) == null && - (PREDEFINED_RUNTIME_IMAGE.fetchFrom(params) == null || - !Arguments.CREATE_JRE_INSTALLER.fetchFrom(params)) && - !Log.isDebug() && - !Log.isVerbose()) { - IOUtils.deleteRecursive(appImageDir); - } else if (appImageDir != null) { - Log.verbose(MessageFormat.format(I18N.getString( - "message.intermediate-image-location"), - appImageDir.getAbsolutePath())); - } - - // cleanup - cleanupConfigFiles(params); - } catch (IOException ex) { - Log.debug(ex); - // noinspection ReturnInsideFinallyBlock - return null; - } - } - } - - private File getPackages_AppPackage(Map params) { - return new File(PACKAGES_ROOT.fetchFrom(params), - APP_FS_NAME.fetchFrom(params) + "-app.pkg"); - } - - private File getPackages_DaemonPackage(Map params) { - return new File(PACKAGES_ROOT.fetchFrom(params), - APP_FS_NAME.fetchFrom(params) + "-daemon.pkg"); - } - - private void cleanupPackagesFiles(Map params) { - if (Log.isDebug() || Log.isVerbose()) { - return; - } - - if (getPackages_AppPackage(params) != null) { - getPackages_AppPackage(params).delete(); - } - if (getPackages_DaemonPackage(params) != null) { - getPackages_DaemonPackage(params).delete(); - } - } - - private File getConfig_DistributionXMLFile( - Map params) { - return new File(CONFIG_ROOT.fetchFrom(params), "distribution.dist"); - } - - private File getConfig_BackgroundImage(Map params) { - return new File(CONFIG_ROOT.fetchFrom(params), - APP_NAME.fetchFrom(params) + "-background.png"); - } - - private File getScripts_PreinstallFile(Map params) { - return new File(SCRIPTS_DIR.fetchFrom(params), "preinstall"); - } - - private File getScripts_PostinstallFile( - Map params) { - return new File(SCRIPTS_DIR.fetchFrom(params), "postinstall"); - } - - private void cleanupConfigFiles(Map params) { - if (Log.isDebug() || Log.isVerbose()) { - return; - } - - if (getConfig_DistributionXMLFile(params) != null) { - getConfig_DistributionXMLFile(params).delete(); - } - if (getConfig_BackgroundImage(params) != null) { - getConfig_BackgroundImage(params).delete(); - } - } - - private String getAppIdentifier(Map params) { - return IDENTIFIER.fetchFrom(params); - } - - private String getDaemonIdentifier(Map params) { - return IDENTIFIER.fetchFrom(params) + ".daemon"; - } - - private void preparePackageScripts(Map params) - throws IOException { - Log.verbose(I18N.getString("message.preparing-scripts")); - - Map data = new HashMap<>(); - - data.put("DEPLOY_DAEMON_IDENTIFIER", getDaemonIdentifier(params)); - data.put("DEPLOY_LAUNCHD_PLIST_FILE", - IDENTIFIER.fetchFrom(params).toLowerCase() + ".launchd.plist"); - - Writer w = new BufferedWriter( - new FileWriter(getScripts_PreinstallFile(params))); - String content = preprocessTextResource(MAC_BUNDLER_PREFIX - + getScripts_PreinstallFile(params).getName(), - I18N.getString("resource.pkg-preinstall-script"), - TEMPLATE_PREINSTALL_SCRIPT, - data, - VERBOSE.fetchFrom(params), - DROP_IN_RESOURCES_ROOT.fetchFrom(params)); - w.write(content); - w.close(); - getScripts_PreinstallFile(params).setExecutable(true, false); - - w = new BufferedWriter( - new FileWriter(getScripts_PostinstallFile(params))); - content = preprocessTextResource(MAC_BUNDLER_PREFIX - + getScripts_PostinstallFile(params).getName(), - I18N.getString("resource.pkg-postinstall-script"), - TEMPLATE_POSTINSTALL_SCRIPT, - data, - VERBOSE.fetchFrom(params), - DROP_IN_RESOURCES_ROOT.fetchFrom(params)); - w.write(content); - w.close(); - getScripts_PostinstallFile(params).setExecutable(true, false); - } - - private void prepareDistributionXMLFile(Map params) - throws IOException { - File f = getConfig_DistributionXMLFile(params); - - Log.verbose(MessageFormat.format(I18N.getString( - "message.preparing-distribution-dist"), f.getAbsolutePath())); - - PrintStream out = new PrintStream(f); - - out.println( - ""); - out.println(""); - - out.println("" + APP_NAME.fetchFrom(params) + ""); - out.println(""); - - if (!LICENSE_FILE.fetchFrom(params).isEmpty()) { - File licFile = null; - - List licFiles = LICENSE_FILE.fetchFrom(params); - if (licFiles.isEmpty()) { - return; - } - String licFileStr = licFiles.get(0); - - for (RelativeFileSet rfs : APP_RESOURCES_LIST.fetchFrom(params)) { - if (rfs.contains(licFileStr)) { - licFile = new File(rfs.getBaseDirectory(), licFileStr); - break; - } - } - - // this is NPE protection, validate should have caught it's absence - // so we don't complain or throw an error - if (licFile != null) { - out.println(""); - } - } - - /* - * Note that the content of the distribution file - * below is generated by productbuild --synthesize - */ - - String appId = getAppIdentifier(params); - String daemonId = getDaemonIdentifier(params); - - out.println(""); - - out.println(""); - out.println(""); - out.println(" "); - out.println(" "); - out.println(" "); - out.println(""); - out.println(""); - out.println(""); - out.println(" "); - out.println(""); - out.println("" - + URLEncoder.encode(getPackages_AppPackage(params).getName(), - "UTF-8") + ""); - - out.println(""); - - out.close(); - } - - private boolean prepareConfigFiles(Map params) - throws IOException { - File imageTarget = getConfig_BackgroundImage(params); - fetchResource(MacAppBundler.MAC_BUNDLER_PREFIX + imageTarget.getName(), - I18N.getString("resource.pkg-background-image"), - DEFAULT_BACKGROUND_IMAGE, - imageTarget, - VERBOSE.fetchFrom(params), - DROP_IN_RESOURCES_ROOT.fetchFrom(params)); - - prepareDistributionXMLFile(params); - - fetchResource(MacAppBundler.MAC_BUNDLER_PREFIX - + getConfig_Script(params).getName(), - I18N.getString("resource.post-install-script"), - (String) null, - getConfig_Script(params), - VERBOSE.fetchFrom(params), - DROP_IN_RESOURCES_ROOT.fetchFrom(params)); - - return true; - } - - // name of post-image script - private File getConfig_Script(Map params) { - return new File(CONFIG_ROOT.fetchFrom(params), - APP_NAME.fetchFrom(params) + "-post-image.sh"); - } - - private File createPKG(Map params, - File outdir, File appLocation) { - // generic find attempt - try { - File appPKG = getPackages_AppPackage(params); - - // build application package - ProcessBuilder pb = new ProcessBuilder("pkgbuild", - "--component", - appLocation.toString(), - "--install-location", - MAC_INSTALL_DIR.fetchFrom(params), - appPKG.getAbsolutePath()); - IOUtils.exec(pb, false); - - // build final package - File finalPKG = new File(outdir, INSTALLER_NAME.fetchFrom(params) - + INSTALLER_SUFFIX.fetchFrom(params) - + ".pkg"); - outdir.mkdirs(); - - List commandLine = new ArrayList<>(); - commandLine.add("productbuild"); - - commandLine.add("--resources"); - commandLine.add(CONFIG_ROOT.fetchFrom(params).getAbsolutePath()); - - // maybe sign - if (Optional.ofNullable(MacAppImageBuilder. - SIGN_BUNDLE.fetchFrom(params)).orElse(Boolean.TRUE)) { - if (Platform.getMajorVersion() > 10 || - (Platform.getMajorVersion() == 10 && - Platform.getMinorVersion() >= 12)) { - // we need this for OS X 10.12+ - Log.verbose(I18N.getString("message.signing.pkg")); - } - - String signingIdentity = - DEVELOPER_ID_INSTALLER_SIGNING_KEY.fetchFrom(params); - if (signingIdentity != null) { - commandLine.add("--sign"); - commandLine.add(signingIdentity); - } - - String keychainName = SIGNING_KEYCHAIN.fetchFrom(params); - if (keychainName != null && !keychainName.isEmpty()) { - commandLine.add("--keychain"); - commandLine.add(keychainName); - } - } - - commandLine.add("--distribution"); - commandLine.add( - getConfig_DistributionXMLFile(params).getAbsolutePath()); - commandLine.add("--package-path"); - commandLine.add(PACKAGES_ROOT.fetchFrom(params).getAbsolutePath()); - - commandLine.add(finalPKG.getAbsolutePath()); - - pb = new ProcessBuilder(commandLine); - IOUtils.exec(pb, false); - - return finalPKG; - } catch (Exception ignored) { - Log.verbose(ignored); - return null; - } finally { - cleanupPackagesFiles(params); - cleanupConfigFiles(params); - } - } - - ////////////////////////////////////////////////////////////////////////// - // Implement Bundler - ////////////////////////////////////////////////////////////////////////// - - @Override - public String getName() { - return I18N.getString("bundler.name"); - } - - @Override - public String getDescription() { - return I18N.getString("bundler.description"); - } - - @Override - public String getID() { - return "pkg"; - } - - @Override - public Collection> getBundleParameters() { - Collection> results = new LinkedHashSet<>(); - results.addAll(MacAppBundler.getAppBundleParameters()); - results.addAll(getPKGBundleParameters()); - return results; - } - - public Collection> getPKGBundleParameters() { - Collection> results = new LinkedHashSet<>(); - - results.addAll(MacAppBundler.getAppBundleParameters()); - results.addAll(Arrays.asList( - DEVELOPER_ID_INSTALLER_SIGNING_KEY, - // IDENTIFIER, - INSTALLER_SUFFIX, - LICENSE_FILE, - // SERVICE_HINT, - SIGNING_KEYCHAIN)); - - return results; - } - - @Override - public boolean validate(Map params) - throws UnsupportedPlatformException, ConfigException { - try { - 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 - validateAppImageAndBundeler(params); - - // validate license file, if used, exists in the proper place - if (params.containsKey(LICENSE_FILE.getID())) { - List appResourcesList = - APP_RESOURCES_LIST.fetchFrom(params); - for (String license : LICENSE_FILE.fetchFrom(params)) { - boolean found = false; - for (RelativeFileSet appResources : appResourcesList) { - found = found || appResources.contains(license); - } - if (!found) { - throw new ConfigException( - I18N.getString("error.license-missing"), - MessageFormat.format( - I18N.getString("error.license-missing.advice"), - license)); - } - } - } - - // reject explicitly set sign to true and no valid signature key - if (Optional.ofNullable(MacAppImageBuilder. - SIGN_BUNDLE.fetchFrom(params)).orElse(Boolean.FALSE)) { - String signingIdentity = - DEVELOPER_ID_INSTALLER_SIGNING_KEY.fetchFrom(params); - if (signingIdentity == null) { - throw new ConfigException( - I18N.getString("error.explicit-sign-no-cert"), - I18N.getString( - "error.explicit-sign-no-cert.advice")); - } - } - - // hdiutil is always available so there's no need - // to test for availability. - - return true; - } catch (RuntimeException re) { - if (re.getCause() instanceof ConfigException) { - throw (ConfigException) re.getCause(); - } else { - throw new ConfigException(re); - } - } - } - - @Override - public File execute( - Map params, File outputParentDir) { - return bundle(params, outputParentDir); - } - - @Override - public boolean supported() { - return Platform.getPlatform() == Platform.MAC; - } - -} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/DMGsetup.scpt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/DMGsetup.scpt Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,15 @@ +tell application "Finder" + tell disk "DEPLOY_ACTUAL_VOLUME_NAME" + open + set current view of container window to icon view + set toolbar visible of container window to false + set statusbar visible of container window to false + + set the bounds of container window to {400, 100, 917, 370} + + set theViewOptions to the icon view options of container window + set arrangement of theViewOptions to not arranged + set icon size of theViewOptions to 128 + end tell +end tell + diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/GenericApp.icns Binary file src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/GenericApp.icns has changed diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/GenericAppHiDPI.icns Binary file src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/GenericAppHiDPI.icns has changed diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/Info-lite.plist.template --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/Info-lite.plist.template Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,38 @@ + + + + + LSMinimumSystemVersion + 10.9 + CFBundleDevelopmentRegion + English + CFBundleAllowMixedLocalizations + + CFBundleExecutable + DEPLOY_LAUNCHER_NAME + CFBundleIconFile + DEPLOY_ICON_FILE + CFBundleIdentifier + DEPLOY_BUNDLE_IDENTIFIER + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + DEPLOY_BUNDLE_NAME + CFBundlePackageType + APPL + CFBundleShortVersionString + DEPLOY_BUNDLE_SHORT_VERSION + CFBundleSignature + ???? + + LSApplicationCategoryType + DEPLOY_BUNDLE_CATEGORY + CFBundleVersion + DEPLOY_BUNDLE_CFBUNDLE_VERSION + NSHumanReadableCopyright + DEPLOY_BUNDLE_COPYRIGHTDEPLOY_FILE_ASSOCIATIONS + NSHighResolutionCapable + true + + diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/Info.plist.template --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/Info.plist.template Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,56 @@ + + + + + LSMinimumSystemVersion + 10.7.4 + CFBundleDevelopmentRegion + English + CFBundleAllowMixedLocalizations + + CFBundleExecutable + DEPLOY_LAUNCHER_NAME + CFBundleIconFile + DEPLOY_ICON_FILE + CFBundleIdentifier + DEPLOY_BUNDLE_IDENTIFIER + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + DEPLOY_BUNDLE_NAME + CFBundlePackageType + APPL + CFBundleShortVersionString + DEPLOY_BUNDLE_SHORT_VERSION + CFBundleSignature + ???? + + LSApplicationCategoryType + DEPLOY_BUNDLE_CATEGORY + CFBundleVersion + DEPLOY_BUNDLE_CFBUNDLE_VERSION + NSHumanReadableCopyright + DEPLOY_BUNDLE_COPYRIGHT + JVMRuntime + DEPLOY_JAVA_RUNTIME_NAME + JVMMainClassName + DEPLOY_LAUNCHER_CLASS + JVMAppClasspath + DEPLOY_APP_CLASSPATH + JVMMainJarName + DEPLOY_MAIN_JAR_NAME + JVMPreferencesID + DEPLOY_PREFERENCES_ID + JVMOptions + +DEPLOY_JVM_OPTIONS + + ArgOptions + +DEPLOY_ARGUMENTS + DEPLOY_FILE_ASSOCIATIONS + NSHighResolutionCapable + true + + diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/MacAppBundler.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/MacAppBundler.properties Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,82 @@ +# +# Copyright (c) 2017, 2018, 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. +# +# + +bundler.name=Mac Application Image +bundler.description=A Directory based image of a mac Application with an optionally co-bundled JRE. Used as a base for the Installer bundlers + +param.signing-key-developer-id-app.name=Apple Developer ID Application Signing Key +param.signing-key-developer-id-app.description=The full name of the Apple Developer ID Application signing key. + +param.icon-icns.name=.icns Icon +param.icon-icns.description=Icon for the application, in ICNS format. + +param.config-root.name=Config Root Dir +param.config-root.description=Configuration directory. + +param.configure-launcher-in-plist=Configure Launcher in Info.plist +param.configure-launcher-in-plist.description=Should the legacy method of configuring hte launcher in the Info.plist be used. + +param.category-name=Category +param.category-name.description=Mac App Store Categories. Note that the key is the string to display to the user and the value is the id of the category. + +param.cfbundle-name.name=CFBundleName +param.cfbundle-name.description=The name of the app as it appears in the Menu Bar. This can be different from the application name. This name should be less than 16 characters long and be suitable for displaying in the menu bar and the app's Info window. + +param.cfbundle-identifier.name=CFBundleIdentifier +param.cfbundle-identifier.description=An identifier that uniquely identifies the application for MacOSX (and on the Mac App Store). May only use alphanumeric (A-Z,a-z,0-9), hyphen (-), and period (.) characters. + +param.cfbundle-version.name=CFBundleVersion +param.cfbundle-version.description=An computer readable version for the CFBundle. May contain only digits and from zero to two dots, such as "1.8.1" or "100". + +param.bundle-id-signing-prefix.name=Bundle Signing Prefix +param.bundle-id-signing-prefix.description=When signing the application bundle this value is prefixed to all components that need to be signed that don't have an existing CFBundleIdentifier. + +param.raw-executable-url.name=Launcher URL +param.raw-executable-url.description=Override the packager default launcher with a custom launcher. + +param.default-icon-icns=Default Icon +param.default-icon-icns.description=The Default Icon for when a user does not specify an icns file. + +error.invalid-cfbundle-version=Invalid CFBundleVersion - ''{0}'' +error.invalid-cfbundle-version.advice=Set a compatible 'appVersion' or set a 'mac.CFBundleVersion'. Valid versions are one to three integers separated by dots. +error.explicit-sign-no-cert=Signature explicitly requested but no signing certificate specified. +error.explicit-sign-no-cert.advice=Either specify a valid cert in 'mac.signing-key-developer-id-app' or unset 'signBundle' or set 'signBundle' to false. +error.non-existent-runtime=The file for the Runtime/JRE directory does not exist. +error.non-existent-runtime.advice=Point the runtime parameter to a directory that containes the JRE. +error.cannot-detect-runtime-in-directory=Cannot determine which JRE/JDK exists in the specified runtime directory. +error.cannot-detect-runtime-in-directory.advice=Point the runtime directory to one of the JDK/JRE root, the Contents/Home directory of that root, or the Contents/Home/jre directory of the JDK. +resource.bundle-config-file=Bundle config file + +message.bundle-name-too-long-warning={0} is set to ''{1}'', which is longer than 16 characters. For a better Mac experience consider shortening it. +message.no-mac-jre-support=Currently Macs require a JDK to package +message.null-classpath=Null app resources? +message.preparing-info-plist=Preparing Info.plist\: {0} +message.icon-not-icns= The specified icon "{0}" is not an ICNS file and will not be used. The default icon will be used in it's place. +message.version-string-too-many-components=Version sting may have between 1 and 3 numbers: 1, 1.2, 1.2.3. +message.version-string-first-number-not-zero=The first number in a CFBundleVersion cannot be zero or negative. +message.version-string-no-negative-numbers=Negative numbers are not allowed in version strings. +message.version-string-numbers-only=Version strings can consist of only numbers and up to two dots. +message.creating-association-with-null-extension=Creating association with null extension. diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/MacAppBundler_ja.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/MacAppBundler_ja.properties Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,56 @@ +bundler.name=Mac\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30A4\u30E1\u30FC\u30B8 +bundler.description=\u30AA\u30D7\u30B7\u30E7\u30F3\u3067JRE\u304C\u30D0\u30F3\u30C9\u30EB\u3055\u308C\u3066\u3044\u308BMac\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u30FB\u30D9\u30FC\u30B9\u306E\u30A4\u30E1\u30FC\u30B8\u3002\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9\u30FB\u30D0\u30F3\u30C9\u30EB\u306E\u30D9\u30FC\u30B9\u3068\u3057\u3066\u4F7F\u7528\u3055\u308C\u307E\u3059\u3002 + +param.signing-key-developer-id-app.name=Apple Developer ID\u306E\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u7F72\u540D\u30AD\u30FC +param.signing-key-developer-id-app.description=Apple Developer ID\u306E\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u7F72\u540D\u30AD\u30FC\u306E\u30D5\u30EB\u30FB\u30CD\u30FC\u30E0\u3002 + +param.icon-icns.name=.icns\u30A2\u30A4\u30B3\u30F3 +param.icon-icns.description=ICNS\u5F62\u5F0F\u3067\u306E\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u30A2\u30A4\u30B3\u30F3\u3002 + +param.config-root.name=Config Root Dir +param.config-root.description=Configuration directory. + +param.configure-launcher-in-plist=Info.plist\u3067\u306E\u30E9\u30F3\u30C1\u30E3\u306E\u69CB\u6210 +param.configure-launcher-in-plist.description=Info.plist\u3067\u306E\u30E9\u30F3\u30C1\u30E3\u306E\u69CB\u6210\u306B\u306F\u30EC\u30AC\u30B7\u30FC\u30FB\u30E1\u30BD\u30C3\u30C9\u3092\u4F7F\u7528\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + +param.category-name=\u30AB\u30C6\u30B4\u30EA +param.category-name.description=Mac App Store\u306E\u30AB\u30C6\u30B4\u30EA\u3002\u30AD\u30FC\u306F\u30E6\u30FC\u30B6\u30FC\u306B\u8868\u793A\u3055\u308C\u308B\u6587\u5B57\u5217\u3067\u3001\u5024\u306F\u30AB\u30C6\u30B4\u30EA\u306EID\u3067\u3059\u3002 + +param.cfbundle-name.name=CFBundleName +param.cfbundle-name.description=\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u304C\u30E1\u30CB\u30E5\u30FC\u30FB\u30D0\u30FC\u306B\u8868\u793A\u3055\u308C\u308B\u969B\u306E\u540D\u524D\u3002\u3053\u308C\u306F\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u540D\u3068\u306F\u7570\u306A\u308B\u5834\u5408\u304C\u3042\u308A\u307E\u3059\u3002\u3053\u306E\u540D\u524D\u306F16\u6587\u5B57\u672A\u6E80\u3068\u3057\u3001\u30E1\u30CB\u30E5\u30FC\u30FB\u30D0\u30FC\u3068\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u60C5\u5831\u30A6\u30A3\u30F3\u30C9\u30A6\u3067\u306E\u8868\u793A\u306B\u9069\u3057\u305F\u3082\u306E\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + +param.cfbundle-identifier.name=CFBundleIdentifier +param.cfbundle-identifier.description=MacOSX(\u304A\u3088\u3073Mac App Store)\u306E\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u3092\u4E00\u610F\u306B\u8B58\u5225\u3059\u308B\u8B58\u5225\u5B50\u3002\u82F1\u6570\u5B57(A-Z\u3001a-z\u30010-9)\u3001\u30CF\u30A4\u30D5\u30F3(-)\u304A\u3088\u3073\u30D4\u30EA\u30AA\u30C9(.)\u306E\u307F\u3092\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002 + +param.cfbundle-version.name=CFBundleVersion +param.cfbundle-version.description=\u30B3\u30F3\u30D4\u30E5\u30FC\u30BF\u3067\u8AAD\u53D6\u308A\u53EF\u80FD\u306ACFBundle\u306E\u30D0\u30FC\u30B8\u30E7\u30F3\u3002\u6570\u5B57\u304A\u3088\u3073\u30BC\u30ED\u304B\u30892\u3064\u307E\u3067\u306E\u30C9\u30C3\u30C8\u306E\u307F\u3092\u542B\u3081\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059("1.8.1"\u3001"100"\u306A\u3069)\u3002 + +param.bundle-id-signing-prefix.name=\u30D0\u30F3\u30C9\u30EB\u7F72\u540D\u63A5\u982D\u8F9E +param.bundle-id-signing-prefix.description=\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30D0\u30F3\u30C9\u30EB\u306B\u7F72\u540D\u3059\u308B\u969B\u3001\u7F72\u540D\u3059\u308B\u5FC5\u8981\u306E\u3042\u308B\u3001\u65E2\u5B58\u306ECFBundleIdentifier\u3092\u6301\u305F\u306A\u3044\u3059\u3079\u3066\u306E\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306B\u3053\u306E\u5024\u304C\u63A5\u982D\u8F9E\u3068\u3057\u3066\u4ED8\u3051\u3089\u308C\u307E\u3059\u3002 + +param.raw-executable-url.name=\u30E9\u30F3\u30C1\u30E3URL +param.raw-executable-url.description=\u30D1\u30C3\u30B1\u30FC\u30B8\u30E3\u306E\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30E9\u30F3\u30C1\u30E3\u3092\u30AB\u30B9\u30BF\u30E0\u30FB\u30E9\u30F3\u30C1\u30E3\u3067\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3057\u307E\u3059\u3002 + +param.default-icon-icns=\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30A2\u30A4\u30B3\u30F3 +param.default-icon-icns.description=\u30E6\u30FC\u30B6\u30FC\u304C\u30A2\u30A4\u30B3\u30F3\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u6307\u5B9A\u3057\u306A\u3044\u5834\u5408\u306E\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30A2\u30A4\u30B3\u30F3\u3002 + +error.invalid-cfbundle-version=CFBundleVersion - ''{0}''\u304C\u7121\u52B9\u3067\u3059 +error.invalid-cfbundle-version.advice=\u4E92\u63DB\u6027\u306E\u3042\u308B'appVersion'\u3092\u8A2D\u5B9A\u3059\u308B\u304B\u3001'mac.CFBundleVersion'\u3092\u8A2D\u5B9A\u3057\u307E\u3059\u3002\u6709\u52B9\u306A\u30D0\u30FC\u30B8\u30E7\u30F3\u306F\u3001\u30C9\u30C3\u30C8\u3067\u533A\u5207\u3089\u308C\u305F1\u304B\u30893\u3064\u306E\u6574\u6570\u3067\u3059\u3002 +error.explicit-sign-no-cert=\u7F72\u540D\u304C\u660E\u793A\u7684\u306B\u8981\u6C42\u3055\u308C\u307E\u3057\u305F\u304C\u3001\u7F72\u540D\u8A3C\u660E\u66F8\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002 +error.explicit-sign-no-cert.advice=\u6709\u52B9\u306A\u8A3C\u660E\u66F8\u3092'mac.signing-key-developer-id-app'\u3067\u6307\u5B9A\u3059\u308B\u304B\u3001'signBundle'\u3092\u8A2D\u5B9A\u89E3\u9664\u3059\u308B\u304B\u3001\u307E\u305F\u306F'signBundle'\u3092false\u306B\u8A2D\u5B9A\u3057\u307E\u3059\u3002 +error.non-existent-runtime=\u30E9\u30F3\u30BF\u30A4\u30E0/JRE\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306B\u30D5\u30A1\u30A4\u30EB\u304C\u5B58\u5728\u3057\u307E\u305B\u3093\u3002 +error.non-existent-runtime.advice=\u30E9\u30F3\u30BF\u30A4\u30E0\u30FB\u30D1\u30E9\u30E1\u30FC\u30BF\u306B\u3001JRE\u3092\u542B\u3080\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u6307\u5B9A\u3057\u307E\u3059\u3002 +error.cannot-detect-runtime-in-directory=\u6307\u5B9A\u3057\u305F\u30E9\u30F3\u30BF\u30A4\u30E0\u30FB\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306B\u3069\u306EJRE/JDK\u304C\u5B58\u5728\u3059\u308B\u306E\u304B\u3092\u7279\u5B9A\u3067\u304D\u307E\u305B\u3093\u3002 +error.cannot-detect-runtime-in-directory.advice=\u30E9\u30A4\u30BF\u30A4\u30E0\u30FB\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306B\u3001JDK/JRE\u30EB\u30FC\u30C8\u3001\u305D\u306E\u30EB\u30FC\u30C8\u306E\u30B3\u30F3\u30C6\u30F3\u30C4/\u30DB\u30FC\u30E0\u30FB\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3001\u307E\u305F\u306FJDK\u306E\u30B3\u30F3\u30C6\u30F3\u30C4/\u30DB\u30FC\u30E0/jre\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u3044\u305A\u308C\u304B\u3092\u6307\u5B9A\u3057\u307E\u3059\u3002 +resource.bundle-config-file=\u30D0\u30F3\u30C9\u30EB\u69CB\u6210\u30D5\u30A1\u30A4\u30EB + +message.bundle-name-too-long-warning={0}\u304C16\u6587\u5B57\u3092\u8D85\u3048\u308B''{1}''\u306B\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002Mac\u3067\u306E\u64CD\u4F5C\u6027\u3092\u3088\u308A\u826F\u304F\u3059\u308B\u305F\u3081\u306B\u77ED\u304F\u3059\u308B\u3053\u3068\u3092\u691C\u8A0E\u3057\u3066\u304F\u3060\u3055\u3044\u3002 +message.no-mac-jre-support=\u73FE\u5728\u3001Mac\u3067\u306FJDK\u3092\u30D1\u30C3\u30B1\u30FC\u30B8\u5316\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059 +message.null-classpath=Null\u306E\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30EA\u30BD\u30FC\u30B9\u3067\u3059\u304B\u3002 +message.preparing-info-plist=Info.plist\u3092\u6E96\u5099\u3057\u3066\u3044\u307E\u3059: {0} +message.icon-not-icns= \u6307\u5B9A\u3057\u305F\u30A2\u30A4\u30B3\u30F3"{0}"\u306FICNS\u30D5\u30A1\u30A4\u30EB\u3067\u306F\u306A\u304F\u3001\u4F7F\u7528\u3055\u308C\u307E\u305B\u3093\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30A2\u30A4\u30B3\u30F3\u304C\u305D\u306E\u4F4D\u7F6E\u306B\u4F7F\u7528\u3055\u308C\u307E\u3059\u3002 +message.version-string-too-many-components=\u30D0\u30FC\u30B8\u30E7\u30F3\u6587\u5B57\u5217\u306B\u306F\u30011\u30011.2\u30011.2.3\u306A\u30691\u304B\u30893\u306E\u6570\u5B57\u3092\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002 +message.version-string-first-number-not-zero=CFBundleVersion\u306E\u6700\u521D\u306E\u6570\u5B57\u306F\u3001\u30BC\u30ED\u307E\u305F\u306F\u8CA0\u306E\u5024\u306B\u3067\u304D\u307E\u305B\u3093\u3002 +message.version-string-no-negative-numbers=\u30D0\u30FC\u30B8\u30E7\u30F3\u6587\u5B57\u5217\u306B\u8CA0\u306E\u6570\u306F\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093\u3002 +message.version-string-numbers-only=\u30D0\u30FC\u30B8\u30E7\u30F3\u6587\u5B57\u5217\u306F\u3001\u6570\u5B57\u30682\u3064\u307E\u3067\u306E\u30C9\u30C3\u30C8\u3067\u306E\u307F\u69CB\u6210\u3067\u304D\u307E\u3059\u3002 +message.creating-association-with-null-extension=null\u62E1\u5F35\u5B50\u3068\u306E\u95A2\u9023\u4ED8\u3051\u3092\u4F5C\u6210\u3057\u3066\u3044\u307E\u3059\u3002 diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/MacAppBundler_zh_CN.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/MacAppBundler_zh_CN.properties Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,82 @@ +# +# Copyright (c) 2017, 2018, 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. +# +# + +bundler.name=Mac \u5E94\u7528\u7A0B\u5E8F\u6620\u50CF +bundler.description=\u4E00\u4E2A\u57FA\u4E8E\u76EE\u5F55\u7684 mac \u5E94\u7528\u7A0B\u5E8F\u6620\u50CF, \u53EF\u4EE5\u9009\u62E9\u6027\u5730\u5E26\u6709\u5171\u540C\u6253\u5305\u7684 JRE\u3002\u7528\u4F5C\u5B89\u88C5\u7A0B\u5E8F\u6253\u5305\u7A0B\u5E8F\u7684\u57FA\u7840 + +param.signing-key-developer-id-app.name=Apple \u5F00\u53D1\u8005 ID \u5E94\u7528\u7A0B\u5E8F\u7B7E\u540D\u5BC6\u94A5 +param.signing-key-developer-id-app.description=Apple \u5F00\u53D1\u8005 ID \u5E94\u7528\u7A0B\u5E8F\u7B7E\u540D\u5BC6\u94A5\u7684\u5168\u540D\u3002 + +param.icon-icns.name=.icns \u56FE\u6807 +param.icon-icns.description=\u5E94\u7528\u7A0B\u5E8F\u7684\u56FE\u6807, \u91C7\u7528 ICNS \u683C\u5F0F\u3002 + +param.config-root.name=Config Root Dir +param.config-root.description=Configuration directory. + +param.configure-launcher-in-plist=\u5728 Info.plist \u4E2D\u914D\u7F6E\u542F\u52A8\u7A0B\u5E8F +param.configure-launcher-in-plist.description=\u662F\u5426\u5E94\u4F7F\u7528\u5728 Info.plist \u4E2D\u914D\u7F6E\u542F\u52A8\u7A0B\u5E8F\u7684\u65E7\u65B9\u6CD5\u3002 + +param.category-name=\u7C7B\u522B +param.category-name.description=Mac App Store \u7C7B\u522B\u3002\u8BF7\u6CE8\u610F, \u952E\u662F\u5411\u7528\u6237\u663E\u793A\u7684\u5B57\u7B26\u4E32, \u503C\u662F\u7C7B\u522B\u7684 ID\u3002 + +param.cfbundle-name.name=CFBundleName +param.cfbundle-name.description=\u5E94\u7528\u7A0B\u5E8F\u5728\u83DC\u5355\u680F\u4E2D\u7684\u663E\u793A\u540D\u79F0\u3002\u53EF\u4EE5\u4E0E\u5E94\u7528\u7A0B\u5E8F\u540D\u79F0\u4E0D\u540C\u3002\u6B64\u540D\u79F0\u7684\u957F\u5EA6\u5E94\u5C11\u4E8E 16 \u4E2A\u5B57\u7B26, \u5E76\u4E14\u5E94\u9002\u5408\u5728\u83DC\u5355\u680F\u548C\u5E94\u7528\u7A0B\u5E8F\u7684\u201C\u4FE1\u606F\u201D\u7A97\u53E3\u4E2D\u663E\u793A\u3002 + +param.cfbundle-identifier.name=CFBundleIdentifier +param.cfbundle-identifier.description=\u552F\u4E00\u6807\u8BC6 MacOSX \u5E94\u7528\u7A0B\u5E8F (\u5728 Mac App Store \u4E0A) \u7684\u6807\u8BC6\u7B26\u3002\u53EA\u80FD\u4F7F\u7528\u5B57\u6BCD\u6570\u5B57 (A-Z,a-z,0-9), \u8FDE\u5B57\u7B26 (-) \u548C\u53E5\u70B9 (.) \u5B57\u7B26\u3002 + +param.cfbundle-version.name=CFBundleVersion +param.cfbundle-version.description=CFBundle \u7684\u8BA1\u7B97\u673A\u53EF\u8BFB\u7248\u672C\u3002\u53EA\u80FD\u5305\u542B\u6570\u5B57\u4EE5\u53CA\u96F6\u5230\u4E24\u4E2A\u70B9, \u4F8B\u5982 "1.8.1" \u6216 "100"\u3002 + +param.bundle-id-signing-prefix.name=\u5305\u7B7E\u540D\u524D\u7F00 +param.bundle-id-signing-prefix.description=\u5BF9\u5E94\u7528\u7A0B\u5E8F\u5305\u8FDB\u884C\u7B7E\u540D\u65F6, \u6B64\u503C\u5C06\u4F5C\u4E3A\u524D\u7F00\u6DFB\u52A0\u5230\u9700\u8981\u7B7E\u540D\u4F46\u4E0D\u5177\u6709\u73B0\u6709 CFBundleIdentifier \u7684\u6240\u6709\u7EC4\u4EF6\u4E2D\u3002 + +param.raw-executable-url.name=\u542F\u52A8\u7A0B\u5E8F URL +param.raw-executable-url.description=\u4F7F\u7528\u5B9A\u5236\u542F\u52A8\u7A0B\u5E8F\u8986\u76D6\u6253\u5305\u7A0B\u5E8F\u9ED8\u8BA4\u542F\u52A8\u7A0B\u5E8F\u3002 + +param.default-icon-icns=\u9ED8\u8BA4\u56FE\u6807 +param.default-icon-icns.description=\u7528\u6237\u672A\u6307\u5B9A icns \u6587\u4EF6\u65F6\u4F7F\u7528\u7684\u9ED8\u8BA4\u56FE\u6807\u3002 + +error.invalid-cfbundle-version=\u65E0\u6548\u7684 CFBundleVersion - ''{0}'' +error.invalid-cfbundle-version.advice=\u8BBE\u7F6E\u517C\u5BB9\u7684 'appVersion' \u6216\u8005\u8BBE\u7F6E 'mac.CFBundleVersion'\u3002\u6709\u6548\u7248\u672C\u5305\u542B\u4E00\u5230\u4E09\u4E2A\u7528\u70B9\u5206\u9694\u7684\u6574\u6570\u3002 +error.explicit-sign-no-cert=\u5DF2\u660E\u786E\u8BF7\u6C42\u7B7E\u540D, \u4F46\u672A\u6307\u5B9A\u7B7E\u540D\u8BC1\u4E66\u3002 +error.explicit-sign-no-cert.advice=\u5728 'mac.signing-key-developer-id-app' \u4E2D\u6307\u5B9A\u6709\u6548\u7684\u8BC1\u4E66, \u6216\u8005\u53D6\u6D88\u8BBE\u7F6E 'signBundle', \u6216\u8005\u5C06 'signBundle' \u8BBE\u7F6E\u4E3A\u201C\u5047\u201D\u3002 +error.non-existent-runtime=\u8FD0\u884C\u65F6/JRE \u76EE\u5F55\u7684\u6587\u4EF6\u4E0D\u5B58\u5728\u3002 +error.non-existent-runtime.advice=\u5C06\u8FD0\u884C\u65F6\u53C2\u6570\u6307\u5411\u5305\u542B JRE \u7684\u76EE\u5F55\u3002 +error.cannot-detect-runtime-in-directory=\u65E0\u6CD5\u786E\u5B9A\u6307\u5B9A\u7684\u8FD0\u884C\u65F6\u76EE\u5F55\u4E2D\u5B58\u5728\u54EA\u4E2A\u7248\u672C\u7684 JRE/JDK\u3002 +error.cannot-detect-runtime-in-directory.advice=\u5C06\u8FD0\u884C\u65F6\u76EE\u5F55\u6307\u5411\u4EE5\u4E0B\u76EE\u5F55\u4E4B\u4E00: JDK/JRE \u6839\u76EE\u5F55, \u8BE5\u6839\u76EE\u5F55\u7684 Contents/Home \u76EE\u5F55\u6216 JDK \u7684 Contents/Home/jre \u76EE\u5F55\u3002 +resource.bundle-config-file=\u5305\u914D\u7F6E\u6587\u4EF6 + +message.bundle-name-too-long-warning={0}\u5DF2\u8BBE\u7F6E\u4E3A ''{1}'', \u5176\u957F\u5EA6\u8D85\u8FC7\u4E86 16 \u4E2A\u5B57\u7B26\u3002\u4E3A\u4E86\u83B7\u5F97\u66F4\u597D\u7684 Mac \u4F53\u9A8C, \u8BF7\u8003\u8651\u5C06\u5176\u7F29\u77ED\u3002 +message.no-mac-jre-support=Mac \u5F53\u524D\u9700\u8981 JDK \u4EE5\u4FBF\u6253\u5305 +message.null-classpath=\u662F\u5426\u4E3A\u7A7A\u5E94\u7528\u7A0B\u5E8F\u8D44\u6E90? +message.preparing-info-plist=\u6B63\u5728\u51C6\u5907 Info.plist: {0} +message.icon-not-icns= \u6307\u5B9A\u7684\u56FE\u6807 "{0}" \u4E0D\u662F ICNS \u6587\u4EF6, \u4E0D\u4F1A\u4F7F\u7528\u3002\u5C06\u4F7F\u7528\u9ED8\u8BA4\u56FE\u6807\u4EE3\u66FF\u3002 +message.version-string-too-many-components=\u7248\u672C\u5B57\u7B26\u4E32\u53EF\u4EE5\u5305\u542B 1 \u5230 3 \u4E2A\u6570\u5B57: 1, 1.2, 1.2.3\u3002 +message.version-string-first-number-not-zero=CFBundleVersion \u4E2D\u7684\u7B2C\u4E00\u4E2A\u6570\u5B57\u4E0D\u80FD\u4E3A\u96F6\u6216\u8D1F\u6570\u3002 +message.version-string-no-negative-numbers=\u7248\u672C\u5B57\u7B26\u4E32\u4E2D\u4E0D\u5141\u8BB8\u4F7F\u7528\u8D1F\u6570\u3002 +message.version-string-numbers-only=\u7248\u672C\u5B57\u7B26\u4E32\u53EA\u80FD\u5305\u542B\u6570\u5B57\u548C\u6700\u591A\u4E24\u4E2A\u70B9\u3002 +message.creating-association-with-null-extension=\u6B63\u5728\u4F7F\u7528\u7A7A\u6269\u5C55\u540D\u521B\u5EFA\u5173\u8054\u3002 diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/MacAppImageBuilder.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/MacAppImageBuilder.properties Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,74 @@ +# +# Copyright (c) 2017, 2018, 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. +# +# + +bundler.name=Mac Application Image +bundler.description=A Directory based image of a mac Application with an optionally co-bundled JRE. Used as a base for the Installer bundlers + +param.icon-icns.name=.icns Icon +param.icon-icns.description= Icon for the application, in ICNS format. + +param.config-root.name=Configuration Root Name +param.config-root.description=The root directory of COnfiguration files. + +param.configure-launcher-in-plist=Configure Launcher in Info.plist +param.configure-launcher-in-plist.description=Should the legacy method of configuring hte launcher in the Info.plist be used. + +param.category-name=Category +param.category-name.description=Mac App Store Categories. Note that the key is the string to display to the user and the value is the id of the category. + +param.cfbundle-name.name=CFBundleName +param.cfbundle-name.description=The name of the app as it appears in the Menu Bar. This can be different from the application name. This name should be less than 16 characters long and be suitable for displaying in the menu bar and the app's Info window. + +param.cfbundle-identifier.name=CFBundleIdentifier +param.cfbundle-identifier.description=An identifier that uniquely identifies the application for MacOSX (and on the Mac App Store). May only use alphanumeric (A-Z,a-z,0-9), hyphen (-), and period (.) characters. + +param.cfbundle-version.name=CFBundleVersion +param.cfbundle-version.description=An computer readable version for the CFBundle. May contain only digits and from zero to two dots, such as "1.8.1" or "100". + +param.bundle-id-signing-prefix.name=Bundle Signing Prefix +param.bundle-id-signing-prefix.description=When signing the application bundle this value is prefixed to all components that need to be signed that don't have an existing CFBundleIdentifier. + +param.default-icon-icns=Default Icon +param.default-icon-icns.description=The Default Icon for when a user does not specify an icns file. + +param.sign-bundle.name=Sign Bundle +param.sign-bundle.description=Request that the bundle be signed. + +resource.app-info-plist=Application Info.plist +resource.runtime-info-plist=Java Runtime Info.plist + +message.bundle-name-too-long-warning={0} is set to ''{1}'', which is longer than 16 characters. For a better Mac experience consider shortening it. +message.null-classpath=Null app resources? +message.preparing-info-plist=Preparing Info.plist\: {0} +message.icon-not-icns= The specified icon "{0}" is not an ICNS file and will not be used. The default icon will be used in it's place. +message.version-string-too-many-components=Version sting may have between 1 and 3 numbers: 1, 1.2, 1.2.3. +message.version-string-first-number-not-zero=The first number in a CFBundleVersion cannot be zero or negative. +message.version-string-no-negative-numbers=Negative numbers are not allowed in version strings. +message.version-string-numbers-only=Version strings can consist of only numbers and up to two dots. +message.creating-association-with-null-extension=Creating association with null extension. + +message.ignoring.symlink=Warning: codesign is skipping the symlink {0} +message.keychain.error=Error: unable to get keychain list. diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/MacAppImageBuilder_ja.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/MacAppImageBuilder_ja.properties Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,71 @@ +# +# Copyright (c) 2017, 2018, 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. +# +# + +bundler.name=Mac\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30A4\u30E1\u30FC\u30B8 +bundler.description=\u30AA\u30D7\u30B7\u30E7\u30F3\u3067JRE\u304C\u30D0\u30F3\u30C9\u30EB\u3055\u308C\u3066\u3044\u308BMac\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u30FB\u30D9\u30FC\u30B9\u306E\u30A4\u30E1\u30FC\u30B8\u3002\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9\u30FB\u30D0\u30F3\u30C9\u30EB\u306E\u30D9\u30FC\u30B9\u3068\u3057\u3066\u4F7F\u7528\u3055\u308C\u307E\u3059\u3002 + +param.icon-icns.name=.icns\u30A2\u30A4\u30B3\u30F3 +param.icon-icns.description= ICNS\u5F62\u5F0F\u3067\u306E\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u30A2\u30A4\u30B3\u30F3\u3002 + +param.config-root.name=Configuration Root Name +param.config-root.description=The root directory of COnfiguration files. + +param.configure-launcher-in-plist=Info.plist\u3067\u306E\u30E9\u30F3\u30C1\u30E3\u306E\u69CB\u6210 +param.configure-launcher-in-plist.description=Info.plist\u3067\u306E\u30E9\u30F3\u30C1\u30E3\u306E\u69CB\u6210\u306B\u306F\u30EC\u30AC\u30B7\u30FC\u30FB\u30E1\u30BD\u30C3\u30C9\u3092\u4F7F\u7528\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + +param.category-name=\u30AB\u30C6\u30B4\u30EA +param.category-name.description=Mac App Store\u306E\u30AB\u30C6\u30B4\u30EA\u3002\u30AD\u30FC\u306F\u30E6\u30FC\u30B6\u30FC\u306B\u8868\u793A\u3055\u308C\u308B\u6587\u5B57\u5217\u3067\u3001\u5024\u306F\u30AB\u30C6\u30B4\u30EA\u306EID\u3067\u3059\u3002 + +param.cfbundle-name.name=CFBundleName +param.cfbundle-name.description=\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u304C\u30E1\u30CB\u30E5\u30FC\u30FB\u30D0\u30FC\u306B\u8868\u793A\u3055\u308C\u308B\u969B\u306E\u540D\u524D\u3002\u3053\u308C\u306F\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u540D\u3068\u306F\u7570\u306A\u308B\u5834\u5408\u304C\u3042\u308A\u307E\u3059\u3002\u3053\u306E\u540D\u524D\u306F16\u6587\u5B57\u672A\u6E80\u3068\u3057\u3001\u30E1\u30CB\u30E5\u30FC\u30FB\u30D0\u30FC\u3068\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u60C5\u5831\u30A6\u30A3\u30F3\u30C9\u30A6\u3067\u306E\u8868\u793A\u306B\u9069\u3057\u305F\u3082\u306E\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + +param.cfbundle-identifier.name=CFBundleIdentifier +param.cfbundle-identifier.description=MacOSX(\u304A\u3088\u3073Mac App Store)\u306E\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u3092\u4E00\u610F\u306B\u8B58\u5225\u3059\u308B\u8B58\u5225\u5B50\u3002\u82F1\u6570\u5B57(A-Z\u3001a-z\u30010-9)\u3001\u30CF\u30A4\u30D5\u30F3(-)\u304A\u3088\u3073\u30D4\u30EA\u30AA\u30C9(.)\u306E\u307F\u3092\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002 + +param.cfbundle-version.name=CFBundleVersion +param.cfbundle-version.description=\u30B3\u30F3\u30D4\u30E5\u30FC\u30BF\u3067\u8AAD\u53D6\u308A\u53EF\u80FD\u306ACFBundle\u306E\u30D0\u30FC\u30B8\u30E7\u30F3\u3002\u6570\u5B57\u304A\u3088\u3073\u30BC\u30ED\u304B\u30892\u3064\u307E\u3067\u306E\u30C9\u30C3\u30C8\u306E\u307F\u3092\u542B\u3081\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059("1.8.1"\u3001"100"\u306A\u3069)\u3002 + +param.bundle-id-signing-prefix.name=\u30D0\u30F3\u30C9\u30EB\u7F72\u540D\u63A5\u982D\u8F9E +param.bundle-id-signing-prefix.description=\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30D0\u30F3\u30C9\u30EB\u306B\u7F72\u540D\u3059\u308B\u969B\u3001\u7F72\u540D\u3059\u308B\u5FC5\u8981\u306E\u3042\u308B\u3001\u65E2\u5B58\u306ECFBundleIdentifier\u3092\u6301\u305F\u306A\u3044\u3059\u3079\u3066\u306E\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306B\u3053\u306E\u5024\u304C\u63A5\u982D\u8F9E\u3068\u3057\u3066\u4ED8\u3051\u3089\u308C\u307E\u3059\u3002 + +param.default-icon-icns=\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30A2\u30A4\u30B3\u30F3 +param.default-icon-icns.description=\u30E6\u30FC\u30B6\u30FC\u304C\u30A2\u30A4\u30B3\u30F3\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u6307\u5B9A\u3057\u306A\u3044\u5834\u5408\u306E\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30A2\u30A4\u30B3\u30F3\u3002 + +resource.app-info-plist=\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306EInfo.plist +resource.runtime-info-plist=Java\u30E9\u30F3\u30BF\u30A4\u30E0\u306EInfo.plist + +message.bundle-name-too-long-warning={0}\u304C16\u6587\u5B57\u3092\u8D85\u3048\u308B''{1}''\u306B\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002Mac\u3067\u306E\u64CD\u4F5C\u6027\u3092\u3088\u308A\u826F\u304F\u3059\u308B\u305F\u3081\u306B\u77ED\u304F\u3059\u308B\u3053\u3068\u3092\u691C\u8A0E\u3057\u3066\u304F\u3060\u3055\u3044\u3002 +message.null-classpath=Null\u306E\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30EA\u30BD\u30FC\u30B9\u3067\u3059\u304B\u3002 +message.preparing-info-plist=Info.plist\u3092\u6E96\u5099\u3057\u3066\u3044\u307E\u3059: {0} +message.icon-not-icns= \u6307\u5B9A\u3057\u305F\u30A2\u30A4\u30B3\u30F3"{0}"\u306FICNS\u30D5\u30A1\u30A4\u30EB\u3067\u306F\u306A\u304F\u3001\u4F7F\u7528\u3055\u308C\u307E\u305B\u3093\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30A2\u30A4\u30B3\u30F3\u304C\u305D\u306E\u4F4D\u7F6E\u306B\u4F7F\u7528\u3055\u308C\u307E\u3059\u3002 +message.version-string-too-many-components=\u30D0\u30FC\u30B8\u30E7\u30F3\u6587\u5B57\u5217\u306B\u306F\u30011\u30011.2\u30011.2.3\u306A\u30691\u304B\u30893\u306E\u6570\u5B57\u3092\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002 +message.version-string-first-number-not-zero=CFBundleVersion\u306E\u6700\u521D\u306E\u6570\u5B57\u306F\u3001\u30BC\u30ED\u307E\u305F\u306F\u8CA0\u306E\u5024\u306B\u3067\u304D\u307E\u305B\u3093\u3002 +message.version-string-no-negative-numbers=\u30D0\u30FC\u30B8\u30E7\u30F3\u6587\u5B57\u5217\u306B\u8CA0\u306E\u6570\u306F\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093\u3002 +message.version-string-numbers-only=\u30D0\u30FC\u30B8\u30E7\u30F3\u6587\u5B57\u5217\u306F\u3001\u6570\u5B57\u30682\u3064\u307E\u3067\u306E\u30C9\u30C3\u30C8\u3067\u306E\u307F\u69CB\u6210\u3067\u304D\u307E\u3059\u3002 +message.creating-association-with-null-extension=null\u62E1\u5F35\u5B50\u3068\u306E\u95A2\u9023\u4ED8\u3051\u3092\u4F5C\u6210\u3057\u3066\u3044\u307E\u3059\u3002 + +message.ignoring.symlink=\u8B66\u544A: codesign\u304Csymlink {0}\u3092\u30B9\u30AD\u30C3\u30D7\u3057\u3066\u3044\u307E\u3059 +message.keychain.error=Error: unable to get keychain list. diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/MacAppImageBuilder_zh_CN.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/MacAppImageBuilder_zh_CN.properties Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,72 @@ +# +# Copyright (c) 2017, 2018, 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. +# +# + +bundler.name=Mac \u5E94\u7528\u7A0B\u5E8F\u6620\u50CF +bundler.description=\u4E00\u4E2A\u57FA\u4E8E\u76EE\u5F55\u7684 mac \u5E94\u7528\u7A0B\u5E8F\u6620\u50CF, \u53EF\u4EE5\u9009\u62E9\u6027\u5730\u5E26\u6709\u5171\u540C\u6253\u5305\u7684 JRE\u3002\u7528\u4F5C\u5B89\u88C5\u7A0B\u5E8F\u6253\u5305\u7A0B\u5E8F\u7684\u57FA\u7840 + +param.icon-icns.name=.icns \u56FE\u6807 +param.icon-icns.description= \u5E94\u7528\u7A0B\u5E8F\u7684\u56FE\u6807, \u91C7\u7528 ICNS \u683C\u5F0F\u3002 + +param.config-root.name=Configuration Root Name +param.config-root.description=The root directory of Configuration files. + +param.configure-launcher-in-plist=\u5728 Info.plist \u4E2D\u914D\u7F6E\u542F\u52A8\u7A0B\u5E8F +param.configure-launcher-in-plist.description=\u662F\u5426\u5E94\u4F7F\u7528\u5728 Info.plist \u4E2D\u914D\u7F6E\u542F\u52A8\u7A0B\u5E8F\u7684\u65E7\u65B9\u6CD5\u3002 + +param.category-name=\u7C7B\u522B +param.category-name.description=Mac App Store \u7C7B\u522B\u3002\u8BF7\u6CE8\u610F, \u952E\u662F\u5411\u7528\u6237\u663E\u793A\u7684\u5B57\u7B26\u4E32, \u503C\u662F\u7C7B\u522B\u7684 ID\u3002 + +param.cfbundle-name.name=CFBundleName +param.cfbundle-name.description=\u5E94\u7528\u7A0B\u5E8F\u5728\u83DC\u5355\u680F\u4E2D\u7684\u663E\u793A\u540D\u79F0\u3002\u53EF\u4EE5\u4E0E\u5E94\u7528\u7A0B\u5E8F\u540D\u79F0\u4E0D\u540C\u3002\u6B64\u540D\u79F0\u7684\u957F\u5EA6\u5E94\u5C11\u4E8E 16 \u4E2A\u5B57\u7B26, \u5E76\u4E14\u5E94\u9002\u5408\u5728\u83DC\u5355\u680F\u548C\u5E94\u7528\u7A0B\u5E8F\u7684\u201C\u4FE1\u606F\u201D\u7A97\u53E3\u4E2D\u663E\u793A\u3002 + +param.cfbundle-identifier.name=CFBundleIdentifier +param.cfbundle-identifier.description=\u552F\u4E00\u6807\u8BC6 MacOSX \u5E94\u7528\u7A0B\u5E8F (\u5728 Mac App Store \u4E0A) \u7684\u6807\u8BC6\u7B26\u3002\u53EA\u80FD\u4F7F\u7528\u5B57\u6BCD\u6570\u5B57 (A-Z,a-z,0-9), \u8FDE\u5B57\u7B26 (-) \u548C\u53E5\u70B9 (.) \u5B57\u7B26\u3002 + +param.cfbundle-version.name=CFBundleVersion +param.cfbundle-version.description=CFBundle \u7684\u8BA1\u7B97\u673A\u53EF\u8BFB\u7248\u672C\u3002\u53EA\u80FD\u5305\u542B\u6570\u5B57\u4EE5\u53CA\u96F6\u5230\u4E24\u4E2A\u70B9, \u4F8B\u5982 "1.8.1" \u6216 "100"\u3002 + +param.bundle-id-signing-prefix.name=\u5305\u7B7E\u540D\u524D\u7F00 +param.bundle-id-signing-prefix.description=\u5BF9\u5E94\u7528\u7A0B\u5E8F\u5305\u8FDB\u884C\u7B7E\u540D\u65F6, \u6B64\u503C\u5C06\u4F5C\u4E3A\u524D\u7F00\u6DFB\u52A0\u5230\u9700\u8981\u7B7E\u540D\u4F46\u4E0D\u5177\u6709\u73B0\u6709 CFBundleIdentifier \u7684\u6240\u6709\u7EC4\u4EF6\u4E2D\u3002 + +param.default-icon-icns=\u9ED8\u8BA4\u56FE\u6807 +param.default-icon-icns.description=\u7528\u6237\u672A\u6307\u5B9A icns \u6587\u4EF6\u65F6\u4F7F\u7528\u7684\u9ED8\u8BA4\u56FE\u6807\u3002 + +resource.app-info-plist=\u5E94\u7528\u7A0B\u5E8F Info.plist +resource.runtime-info-plist=Java \u8FD0\u884C\u65F6 Info.plist + +message.bundle-name-too-long-warning={0}\u5DF2\u8BBE\u7F6E\u4E3A ''{1}'', \u5176\u957F\u5EA6\u8D85\u8FC7\u4E86 16 \u4E2A\u5B57\u7B26\u3002\u4E3A\u4E86\u83B7\u5F97\u66F4\u597D\u7684 Mac \u4F53\u9A8C, \u8BF7\u8003\u8651\u5C06\u5176\u7F29\u77ED\u3002 +message.null-classpath=\u662F\u5426\u4E3A\u7A7A\u5E94\u7528\u7A0B\u5E8F\u8D44\u6E90? +message.preparing-info-plist=\u6B63\u5728\u51C6\u5907 Info.plist: {0} +message.icon-not-icns= \u6307\u5B9A\u7684\u56FE\u6807 "{0}" \u4E0D\u662F ICNS \u6587\u4EF6, \u4E0D\u4F1A\u4F7F\u7528\u3002\u5C06\u4F7F\u7528\u9ED8\u8BA4\u56FE\u6807\u4EE3\u66FF\u3002 +message.version-string-too-many-components=\u7248\u672C\u5B57\u7B26\u4E32\u53EF\u4EE5\u5305\u542B 1 \u5230 3 \u4E2A\u6570\u5B57: 1, 1.2, 1.2.3\u3002 +message.version-string-first-number-not-zero=CFBundleVersion \u4E2D\u7684\u7B2C\u4E00\u4E2A\u6570\u5B57\u4E0D\u80FD\u4E3A\u96F6\u6216\u8D1F\u6570\u3002 +message.version-string-no-negative-numbers=\u7248\u672C\u5B57\u7B26\u4E32\u4E2D\u4E0D\u5141\u8BB8\u4F7F\u7528\u8D1F\u6570\u3002 +message.version-string-numbers-only=\u7248\u672C\u5B57\u7B26\u4E32\u53EA\u80FD\u5305\u542B\u6570\u5B57\u548C\u6700\u591A\u4E24\u4E2A\u70B9\u3002 +message.creating-association-with-null-extension=\u6B63\u5728\u4F7F\u7528\u7A7A\u6269\u5C55\u540D\u521B\u5EFA\u5173\u8054\u3002 + +message.ignoring.symlink=\u8B66\u544A: codesign \u6B63\u5728\u8DF3\u8FC7\u7B26\u53F7\u94FE\u63A5 {0} +message.keychain.error=Error: unable to get keychain list. + diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/MacAppStore.entitlements --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/MacAppStore.entitlements Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,8 @@ + + + + + com.apple.security.app-sandbox + + + diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/MacAppStoreBundler.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/MacAppStoreBundler.properties Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,61 @@ +# +# Copyright (c) 2017, 2018, 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. +# +# + +bundler.name=Mac App Store Ready Bundler +bundler.description=Creates a binary bundle ready for deployment into the Mac App Store." + +param.signing-key-app.name=Application Signing Key +param.signing-key-app.description=The full name of the signing key to sign the application with. + +param.signing-key-pkg.name=Installer Signing Key +param.signing-key-pkg.description=The full name of the signing key to sign the PKG Installer with. + +param.mac-app-store-entitlements.name=Entitlements File +param.mac-app-store-entitlements.description=File location of a custom mac app store entitlements file + +param.installer-suffix.name=Installer Suffix +param.installer-suffix.description=The suffix for the installer name for this package. .pkg. + +resource.mac-app-store-entitlements=Mac App Store Entitlements +resource.mac-app-store-inherit-entitlements=Mac App Store Inherit Entitlements + +error.parameters-null=Parameters map is null. +error.parameters-null.advice=Pass in a non-null parameters map. +error.cannot-create-output-dir=Output directory {0} cannot be created. +error.cannot-write-to-output-dir=Output directory {0} is not writable. +error.no-system-runtime=Bundle Configured to use the System JRE +error.no-system-runtime.advice=Do not set 'runtime' to null, either don't set it or set it to a valid value. +error.must-sign-app-store=Mac App Store apps must be signed, and signing has been disabled by bundler configuration. +error.must-sign-app-store.advice=Either unset 'signBundle' or set 'signBundle' to true. +error.no-app-signing-key=No Mac App Store App Signing Key +error.no-app-signing-key.advice=Install your app signing keys into your Mac Keychain using XCode. +error.no-pkg-signing-key=No Mac App Store Installer Signing Key +error.no-pkg-signing-key.advice=Install your app signing keys into your Mac Keychain using XCode. +error.certificate.expired=Error: Certificate expired {0}. + + +message.building-bundle=Building Mac App Store Bundle for {0} +mesasge.intermediate-bundle-location=Intermediate application bundle image\: {0} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/MacAppStoreBundler_ja.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/MacAppStoreBundler_ja.properties Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,61 @@ +# +# Copyright (c) 2017, 2018, 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. +# +# + +bundler.name=Mac App Store\u306E\u6E96\u5099\u5B8C\u4E86\u30D0\u30F3\u30C9\u30E9 +bundler.description=Mac App Store\u3078\u306E\u30C7\u30D7\u30ED\u30A4\u30E1\u30F3\u30C8\u6E96\u5099\u5B8C\u4E86\u306E\u30D0\u30A4\u30CA\u30EA\u30FB\u30D0\u30F3\u30C9\u30EB\u3092\u4F5C\u6210\u3057\u307E\u3059\u3002" + +param.signing-key-app.name=\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u7F72\u540D\u30AD\u30FC +param.signing-key-app.description=\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u3092\u7F72\u540D\u3059\u308B\u7F72\u540D\u30AD\u30FC\u306E\u30D5\u30EB\u30FB\u30CD\u30FC\u30E0\u3002 + +param.signing-key-pkg.name=\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9\u7F72\u540D\u30AD\u30FC +param.signing-key-pkg.description=PKG\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9\u3092\u7F72\u540D\u3059\u308B\u7F72\u540D\u30AD\u30FC\u306E\u30D5\u30EB\u30FB\u30CD\u30FC\u30E0\u3002 + +param.mac-app-store-entitlements.name=\u6A29\u9650\u30D5\u30A1\u30A4\u30EB +param.mac-app-store-entitlements.description=\u30AB\u30B9\u30BF\u30E0Mac App Store\u6A29\u9650\u30D5\u30A1\u30A4\u30EB\u306E\u30D5\u30A1\u30A4\u30EB\u5834\u6240 + +param.installer-suffix.name=\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9\u63A5\u5C3E\u8F9E +param.installer-suffix.description=\u3053\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9\u540D\u63A5\u5C3E\u8F9E\u3002.pkg\u3002 + +resource.mac-app-store-entitlements=Mac App Store\u6A29\u9650 +resource.mac-app-store-inherit-entitlements=Mac App Store\u7D99\u627F\u6A29\u9650 + +error.parameters-null=\u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30DE\u30C3\u30D7\u304Cnull\u3067\u3059\u3002 +error.parameters-null.advice=\u975Enull\u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30DE\u30C3\u30D7\u3067\u6E21\u3057\u3066\u304F\u3060\u3055\u3044\u3002 +error.cannot-create-output-dir=\u51FA\u529B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA{0}\u3092\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093\u3002 +error.cannot-write-to-output-dir=\u51FA\u529B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA{0}\u306F\u66F8\u8FBC\u307F\u4E0D\u53EF\u3067\u3059\u3002 +error.no-system-runtime=\u30B7\u30B9\u30C6\u30E0JRE\u3092\u4F7F\u7528\u3059\u308B\u3088\u3046\u306B\u69CB\u6210\u3055\u308C\u305F\u30D0\u30F3\u30C9\u30EB +error.no-system-runtime.advice='runtime'\u3092null\u306B\u8A2D\u5B9A\u3057\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002\u8A2D\u5B9A\u3057\u306A\u3044\u304B\u3001\u6709\u52B9\u306A\u5024\u306B\u8A2D\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002 +error.must-sign-app-store=Mac App Store\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306F\u7F72\u540D\u3055\u308C\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u304C\u3001\u7F72\u540D\u306F\u30D0\u30F3\u30C9\u30E9\u69CB\u6210\u306B\u3088\u3063\u3066\u7121\u52B9\u5316\u3055\u308C\u3066\u3044\u307E\u3059\u3002 +error.must-sign-app-store.advice='signBundle'\u3092\u8A2D\u5B9A\u89E3\u9664\u3059\u308B\u304B\u3001'signBundle'\u3092true\u306B\u8A2D\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002 +error.no-app-signing-key=Mac App Store\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u7F72\u540D\u30AD\u30FC\u304C\u3042\u308A\u307E\u305B\u3093 +error.no-app-signing-key.advice=XCode\u3092\u4F7F\u7528\u3057\u3066\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u7F72\u540D\u30AD\u30FC\u3092Mac\u30AD\u30FC\u30C1\u30A7\u30FC\u30F3\u306B\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3057\u307E\u3059\u3002 +error.no-pkg-signing-key=Mac App Store\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9\u306E\u7F72\u540D\u30AD\u30FC\u304C\u3042\u308A\u307E\u305B\u3093 +error.no-pkg-signing-key.advice=XCode\u3092\u4F7F\u7528\u3057\u3066\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u7F72\u540D\u30AD\u30FC\u3092Mac\u30AD\u30FC\u30C1\u30A7\u30FC\u30F3\u306B\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3057\u307E\u3059\u3002 +error.certificate.expired=\u30A8\u30E9\u30FC: \u8A3C\u660E\u66F8\u306F{0}\u306B\u671F\u9650\u304C\u5207\u308C\u307E\u3057\u305F\u3002 + + +message.building-bundle={0}\u306EMac App Store\u30D0\u30F3\u30C9\u30EB\u306E\u4F5C\u6210 +mesasge.intermediate-bundle-location=\u4E2D\u9593\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30D0\u30F3\u30C9\u30EB\u30FB\u30A4\u30E1\u30FC\u30B8: {0} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/MacAppStoreBundler_zh_CN.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/MacAppStoreBundler_zh_CN.properties Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,61 @@ +# +# Copyright (c) 2017, 2018, 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. +# +# + +bundler.name=\u652F\u6301 Mac App Store \u7684\u6253\u5305\u7A0B\u5E8F +bundler.description=\u521B\u5EFA\u53EF\u90E8\u7F72\u5230 Mac App Store \u4E2D\u7684\u4E8C\u8FDB\u5236\u6587\u4EF6\u5305\u3002" + +param.signing-key-app.name=\u5E94\u7528\u7A0B\u5E8F\u7B7E\u540D\u5BC6\u94A5 +param.signing-key-app.description=\u7528\u4E8E\u5BF9\u5E94\u7528\u7A0B\u5E8F\u7B7E\u540D\u7684\u7B7E\u540D\u5BC6\u94A5\u7684\u5B8C\u6574\u540D\u79F0\u3002 + +param.signing-key-pkg.name=\u5B89\u88C5\u7A0B\u5E8F\u7B7E\u540D\u5BC6\u94A5 +param.signing-key-pkg.description=\u7528\u4E8E\u5BF9 PKG \u5B89\u88C5\u7A0B\u5E8F\u7B7E\u540D\u7684\u7B7E\u540D\u5BC6\u94A5\u7684\u5B8C\u6574\u540D\u79F0\u3002 + +param.mac-app-store-entitlements.name=\u6743\u5229\u6587\u4EF6 +param.mac-app-store-entitlements.description=\u5B9A\u5236 Mac App Store \u6743\u5229\u6587\u4EF6\u7684\u6587\u4EF6\u4F4D\u7F6E + +param.installer-suffix.name=\u5B89\u88C5\u7A0B\u5E8F\u540E\u7F00 +param.installer-suffix.description=\u6B64\u7A0B\u5E8F\u5305\u7684\u5B89\u88C5\u6587\u4EF6\u540D\u79F0\u7684\u540E\u7F00\u3002<\u540D\u79F0><\u540E\u7F00>.pkg\u3002 + +resource.mac-app-store-entitlements=Mac App Store \u6743\u5229 +resource.mac-app-store-inherit-entitlements=Mac App Store \u7EE7\u627F\u6743\u5229 + +error.parameters-null=\u53C2\u6570\u6620\u5C04\u4E3A\u7A7A\u503C\u3002 +error.parameters-null.advice=\u8BF7\u4F20\u5165\u975E\u7A7A\u53C2\u6570\u6620\u5C04\u3002 +error.cannot-create-output-dir=\u65E0\u6CD5\u521B\u5EFA\u8F93\u51FA\u76EE\u5F55 {0}\u3002 +error.cannot-write-to-output-dir=\u8F93\u51FA\u76EE\u5F55 {0} \u4E0D\u53EF\u5199\u3002 +error.no-system-runtime=\u914D\u7F6E\u4E3A\u4F7F\u7528\u7CFB\u7EDF JRE \u7684\u5305 +error.no-system-runtime.advice=\u4E0D\u8981\u5C06 'runtime' \u8BBE\u7F6E\u4E3A\u7A7A\u503C, \u8981\u4E48\u4E0D\u8BBE\u7F6E\u8BE5\u503C, \u8981\u4E48\u5C06\u5176\u8BBE\u7F6E\u4E3A\u6709\u6548\u503C\u3002 +error.must-sign-app-store=Mac App Store \u5E94\u7528\u7A0B\u5E8F\u5FC5\u987B\u7B7E\u540D, \u800C\u6253\u5305\u7A0B\u5E8F\u914D\u7F6E\u5DF2\u7981\u7528\u7B7E\u540D\u3002 +error.must-sign-app-store.advice=\u53D6\u6D88\u8BBE\u7F6E 'signBundle' \u6216\u8005\u5C06 'signBundle' \u8BBE\u7F6E\u4E3A true\u3002 +error.no-app-signing-key=\u65E0 Mac App Store \u5E94\u7528\u7A0B\u5E8F\u7B7E\u540D\u5BC6\u94A5 +error.no-app-signing-key.advice=\u4F7F\u7528 XCode \u5C06\u5E94\u7528\u7A0B\u5E8F\u7B7E\u540D\u5BC6\u94A5\u5B89\u88C5\u5230 Mac \u5BC6\u94A5\u94FE\u4E2D\u3002 +error.no-pkg-signing-key=\u65E0 Mac App Store \u5B89\u88C5\u7A0B\u5E8F\u7B7E\u540D\u5BC6\u94A5 +error.no-pkg-signing-key.advice=\u4F7F\u7528 XCode \u5C06\u5E94\u7528\u7A0B\u5E8F\u7B7E\u540D\u5BC6\u94A5\u5B89\u88C5\u5230 Mac \u5BC6\u94A5\u94FE\u4E2D\u3002 +error.certificate.expired=\u9519\u8BEF: \u8BC1\u4E66\u5DF2\u5931\u6548 {0}\u3002 + + +message.building-bundle=\u6B63\u5728\u4E3A {0} \u6784\u5EFA Mac App Store \u5305 +mesasge.intermediate-bundle-location=\u4E34\u65F6\u5E94\u7528\u7A0B\u5E8F\u5305\u6620\u50CF: {0} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/MacAppStore_Inherit.entitlements --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/MacAppStore_Inherit.entitlements Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,10 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.inherit + + + diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/MacBaseInstallerBundler.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/MacBaseInstallerBundler.properties Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,58 @@ +# +# Copyright (c) 2017, 2018, 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. +# +# + +bundler.name=Mac App Store +bundler.description=Creates a binary bundle ready for deployment into the Mac App Store. + +param.app-bundler.name=Mac App Bundler +param.app-bundle.description=Creates a .app bundle for the Mac + +param.app-image-build-root.name=Build Root Dir +param.app-image-build-root.description=This is temporary location built by the packager that is the root of the image application + +param.signing-keychain.name=Signing Keychain +param.signing-keychain.description=The location of the keychain to use. If not specified the standard keychains will be used. + +param.signing-key-name.name=Signing Key User Name +param.signing-key-name.description=The user name portion of the typical "Mac Developer ID Application: " signing key. + +param.installer-name.name=Installer Name +param.installer-name.description=The filename of the generated installer without the file type extension. Default is -. + +param.config-root.name=Config Root Dir +param.config-root.description=Configuration directory. + +error.parameters-null=Parameters map is null. +error.parameters-null.advice=Pass in a non-null parameters map. + +message.app-image-dir-does-not-exist=Specified application image directory {0}\: {1} does not exists +message.app-image-dir-does-not-exist.advice=Confirm that the value for {0} exists + +message.could-not-retrieve-name=Could not retrieve gecos name +message.app-image-requires-app-name=When using an external app image you must specify the app name. +message.app-image-requires-app-name.advice=Set the app name via the -name CLI flag, the fx:application/@name ANT attribute, or via the 'appName' bundler argument. +message.app-image-requires-identifier=When using an external app image you must specify the identifier. +message.app-image-requires-identifier.advice=Set the identifier via the -appId CLI flag, the fx:application/@id ANT attribute, or via the 'identifier' bundler argument. diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/MacBaseInstallerBundler_ja.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/MacBaseInstallerBundler_ja.properties Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,57 @@ +# +# Copyright (c) 2017, 2018, 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. +# +# + +bundler.name=Mac App Store +bundler.description=Mac App Store\u3078\u306e\u30c7\u30d7\u30ed\u30a4\u30e1\u30f3\u30c8\u6e96\u5099\u5b8c\u4e86\u306e\u30d0\u30a4\u30ca\u30ea\u30fb\u30d0\u30f3\u30c9\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002 + +param.app-bundler.name=Mac\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30fb\u30d0\u30f3\u30c9\u30e9 +param.app-bundle.description=Mac\u7528\u306e.app\u30d0\u30f3\u30c9\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059 + +param.app-image-build-root.name=Build Root Dir +param.app-image-build-root.description=\u3053\u308c\u306f\u30a4\u30e1\u30fc\u30b8\u30fb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30eb\u30fc\u30c8\u3067\u3042\u308b\u30d1\u30c3\u30b1\u30fc\u30b8\u30e3\u306b\u3088\u3063\u3066\u4f5c\u6210\u3055\u308c\u308b\u4e00\u6642\u7684\u306a\u5834\u6240\u3067\u3059 + +param.signing-keychain.name=\u7f72\u540d\u30ad\u30fc\u30c1\u30a7\u30fc\u30f3 +param.signing-keychain.description=\u4f7f\u7528\u3059\u308b\u30ad\u30fc\u30c1\u30a7\u30fc\u30f3\u306e\u5834\u6240\u3002\u6307\u5b9a\u3055\u308c\u3066\u3044\u306a\u3044\u5834\u5408\u306f\u3001\u6a19\u6e96\u306e\u30ad\u30fc\u30c1\u30a7\u30fc\u30f3\u304c\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002 + +param.signing-key-name.name=\u7f72\u540d\u30ad\u30fc\u306e\u30e6\u30fc\u30b6\u30fc\u540d +param.signing-key-name.description=\u4e00\u822c\u7684\u306a"Mac Developer ID\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3: "\u7f72\u540d\u30ad\u30fc\u306e\u30e6\u30fc\u30b6\u30fc\u540d\u90e8\u5206\u3002 + +param.installer-name.name=\u30a4\u30f3\u30b9\u30c8\u30fc\u30e9\u540d +param.installer-name.description=\u30d5\u30a1\u30a4\u30eb\u30fb\u30bf\u30a4\u30d7\u62e1\u5f35\u5b50\u306a\u3057\u306e\u751f\u6210\u3055\u308c\u305f\u30a4\u30f3\u30b9\u30c8\uff0d\u30e9\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u306f-\u3067\u3059\u3002 + +param.config-root.name=Config Root Dir +param.config-root.description=Configuration directory. + +error.parameters-null=\u30d1\u30e9\u30e1\u30fc\u30bf\u30fb\u30de\u30c3\u30d7\u304cnull\u3067\u3059\u3002 +error.parameters-null.advice=\u975enull\u30d1\u30e9\u30e1\u30fc\u30bf\u30fb\u30de\u30c3\u30d7\u3067\u6e21\u3057\u3066\u304f\u3060\u3055\u3044\u3002 + +message.app-image-dir-does-not-exist=\u6307\u5b9a\u3055\u308c\u305f\u30a4\u30e1\u30fc\u30b8\u30fb\u30c7\u30a3\u30ec\u30af\u30c8\u30ea {0}: {1}\u306f\u5b58\u5728\u3057\u307e\u305b\u3093 +message.app-image-dir-does-not-exist.advice={0}\u306e\u5024\u304c\u5b58\u5728\u3059\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044 +message.could-not-retrieve-name=gecos\u540d\u3092\u53d6\u5f97\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f +message.app-image-requires-app-name=\u5916\u90e8\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30fb\u30a4\u30e1\u30fc\u30b8\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u540d\u3092\u6307\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 +message.app-image-requires-app-name.advice=-name CLI\u30d5\u30e9\u30b0\u3001fx:application/@name ANT\u5c5e\u6027\u307e\u305f\u306f'appName'\u30d0\u30f3\u30c9\u30e9\u5f15\u6570\u3067\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u540d\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002 +message.app-image-requires-identifier=\u5916\u90e8\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30fb\u30a4\u30e1\u30fc\u30b8\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u3001\u8b58\u5225\u5b50\u3092\u6307\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 +message.app-image-requires-identifier.advice=-appId CLI\u30d5\u30e9\u30b0\u3001fx:application/@id ANT\u5c5e\u6027\u307e\u305f\u306f'identifier'\u30d0\u30f3\u30c9\u30e9\u5f15\u6570\u3067\u8b58\u5225\u5b50\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002 diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/MacBaseInstallerBundler_zh_CN.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/MacBaseInstallerBundler_zh_CN.properties Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,57 @@ +# +# Copyright (c) 2017, 2018, 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. +# +# + +bundler.name=Mac App Store +bundler.description=\u521b\u5efa\u53ef\u90e8\u7f72\u5230 Mac App Store \u4e2d\u7684\u4e8c\u8fdb\u5236\u6587\u4ef6\u5305\u3002 + +param.app-bundler.name=Mac \u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u7a0b\u5e8f +param.app-bundle.description=\u521b\u5efa\u7528\u4e8e Mac \u7684 .app \u5305 + +param.app-image-build-root.name=Build Root Dir +param.app-image-build-root.description=\u8fd9\u662f\u7531\u6253\u5305\u7a0b\u5e8f\u6784\u5efa\u7684\u4e34\u65f6\u4f4d\u7f6e, \u662f\u6620\u50cf\u5e94\u7528\u7a0b\u5e8f\u7684\u6839\u76ee\u5f55 + +param.signing-keychain.name=\u7b7e\u540d\u5bc6\u94a5\u94fe +param.signing-keychain.description=\u8981\u4f7f\u7528\u7684\u5bc6\u94a5\u94fe\u7684\u4f4d\u7f6e\u3002\u5982\u679c\u672a\u6307\u5b9a, \u5219\u5c06\u4f7f\u7528\u6807\u51c6\u5bc6\u94a5\u94fe\u3002 + +param.signing-key-name.name=\u7b7e\u540d\u5bc6\u94a5\u7528\u6237\u540d +param.signing-key-name.description=\u5178\u578b "Mac \u5f00\u53d1\u8005 ID \u5e94\u7528\u7a0b\u5e8f: <\u7528\u6237\u540d>" \u7b7e\u540d\u5bc6\u94a5\u7684\u7528\u6237\u540d\u90e8\u5206\u3002 + +param.installer-name.name=\u5b89\u88c5\u7a0b\u5e8f\u540d\u79f0 +param.installer-name.description=\u6240\u751f\u6210\u5b89\u88c5\u7a0b\u5e8f\u4e0d\u5e26\u6587\u4ef6\u7c7b\u578b\u6269\u5c55\u540d\u7684\u6587\u4ef6\u540d\u3002\u9ed8\u8ba4\u503c\u4e3a <\u5e94\u7528\u7a0b\u5e8f\u540d\u79f0>-<\u7248\u672c>\u3002 + +param.config-root.name=Config Root Dir +param.config-root.description=Configuration directory. + +error.parameters-null=\u53c2\u6570\u6620\u5c04\u4e3a\u7a7a\u503c\u3002 +error.parameters-null.advice=\u8bf7\u4f20\u5165\u975e\u7a7a\u53c2\u6570\u6620\u5c04\u3002 + +message.app-image-dir-does-not-exist=\u6307\u5b9a\u7684\u6620\u50cf\u76ee\u5f55 {0}: {1} \u4e0d\u5b58\u5728 +message.app-image-dir-does-not-exist.advice=\u786e\u8ba4 {0} \u7684\u503c\u662f\u5426\u5b58\u5728 +message.could-not-retrieve-name=\u65e0\u6cd5\u68c0\u7d22 gecos \u540d\u79f0 +message.app-image-requires-app-name=\u4f7f\u7528\u5916\u90e8\u5e94\u7528\u7a0b\u5e8f\u6620\u50cf\u65f6, \u5fc5\u987b\u6307\u5b9a\u5e94\u7528\u7a0b\u5e8f\u540d\u79f0\u3002 +message.app-image-requires-app-name.advice=\u901a\u8fc7 -name CLI \u6807\u8bb0, fx:application/@name ANT \u5c5e\u6027\u6216\u901a\u8fc7 'appName' \u6253\u5305\u7a0b\u5e8f\u53c2\u6570\u8bbe\u7f6e\u5e94\u7528\u7a0b\u5e8f\u540d\u79f0\u3002 +message.app-image-requires-identifier=\u4f7f\u7528\u5916\u90e8\u5e94\u7528\u7a0b\u5e8f\u6620\u50cf\u65f6, \u5fc5\u987b\u6307\u5b9a\u6807\u8bc6\u7b26\u3002 +message.app-image-requires-identifier.advice=\u901a\u8fc7 -appId CLI \u6807\u8bb0, fx:application/@id ANT \u5c5e\u6027\u6216\u901a\u8fc7 'identifier' \u6253\u5305\u7a0b\u5e8f\u53c2\u6570\u8bbe\u7f6e\u6807\u8bc6\u7b26\u3002 diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/MacDmgBundler.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/MacDmgBundler.properties Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,61 @@ +# +# Copyright (c) 2017, 2018, 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. +# +# + +bundler.name=DMG Installer +bundler.description=Mac DMG Installer Bundle + +param.simple-dmg.name=Simple DMG Generation +param.simple-dmg.description=Generate a DMG without AppleScript customizations. Recommended for continuous automated builds. + +param.installer-suffix.name=Installer Suffix +param.installer-suffix.description=The suffix for the installer name for this package. .dmg. + +error.parameters-null=Parameters map is null. +error.parameters-null.advice=Pass in a non-null parameters map. + +error.dmg-does-not-do-daemons=DMG bundler doesn't support services. +error.dmg-does-not-do-daemons.advice=Make sure that the service hint is set to false. + +error.license-missing=Specified license file is missing. +error.license-missing.advice=Make sure that "{0}" references a file in the app resources, and that it is relative file reference. + +error.cannot-create-output-dir=Output directory {0} cannot be created. +error.cannot-write-to-output-dir=Output directory {0} is not writable. + +resource.dmg-setup-script=DMG setup script +resource.license-setup=License setup +resource.dmg-background=dmg background +resource.volume-icon=volume icon +resource.post-install-script=script to run after application image is populated + +message.building-dmg=Building DMG package for {0} +message.running-script=Running shell script on application image [{0}] +message.intermediate-image-location=[DEBUG] Intermediate application bundle image\: {0} +message.preparing-dmg-setup=Preparing dmg setup\: {0} +message.creating-dmg-file=Creating DMG file\: {0} +message.dmg-cannot-be-overwritten=Dmg file exists ({0} and can not be removed. +message.output-to-location=Result DMG installer for {0}\: {1} + diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/MacDmgBundler_ja.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/MacDmgBundler_ja.properties Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,61 @@ +# +# Copyright (c) 2017, 2018, 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. +# +# + +bundler.name=DMG\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9 +bundler.description=Mac DMG\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9\u30FB\u30D0\u30F3\u30C9\u30EB + +param.simple-dmg.name=DMG\u306E\u7C21\u6613\u751F\u6210 +param.simple-dmg.description=AppleScript\u306E\u30AB\u30B9\u30BF\u30DE\u30A4\u30BA\u306A\u3057\u3067DMG\u3092\u751F\u6210\u3057\u307E\u3059\u3002\u9023\u7D9A\u3057\u305F\u81EA\u52D5\u4F5C\u6210\u306E\u5834\u5408\u306B\u304A\u85A6\u3081\u3057\u307E\u3059\u3002 + +param.installer-suffix.name=\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9\u63A5\u5C3E\u8F9E +param.installer-suffix.description=\u3053\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9\u540D\u306E\u63A5\u5C3E\u8F9E\u3002.dmg\u3002 + +error.parameters-null=\u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30DE\u30C3\u30D7\u304Cnull\u3067\u3059\u3002 +error.parameters-null.advice=\u975Enull\u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30DE\u30C3\u30D7\u3067\u6E21\u3057\u3066\u304F\u3060\u3055\u3044\u3002 + +error.dmg-does-not-do-daemons=DMG\u30D0\u30F3\u30C9\u30E9\u306F\u30B5\u30FC\u30D3\u30B9\u3092\u30B5\u30DD\u30FC\u30C8\u3057\u3066\u3044\u307E\u305B\u3093\u3002 +error.dmg-does-not-do-daemons.advice=\u30B5\u30FC\u30D3\u30B9\u306E\u30D2\u30F3\u30C8\u304Cfalse\u306B\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002 + +error.license-missing=\u6307\u5B9A\u3057\u305F\u30E9\u30A4\u30BB\u30F3\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u304C\u3042\u308A\u307E\u305B\u3093\u3002 +error.license-missing.advice="{0}"\u304C\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30EA\u30BD\u30FC\u30B9\u5185\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u53C2\u7167\u3057\u3001\u76F8\u5BFE\u30D5\u30A1\u30A4\u30EB\u53C2\u7167\u3067\u3042\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002 + +error.cannot-create-output-dir=\u51FA\u529B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA{0}\u3092\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093\u3002 +error.cannot-write-to-output-dir=\u51FA\u529B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA{0}\u306F\u66F8\u8FBC\u307F\u4E0D\u53EF\u3067\u3059\u3002 + +resource.dmg-setup-script=DMG\u8A2D\u5B9A\u30B9\u30AF\u30EA\u30D7\u30C8 +resource.license-setup=\u30E9\u30A4\u30BB\u30F3\u30B9\u306E\u8A2D\u5B9A +resource.dmg-background=dmg\u80CC\u666F +resource.volume-icon=\u30DC\u30EA\u30E5\u30FC\u30E0\u30FB\u30A2\u30A4\u30B3\u30F3 +resource.post-install-script=\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30A4\u30E1\u30FC\u30B8\u3092\u79FB\u5165\u3057\u305F\u5F8C\u306B\u5B9F\u884C\u3059\u308B\u30B9\u30AF\u30EA\u30D7\u30C8 + +message.building-dmg={0}\u306EDMG\u30D1\u30C3\u30B1\u30FC\u30B8\u3092\u4F5C\u6210\u3057\u3066\u3044\u307E\u3059 +message.running-script=\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30A4\u30E1\u30FC\u30B8[{0}]\u3067\u30B7\u30A7\u30EB\u30FB\u30B9\u30AF\u30EA\u30D7\u30C8\u3092\u5B9F\u884C\u3057\u3066\u3044\u307E\u3059 +message.intermediate-image-location=[\u30C7\u30D0\u30C3\u30B0]\u4E2D\u9593\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30D0\u30F3\u30C9\u30EB\u30FB\u30A4\u30E1\u30FC\u30B8: {0} +message.preparing-dmg-setup=dmg\u306E\u8A2D\u5B9A\u3092\u6E96\u5099\u3057\u3066\u3044\u307E\u3059: {0} +message.creating-dmg-file=DMG\u30D5\u30A1\u30A4\u30EB\u3092\u4F5C\u6210\u3057\u3066\u3044\u307E\u3059: {0} +message.dmg-cannot-be-overwritten=Dmg\u30D5\u30A1\u30A4\u30EB\u306F\u5B58\u5728\u3057({0}\u3001\u524A\u9664\u3067\u304D\u307E\u305B\u3093\u3002 +message.output-to-location={0}\u306E\u7D50\u679C\u306EDMG\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9: {1} + diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/MacDmgBundler_zh_CN.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/MacDmgBundler_zh_CN.properties Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,61 @@ +# +# Copyright (c) 2017, 2018, 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. +# +# + +bundler.name=DMG \u5B89\u88C5\u7A0B\u5E8F +bundler.description=Mac DMG \u5B89\u88C5\u7A0B\u5E8F\u5305 + +param.simple-dmg.name=\u7B80\u5355 DMG \u751F\u6210 +param.simple-dmg.description=\u751F\u6210\u4E0D\u5E26 AppleScript \u5B9A\u5236\u7684 DMG\u3002\u5EFA\u8BAE\u7528\u4E8E\u8FDE\u7EED\u81EA\u52A8\u6784\u5EFA\u3002 + +param.installer-suffix.name=\u5B89\u88C5\u7A0B\u5E8F\u540E\u7F00 +param.installer-suffix.description=\u6B64\u7A0B\u5E8F\u5305\u7684\u5B89\u88C5\u6587\u4EF6\u540D\u79F0\u7684\u540E\u7F00\u3002<\u540D\u79F0><\u540E\u7F00>.dmg\u3002 + +error.parameters-null=\u53C2\u6570\u6620\u5C04\u4E3A\u7A7A\u503C\u3002 +error.parameters-null.advice=\u8BF7\u4F20\u5165\u975E\u7A7A\u53C2\u6570\u6620\u5C04\u3002 + +error.dmg-does-not-do-daemons=DMG \u6253\u5305\u7A0B\u5E8F\u4E0D\u652F\u6301\u670D\u52A1\u3002 +error.dmg-does-not-do-daemons.advice=\u786E\u4FDD\u670D\u52A1\u63D0\u793A\u8BBE\u7F6E\u4E3A false\u3002 + +error.license-missing=\u7F3A\u5C11\u6307\u5B9A\u7684\u8BB8\u53EF\u8BC1\u6587\u4EF6\u3002 +error.license-missing.advice=\u786E\u4FDD "{0}" \u5F15\u7528\u5E94\u7528\u7A0B\u5E8F\u8D44\u6E90\u4E2D\u7684\u6587\u4EF6, \u5E76\u4E14\u662F\u76F8\u5BF9\u6587\u4EF6\u5F15\u7528\u3002 + +error.cannot-create-output-dir=\u65E0\u6CD5\u521B\u5EFA\u8F93\u51FA\u76EE\u5F55 {0}\u3002 +error.cannot-write-to-output-dir=\u8F93\u51FA\u76EE\u5F55 {0} \u4E0D\u53EF\u5199\u3002 + +resource.dmg-setup-script=DMG \u8BBE\u7F6E\u811A\u672C +resource.license-setup=\u8BB8\u53EF\u8BC1\u8BBE\u7F6E +resource.dmg-background=dmg \u80CC\u666F +resource.volume-icon=\u5377\u56FE\u6807 +resource.post-install-script=\u8981\u5728\u586B\u5145\u5E94\u7528\u7A0B\u5E8F\u6620\u50CF\u4E4B\u540E\u8FD0\u884C\u7684\u811A\u672C + +message.building-dmg=\u6B63\u5728\u4E3A {0} \u6784\u5EFA DMG \u7A0B\u5E8F\u5305 +message.running-script=\u6B63\u5728\u5E94\u7528\u7A0B\u5E8F\u6620\u50CF [{0}] \u4E0A\u8FD0\u884C shell \u811A\u672C +message.intermediate-image-location=[\u8C03\u8BD5] \u4E34\u65F6\u5E94\u7528\u7A0B\u5E8F\u5305\u6620\u50CF: {0} +message.preparing-dmg-setup=\u6B63\u5728\u51C6\u5907 dmg \u8BBE\u7F6E: {0} +message.creating-dmg-file=\u6B63\u5728\u521B\u5EFA DMG \u6587\u4EF6: {0} +message.dmg-cannot-be-overwritten=Dmg \u6587\u4EF6\u5DF2\u5B58\u5728 ({0}) \u4E14\u65E0\u6CD5\u5220\u9664\u3002 +message.output-to-location=\u4E3A {0} \u751F\u6210\u7684 DMG \u5B89\u88C5\u7A0B\u5E8F: {1} + diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/MacPkgBundler.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/MacPkgBundler.properties Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,64 @@ +# +# Copyright (c) 2017, 2018, 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. +# +# + +bundler.name=PKG Installer +bundler.description=Mac PKG Installer Bundle. + +param.signing-key-developer-id-installer.name=Apple Developer ID Installer Signing Key +param.signing-key-developer-id-installer.description=The full name of the Apple Developer ID Installer signing key. + +param.packages-root.name=PKG Root Dir +param.packages-root.description=This is temporary location for component packages (application and daemon). The packages are incorporated into final product package. + +param.installer-suffix.name=Installer Suffix +param.installer-suffix.description=The suffix for the installer name for this package. .pkg. + +param.scripts-dir.name= +param.scripts-dir.description=This is temporary location for package scripts + +param.mac-install-dir.name=Mac Installation Directory +param.mac-install-dir.description=Installation directory of the application on Mac. + +resource.pkg-preinstall-script=PKG preinstall script +resource.pkg-postinstall-script=PKG postinstall script +resource.pkg-background-image=pkg background image +resource.post-install-script=script to run after application image is populated + +error.parameters-null=Parameters map is null. +error.parameters-null.advice=Pass in a non-null parameters map. +error.license-missing=Specified license file is missing. +error.license-missing.advice=Make sure that "{0}" references a file in the app resources, and that it is relative to the basedir "{1}". +error.explicit-sign-no-cert=Signature explicitly requested but no signing certificate specified. +error.explicit-sign-no-cert.advice=Either specify a valid cert in 'mac.signing-key-developer-id-installer' or unset 'signBundle' or set 'signBundle' to false. +error.cannot-create-output-dir=Output directory {0} cannot be created. +error.cannot-write-to-output-dir=Output directory {0} is not writable. + +message.building-pkg=Building PKG package for {0} +message.running-script=Running shell script on application image [{0}] +message.preparing-scripts=Preparing package scripts +message.preparing-distribution-dist=Preparing distribution.dist\: {0} +message.intermediate-image-location=[DEBUG] Intermediate application bundle image\: {0} +message.signing.pkg=Warning: For signing PKG, you might need to set "Always Trust" for your certificate using "Keychain Access" tool. diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/MacPkgBundler_ja.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/MacPkgBundler_ja.properties Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,60 @@ +# +# Copyright (c) 2017, 2018, 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. +# +# + +bundler.name=PKG\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9 +bundler.description=Mac PKG\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9\u30FB\u30D0\u30F3\u30C9\u30EB\u3002 + +param.signing-key-developer-id-installer.name=Apple Developer ID\u306E\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9\u7F72\u540D\u30AD\u30FC +param.signing-key-developer-id-installer.description=Apple Developer ID\u306E\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9\u7F72\u540D\u30AD\u30FC\u306E\u30D5\u30EB\u30FB\u30CD\u30FC\u30E0\u3002 + +param.packages-root.name=PKG Root Dir +param.packages-root.description=\u3053\u308C\u306F\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u30FB\u30D1\u30C3\u30B1\u30FC\u30B8(\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u304A\u3088\u3073\u30C7\u30FC\u30E2\u30F3)\u306E\u4E00\u6642\u7684\u306A\u5834\u6240\u3067\u3059\u3002\u30D1\u30C3\u30B1\u30FC\u30B8\u306F\u6700\u7D42\u88FD\u54C1\u30D1\u30C3\u30B1\u30FC\u30B8\u306B\u7D44\u307F\u8FBC\u307E\u308C\u307E\u3059\u3002 + +param.installer-suffix.name=\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9\u63A5\u5C3E\u8F9E +param.installer-suffix.description=\u3053\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9\u540D\u63A5\u5C3E\u8F9E\u3002.pkg\u3002 + +param.scripts-dir.name= +param.scripts-dir.description=\u3053\u308C\u306F\u30D1\u30C3\u30B1\u30FC\u30B8\u30FB\u30B9\u30AF\u30EA\u30D7\u30C8\u306E\u4E00\u6642\u7684\u306A\u5834\u6240\u3067\u3059 + +resource.pkg-preinstall-script=PKG\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u524D\u30B9\u30AF\u30EA\u30D7\u30C8 +resource.pkg-postinstall-script=PKG\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u5F8C\u30B9\u30AF\u30EA\u30D7\u30C8 +resource.pkg-background-image=pkg\u80CC\u666F\u30A4\u30E1\u30FC\u30B8 +resource.post-install-script=\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30A4\u30E1\u30FC\u30B8\u3092\u79FB\u5165\u3057\u305F\u5F8C\u306B\u5B9F\u884C\u3059\u308B\u30B9\u30AF\u30EA\u30D7\u30C8 + +error.parameters-null=\u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30DE\u30C3\u30D7\u304Cnull\u3067\u3059\u3002 +error.parameters-null.advice=\u975Enull\u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30DE\u30C3\u30D7\u3067\u6E21\u3057\u3066\u304F\u3060\u3055\u3044\u3002 +error.license-missing=\u6307\u5B9A\u3057\u305F\u30E9\u30A4\u30BB\u30F3\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u304C\u3042\u308A\u307E\u305B\u3093\u3002 +error.license-missing.advice="{0}"\u304C\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30EA\u30BD\u30FC\u30B9\u5185\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u53C2\u7167\u3057\u3001\u30D9\u30FC\u30B9\u30FB\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA"{1}"\u306B\u5BFE\u3057\u3066\u76F8\u5BFE\u7684\u3067\u3042\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002 +error.explicit-sign-no-cert=\u7F72\u540D\u304C\u660E\u793A\u7684\u306B\u8981\u6C42\u3055\u308C\u307E\u3057\u305F\u304C\u3001\u7F72\u540D\u8A3C\u660E\u66F8\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002 +error.explicit-sign-no-cert.advice=\u6709\u52B9\u306A\u8A3C\u660E\u66F8\u3092'mac.signing-key-developer-id-installer'\u3067\u6307\u5B9A\u3059\u308B\u304B\u3001'signBundle'\u3092\u8A2D\u5B9A\u89E3\u9664\u3059\u308B\u304B\u3001\u307E\u305F\u306F'signBundle'\u3092false\u306B\u8A2D\u5B9A\u3057\u307E\u3059\u3002 +error.cannot-create-output-dir=\u51FA\u529B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA{0}\u3092\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093\u3002 +error.cannot-write-to-output-dir=\u51FA\u529B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA{0}\u306F\u66F8\u8FBC\u307F\u4E0D\u53EF\u3067\u3059\u3002 + +message.building-pkg={0}\u306EPKG\u30D1\u30C3\u30B1\u30FC\u30B8\u3092\u4F5C\u6210\u3057\u3066\u3044\u307E\u3059 +message.running-script=\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30A4\u30E1\u30FC\u30B8[{0}]\u3067\u30B7\u30A7\u30EB\u30FB\u30B9\u30AF\u30EA\u30D7\u30C8\u3092\u5B9F\u884C\u3057\u3066\u3044\u307E\u3059 +message.preparing-scripts=\u30D1\u30C3\u30B1\u30FC\u30B8\u30FB\u30B9\u30AF\u30EA\u30D7\u30C8\u3092\u6E96\u5099\u3057\u3066\u3044\u307E\u3059 +message.preparing-distribution-dist=distribution.dist\u3092\u6E96\u5099\u3057\u3066\u3044\u307E\u3059: {0} +message.intermediate-image-location=[\u30C7\u30D0\u30C3\u30B0]\u4E2D\u9593\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30D0\u30F3\u30C9\u30EB\u30FB\u30A4\u30E1\u30FC\u30B8: {0} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/MacPkgBundler_zh_CN.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/MacPkgBundler_zh_CN.properties Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,60 @@ +# +# Copyright (c) 2017, 2018, 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. +# +# + +bundler.name=PKG \u5B89\u88C5\u7A0B\u5E8F +bundler.description=Mac PKG \u5B89\u88C5\u7A0B\u5E8F\u5305\u3002 + +param.signing-key-developer-id-installer.name=Apple \u5F00\u53D1\u8005 ID \u5B89\u88C5\u7A0B\u5E8F\u7B7E\u540D\u5BC6\u94A5 +param.signing-key-developer-id-installer.description=Apple \u5F00\u53D1\u8005 ID \u5B89\u88C5\u7A0B\u5E8F\u7B7E\u540D\u5BC6\u94A5\u7684\u5168\u540D\u3002 + +param.packages-root.name=PKG Root Dir +param.packages-root.description=\u8FD9\u662F\u7EC4\u4EF6\u7A0B\u5E8F\u5305 (\u5E94\u7528\u7A0B\u5E8F\u548C\u5B88\u62A4\u7A0B\u5E8F) \u7684\u4E34\u65F6\u4F4D\u7F6E\u3002\u7A0B\u5E8F\u5305\u96C6\u6210\u5230\u6700\u7EC8\u4EA7\u54C1\u7A0B\u5E8F\u5305\u4E2D\u3002 + +param.installer-suffix.name=\u5B89\u88C5\u7A0B\u5E8F\u540E\u7F00 +param.installer-suffix.description=\u6B64\u7A0B\u5E8F\u5305\u7684\u5B89\u88C5\u6587\u4EF6\u540D\u79F0\u7684\u540E\u7F00\u3002<\u540D\u79F0><\u540E\u7F00>.pkg\u3002 + +param.scripts-dir.name= +param.scripts-dir.description=\u8FD9\u662F\u7A0B\u5E8F\u5305\u811A\u672C\u7684\u4E34\u65F6\u4F4D\u7F6E + +resource.pkg-preinstall-script=PKG \u5B89\u88C5\u524D\u811A\u672C +resource.pkg-postinstall-script=PKG \u5B89\u88C5\u540E\u811A\u672C +resource.pkg-background-image=pkg \u80CC\u666F\u56FE\u50CF +resource.post-install-script=\u8981\u5728\u586B\u5145\u5E94\u7528\u7A0B\u5E8F\u6620\u50CF\u4E4B\u540E\u8FD0\u884C\u7684\u811A\u672C + +error.parameters-null=\u53C2\u6570\u6620\u5C04\u4E3A\u7A7A\u503C\u3002 +error.parameters-null.advice=\u8BF7\u4F20\u5165\u975E\u7A7A\u53C2\u6570\u6620\u5C04\u3002 +error.license-missing=\u7F3A\u5C11\u6307\u5B9A\u7684\u8BB8\u53EF\u8BC1\u6587\u4EF6\u3002 +error.license-missing.advice=\u8BF7\u786E\u4FDD "{0}" \u5F15\u7528\u5E94\u7528\u7A0B\u5E8F\u8D44\u6E90\u4E2D\u7684\u6587\u4EF6, \u5E76\u4E14\u4F7F\u7528\u57FA\u76EE\u5F55 "{1}" \u7684\u76F8\u5BF9\u76EE\u5F55\u3002 +error.explicit-sign-no-cert=\u5DF2\u660E\u786E\u8BF7\u6C42\u7B7E\u540D, \u4F46\u672A\u6307\u5B9A\u7B7E\u540D\u8BC1\u4E66\u3002 +error.explicit-sign-no-cert.advice=\u5728 'mac.signing-key-developer-id-installer' \u4E2D\u6307\u5B9A\u6709\u6548\u7684\u8BC1\u4E66, \u6216\u8005\u53D6\u6D88\u8BBE\u7F6E 'signBundle', \u6216\u8005\u5C06 'signBundle' \u8BBE\u7F6E\u4E3A false\u3002 +error.cannot-create-output-dir=\u65E0\u6CD5\u521B\u5EFA\u8F93\u51FA\u76EE\u5F55 {0}\u3002 +error.cannot-write-to-output-dir=\u8F93\u51FA\u76EE\u5F55 {0} \u4E0D\u53EF\u5199\u3002 + +message.building-pkg=\u6B63\u5728\u4E3A {0} \u6784\u5EFA PKG \u7A0B\u5E8F\u5305 +message.running-script=\u6B63\u5728\u5E94\u7528\u7A0B\u5E8F\u6620\u50CF [{0}] \u4E0A\u8FD0\u884C shell \u811A\u672C +message.preparing-scripts=\u6B63\u5728\u51C6\u5907\u7A0B\u5E8F\u5305\u811A\u672C +message.preparing-distribution-dist=\u6B63\u5728\u51C6\u5907 distribution.dist: {0} +message.intermediate-image-location=[\u8C03\u8BD5] \u4E34\u65F6\u5E94\u7528\u7A0B\u5E8F\u5305\u6620\u50CF: {0} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/MacResources.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/MacResources.java Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2011, 2018, 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.jpackager.internal.resources; + +// no-op, use as anchor for resource loading +public class MacResources { + +} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/Runtime-Info.plist.template --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/Runtime-Info.plist.template Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + libjli.dylib + CFBundleIdentifier + CF_BUNDLE_IDENTIFIER + CFBundleInfoDictionaryVersion + 7.0 + CFBundleName + CF_BUNDLE_NAME + CFBundlePackageType + BNDL + CFBundleShortVersionString + CF_BUNDLE_SHORT_VERSION_STRING + CFBundleSignature + ???? + CFBundleVersion + CF_BUNDLE_VERSION + + diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/background_dmg.png Binary file src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/background_dmg.png has changed diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/background_pkg.png Binary file src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/background_pkg.png has changed diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/builders/mac/MacAppImageBuilder.properties --- a/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/builders/mac/MacAppImageBuilder.properties Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,74 +0,0 @@ -# -# Copyright (c) 2017, 2018, 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. -# -# - -bundler.name=Mac Application Image -bundler.description=A Directory based image of a mac Application with an optionally co-bundled JRE. Used as a base for the Installer bundlers - -param.icon-icns.name=.icns Icon -param.icon-icns.description= Icon for the application, in ICNS format. - -param.config-root.name=Configuration Root Name -param.config-root.description=The root directory of COnfiguration files. - -param.configure-launcher-in-plist=Configure Launcher in Info.plist -param.configure-launcher-in-plist.description=Should the legacy method of configuring hte launcher in the Info.plist be used. - -param.category-name=Category -param.category-name.description=Mac App Store Categories. Note that the key is the string to display to the user and the value is the id of the category. - -param.cfbundle-name.name=CFBundleName -param.cfbundle-name.description=The name of the app as it appears in the Menu Bar. This can be different from the application name. This name should be less than 16 characters long and be suitable for displaying in the menu bar and the app's Info window. - -param.cfbundle-identifier.name=CFBundleIdentifier -param.cfbundle-identifier.description=An identifier that uniquely identifies the application for MacOSX (and on the Mac App Store). May only use alphanumeric (A-Z,a-z,0-9), hyphen (-), and period (.) characters. - -param.cfbundle-version.name=CFBundleVersion -param.cfbundle-version.description=An computer readable version for the CFBundle. May contain only digits and from zero to two dots, such as "1.8.1" or "100". - -param.bundle-id-signing-prefix.name=Bundle Signing Prefix -param.bundle-id-signing-prefix.description=When signing the application bundle this value is prefixed to all components that need to be signed that don't have an existing CFBundleIdentifier. - -param.default-icon-icns=Default Icon -param.default-icon-icns.description=The Default Icon for when a user does not specify an icns file. - -param.sign-bundle.name=Sign Bundle -param.sign-bundle.description=Request that the bundle be signed. - -resource.app-info-plist=Application Info.plist -resource.runtime-info-plist=Java Runtime Info.plist - -message.bundle-name-too-long-warning={0} is set to ''{1}'', which is longer than 16 characters. For a better Mac experience consider shortening it. -message.null-classpath=Null app resources? -message.preparing-info-plist=Preparing Info.plist\: {0} -message.icon-not-icns= The specified icon "{0}" is not an ICNS file and will not be used. The default icon will be used in it's place. -message.version-string-too-many-components=Version sting may have between 1 and 3 numbers: 1, 1.2, 1.2.3. -message.version-string-first-number-not-zero=The first number in a CFBundleVersion cannot be zero or negative. -message.version-string-no-negative-numbers=Negative numbers are not allowed in version strings. -message.version-string-numbers-only=Version strings can consist of only numbers and up to two dots. -message.creating-association-with-null-extension=Creating association with null extension. - -message.ignoring.symlink=Warning: codesign is skipping the symlink {0} -message.keychain.error=Error: unable to get keychain list. diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/builders/mac/MacAppImageBuilder_ja.properties --- a/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/builders/mac/MacAppImageBuilder_ja.properties Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,71 +0,0 @@ -# -# Copyright (c) 2017, 2018, 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. -# -# - -bundler.name=Mac\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30A4\u30E1\u30FC\u30B8 -bundler.description=\u30AA\u30D7\u30B7\u30E7\u30F3\u3067JRE\u304C\u30D0\u30F3\u30C9\u30EB\u3055\u308C\u3066\u3044\u308BMac\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u30FB\u30D9\u30FC\u30B9\u306E\u30A4\u30E1\u30FC\u30B8\u3002\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9\u30FB\u30D0\u30F3\u30C9\u30EB\u306E\u30D9\u30FC\u30B9\u3068\u3057\u3066\u4F7F\u7528\u3055\u308C\u307E\u3059\u3002 - -param.icon-icns.name=.icns\u30A2\u30A4\u30B3\u30F3 -param.icon-icns.description= ICNS\u5F62\u5F0F\u3067\u306E\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u30A2\u30A4\u30B3\u30F3\u3002 - -param.config-root.name=Configuration Root Name -param.config-root.description=The root directory of COnfiguration files. - -param.configure-launcher-in-plist=Info.plist\u3067\u306E\u30E9\u30F3\u30C1\u30E3\u306E\u69CB\u6210 -param.configure-launcher-in-plist.description=Info.plist\u3067\u306E\u30E9\u30F3\u30C1\u30E3\u306E\u69CB\u6210\u306B\u306F\u30EC\u30AC\u30B7\u30FC\u30FB\u30E1\u30BD\u30C3\u30C9\u3092\u4F7F\u7528\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 - -param.category-name=\u30AB\u30C6\u30B4\u30EA -param.category-name.description=Mac App Store\u306E\u30AB\u30C6\u30B4\u30EA\u3002\u30AD\u30FC\u306F\u30E6\u30FC\u30B6\u30FC\u306B\u8868\u793A\u3055\u308C\u308B\u6587\u5B57\u5217\u3067\u3001\u5024\u306F\u30AB\u30C6\u30B4\u30EA\u306EID\u3067\u3059\u3002 - -param.cfbundle-name.name=CFBundleName -param.cfbundle-name.description=\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u304C\u30E1\u30CB\u30E5\u30FC\u30FB\u30D0\u30FC\u306B\u8868\u793A\u3055\u308C\u308B\u969B\u306E\u540D\u524D\u3002\u3053\u308C\u306F\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u540D\u3068\u306F\u7570\u306A\u308B\u5834\u5408\u304C\u3042\u308A\u307E\u3059\u3002\u3053\u306E\u540D\u524D\u306F16\u6587\u5B57\u672A\u6E80\u3068\u3057\u3001\u30E1\u30CB\u30E5\u30FC\u30FB\u30D0\u30FC\u3068\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u60C5\u5831\u30A6\u30A3\u30F3\u30C9\u30A6\u3067\u306E\u8868\u793A\u306B\u9069\u3057\u305F\u3082\u306E\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 - -param.cfbundle-identifier.name=CFBundleIdentifier -param.cfbundle-identifier.description=MacOSX(\u304A\u3088\u3073Mac App Store)\u306E\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u3092\u4E00\u610F\u306B\u8B58\u5225\u3059\u308B\u8B58\u5225\u5B50\u3002\u82F1\u6570\u5B57(A-Z\u3001a-z\u30010-9)\u3001\u30CF\u30A4\u30D5\u30F3(-)\u304A\u3088\u3073\u30D4\u30EA\u30AA\u30C9(.)\u306E\u307F\u3092\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002 - -param.cfbundle-version.name=CFBundleVersion -param.cfbundle-version.description=\u30B3\u30F3\u30D4\u30E5\u30FC\u30BF\u3067\u8AAD\u53D6\u308A\u53EF\u80FD\u306ACFBundle\u306E\u30D0\u30FC\u30B8\u30E7\u30F3\u3002\u6570\u5B57\u304A\u3088\u3073\u30BC\u30ED\u304B\u30892\u3064\u307E\u3067\u306E\u30C9\u30C3\u30C8\u306E\u307F\u3092\u542B\u3081\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059("1.8.1"\u3001"100"\u306A\u3069)\u3002 - -param.bundle-id-signing-prefix.name=\u30D0\u30F3\u30C9\u30EB\u7F72\u540D\u63A5\u982D\u8F9E -param.bundle-id-signing-prefix.description=\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30D0\u30F3\u30C9\u30EB\u306B\u7F72\u540D\u3059\u308B\u969B\u3001\u7F72\u540D\u3059\u308B\u5FC5\u8981\u306E\u3042\u308B\u3001\u65E2\u5B58\u306ECFBundleIdentifier\u3092\u6301\u305F\u306A\u3044\u3059\u3079\u3066\u306E\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306B\u3053\u306E\u5024\u304C\u63A5\u982D\u8F9E\u3068\u3057\u3066\u4ED8\u3051\u3089\u308C\u307E\u3059\u3002 - -param.default-icon-icns=\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30A2\u30A4\u30B3\u30F3 -param.default-icon-icns.description=\u30E6\u30FC\u30B6\u30FC\u304C\u30A2\u30A4\u30B3\u30F3\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u6307\u5B9A\u3057\u306A\u3044\u5834\u5408\u306E\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30A2\u30A4\u30B3\u30F3\u3002 - -resource.app-info-plist=\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306EInfo.plist -resource.runtime-info-plist=Java\u30E9\u30F3\u30BF\u30A4\u30E0\u306EInfo.plist - -message.bundle-name-too-long-warning={0}\u304C16\u6587\u5B57\u3092\u8D85\u3048\u308B''{1}''\u306B\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002Mac\u3067\u306E\u64CD\u4F5C\u6027\u3092\u3088\u308A\u826F\u304F\u3059\u308B\u305F\u3081\u306B\u77ED\u304F\u3059\u308B\u3053\u3068\u3092\u691C\u8A0E\u3057\u3066\u304F\u3060\u3055\u3044\u3002 -message.null-classpath=Null\u306E\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30EA\u30BD\u30FC\u30B9\u3067\u3059\u304B\u3002 -message.preparing-info-plist=Info.plist\u3092\u6E96\u5099\u3057\u3066\u3044\u307E\u3059: {0} -message.icon-not-icns= \u6307\u5B9A\u3057\u305F\u30A2\u30A4\u30B3\u30F3"{0}"\u306FICNS\u30D5\u30A1\u30A4\u30EB\u3067\u306F\u306A\u304F\u3001\u4F7F\u7528\u3055\u308C\u307E\u305B\u3093\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30A2\u30A4\u30B3\u30F3\u304C\u305D\u306E\u4F4D\u7F6E\u306B\u4F7F\u7528\u3055\u308C\u307E\u3059\u3002 -message.version-string-too-many-components=\u30D0\u30FC\u30B8\u30E7\u30F3\u6587\u5B57\u5217\u306B\u306F\u30011\u30011.2\u30011.2.3\u306A\u30691\u304B\u30893\u306E\u6570\u5B57\u3092\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002 -message.version-string-first-number-not-zero=CFBundleVersion\u306E\u6700\u521D\u306E\u6570\u5B57\u306F\u3001\u30BC\u30ED\u307E\u305F\u306F\u8CA0\u306E\u5024\u306B\u3067\u304D\u307E\u305B\u3093\u3002 -message.version-string-no-negative-numbers=\u30D0\u30FC\u30B8\u30E7\u30F3\u6587\u5B57\u5217\u306B\u8CA0\u306E\u6570\u306F\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093\u3002 -message.version-string-numbers-only=\u30D0\u30FC\u30B8\u30E7\u30F3\u6587\u5B57\u5217\u306F\u3001\u6570\u5B57\u30682\u3064\u307E\u3067\u306E\u30C9\u30C3\u30C8\u3067\u306E\u307F\u69CB\u6210\u3067\u304D\u307E\u3059\u3002 -message.creating-association-with-null-extension=null\u62E1\u5F35\u5B50\u3068\u306E\u95A2\u9023\u4ED8\u3051\u3092\u4F5C\u6210\u3057\u3066\u3044\u307E\u3059\u3002 - -message.ignoring.symlink=\u8B66\u544A: codesign\u304Csymlink {0}\u3092\u30B9\u30AD\u30C3\u30D7\u3057\u3066\u3044\u307E\u3059 -message.keychain.error=Error: unable to get keychain list. diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/builders/mac/MacAppImageBuilder_zh_CN.properties --- a/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/builders/mac/MacAppImageBuilder_zh_CN.properties Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ -# -# Copyright (c) 2017, 2018, 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. -# -# - -bundler.name=Mac \u5E94\u7528\u7A0B\u5E8F\u6620\u50CF -bundler.description=\u4E00\u4E2A\u57FA\u4E8E\u76EE\u5F55\u7684 mac \u5E94\u7528\u7A0B\u5E8F\u6620\u50CF, \u53EF\u4EE5\u9009\u62E9\u6027\u5730\u5E26\u6709\u5171\u540C\u6253\u5305\u7684 JRE\u3002\u7528\u4F5C\u5B89\u88C5\u7A0B\u5E8F\u6253\u5305\u7A0B\u5E8F\u7684\u57FA\u7840 - -param.icon-icns.name=.icns \u56FE\u6807 -param.icon-icns.description= \u5E94\u7528\u7A0B\u5E8F\u7684\u56FE\u6807, \u91C7\u7528 ICNS \u683C\u5F0F\u3002 - -param.config-root.name=Configuration Root Name -param.config-root.description=The root directory of Configuration files. - -param.configure-launcher-in-plist=\u5728 Info.plist \u4E2D\u914D\u7F6E\u542F\u52A8\u7A0B\u5E8F -param.configure-launcher-in-plist.description=\u662F\u5426\u5E94\u4F7F\u7528\u5728 Info.plist \u4E2D\u914D\u7F6E\u542F\u52A8\u7A0B\u5E8F\u7684\u65E7\u65B9\u6CD5\u3002 - -param.category-name=\u7C7B\u522B -param.category-name.description=Mac App Store \u7C7B\u522B\u3002\u8BF7\u6CE8\u610F, \u952E\u662F\u5411\u7528\u6237\u663E\u793A\u7684\u5B57\u7B26\u4E32, \u503C\u662F\u7C7B\u522B\u7684 ID\u3002 - -param.cfbundle-name.name=CFBundleName -param.cfbundle-name.description=\u5E94\u7528\u7A0B\u5E8F\u5728\u83DC\u5355\u680F\u4E2D\u7684\u663E\u793A\u540D\u79F0\u3002\u53EF\u4EE5\u4E0E\u5E94\u7528\u7A0B\u5E8F\u540D\u79F0\u4E0D\u540C\u3002\u6B64\u540D\u79F0\u7684\u957F\u5EA6\u5E94\u5C11\u4E8E 16 \u4E2A\u5B57\u7B26, \u5E76\u4E14\u5E94\u9002\u5408\u5728\u83DC\u5355\u680F\u548C\u5E94\u7528\u7A0B\u5E8F\u7684\u201C\u4FE1\u606F\u201D\u7A97\u53E3\u4E2D\u663E\u793A\u3002 - -param.cfbundle-identifier.name=CFBundleIdentifier -param.cfbundle-identifier.description=\u552F\u4E00\u6807\u8BC6 MacOSX \u5E94\u7528\u7A0B\u5E8F (\u5728 Mac App Store \u4E0A) \u7684\u6807\u8BC6\u7B26\u3002\u53EA\u80FD\u4F7F\u7528\u5B57\u6BCD\u6570\u5B57 (A-Z,a-z,0-9), \u8FDE\u5B57\u7B26 (-) \u548C\u53E5\u70B9 (.) \u5B57\u7B26\u3002 - -param.cfbundle-version.name=CFBundleVersion -param.cfbundle-version.description=CFBundle \u7684\u8BA1\u7B97\u673A\u53EF\u8BFB\u7248\u672C\u3002\u53EA\u80FD\u5305\u542B\u6570\u5B57\u4EE5\u53CA\u96F6\u5230\u4E24\u4E2A\u70B9, \u4F8B\u5982 "1.8.1" \u6216 "100"\u3002 - -param.bundle-id-signing-prefix.name=\u5305\u7B7E\u540D\u524D\u7F00 -param.bundle-id-signing-prefix.description=\u5BF9\u5E94\u7528\u7A0B\u5E8F\u5305\u8FDB\u884C\u7B7E\u540D\u65F6, \u6B64\u503C\u5C06\u4F5C\u4E3A\u524D\u7F00\u6DFB\u52A0\u5230\u9700\u8981\u7B7E\u540D\u4F46\u4E0D\u5177\u6709\u73B0\u6709 CFBundleIdentifier \u7684\u6240\u6709\u7EC4\u4EF6\u4E2D\u3002 - -param.default-icon-icns=\u9ED8\u8BA4\u56FE\u6807 -param.default-icon-icns.description=\u7528\u6237\u672A\u6307\u5B9A icns \u6587\u4EF6\u65F6\u4F7F\u7528\u7684\u9ED8\u8BA4\u56FE\u6807\u3002 - -resource.app-info-plist=\u5E94\u7528\u7A0B\u5E8F Info.plist -resource.runtime-info-plist=Java \u8FD0\u884C\u65F6 Info.plist - -message.bundle-name-too-long-warning={0}\u5DF2\u8BBE\u7F6E\u4E3A ''{1}'', \u5176\u957F\u5EA6\u8D85\u8FC7\u4E86 16 \u4E2A\u5B57\u7B26\u3002\u4E3A\u4E86\u83B7\u5F97\u66F4\u597D\u7684 Mac \u4F53\u9A8C, \u8BF7\u8003\u8651\u5C06\u5176\u7F29\u77ED\u3002 -message.null-classpath=\u662F\u5426\u4E3A\u7A7A\u5E94\u7528\u7A0B\u5E8F\u8D44\u6E90? -message.preparing-info-plist=\u6B63\u5728\u51C6\u5907 Info.plist: {0} -message.icon-not-icns= \u6307\u5B9A\u7684\u56FE\u6807 "{0}" \u4E0D\u662F ICNS \u6587\u4EF6, \u4E0D\u4F1A\u4F7F\u7528\u3002\u5C06\u4F7F\u7528\u9ED8\u8BA4\u56FE\u6807\u4EE3\u66FF\u3002 -message.version-string-too-many-components=\u7248\u672C\u5B57\u7B26\u4E32\u53EF\u4EE5\u5305\u542B 1 \u5230 3 \u4E2A\u6570\u5B57: 1, 1.2, 1.2.3\u3002 -message.version-string-first-number-not-zero=CFBundleVersion \u4E2D\u7684\u7B2C\u4E00\u4E2A\u6570\u5B57\u4E0D\u80FD\u4E3A\u96F6\u6216\u8D1F\u6570\u3002 -message.version-string-no-negative-numbers=\u7248\u672C\u5B57\u7B26\u4E32\u4E2D\u4E0D\u5141\u8BB8\u4F7F\u7528\u8D1F\u6570\u3002 -message.version-string-numbers-only=\u7248\u672C\u5B57\u7B26\u4E32\u53EA\u80FD\u5305\u542B\u6570\u5B57\u548C\u6700\u591A\u4E24\u4E2A\u70B9\u3002 -message.creating-association-with-null-extension=\u6B63\u5728\u4F7F\u7528\u7A7A\u6269\u5C55\u540D\u521B\u5EFA\u5173\u8054\u3002 - -message.ignoring.symlink=\u8B66\u544A: codesign \u6B63\u5728\u8DF3\u8FC7\u7B26\u53F7\u94FE\u63A5 {0} -message.keychain.error=Error: unable to get keychain list. - diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/launchd.plist.template --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/launchd.plist.template Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,14 @@ + + + + + Label + DEPLOY_DAEMON_IDENTIFIER + ProgramArguments + + DEPLOY_DAEMON_LAUNCHER_PATH + + RunAtLoad + KeepAlive + + diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/lic_template.plist --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/lic_template.plist Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,244 @@ + + + + + LPic + + + Attributes + 0x0000 + Data + AAAAAgAAAAAAAAAAAAQAAA== + ID + 5000 + Name + + + + STR# + + + Attributes + 0x0000 + Data + AAYPRW5nbGlzaCBkZWZhdWx0BUFncmVlCERpc2FncmVlBVByaW50B1NhdmUuLi56SWYgeW91IGFncmVlIHdpdGggdGhlIHRlcm1zIG9mIHRoaXMgbGljZW5zZSwgY2xpY2sgIkFncmVlIiB0byBhY2Nlc3MgdGhlIHNvZnR3YXJlLiAgSWYgeW91IGRvIG5vdCBhZ3JlZSwgcHJlc3MgIkRpc2FncmVlLiI= + ID + 5000 + Name + English buttons + + + Attributes + 0x0000 + Data + AAYHRGV1dHNjaAtBa3plcHRpZXJlbghBYmxlaG5lbgdEcnVja2VuClNpY2hlcm4uLi7nS2xpY2tlbiBTaWUgaW4g0kFremVwdGllcmVu0ywgd2VubiBTaWUgbWl0IGRlbiBCZXN0aW1tdW5nZW4gZGVzIFNvZnR3YXJlLUxpemVuenZlcnRyYWdzIGVpbnZlcnN0YW5kZW4gc2luZC4gRmFsbHMgbmljaHQsIGJpdHRlINJBYmxlaG5lbtMgYW5rbGlja2VuLiBTaWUga5pubmVuIGRpZSBTb2Z0d2FyZSBudXIgaW5zdGFsbGllcmVuLCB3ZW5uIFNpZSDSQWt6ZXB0aWVyZW7TIGFuZ2VrbGlja3QgaGFiZW4u + ID + 5001 + Name + German + + + Attributes + 0x0000 + Data + AAYHRW5nbGlzaAVBZ3JlZQhEaXNhZ3JlZQVQcmludAdTYXZlLi4ue0lmIHlvdSBhZ3JlZSB3aXRoIHRoZSB0ZXJtcyBvZiB0aGlzIGxpY2Vuc2UsIHByZXNzICJBZ3JlZSIgdG8gaW5zdGFsbCB0aGUgc29mdHdhcmUuICBJZiB5b3UgZG8gbm90IGFncmVlLCBwcmVzcyAiRGlzYWdyZWUiLg== + ID + 5002 + Name + English + + + Attributes + 0x0000 + Data + AAYHRXNwYZZvbAdBY2VwdGFyCk5vIGFjZXB0YXIISW1wcmltaXIKR3VhcmRhci4uLsBTaSBlc3SHIGRlIGFjdWVyZG8gY29uIGxvcyB0jnJtaW5vcyBkZSBlc3RhIGxpY2VuY2lhLCBwdWxzZSAiQWNlcHRhciIgcGFyYSBpbnN0YWxhciBlbCBzb2Z0d2FyZS4gRW4gZWwgc3VwdWVzdG8gZGUgcXVlIG5vIGVzdI4gZGUgYWN1ZXJkbyBjb24gbG9zIHSOcm1pbm9zIGRlIGVzdGEgbGljZW5jaWEsIHB1bHNlICJObyBhY2VwdGFyLiI= + ID + 5003 + Name + Spanish + + + Attributes + 0x0000 + Data + AAYIRnJhbo1haXMIQWNjZXB0ZXIHUmVmdXNlcghJbXByaW1lcg5FbnJlZ2lzdHJlci4uLrpTaSB2b3VzIGFjY2VwdGV6IGxlcyB0ZXJtZXMgZGUgbGEgcHKOc2VudGUgbGljZW5jZSwgY2xpcXVleiBzdXIgIkFjY2VwdGVyIiBhZmluIGQnaW5zdGFsbGVyIGxlIGxvZ2ljaWVsLiBTaSB2b3VzIG4nkHRlcyBwYXMgZCdhY2NvcmQgYXZlYyBsZXMgdGVybWVzIGRlIGxhIGxpY2VuY2UsIGNsaXF1ZXogc3VyICJSZWZ1c2VyIi4= + ID + 5004 + Name + French + + + Attributes + 0x0000 + Data + AAYISXRhbGlhbm8HQWNjZXR0bwdSaWZpdXRvBlN0YW1wYQtSZWdpc3RyYS4uLn9TZSBhY2NldHRpIGxlIGNvbmRpemlvbmkgZGkgcXVlc3RhIGxpY2VuemEsIGZhaSBjbGljIHN1ICJBY2NldHRvIiBwZXIgaW5zdGFsbGFyZSBpbCBzb2Z0d2FyZS4gQWx0cmltZW50aSBmYWkgY2xpYyBzdSAiUmlmaXV0byIu + ID + 5005 + Name + Italian + + + Attributes + 0x0000 + Data + AAYISmFwYW5lc2UKk6+I04K1gtyCtwyTr4jTgrWC3IK5gvEIiPON/IK3gukHlduRti4uLrSWe4Ncg3SDZ4NFg0eDQY5nl3CLlpH4jF+W8YLMj/CMj4LJk6+I04KzguqC6Y/qjYeCyYLNgUGDXIN0g2eDRYNHg0GC8INDg5ODWINngVuDi4K3gumCvYLfgsmBdZOviNOCtYLcgreBdoLwiZ+CtYLEgq2CvoKzgqKBQoFAk6+I04KzguqCyIKij+qNh4LJgs2BQYF1k6+I04K1gtyCuYLxgXaC8ImfgrWCxIKtgr6Cs4KigUI= + ID + 5006 + Name + Japanese + + + Attributes + 0x0000 + Data + AAYKTmVkZXJsYW5kcwJKYQNOZWUFUHJpbnQJQmV3YWFyLi4upEluZGllbiB1IGFra29vcmQgZ2FhdCBtZXQgZGUgdm9vcndhYXJkZW4gdmFuIGRlemUgbGljZW50aWUsIGt1bnQgdSBvcCAnSmEnIGtsaWtrZW4gb20gZGUgcHJvZ3JhbW1hdHV1ciB0ZSBpbnN0YWxsZXJlbi4gSW5kaWVuIHUgbmlldCBha2tvb3JkIGdhYXQsIGtsaWt0IHUgb3AgJ05lZScu + ID + 5007 + Name + Dutch + + + Attributes + 0x0000 + Data + AAYGU3ZlbnNrCEdvZGuKbm5zBkF2YppqcwhTa3JpdiB1dAhTcGFyYS4uLpNPbSBEdSBnb2Rrim5uZXIgbGljZW5zdmlsbGtvcmVuIGtsaWNrYSBwjCAiR29ka4pubnMiIGaaciBhdHQgaW5zdGFsbGVyYSBwcm9ncmFtcHJvZHVrdGVuLiBPbSBEdSBpbnRlIGdvZGuKbm5lciBsaWNlbnN2aWxsa29yZW4sIGtsaWNrYSBwjCAiQXZimmpzIi4= + ID + 5008 + Name + Swedish + + + Attributes + 0x0000 + Data + AAYRUG9ydHVndZBzLCBCcmFzaWwJQ29uY29yZGFyCURpc2NvcmRhcghJbXByaW1pcglTYWx2YXIuLi6MU2UgZXN0hyBkZSBhY29yZG8gY29tIG9zIHRlcm1vcyBkZXN0YSBsaWNlbo1hLCBwcmVzc2lvbmUgIkNvbmNvcmRhciIgcGFyYSBpbnN0YWxhciBvIHNvZnR3YXJlLiBTZSBui28gZXN0hyBkZSBhY29yZG8sIHByZXNzaW9uZSAiRGlzY29yZGFyIi4= + ID + 5009 + Name + Brazilian Portuguese + + + Attributes + 0x0000 + Data + AAYSU2ltcGxpZmllZCBDaGluZXNlBM2s0uIGsrvNrNLiBLTy06EGtOa0oqGtVMjnufvE+s2s0uKxvtDtv8nQrdLptcTM9b/uo6zH67C0obDNrNLiobHAtLCy17C0y8jtvP6ho8jnufvE+rK7zazS4qOsx+uwtKGwsrvNrNLiobGhow== + ID + 5010 + Name + Simplified Chinese + + + Attributes + 0x0000 + Data + AAYTVHJhZGl0aW9uYWwgQ2hpbmVzZQSmULdOBqSjplC3TgSmQ6ZMBsB4pnOhS1CmcKpHsXqmULdOpbuzXKVpw9K4zKq6sfi02qFBvdCr9qGnplC3TqGopUimd7jLs27F6aFDpnCqR6SjplC3TqFBvdCr9qGnpKOmULdOoaihQw== + ID + 5011 + Name + Traditional Chinese + + + Attributes + 0x0000 + Data + AAYFRGFuc2sERW5pZwVVZW5pZwdVZHNrcml2CkFya2l2ZXIuLi6YSHZpcyBkdSBhY2NlcHRlcmVyIGJldGluZ2Vsc2VybmUgaSBsaWNlbnNhZnRhbGVuLCBza2FsIGR1IGtsaWtrZSBwjCDSRW5pZ9MgZm9yIGF0IGluc3RhbGxlcmUgc29mdHdhcmVuLiBLbGlrIHCMINJVZW5pZ9MgZm9yIGF0IGFubnVsbGVyZSBpbnN0YWxsZXJpbmdlbi4= + ID + 5012 + Name + Danish + + + Attributes + 0x0000 + Data + AAYFU3VvbWkISHl2imtzeW4KRW4gaHl2imtzeQdUdWxvc3RhCVRhbGxlbm5hyW9IeXaKa3N5IGxpc2Vuc3Npc29waW11a3NlbiBlaGRvdCBvc29pdHRhbWFsbGEg1Uh5doprc3nVLiBKb3MgZXQgaHl2imtzeSBzb3BpbXVrc2VuIGVodG9qYSwgb3NvaXRhINVFbiBoeXaKa3N51S4= + ID + 5013 + Name + Finnish + + + Attributes + 0x0000 + Data + AAYRRnJhbo1haXMgY2FuYWRpZW4IQWNjZXB0ZXIHUmVmdXNlcghJbXByaW1lcg5FbnJlZ2lzdHJlci4uLrpTaSB2b3VzIGFjY2VwdGV6IGxlcyB0ZXJtZXMgZGUgbGEgcHKOc2VudGUgbGljZW5jZSwgY2xpcXVleiBzdXIgIkFjY2VwdGVyIiBhZmluIGQnaW5zdGFsbGVyIGxlIGxvZ2ljaWVsLiBTaSB2b3VzIG4nkHRlcyBwYXMgZCdhY2NvcmQgYXZlYyBsZXMgdGVybWVzIGRlIGxhIGxpY2VuY2UsIGNsaXF1ZXogc3VyICJSZWZ1c2VyIi4= + ID + 5014 + Name + French Canadian + + + Attributes + 0x0000 + Data + AAYGS29yZWFuBLW/wMcJtb/AxyC+yMfUBsfBuLDGrgfA+sDlLi4ufrvnv+sgsOi+4LytwMcgs7u/67+hILW/wMfHz7jpLCAitb/AxyIgtNzD37imILStt68gvNLHwcauv/6+7rimILyzxKHHz73KvcO/wC4gtb/Ax8fPwfYgvsq0wrTZuOksICK1v8DHIL7Ix9QiILTcw9+4piC0qbijvcq9w7/ALg== + ID + 5015 + Name + Korean + + + Attributes + 0x0000 + Data + AAYFTm9yc2sERW5pZwlJa2tlIGVuaWcIU2tyaXYgdXQKQXJraXZlci4uLqNIdmlzIERlIGVyIGVuaWcgaSBiZXN0ZW1tZWxzZW5lIGkgZGVubmUgbGlzZW5zYXZ0YWxlbiwga2xpa2tlciBEZSBwjCAiRW5pZyIta25hcHBlbiBmb3IgjCBpbnN0YWxsZXJlIHByb2dyYW12YXJlbi4gSHZpcyBEZSBpa2tlIGVyIGVuaWcsIGtsaWtrZXIgRGUgcIwgIklra2UgZW5pZyIu + ID + 5016 + Name + Norwegian + + + TEXT + + + Attributes + 0x0000 + Data + APPLICATION_LICENSE_TEXT + ID + 5000 + Name + English SLA + + + TMPL + + + Attributes + 0x0000 + Data + E0RlZmF1bHQgTGFuZ3VhZ2UgSUREV1JEBUNvdW50T0NOVAQqKioqTFNUQwtzeXMgbGFuZyBJRERXUkQebG9jYWwgcmVzIElEIChvZmZzZXQgZnJvbSA1MDAwRFdSRBAyLWJ5dGUgbGFuZ3VhZ2U/RFdSRAQqKioqTFNURQ== + ID + 128 + Name + LPic + + + plst + + + Attributes + 0x0050 + Data + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + ID + 0 + Name + + + + styl + + + Attributes + 0x0000 + Data + AAMAAAAAAAwACQAUAAAAAAAAAAAAAAAAACcADAAJABQBAAAAAAAAAAAAAAAAKgAMAAkAFAAAAAAAAAAAAAA= + ID + 5000 + Name + English SLA + + + + diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/DMGsetup.scpt --- a/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/DMGsetup.scpt Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ -tell application "Finder" - tell disk "DEPLOY_ACTUAL_VOLUME_NAME" - open - set current view of container window to icon view - set toolbar visible of container window to false - set statusbar visible of container window to false - - set the bounds of container window to {400, 100, 917, 370} - - set theViewOptions to the icon view options of container window - set arrangement of theViewOptions to not arranged - set icon size of theViewOptions to 128 - end tell -end tell - diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/GenericApp.icns Binary file src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/GenericApp.icns has changed diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/GenericAppHiDPI.icns Binary file src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/GenericAppHiDPI.icns has changed diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/Info-lite.plist.template --- a/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/Info-lite.plist.template Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ - - - - - LSMinimumSystemVersion - 10.9 - CFBundleDevelopmentRegion - English - CFBundleAllowMixedLocalizations - - CFBundleExecutable - DEPLOY_LAUNCHER_NAME - CFBundleIconFile - DEPLOY_ICON_FILE - CFBundleIdentifier - DEPLOY_BUNDLE_IDENTIFIER - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - DEPLOY_BUNDLE_NAME - CFBundlePackageType - APPL - CFBundleShortVersionString - DEPLOY_BUNDLE_SHORT_VERSION - CFBundleSignature - ???? - - LSApplicationCategoryType - DEPLOY_BUNDLE_CATEGORY - CFBundleVersion - DEPLOY_BUNDLE_CFBUNDLE_VERSION - NSHumanReadableCopyright - DEPLOY_BUNDLE_COPYRIGHTDEPLOY_FILE_ASSOCIATIONS - NSHighResolutionCapable - true - - diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/Info.plist.template --- a/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/Info.plist.template Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +0,0 @@ - - - - - LSMinimumSystemVersion - 10.7.4 - CFBundleDevelopmentRegion - English - CFBundleAllowMixedLocalizations - - CFBundleExecutable - DEPLOY_LAUNCHER_NAME - CFBundleIconFile - DEPLOY_ICON_FILE - CFBundleIdentifier - DEPLOY_BUNDLE_IDENTIFIER - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - DEPLOY_BUNDLE_NAME - CFBundlePackageType - APPL - CFBundleShortVersionString - DEPLOY_BUNDLE_SHORT_VERSION - CFBundleSignature - ???? - - LSApplicationCategoryType - DEPLOY_BUNDLE_CATEGORY - CFBundleVersion - DEPLOY_BUNDLE_CFBUNDLE_VERSION - NSHumanReadableCopyright - DEPLOY_BUNDLE_COPYRIGHT - JVMRuntime - DEPLOY_JAVA_RUNTIME_NAME - JVMMainClassName - DEPLOY_LAUNCHER_CLASS - JVMAppClasspath - DEPLOY_APP_CLASSPATH - JVMMainJarName - DEPLOY_MAIN_JAR_NAME - JVMPreferencesID - DEPLOY_PREFERENCES_ID - JVMOptions - -DEPLOY_JVM_OPTIONS - - ArgOptions - -DEPLOY_ARGUMENTS - DEPLOY_FILE_ASSOCIATIONS - NSHighResolutionCapable - true - - diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/MacAppBundler.properties --- a/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/MacAppBundler.properties Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,82 +0,0 @@ -# -# Copyright (c) 2017, 2018, 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. -# -# - -bundler.name=Mac Application Image -bundler.description=A Directory based image of a mac Application with an optionally co-bundled JRE. Used as a base for the Installer bundlers - -param.signing-key-developer-id-app.name=Apple Developer ID Application Signing Key -param.signing-key-developer-id-app.description=The full name of the Apple Developer ID Application signing key. - -param.icon-icns.name=.icns Icon -param.icon-icns.description=Icon for the application, in ICNS format. - -param.config-root.name=Config Root Dir -param.config-root.description=Configuration directory. - -param.configure-launcher-in-plist=Configure Launcher in Info.plist -param.configure-launcher-in-plist.description=Should the legacy method of configuring hte launcher in the Info.plist be used. - -param.category-name=Category -param.category-name.description=Mac App Store Categories. Note that the key is the string to display to the user and the value is the id of the category. - -param.cfbundle-name.name=CFBundleName -param.cfbundle-name.description=The name of the app as it appears in the Menu Bar. This can be different from the application name. This name should be less than 16 characters long and be suitable for displaying in the menu bar and the app's Info window. - -param.cfbundle-identifier.name=CFBundleIdentifier -param.cfbundle-identifier.description=An identifier that uniquely identifies the application for MacOSX (and on the Mac App Store). May only use alphanumeric (A-Z,a-z,0-9), hyphen (-), and period (.) characters. - -param.cfbundle-version.name=CFBundleVersion -param.cfbundle-version.description=An computer readable version for the CFBundle. May contain only digits and from zero to two dots, such as "1.8.1" or "100". - -param.bundle-id-signing-prefix.name=Bundle Signing Prefix -param.bundle-id-signing-prefix.description=When signing the application bundle this value is prefixed to all components that need to be signed that don't have an existing CFBundleIdentifier. - -param.raw-executable-url.name=Launcher URL -param.raw-executable-url.description=Override the packager default launcher with a custom launcher. - -param.default-icon-icns=Default Icon -param.default-icon-icns.description=The Default Icon for when a user does not specify an icns file. - -error.invalid-cfbundle-version=Invalid CFBundleVersion - ''{0}'' -error.invalid-cfbundle-version.advice=Set a compatible 'appVersion' or set a 'mac.CFBundleVersion'. Valid versions are one to three integers separated by dots. -error.explicit-sign-no-cert=Signature explicitly requested but no signing certificate specified. -error.explicit-sign-no-cert.advice=Either specify a valid cert in 'mac.signing-key-developer-id-app' or unset 'signBundle' or set 'signBundle' to false. -error.non-existent-runtime=The file for the Runtime/JRE directory does not exist. -error.non-existent-runtime.advice=Point the runtime parameter to a directory that containes the JRE. -error.cannot-detect-runtime-in-directory=Cannot determine which JRE/JDK exists in the specified runtime directory. -error.cannot-detect-runtime-in-directory.advice=Point the runtime directory to one of the JDK/JRE root, the Contents/Home directory of that root, or the Contents/Home/jre directory of the JDK. -resource.bundle-config-file=Bundle config file - -message.bundle-name-too-long-warning={0} is set to ''{1}'', which is longer than 16 characters. For a better Mac experience consider shortening it. -message.no-mac-jre-support=Currently Macs require a JDK to package -message.null-classpath=Null app resources? -message.preparing-info-plist=Preparing Info.plist\: {0} -message.icon-not-icns= The specified icon "{0}" is not an ICNS file and will not be used. The default icon will be used in it's place. -message.version-string-too-many-components=Version sting may have between 1 and 3 numbers: 1, 1.2, 1.2.3. -message.version-string-first-number-not-zero=The first number in a CFBundleVersion cannot be zero or negative. -message.version-string-no-negative-numbers=Negative numbers are not allowed in version strings. -message.version-string-numbers-only=Version strings can consist of only numbers and up to two dots. -message.creating-association-with-null-extension=Creating association with null extension. diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/MacAppBundler_ja.properties --- a/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/MacAppBundler_ja.properties Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +0,0 @@ -bundler.name=Mac\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30A4\u30E1\u30FC\u30B8 -bundler.description=\u30AA\u30D7\u30B7\u30E7\u30F3\u3067JRE\u304C\u30D0\u30F3\u30C9\u30EB\u3055\u308C\u3066\u3044\u308BMac\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u30FB\u30D9\u30FC\u30B9\u306E\u30A4\u30E1\u30FC\u30B8\u3002\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9\u30FB\u30D0\u30F3\u30C9\u30EB\u306E\u30D9\u30FC\u30B9\u3068\u3057\u3066\u4F7F\u7528\u3055\u308C\u307E\u3059\u3002 - -param.signing-key-developer-id-app.name=Apple Developer ID\u306E\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u7F72\u540D\u30AD\u30FC -param.signing-key-developer-id-app.description=Apple Developer ID\u306E\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u7F72\u540D\u30AD\u30FC\u306E\u30D5\u30EB\u30FB\u30CD\u30FC\u30E0\u3002 - -param.icon-icns.name=.icns\u30A2\u30A4\u30B3\u30F3 -param.icon-icns.description=ICNS\u5F62\u5F0F\u3067\u306E\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u30A2\u30A4\u30B3\u30F3\u3002 - -param.config-root.name=Config Root Dir -param.config-root.description=Configuration directory. - -param.configure-launcher-in-plist=Info.plist\u3067\u306E\u30E9\u30F3\u30C1\u30E3\u306E\u69CB\u6210 -param.configure-launcher-in-plist.description=Info.plist\u3067\u306E\u30E9\u30F3\u30C1\u30E3\u306E\u69CB\u6210\u306B\u306F\u30EC\u30AC\u30B7\u30FC\u30FB\u30E1\u30BD\u30C3\u30C9\u3092\u4F7F\u7528\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 - -param.category-name=\u30AB\u30C6\u30B4\u30EA -param.category-name.description=Mac App Store\u306E\u30AB\u30C6\u30B4\u30EA\u3002\u30AD\u30FC\u306F\u30E6\u30FC\u30B6\u30FC\u306B\u8868\u793A\u3055\u308C\u308B\u6587\u5B57\u5217\u3067\u3001\u5024\u306F\u30AB\u30C6\u30B4\u30EA\u306EID\u3067\u3059\u3002 - -param.cfbundle-name.name=CFBundleName -param.cfbundle-name.description=\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u304C\u30E1\u30CB\u30E5\u30FC\u30FB\u30D0\u30FC\u306B\u8868\u793A\u3055\u308C\u308B\u969B\u306E\u540D\u524D\u3002\u3053\u308C\u306F\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u540D\u3068\u306F\u7570\u306A\u308B\u5834\u5408\u304C\u3042\u308A\u307E\u3059\u3002\u3053\u306E\u540D\u524D\u306F16\u6587\u5B57\u672A\u6E80\u3068\u3057\u3001\u30E1\u30CB\u30E5\u30FC\u30FB\u30D0\u30FC\u3068\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u60C5\u5831\u30A6\u30A3\u30F3\u30C9\u30A6\u3067\u306E\u8868\u793A\u306B\u9069\u3057\u305F\u3082\u306E\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 - -param.cfbundle-identifier.name=CFBundleIdentifier -param.cfbundle-identifier.description=MacOSX(\u304A\u3088\u3073Mac App Store)\u306E\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u3092\u4E00\u610F\u306B\u8B58\u5225\u3059\u308B\u8B58\u5225\u5B50\u3002\u82F1\u6570\u5B57(A-Z\u3001a-z\u30010-9)\u3001\u30CF\u30A4\u30D5\u30F3(-)\u304A\u3088\u3073\u30D4\u30EA\u30AA\u30C9(.)\u306E\u307F\u3092\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002 - -param.cfbundle-version.name=CFBundleVersion -param.cfbundle-version.description=\u30B3\u30F3\u30D4\u30E5\u30FC\u30BF\u3067\u8AAD\u53D6\u308A\u53EF\u80FD\u306ACFBundle\u306E\u30D0\u30FC\u30B8\u30E7\u30F3\u3002\u6570\u5B57\u304A\u3088\u3073\u30BC\u30ED\u304B\u30892\u3064\u307E\u3067\u306E\u30C9\u30C3\u30C8\u306E\u307F\u3092\u542B\u3081\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059("1.8.1"\u3001"100"\u306A\u3069)\u3002 - -param.bundle-id-signing-prefix.name=\u30D0\u30F3\u30C9\u30EB\u7F72\u540D\u63A5\u982D\u8F9E -param.bundle-id-signing-prefix.description=\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30D0\u30F3\u30C9\u30EB\u306B\u7F72\u540D\u3059\u308B\u969B\u3001\u7F72\u540D\u3059\u308B\u5FC5\u8981\u306E\u3042\u308B\u3001\u65E2\u5B58\u306ECFBundleIdentifier\u3092\u6301\u305F\u306A\u3044\u3059\u3079\u3066\u306E\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306B\u3053\u306E\u5024\u304C\u63A5\u982D\u8F9E\u3068\u3057\u3066\u4ED8\u3051\u3089\u308C\u307E\u3059\u3002 - -param.raw-executable-url.name=\u30E9\u30F3\u30C1\u30E3URL -param.raw-executable-url.description=\u30D1\u30C3\u30B1\u30FC\u30B8\u30E3\u306E\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30E9\u30F3\u30C1\u30E3\u3092\u30AB\u30B9\u30BF\u30E0\u30FB\u30E9\u30F3\u30C1\u30E3\u3067\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3057\u307E\u3059\u3002 - -param.default-icon-icns=\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30A2\u30A4\u30B3\u30F3 -param.default-icon-icns.description=\u30E6\u30FC\u30B6\u30FC\u304C\u30A2\u30A4\u30B3\u30F3\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u6307\u5B9A\u3057\u306A\u3044\u5834\u5408\u306E\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30A2\u30A4\u30B3\u30F3\u3002 - -error.invalid-cfbundle-version=CFBundleVersion - ''{0}''\u304C\u7121\u52B9\u3067\u3059 -error.invalid-cfbundle-version.advice=\u4E92\u63DB\u6027\u306E\u3042\u308B'appVersion'\u3092\u8A2D\u5B9A\u3059\u308B\u304B\u3001'mac.CFBundleVersion'\u3092\u8A2D\u5B9A\u3057\u307E\u3059\u3002\u6709\u52B9\u306A\u30D0\u30FC\u30B8\u30E7\u30F3\u306F\u3001\u30C9\u30C3\u30C8\u3067\u533A\u5207\u3089\u308C\u305F1\u304B\u30893\u3064\u306E\u6574\u6570\u3067\u3059\u3002 -error.explicit-sign-no-cert=\u7F72\u540D\u304C\u660E\u793A\u7684\u306B\u8981\u6C42\u3055\u308C\u307E\u3057\u305F\u304C\u3001\u7F72\u540D\u8A3C\u660E\u66F8\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002 -error.explicit-sign-no-cert.advice=\u6709\u52B9\u306A\u8A3C\u660E\u66F8\u3092'mac.signing-key-developer-id-app'\u3067\u6307\u5B9A\u3059\u308B\u304B\u3001'signBundle'\u3092\u8A2D\u5B9A\u89E3\u9664\u3059\u308B\u304B\u3001\u307E\u305F\u306F'signBundle'\u3092false\u306B\u8A2D\u5B9A\u3057\u307E\u3059\u3002 -error.non-existent-runtime=\u30E9\u30F3\u30BF\u30A4\u30E0/JRE\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306B\u30D5\u30A1\u30A4\u30EB\u304C\u5B58\u5728\u3057\u307E\u305B\u3093\u3002 -error.non-existent-runtime.advice=\u30E9\u30F3\u30BF\u30A4\u30E0\u30FB\u30D1\u30E9\u30E1\u30FC\u30BF\u306B\u3001JRE\u3092\u542B\u3080\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u6307\u5B9A\u3057\u307E\u3059\u3002 -error.cannot-detect-runtime-in-directory=\u6307\u5B9A\u3057\u305F\u30E9\u30F3\u30BF\u30A4\u30E0\u30FB\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306B\u3069\u306EJRE/JDK\u304C\u5B58\u5728\u3059\u308B\u306E\u304B\u3092\u7279\u5B9A\u3067\u304D\u307E\u305B\u3093\u3002 -error.cannot-detect-runtime-in-directory.advice=\u30E9\u30A4\u30BF\u30A4\u30E0\u30FB\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306B\u3001JDK/JRE\u30EB\u30FC\u30C8\u3001\u305D\u306E\u30EB\u30FC\u30C8\u306E\u30B3\u30F3\u30C6\u30F3\u30C4/\u30DB\u30FC\u30E0\u30FB\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3001\u307E\u305F\u306FJDK\u306E\u30B3\u30F3\u30C6\u30F3\u30C4/\u30DB\u30FC\u30E0/jre\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u3044\u305A\u308C\u304B\u3092\u6307\u5B9A\u3057\u307E\u3059\u3002 -resource.bundle-config-file=\u30D0\u30F3\u30C9\u30EB\u69CB\u6210\u30D5\u30A1\u30A4\u30EB - -message.bundle-name-too-long-warning={0}\u304C16\u6587\u5B57\u3092\u8D85\u3048\u308B''{1}''\u306B\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002Mac\u3067\u306E\u64CD\u4F5C\u6027\u3092\u3088\u308A\u826F\u304F\u3059\u308B\u305F\u3081\u306B\u77ED\u304F\u3059\u308B\u3053\u3068\u3092\u691C\u8A0E\u3057\u3066\u304F\u3060\u3055\u3044\u3002 -message.no-mac-jre-support=\u73FE\u5728\u3001Mac\u3067\u306FJDK\u3092\u30D1\u30C3\u30B1\u30FC\u30B8\u5316\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059 -message.null-classpath=Null\u306E\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30EA\u30BD\u30FC\u30B9\u3067\u3059\u304B\u3002 -message.preparing-info-plist=Info.plist\u3092\u6E96\u5099\u3057\u3066\u3044\u307E\u3059: {0} -message.icon-not-icns= \u6307\u5B9A\u3057\u305F\u30A2\u30A4\u30B3\u30F3"{0}"\u306FICNS\u30D5\u30A1\u30A4\u30EB\u3067\u306F\u306A\u304F\u3001\u4F7F\u7528\u3055\u308C\u307E\u305B\u3093\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30A2\u30A4\u30B3\u30F3\u304C\u305D\u306E\u4F4D\u7F6E\u306B\u4F7F\u7528\u3055\u308C\u307E\u3059\u3002 -message.version-string-too-many-components=\u30D0\u30FC\u30B8\u30E7\u30F3\u6587\u5B57\u5217\u306B\u306F\u30011\u30011.2\u30011.2.3\u306A\u30691\u304B\u30893\u306E\u6570\u5B57\u3092\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002 -message.version-string-first-number-not-zero=CFBundleVersion\u306E\u6700\u521D\u306E\u6570\u5B57\u306F\u3001\u30BC\u30ED\u307E\u305F\u306F\u8CA0\u306E\u5024\u306B\u3067\u304D\u307E\u305B\u3093\u3002 -message.version-string-no-negative-numbers=\u30D0\u30FC\u30B8\u30E7\u30F3\u6587\u5B57\u5217\u306B\u8CA0\u306E\u6570\u306F\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093\u3002 -message.version-string-numbers-only=\u30D0\u30FC\u30B8\u30E7\u30F3\u6587\u5B57\u5217\u306F\u3001\u6570\u5B57\u30682\u3064\u307E\u3067\u306E\u30C9\u30C3\u30C8\u3067\u306E\u307F\u69CB\u6210\u3067\u304D\u307E\u3059\u3002 -message.creating-association-with-null-extension=null\u62E1\u5F35\u5B50\u3068\u306E\u95A2\u9023\u4ED8\u3051\u3092\u4F5C\u6210\u3057\u3066\u3044\u307E\u3059\u3002 diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/MacAppBundler_zh_CN.properties --- a/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/MacAppBundler_zh_CN.properties Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,82 +0,0 @@ -# -# Copyright (c) 2017, 2018, 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. -# -# - -bundler.name=Mac \u5E94\u7528\u7A0B\u5E8F\u6620\u50CF -bundler.description=\u4E00\u4E2A\u57FA\u4E8E\u76EE\u5F55\u7684 mac \u5E94\u7528\u7A0B\u5E8F\u6620\u50CF, \u53EF\u4EE5\u9009\u62E9\u6027\u5730\u5E26\u6709\u5171\u540C\u6253\u5305\u7684 JRE\u3002\u7528\u4F5C\u5B89\u88C5\u7A0B\u5E8F\u6253\u5305\u7A0B\u5E8F\u7684\u57FA\u7840 - -param.signing-key-developer-id-app.name=Apple \u5F00\u53D1\u8005 ID \u5E94\u7528\u7A0B\u5E8F\u7B7E\u540D\u5BC6\u94A5 -param.signing-key-developer-id-app.description=Apple \u5F00\u53D1\u8005 ID \u5E94\u7528\u7A0B\u5E8F\u7B7E\u540D\u5BC6\u94A5\u7684\u5168\u540D\u3002 - -param.icon-icns.name=.icns \u56FE\u6807 -param.icon-icns.description=\u5E94\u7528\u7A0B\u5E8F\u7684\u56FE\u6807, \u91C7\u7528 ICNS \u683C\u5F0F\u3002 - -param.config-root.name=Config Root Dir -param.config-root.description=Configuration directory. - -param.configure-launcher-in-plist=\u5728 Info.plist \u4E2D\u914D\u7F6E\u542F\u52A8\u7A0B\u5E8F -param.configure-launcher-in-plist.description=\u662F\u5426\u5E94\u4F7F\u7528\u5728 Info.plist \u4E2D\u914D\u7F6E\u542F\u52A8\u7A0B\u5E8F\u7684\u65E7\u65B9\u6CD5\u3002 - -param.category-name=\u7C7B\u522B -param.category-name.description=Mac App Store \u7C7B\u522B\u3002\u8BF7\u6CE8\u610F, \u952E\u662F\u5411\u7528\u6237\u663E\u793A\u7684\u5B57\u7B26\u4E32, \u503C\u662F\u7C7B\u522B\u7684 ID\u3002 - -param.cfbundle-name.name=CFBundleName -param.cfbundle-name.description=\u5E94\u7528\u7A0B\u5E8F\u5728\u83DC\u5355\u680F\u4E2D\u7684\u663E\u793A\u540D\u79F0\u3002\u53EF\u4EE5\u4E0E\u5E94\u7528\u7A0B\u5E8F\u540D\u79F0\u4E0D\u540C\u3002\u6B64\u540D\u79F0\u7684\u957F\u5EA6\u5E94\u5C11\u4E8E 16 \u4E2A\u5B57\u7B26, \u5E76\u4E14\u5E94\u9002\u5408\u5728\u83DC\u5355\u680F\u548C\u5E94\u7528\u7A0B\u5E8F\u7684\u201C\u4FE1\u606F\u201D\u7A97\u53E3\u4E2D\u663E\u793A\u3002 - -param.cfbundle-identifier.name=CFBundleIdentifier -param.cfbundle-identifier.description=\u552F\u4E00\u6807\u8BC6 MacOSX \u5E94\u7528\u7A0B\u5E8F (\u5728 Mac App Store \u4E0A) \u7684\u6807\u8BC6\u7B26\u3002\u53EA\u80FD\u4F7F\u7528\u5B57\u6BCD\u6570\u5B57 (A-Z,a-z,0-9), \u8FDE\u5B57\u7B26 (-) \u548C\u53E5\u70B9 (.) \u5B57\u7B26\u3002 - -param.cfbundle-version.name=CFBundleVersion -param.cfbundle-version.description=CFBundle \u7684\u8BA1\u7B97\u673A\u53EF\u8BFB\u7248\u672C\u3002\u53EA\u80FD\u5305\u542B\u6570\u5B57\u4EE5\u53CA\u96F6\u5230\u4E24\u4E2A\u70B9, \u4F8B\u5982 "1.8.1" \u6216 "100"\u3002 - -param.bundle-id-signing-prefix.name=\u5305\u7B7E\u540D\u524D\u7F00 -param.bundle-id-signing-prefix.description=\u5BF9\u5E94\u7528\u7A0B\u5E8F\u5305\u8FDB\u884C\u7B7E\u540D\u65F6, \u6B64\u503C\u5C06\u4F5C\u4E3A\u524D\u7F00\u6DFB\u52A0\u5230\u9700\u8981\u7B7E\u540D\u4F46\u4E0D\u5177\u6709\u73B0\u6709 CFBundleIdentifier \u7684\u6240\u6709\u7EC4\u4EF6\u4E2D\u3002 - -param.raw-executable-url.name=\u542F\u52A8\u7A0B\u5E8F URL -param.raw-executable-url.description=\u4F7F\u7528\u5B9A\u5236\u542F\u52A8\u7A0B\u5E8F\u8986\u76D6\u6253\u5305\u7A0B\u5E8F\u9ED8\u8BA4\u542F\u52A8\u7A0B\u5E8F\u3002 - -param.default-icon-icns=\u9ED8\u8BA4\u56FE\u6807 -param.default-icon-icns.description=\u7528\u6237\u672A\u6307\u5B9A icns \u6587\u4EF6\u65F6\u4F7F\u7528\u7684\u9ED8\u8BA4\u56FE\u6807\u3002 - -error.invalid-cfbundle-version=\u65E0\u6548\u7684 CFBundleVersion - ''{0}'' -error.invalid-cfbundle-version.advice=\u8BBE\u7F6E\u517C\u5BB9\u7684 'appVersion' \u6216\u8005\u8BBE\u7F6E 'mac.CFBundleVersion'\u3002\u6709\u6548\u7248\u672C\u5305\u542B\u4E00\u5230\u4E09\u4E2A\u7528\u70B9\u5206\u9694\u7684\u6574\u6570\u3002 -error.explicit-sign-no-cert=\u5DF2\u660E\u786E\u8BF7\u6C42\u7B7E\u540D, \u4F46\u672A\u6307\u5B9A\u7B7E\u540D\u8BC1\u4E66\u3002 -error.explicit-sign-no-cert.advice=\u5728 'mac.signing-key-developer-id-app' \u4E2D\u6307\u5B9A\u6709\u6548\u7684\u8BC1\u4E66, \u6216\u8005\u53D6\u6D88\u8BBE\u7F6E 'signBundle', \u6216\u8005\u5C06 'signBundle' \u8BBE\u7F6E\u4E3A\u201C\u5047\u201D\u3002 -error.non-existent-runtime=\u8FD0\u884C\u65F6/JRE \u76EE\u5F55\u7684\u6587\u4EF6\u4E0D\u5B58\u5728\u3002 -error.non-existent-runtime.advice=\u5C06\u8FD0\u884C\u65F6\u53C2\u6570\u6307\u5411\u5305\u542B JRE \u7684\u76EE\u5F55\u3002 -error.cannot-detect-runtime-in-directory=\u65E0\u6CD5\u786E\u5B9A\u6307\u5B9A\u7684\u8FD0\u884C\u65F6\u76EE\u5F55\u4E2D\u5B58\u5728\u54EA\u4E2A\u7248\u672C\u7684 JRE/JDK\u3002 -error.cannot-detect-runtime-in-directory.advice=\u5C06\u8FD0\u884C\u65F6\u76EE\u5F55\u6307\u5411\u4EE5\u4E0B\u76EE\u5F55\u4E4B\u4E00: JDK/JRE \u6839\u76EE\u5F55, \u8BE5\u6839\u76EE\u5F55\u7684 Contents/Home \u76EE\u5F55\u6216 JDK \u7684 Contents/Home/jre \u76EE\u5F55\u3002 -resource.bundle-config-file=\u5305\u914D\u7F6E\u6587\u4EF6 - -message.bundle-name-too-long-warning={0}\u5DF2\u8BBE\u7F6E\u4E3A ''{1}'', \u5176\u957F\u5EA6\u8D85\u8FC7\u4E86 16 \u4E2A\u5B57\u7B26\u3002\u4E3A\u4E86\u83B7\u5F97\u66F4\u597D\u7684 Mac \u4F53\u9A8C, \u8BF7\u8003\u8651\u5C06\u5176\u7F29\u77ED\u3002 -message.no-mac-jre-support=Mac \u5F53\u524D\u9700\u8981 JDK \u4EE5\u4FBF\u6253\u5305 -message.null-classpath=\u662F\u5426\u4E3A\u7A7A\u5E94\u7528\u7A0B\u5E8F\u8D44\u6E90? -message.preparing-info-plist=\u6B63\u5728\u51C6\u5907 Info.plist: {0} -message.icon-not-icns= \u6307\u5B9A\u7684\u56FE\u6807 "{0}" \u4E0D\u662F ICNS \u6587\u4EF6, \u4E0D\u4F1A\u4F7F\u7528\u3002\u5C06\u4F7F\u7528\u9ED8\u8BA4\u56FE\u6807\u4EE3\u66FF\u3002 -message.version-string-too-many-components=\u7248\u672C\u5B57\u7B26\u4E32\u53EF\u4EE5\u5305\u542B 1 \u5230 3 \u4E2A\u6570\u5B57: 1, 1.2, 1.2.3\u3002 -message.version-string-first-number-not-zero=CFBundleVersion \u4E2D\u7684\u7B2C\u4E00\u4E2A\u6570\u5B57\u4E0D\u80FD\u4E3A\u96F6\u6216\u8D1F\u6570\u3002 -message.version-string-no-negative-numbers=\u7248\u672C\u5B57\u7B26\u4E32\u4E2D\u4E0D\u5141\u8BB8\u4F7F\u7528\u8D1F\u6570\u3002 -message.version-string-numbers-only=\u7248\u672C\u5B57\u7B26\u4E32\u53EA\u80FD\u5305\u542B\u6570\u5B57\u548C\u6700\u591A\u4E24\u4E2A\u70B9\u3002 -message.creating-association-with-null-extension=\u6B63\u5728\u4F7F\u7528\u7A7A\u6269\u5C55\u540D\u521B\u5EFA\u5173\u8054\u3002 diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/MacAppStore.entitlements --- a/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/MacAppStore.entitlements Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ - - - - - com.apple.security.app-sandbox - - - diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/MacAppStoreBundler.properties --- a/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/MacAppStoreBundler.properties Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,61 +0,0 @@ -# -# Copyright (c) 2017, 2018, 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. -# -# - -bundler.name=Mac App Store Ready Bundler -bundler.description=Creates a binary bundle ready for deployment into the Mac App Store." - -param.signing-key-app.name=Application Signing Key -param.signing-key-app.description=The full name of the signing key to sign the application with. - -param.signing-key-pkg.name=Installer Signing Key -param.signing-key-pkg.description=The full name of the signing key to sign the PKG Installer with. - -param.mac-app-store-entitlements.name=Entitlements File -param.mac-app-store-entitlements.description=File location of a custom mac app store entitlements file - -param.installer-suffix.name=Installer Suffix -param.installer-suffix.description=The suffix for the installer name for this package. .pkg. - -resource.mac-app-store-entitlements=Mac App Store Entitlements -resource.mac-app-store-inherit-entitlements=Mac App Store Inherit Entitlements - -error.parameters-null=Parameters map is null. -error.parameters-null.advice=Pass in a non-null parameters map. -error.cannot-create-output-dir=Output directory {0} cannot be created. -error.cannot-write-to-output-dir=Output directory {0} is not writable. -error.no-system-runtime=Bundle Configured to use the System JRE -error.no-system-runtime.advice=Do not set 'runtime' to null, either don't set it or set it to a valid value. -error.must-sign-app-store=Mac App Store apps must be signed, and signing has been disabled by bundler configuration. -error.must-sign-app-store.advice=Either unset 'signBundle' or set 'signBundle' to true. -error.no-app-signing-key=No Mac App Store App Signing Key -error.no-app-signing-key.advice=Install your app signing keys into your Mac Keychain using XCode. -error.no-pkg-signing-key=No Mac App Store Installer Signing Key -error.no-pkg-signing-key.advice=Install your app signing keys into your Mac Keychain using XCode. -error.certificate.expired=Error: Certificate expired {0}. - - -message.building-bundle=Building Mac App Store Bundle for {0} -mesasge.intermediate-bundle-location=Intermediate application bundle image\: {0} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/MacAppStoreBundler_ja.properties --- a/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/MacAppStoreBundler_ja.properties Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,61 +0,0 @@ -# -# Copyright (c) 2017, 2018, 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. -# -# - -bundler.name=Mac App Store\u306E\u6E96\u5099\u5B8C\u4E86\u30D0\u30F3\u30C9\u30E9 -bundler.description=Mac App Store\u3078\u306E\u30C7\u30D7\u30ED\u30A4\u30E1\u30F3\u30C8\u6E96\u5099\u5B8C\u4E86\u306E\u30D0\u30A4\u30CA\u30EA\u30FB\u30D0\u30F3\u30C9\u30EB\u3092\u4F5C\u6210\u3057\u307E\u3059\u3002" - -param.signing-key-app.name=\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u7F72\u540D\u30AD\u30FC -param.signing-key-app.description=\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u3092\u7F72\u540D\u3059\u308B\u7F72\u540D\u30AD\u30FC\u306E\u30D5\u30EB\u30FB\u30CD\u30FC\u30E0\u3002 - -param.signing-key-pkg.name=\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9\u7F72\u540D\u30AD\u30FC -param.signing-key-pkg.description=PKG\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9\u3092\u7F72\u540D\u3059\u308B\u7F72\u540D\u30AD\u30FC\u306E\u30D5\u30EB\u30FB\u30CD\u30FC\u30E0\u3002 - -param.mac-app-store-entitlements.name=\u6A29\u9650\u30D5\u30A1\u30A4\u30EB -param.mac-app-store-entitlements.description=\u30AB\u30B9\u30BF\u30E0Mac App Store\u6A29\u9650\u30D5\u30A1\u30A4\u30EB\u306E\u30D5\u30A1\u30A4\u30EB\u5834\u6240 - -param.installer-suffix.name=\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9\u63A5\u5C3E\u8F9E -param.installer-suffix.description=\u3053\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9\u540D\u63A5\u5C3E\u8F9E\u3002.pkg\u3002 - -resource.mac-app-store-entitlements=Mac App Store\u6A29\u9650 -resource.mac-app-store-inherit-entitlements=Mac App Store\u7D99\u627F\u6A29\u9650 - -error.parameters-null=\u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30DE\u30C3\u30D7\u304Cnull\u3067\u3059\u3002 -error.parameters-null.advice=\u975Enull\u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30DE\u30C3\u30D7\u3067\u6E21\u3057\u3066\u304F\u3060\u3055\u3044\u3002 -error.cannot-create-output-dir=\u51FA\u529B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA{0}\u3092\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093\u3002 -error.cannot-write-to-output-dir=\u51FA\u529B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA{0}\u306F\u66F8\u8FBC\u307F\u4E0D\u53EF\u3067\u3059\u3002 -error.no-system-runtime=\u30B7\u30B9\u30C6\u30E0JRE\u3092\u4F7F\u7528\u3059\u308B\u3088\u3046\u306B\u69CB\u6210\u3055\u308C\u305F\u30D0\u30F3\u30C9\u30EB -error.no-system-runtime.advice='runtime'\u3092null\u306B\u8A2D\u5B9A\u3057\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002\u8A2D\u5B9A\u3057\u306A\u3044\u304B\u3001\u6709\u52B9\u306A\u5024\u306B\u8A2D\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002 -error.must-sign-app-store=Mac App Store\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306F\u7F72\u540D\u3055\u308C\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u304C\u3001\u7F72\u540D\u306F\u30D0\u30F3\u30C9\u30E9\u69CB\u6210\u306B\u3088\u3063\u3066\u7121\u52B9\u5316\u3055\u308C\u3066\u3044\u307E\u3059\u3002 -error.must-sign-app-store.advice='signBundle'\u3092\u8A2D\u5B9A\u89E3\u9664\u3059\u308B\u304B\u3001'signBundle'\u3092true\u306B\u8A2D\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002 -error.no-app-signing-key=Mac App Store\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u7F72\u540D\u30AD\u30FC\u304C\u3042\u308A\u307E\u305B\u3093 -error.no-app-signing-key.advice=XCode\u3092\u4F7F\u7528\u3057\u3066\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u7F72\u540D\u30AD\u30FC\u3092Mac\u30AD\u30FC\u30C1\u30A7\u30FC\u30F3\u306B\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3057\u307E\u3059\u3002 -error.no-pkg-signing-key=Mac App Store\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9\u306E\u7F72\u540D\u30AD\u30FC\u304C\u3042\u308A\u307E\u305B\u3093 -error.no-pkg-signing-key.advice=XCode\u3092\u4F7F\u7528\u3057\u3066\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u7F72\u540D\u30AD\u30FC\u3092Mac\u30AD\u30FC\u30C1\u30A7\u30FC\u30F3\u306B\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3057\u307E\u3059\u3002 -error.certificate.expired=\u30A8\u30E9\u30FC: \u8A3C\u660E\u66F8\u306F{0}\u306B\u671F\u9650\u304C\u5207\u308C\u307E\u3057\u305F\u3002 - - -message.building-bundle={0}\u306EMac App Store\u30D0\u30F3\u30C9\u30EB\u306E\u4F5C\u6210 -mesasge.intermediate-bundle-location=\u4E2D\u9593\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30D0\u30F3\u30C9\u30EB\u30FB\u30A4\u30E1\u30FC\u30B8: {0} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/MacAppStoreBundler_zh_CN.properties --- a/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/MacAppStoreBundler_zh_CN.properties Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,61 +0,0 @@ -# -# Copyright (c) 2017, 2018, 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. -# -# - -bundler.name=\u652F\u6301 Mac App Store \u7684\u6253\u5305\u7A0B\u5E8F -bundler.description=\u521B\u5EFA\u53EF\u90E8\u7F72\u5230 Mac App Store \u4E2D\u7684\u4E8C\u8FDB\u5236\u6587\u4EF6\u5305\u3002" - -param.signing-key-app.name=\u5E94\u7528\u7A0B\u5E8F\u7B7E\u540D\u5BC6\u94A5 -param.signing-key-app.description=\u7528\u4E8E\u5BF9\u5E94\u7528\u7A0B\u5E8F\u7B7E\u540D\u7684\u7B7E\u540D\u5BC6\u94A5\u7684\u5B8C\u6574\u540D\u79F0\u3002 - -param.signing-key-pkg.name=\u5B89\u88C5\u7A0B\u5E8F\u7B7E\u540D\u5BC6\u94A5 -param.signing-key-pkg.description=\u7528\u4E8E\u5BF9 PKG \u5B89\u88C5\u7A0B\u5E8F\u7B7E\u540D\u7684\u7B7E\u540D\u5BC6\u94A5\u7684\u5B8C\u6574\u540D\u79F0\u3002 - -param.mac-app-store-entitlements.name=\u6743\u5229\u6587\u4EF6 -param.mac-app-store-entitlements.description=\u5B9A\u5236 Mac App Store \u6743\u5229\u6587\u4EF6\u7684\u6587\u4EF6\u4F4D\u7F6E - -param.installer-suffix.name=\u5B89\u88C5\u7A0B\u5E8F\u540E\u7F00 -param.installer-suffix.description=\u6B64\u7A0B\u5E8F\u5305\u7684\u5B89\u88C5\u6587\u4EF6\u540D\u79F0\u7684\u540E\u7F00\u3002<\u540D\u79F0><\u540E\u7F00>.pkg\u3002 - -resource.mac-app-store-entitlements=Mac App Store \u6743\u5229 -resource.mac-app-store-inherit-entitlements=Mac App Store \u7EE7\u627F\u6743\u5229 - -error.parameters-null=\u53C2\u6570\u6620\u5C04\u4E3A\u7A7A\u503C\u3002 -error.parameters-null.advice=\u8BF7\u4F20\u5165\u975E\u7A7A\u53C2\u6570\u6620\u5C04\u3002 -error.cannot-create-output-dir=\u65E0\u6CD5\u521B\u5EFA\u8F93\u51FA\u76EE\u5F55 {0}\u3002 -error.cannot-write-to-output-dir=\u8F93\u51FA\u76EE\u5F55 {0} \u4E0D\u53EF\u5199\u3002 -error.no-system-runtime=\u914D\u7F6E\u4E3A\u4F7F\u7528\u7CFB\u7EDF JRE \u7684\u5305 -error.no-system-runtime.advice=\u4E0D\u8981\u5C06 'runtime' \u8BBE\u7F6E\u4E3A\u7A7A\u503C, \u8981\u4E48\u4E0D\u8BBE\u7F6E\u8BE5\u503C, \u8981\u4E48\u5C06\u5176\u8BBE\u7F6E\u4E3A\u6709\u6548\u503C\u3002 -error.must-sign-app-store=Mac App Store \u5E94\u7528\u7A0B\u5E8F\u5FC5\u987B\u7B7E\u540D, \u800C\u6253\u5305\u7A0B\u5E8F\u914D\u7F6E\u5DF2\u7981\u7528\u7B7E\u540D\u3002 -error.must-sign-app-store.advice=\u53D6\u6D88\u8BBE\u7F6E 'signBundle' \u6216\u8005\u5C06 'signBundle' \u8BBE\u7F6E\u4E3A true\u3002 -error.no-app-signing-key=\u65E0 Mac App Store \u5E94\u7528\u7A0B\u5E8F\u7B7E\u540D\u5BC6\u94A5 -error.no-app-signing-key.advice=\u4F7F\u7528 XCode \u5C06\u5E94\u7528\u7A0B\u5E8F\u7B7E\u540D\u5BC6\u94A5\u5B89\u88C5\u5230 Mac \u5BC6\u94A5\u94FE\u4E2D\u3002 -error.no-pkg-signing-key=\u65E0 Mac App Store \u5B89\u88C5\u7A0B\u5E8F\u7B7E\u540D\u5BC6\u94A5 -error.no-pkg-signing-key.advice=\u4F7F\u7528 XCode \u5C06\u5E94\u7528\u7A0B\u5E8F\u7B7E\u540D\u5BC6\u94A5\u5B89\u88C5\u5230 Mac \u5BC6\u94A5\u94FE\u4E2D\u3002 -error.certificate.expired=\u9519\u8BEF: \u8BC1\u4E66\u5DF2\u5931\u6548 {0}\u3002 - - -message.building-bundle=\u6B63\u5728\u4E3A {0} \u6784\u5EFA Mac App Store \u5305 -mesasge.intermediate-bundle-location=\u4E34\u65F6\u5E94\u7528\u7A0B\u5E8F\u5305\u6620\u50CF: {0} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/MacAppStore_Inherit.entitlements --- a/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/MacAppStore_Inherit.entitlements Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ - - - - - com.apple.security.app-sandbox - - com.apple.security.inherit - - - diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/MacBaseInstallerBundler.properties --- a/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/MacBaseInstallerBundler.properties Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +0,0 @@ -# -# Copyright (c) 2017, 2018, 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. -# -# - -bundler.name=Mac App Store -bundler.description=Creates a binary bundle ready for deployment into the Mac App Store. - -param.app-bundler.name=Mac App Bundler -param.app-bundle.description=Creates a .app bundle for the Mac - -param.app-image-build-root.name=Build Root Dir -param.app-image-build-root.description=This is temporary location built by the packager that is the root of the image application - -param.signing-keychain.name=Signing Keychain -param.signing-keychain.description=The location of the keychain to use. If not specified the standard keychains will be used. - -param.signing-key-name.name=Signing Key User Name -param.signing-key-name.description=The user name portion of the typical "Mac Developer ID Application: " signing key. - -param.installer-name.name=Installer Name -param.installer-name.description=The filename of the generated installer without the file type extension. Default is -. - -param.config-root.name=Config Root Dir -param.config-root.description=Configuration directory. - -error.parameters-null=Parameters map is null. -error.parameters-null.advice=Pass in a non-null parameters map. - -message.app-image-dir-does-not-exist=Specified application image directory {0}\: {1} does not exists -message.app-image-dir-does-not-exist.advice=Confirm that the value for {0} exists - -message.could-not-retrieve-name=Could not retrieve gecos name -message.app-image-requires-app-name=When using an external app image you must specify the app name. -message.app-image-requires-app-name.advice=Set the app name via the -name CLI flag, the fx:application/@name ANT attribute, or via the 'appName' bundler argument. -message.app-image-requires-identifier=When using an external app image you must specify the identifier. -message.app-image-requires-identifier.advice=Set the identifier via the -appId CLI flag, the fx:application/@id ANT attribute, or via the 'identifier' bundler argument. diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/MacBaseInstallerBundler_ja.properties --- a/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/MacBaseInstallerBundler_ja.properties Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ -# -# Copyright (c) 2017, 2018, 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. -# -# - -bundler.name=Mac App Store -bundler.description=Mac App Store\u3078\u306e\u30c7\u30d7\u30ed\u30a4\u30e1\u30f3\u30c8\u6e96\u5099\u5b8c\u4e86\u306e\u30d0\u30a4\u30ca\u30ea\u30fb\u30d0\u30f3\u30c9\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002 - -param.app-bundler.name=Mac\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30fb\u30d0\u30f3\u30c9\u30e9 -param.app-bundle.description=Mac\u7528\u306e.app\u30d0\u30f3\u30c9\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059 - -param.app-image-build-root.name=Build Root Dir -param.app-image-build-root.description=\u3053\u308c\u306f\u30a4\u30e1\u30fc\u30b8\u30fb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30eb\u30fc\u30c8\u3067\u3042\u308b\u30d1\u30c3\u30b1\u30fc\u30b8\u30e3\u306b\u3088\u3063\u3066\u4f5c\u6210\u3055\u308c\u308b\u4e00\u6642\u7684\u306a\u5834\u6240\u3067\u3059 - -param.signing-keychain.name=\u7f72\u540d\u30ad\u30fc\u30c1\u30a7\u30fc\u30f3 -param.signing-keychain.description=\u4f7f\u7528\u3059\u308b\u30ad\u30fc\u30c1\u30a7\u30fc\u30f3\u306e\u5834\u6240\u3002\u6307\u5b9a\u3055\u308c\u3066\u3044\u306a\u3044\u5834\u5408\u306f\u3001\u6a19\u6e96\u306e\u30ad\u30fc\u30c1\u30a7\u30fc\u30f3\u304c\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002 - -param.signing-key-name.name=\u7f72\u540d\u30ad\u30fc\u306e\u30e6\u30fc\u30b6\u30fc\u540d -param.signing-key-name.description=\u4e00\u822c\u7684\u306a"Mac Developer ID\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3: "\u7f72\u540d\u30ad\u30fc\u306e\u30e6\u30fc\u30b6\u30fc\u540d\u90e8\u5206\u3002 - -param.installer-name.name=\u30a4\u30f3\u30b9\u30c8\u30fc\u30e9\u540d -param.installer-name.description=\u30d5\u30a1\u30a4\u30eb\u30fb\u30bf\u30a4\u30d7\u62e1\u5f35\u5b50\u306a\u3057\u306e\u751f\u6210\u3055\u308c\u305f\u30a4\u30f3\u30b9\u30c8\uff0d\u30e9\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u306f-\u3067\u3059\u3002 - -param.config-root.name=Config Root Dir -param.config-root.description=Configuration directory. - -error.parameters-null=\u30d1\u30e9\u30e1\u30fc\u30bf\u30fb\u30de\u30c3\u30d7\u304cnull\u3067\u3059\u3002 -error.parameters-null.advice=\u975enull\u30d1\u30e9\u30e1\u30fc\u30bf\u30fb\u30de\u30c3\u30d7\u3067\u6e21\u3057\u3066\u304f\u3060\u3055\u3044\u3002 - -message.app-image-dir-does-not-exist=\u6307\u5b9a\u3055\u308c\u305f\u30a4\u30e1\u30fc\u30b8\u30fb\u30c7\u30a3\u30ec\u30af\u30c8\u30ea {0}: {1}\u306f\u5b58\u5728\u3057\u307e\u305b\u3093 -message.app-image-dir-does-not-exist.advice={0}\u306e\u5024\u304c\u5b58\u5728\u3059\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044 -message.could-not-retrieve-name=gecos\u540d\u3092\u53d6\u5f97\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f -message.app-image-requires-app-name=\u5916\u90e8\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30fb\u30a4\u30e1\u30fc\u30b8\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u540d\u3092\u6307\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 -message.app-image-requires-app-name.advice=-name CLI\u30d5\u30e9\u30b0\u3001fx:application/@name ANT\u5c5e\u6027\u307e\u305f\u306f'appName'\u30d0\u30f3\u30c9\u30e9\u5f15\u6570\u3067\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u540d\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002 -message.app-image-requires-identifier=\u5916\u90e8\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30fb\u30a4\u30e1\u30fc\u30b8\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u3001\u8b58\u5225\u5b50\u3092\u6307\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 -message.app-image-requires-identifier.advice=-appId CLI\u30d5\u30e9\u30b0\u3001fx:application/@id ANT\u5c5e\u6027\u307e\u305f\u306f'identifier'\u30d0\u30f3\u30c9\u30e9\u5f15\u6570\u3067\u8b58\u5225\u5b50\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002 diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/MacBaseInstallerBundler_zh_CN.properties --- a/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/MacBaseInstallerBundler_zh_CN.properties Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ -# -# Copyright (c) 2017, 2018, 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. -# -# - -bundler.name=Mac App Store -bundler.description=\u521b\u5efa\u53ef\u90e8\u7f72\u5230 Mac App Store \u4e2d\u7684\u4e8c\u8fdb\u5236\u6587\u4ef6\u5305\u3002 - -param.app-bundler.name=Mac \u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u7a0b\u5e8f -param.app-bundle.description=\u521b\u5efa\u7528\u4e8e Mac \u7684 .app \u5305 - -param.app-image-build-root.name=Build Root Dir -param.app-image-build-root.description=\u8fd9\u662f\u7531\u6253\u5305\u7a0b\u5e8f\u6784\u5efa\u7684\u4e34\u65f6\u4f4d\u7f6e, \u662f\u6620\u50cf\u5e94\u7528\u7a0b\u5e8f\u7684\u6839\u76ee\u5f55 - -param.signing-keychain.name=\u7b7e\u540d\u5bc6\u94a5\u94fe -param.signing-keychain.description=\u8981\u4f7f\u7528\u7684\u5bc6\u94a5\u94fe\u7684\u4f4d\u7f6e\u3002\u5982\u679c\u672a\u6307\u5b9a, \u5219\u5c06\u4f7f\u7528\u6807\u51c6\u5bc6\u94a5\u94fe\u3002 - -param.signing-key-name.name=\u7b7e\u540d\u5bc6\u94a5\u7528\u6237\u540d -param.signing-key-name.description=\u5178\u578b "Mac \u5f00\u53d1\u8005 ID \u5e94\u7528\u7a0b\u5e8f: <\u7528\u6237\u540d>" \u7b7e\u540d\u5bc6\u94a5\u7684\u7528\u6237\u540d\u90e8\u5206\u3002 - -param.installer-name.name=\u5b89\u88c5\u7a0b\u5e8f\u540d\u79f0 -param.installer-name.description=\u6240\u751f\u6210\u5b89\u88c5\u7a0b\u5e8f\u4e0d\u5e26\u6587\u4ef6\u7c7b\u578b\u6269\u5c55\u540d\u7684\u6587\u4ef6\u540d\u3002\u9ed8\u8ba4\u503c\u4e3a <\u5e94\u7528\u7a0b\u5e8f\u540d\u79f0>-<\u7248\u672c>\u3002 - -param.config-root.name=Config Root Dir -param.config-root.description=Configuration directory. - -error.parameters-null=\u53c2\u6570\u6620\u5c04\u4e3a\u7a7a\u503c\u3002 -error.parameters-null.advice=\u8bf7\u4f20\u5165\u975e\u7a7a\u53c2\u6570\u6620\u5c04\u3002 - -message.app-image-dir-does-not-exist=\u6307\u5b9a\u7684\u6620\u50cf\u76ee\u5f55 {0}: {1} \u4e0d\u5b58\u5728 -message.app-image-dir-does-not-exist.advice=\u786e\u8ba4 {0} \u7684\u503c\u662f\u5426\u5b58\u5728 -message.could-not-retrieve-name=\u65e0\u6cd5\u68c0\u7d22 gecos \u540d\u79f0 -message.app-image-requires-app-name=\u4f7f\u7528\u5916\u90e8\u5e94\u7528\u7a0b\u5e8f\u6620\u50cf\u65f6, \u5fc5\u987b\u6307\u5b9a\u5e94\u7528\u7a0b\u5e8f\u540d\u79f0\u3002 -message.app-image-requires-app-name.advice=\u901a\u8fc7 -name CLI \u6807\u8bb0, fx:application/@name ANT \u5c5e\u6027\u6216\u901a\u8fc7 'appName' \u6253\u5305\u7a0b\u5e8f\u53c2\u6570\u8bbe\u7f6e\u5e94\u7528\u7a0b\u5e8f\u540d\u79f0\u3002 -message.app-image-requires-identifier=\u4f7f\u7528\u5916\u90e8\u5e94\u7528\u7a0b\u5e8f\u6620\u50cf\u65f6, \u5fc5\u987b\u6307\u5b9a\u6807\u8bc6\u7b26\u3002 -message.app-image-requires-identifier.advice=\u901a\u8fc7 -appId CLI \u6807\u8bb0, fx:application/@id ANT \u5c5e\u6027\u6216\u901a\u8fc7 'identifier' \u6253\u5305\u7a0b\u5e8f\u53c2\u6570\u8bbe\u7f6e\u6807\u8bc6\u7b26\u3002 diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/MacDmgBundler.properties --- a/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/MacDmgBundler.properties Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,61 +0,0 @@ -# -# Copyright (c) 2017, 2018, 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. -# -# - -bundler.name=DMG Installer -bundler.description=Mac DMG Installer Bundle - -param.simple-dmg.name=Simple DMG Generation -param.simple-dmg.description=Generate a DMG without AppleScript customizations. Recommended for continuous automated builds. - -param.installer-suffix.name=Installer Suffix -param.installer-suffix.description=The suffix for the installer name for this package. .dmg. - -error.parameters-null=Parameters map is null. -error.parameters-null.advice=Pass in a non-null parameters map. - -error.dmg-does-not-do-daemons=DMG bundler doesn't support services. -error.dmg-does-not-do-daemons.advice=Make sure that the service hint is set to false. - -error.license-missing=Specified license file is missing. -error.license-missing.advice=Make sure that "{0}" references a file in the app resources, and that it is relative file reference. - -error.cannot-create-output-dir=Output directory {0} cannot be created. -error.cannot-write-to-output-dir=Output directory {0} is not writable. - -resource.dmg-setup-script=DMG setup script -resource.license-setup=License setup -resource.dmg-background=dmg background -resource.volume-icon=volume icon -resource.post-install-script=script to run after application image is populated - -message.building-dmg=Building DMG package for {0} -message.running-script=Running shell script on application image [{0}] -message.intermediate-image-location=[DEBUG] Intermediate application bundle image\: {0} -message.preparing-dmg-setup=Preparing dmg setup\: {0} -message.creating-dmg-file=Creating DMG file\: {0} -message.dmg-cannot-be-overwritten=Dmg file exists ({0} and can not be removed. -message.output-to-location=Result DMG installer for {0}\: {1} - diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/MacDmgBundler_ja.properties --- a/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/MacDmgBundler_ja.properties Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,61 +0,0 @@ -# -# Copyright (c) 2017, 2018, 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. -# -# - -bundler.name=DMG\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9 -bundler.description=Mac DMG\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9\u30FB\u30D0\u30F3\u30C9\u30EB - -param.simple-dmg.name=DMG\u306E\u7C21\u6613\u751F\u6210 -param.simple-dmg.description=AppleScript\u306E\u30AB\u30B9\u30BF\u30DE\u30A4\u30BA\u306A\u3057\u3067DMG\u3092\u751F\u6210\u3057\u307E\u3059\u3002\u9023\u7D9A\u3057\u305F\u81EA\u52D5\u4F5C\u6210\u306E\u5834\u5408\u306B\u304A\u85A6\u3081\u3057\u307E\u3059\u3002 - -param.installer-suffix.name=\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9\u63A5\u5C3E\u8F9E -param.installer-suffix.description=\u3053\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9\u540D\u306E\u63A5\u5C3E\u8F9E\u3002.dmg\u3002 - -error.parameters-null=\u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30DE\u30C3\u30D7\u304Cnull\u3067\u3059\u3002 -error.parameters-null.advice=\u975Enull\u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30DE\u30C3\u30D7\u3067\u6E21\u3057\u3066\u304F\u3060\u3055\u3044\u3002 - -error.dmg-does-not-do-daemons=DMG\u30D0\u30F3\u30C9\u30E9\u306F\u30B5\u30FC\u30D3\u30B9\u3092\u30B5\u30DD\u30FC\u30C8\u3057\u3066\u3044\u307E\u305B\u3093\u3002 -error.dmg-does-not-do-daemons.advice=\u30B5\u30FC\u30D3\u30B9\u306E\u30D2\u30F3\u30C8\u304Cfalse\u306B\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002 - -error.license-missing=\u6307\u5B9A\u3057\u305F\u30E9\u30A4\u30BB\u30F3\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u304C\u3042\u308A\u307E\u305B\u3093\u3002 -error.license-missing.advice="{0}"\u304C\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30EA\u30BD\u30FC\u30B9\u5185\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u53C2\u7167\u3057\u3001\u76F8\u5BFE\u30D5\u30A1\u30A4\u30EB\u53C2\u7167\u3067\u3042\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002 - -error.cannot-create-output-dir=\u51FA\u529B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA{0}\u3092\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093\u3002 -error.cannot-write-to-output-dir=\u51FA\u529B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA{0}\u306F\u66F8\u8FBC\u307F\u4E0D\u53EF\u3067\u3059\u3002 - -resource.dmg-setup-script=DMG\u8A2D\u5B9A\u30B9\u30AF\u30EA\u30D7\u30C8 -resource.license-setup=\u30E9\u30A4\u30BB\u30F3\u30B9\u306E\u8A2D\u5B9A -resource.dmg-background=dmg\u80CC\u666F -resource.volume-icon=\u30DC\u30EA\u30E5\u30FC\u30E0\u30FB\u30A2\u30A4\u30B3\u30F3 -resource.post-install-script=\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30A4\u30E1\u30FC\u30B8\u3092\u79FB\u5165\u3057\u305F\u5F8C\u306B\u5B9F\u884C\u3059\u308B\u30B9\u30AF\u30EA\u30D7\u30C8 - -message.building-dmg={0}\u306EDMG\u30D1\u30C3\u30B1\u30FC\u30B8\u3092\u4F5C\u6210\u3057\u3066\u3044\u307E\u3059 -message.running-script=\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30A4\u30E1\u30FC\u30B8[{0}]\u3067\u30B7\u30A7\u30EB\u30FB\u30B9\u30AF\u30EA\u30D7\u30C8\u3092\u5B9F\u884C\u3057\u3066\u3044\u307E\u3059 -message.intermediate-image-location=[\u30C7\u30D0\u30C3\u30B0]\u4E2D\u9593\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30D0\u30F3\u30C9\u30EB\u30FB\u30A4\u30E1\u30FC\u30B8: {0} -message.preparing-dmg-setup=dmg\u306E\u8A2D\u5B9A\u3092\u6E96\u5099\u3057\u3066\u3044\u307E\u3059: {0} -message.creating-dmg-file=DMG\u30D5\u30A1\u30A4\u30EB\u3092\u4F5C\u6210\u3057\u3066\u3044\u307E\u3059: {0} -message.dmg-cannot-be-overwritten=Dmg\u30D5\u30A1\u30A4\u30EB\u306F\u5B58\u5728\u3057({0}\u3001\u524A\u9664\u3067\u304D\u307E\u305B\u3093\u3002 -message.output-to-location={0}\u306E\u7D50\u679C\u306EDMG\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9: {1} - diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/MacDmgBundler_zh_CN.properties --- a/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/MacDmgBundler_zh_CN.properties Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,61 +0,0 @@ -# -# Copyright (c) 2017, 2018, 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. -# -# - -bundler.name=DMG \u5B89\u88C5\u7A0B\u5E8F -bundler.description=Mac DMG \u5B89\u88C5\u7A0B\u5E8F\u5305 - -param.simple-dmg.name=\u7B80\u5355 DMG \u751F\u6210 -param.simple-dmg.description=\u751F\u6210\u4E0D\u5E26 AppleScript \u5B9A\u5236\u7684 DMG\u3002\u5EFA\u8BAE\u7528\u4E8E\u8FDE\u7EED\u81EA\u52A8\u6784\u5EFA\u3002 - -param.installer-suffix.name=\u5B89\u88C5\u7A0B\u5E8F\u540E\u7F00 -param.installer-suffix.description=\u6B64\u7A0B\u5E8F\u5305\u7684\u5B89\u88C5\u6587\u4EF6\u540D\u79F0\u7684\u540E\u7F00\u3002<\u540D\u79F0><\u540E\u7F00>.dmg\u3002 - -error.parameters-null=\u53C2\u6570\u6620\u5C04\u4E3A\u7A7A\u503C\u3002 -error.parameters-null.advice=\u8BF7\u4F20\u5165\u975E\u7A7A\u53C2\u6570\u6620\u5C04\u3002 - -error.dmg-does-not-do-daemons=DMG \u6253\u5305\u7A0B\u5E8F\u4E0D\u652F\u6301\u670D\u52A1\u3002 -error.dmg-does-not-do-daemons.advice=\u786E\u4FDD\u670D\u52A1\u63D0\u793A\u8BBE\u7F6E\u4E3A false\u3002 - -error.license-missing=\u7F3A\u5C11\u6307\u5B9A\u7684\u8BB8\u53EF\u8BC1\u6587\u4EF6\u3002 -error.license-missing.advice=\u786E\u4FDD "{0}" \u5F15\u7528\u5E94\u7528\u7A0B\u5E8F\u8D44\u6E90\u4E2D\u7684\u6587\u4EF6, \u5E76\u4E14\u662F\u76F8\u5BF9\u6587\u4EF6\u5F15\u7528\u3002 - -error.cannot-create-output-dir=\u65E0\u6CD5\u521B\u5EFA\u8F93\u51FA\u76EE\u5F55 {0}\u3002 -error.cannot-write-to-output-dir=\u8F93\u51FA\u76EE\u5F55 {0} \u4E0D\u53EF\u5199\u3002 - -resource.dmg-setup-script=DMG \u8BBE\u7F6E\u811A\u672C -resource.license-setup=\u8BB8\u53EF\u8BC1\u8BBE\u7F6E -resource.dmg-background=dmg \u80CC\u666F -resource.volume-icon=\u5377\u56FE\u6807 -resource.post-install-script=\u8981\u5728\u586B\u5145\u5E94\u7528\u7A0B\u5E8F\u6620\u50CF\u4E4B\u540E\u8FD0\u884C\u7684\u811A\u672C - -message.building-dmg=\u6B63\u5728\u4E3A {0} \u6784\u5EFA DMG \u7A0B\u5E8F\u5305 -message.running-script=\u6B63\u5728\u5E94\u7528\u7A0B\u5E8F\u6620\u50CF [{0}] \u4E0A\u8FD0\u884C shell \u811A\u672C -message.intermediate-image-location=[\u8C03\u8BD5] \u4E34\u65F6\u5E94\u7528\u7A0B\u5E8F\u5305\u6620\u50CF: {0} -message.preparing-dmg-setup=\u6B63\u5728\u51C6\u5907 dmg \u8BBE\u7F6E: {0} -message.creating-dmg-file=\u6B63\u5728\u521B\u5EFA DMG \u6587\u4EF6: {0} -message.dmg-cannot-be-overwritten=Dmg \u6587\u4EF6\u5DF2\u5B58\u5728 ({0}) \u4E14\u65E0\u6CD5\u5220\u9664\u3002 -message.output-to-location=\u4E3A {0} \u751F\u6210\u7684 DMG \u5B89\u88C5\u7A0B\u5E8F: {1} - diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/MacPkgBundler.properties --- a/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/MacPkgBundler.properties Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,64 +0,0 @@ -# -# Copyright (c) 2017, 2018, 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. -# -# - -bundler.name=PKG Installer -bundler.description=Mac PKG Installer Bundle. - -param.signing-key-developer-id-installer.name=Apple Developer ID Installer Signing Key -param.signing-key-developer-id-installer.description=The full name of the Apple Developer ID Installer signing key. - -param.packages-root.name=PKG Root Dir -param.packages-root.description=This is temporary location for component packages (application and daemon). The packages are incorporated into final product package. - -param.installer-suffix.name=Installer Suffix -param.installer-suffix.description=The suffix for the installer name for this package. .pkg. - -param.scripts-dir.name= -param.scripts-dir.description=This is temporary location for package scripts - -param.mac-install-dir.name=Mac Installation Directory -param.mac-install-dir.description=Installation directory of the application on Mac. - -resource.pkg-preinstall-script=PKG preinstall script -resource.pkg-postinstall-script=PKG postinstall script -resource.pkg-background-image=pkg background image -resource.post-install-script=script to run after application image is populated - -error.parameters-null=Parameters map is null. -error.parameters-null.advice=Pass in a non-null parameters map. -error.license-missing=Specified license file is missing. -error.license-missing.advice=Make sure that "{0}" references a file in the app resources, and that it is relative to the basedir "{1}". -error.explicit-sign-no-cert=Signature explicitly requested but no signing certificate specified. -error.explicit-sign-no-cert.advice=Either specify a valid cert in 'mac.signing-key-developer-id-installer' or unset 'signBundle' or set 'signBundle' to false. -error.cannot-create-output-dir=Output directory {0} cannot be created. -error.cannot-write-to-output-dir=Output directory {0} is not writable. - -message.building-pkg=Building PKG package for {0} -message.running-script=Running shell script on application image [{0}] -message.preparing-scripts=Preparing package scripts -message.preparing-distribution-dist=Preparing distribution.dist\: {0} -message.intermediate-image-location=[DEBUG] Intermediate application bundle image\: {0} -message.signing.pkg=Warning: For signing PKG, you might need to set "Always Trust" for your certificate using "Keychain Access" tool. diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/MacPkgBundler_ja.properties --- a/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/MacPkgBundler_ja.properties Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ -# -# Copyright (c) 2017, 2018, 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. -# -# - -bundler.name=PKG\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9 -bundler.description=Mac PKG\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9\u30FB\u30D0\u30F3\u30C9\u30EB\u3002 - -param.signing-key-developer-id-installer.name=Apple Developer ID\u306E\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9\u7F72\u540D\u30AD\u30FC -param.signing-key-developer-id-installer.description=Apple Developer ID\u306E\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9\u7F72\u540D\u30AD\u30FC\u306E\u30D5\u30EB\u30FB\u30CD\u30FC\u30E0\u3002 - -param.packages-root.name=PKG Root Dir -param.packages-root.description=\u3053\u308C\u306F\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u30FB\u30D1\u30C3\u30B1\u30FC\u30B8(\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u304A\u3088\u3073\u30C7\u30FC\u30E2\u30F3)\u306E\u4E00\u6642\u7684\u306A\u5834\u6240\u3067\u3059\u3002\u30D1\u30C3\u30B1\u30FC\u30B8\u306F\u6700\u7D42\u88FD\u54C1\u30D1\u30C3\u30B1\u30FC\u30B8\u306B\u7D44\u307F\u8FBC\u307E\u308C\u307E\u3059\u3002 - -param.installer-suffix.name=\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9\u63A5\u5C3E\u8F9E -param.installer-suffix.description=\u3053\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9\u540D\u63A5\u5C3E\u8F9E\u3002.pkg\u3002 - -param.scripts-dir.name= -param.scripts-dir.description=\u3053\u308C\u306F\u30D1\u30C3\u30B1\u30FC\u30B8\u30FB\u30B9\u30AF\u30EA\u30D7\u30C8\u306E\u4E00\u6642\u7684\u306A\u5834\u6240\u3067\u3059 - -resource.pkg-preinstall-script=PKG\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u524D\u30B9\u30AF\u30EA\u30D7\u30C8 -resource.pkg-postinstall-script=PKG\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u5F8C\u30B9\u30AF\u30EA\u30D7\u30C8 -resource.pkg-background-image=pkg\u80CC\u666F\u30A4\u30E1\u30FC\u30B8 -resource.post-install-script=\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30A4\u30E1\u30FC\u30B8\u3092\u79FB\u5165\u3057\u305F\u5F8C\u306B\u5B9F\u884C\u3059\u308B\u30B9\u30AF\u30EA\u30D7\u30C8 - -error.parameters-null=\u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30DE\u30C3\u30D7\u304Cnull\u3067\u3059\u3002 -error.parameters-null.advice=\u975Enull\u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30DE\u30C3\u30D7\u3067\u6E21\u3057\u3066\u304F\u3060\u3055\u3044\u3002 -error.license-missing=\u6307\u5B9A\u3057\u305F\u30E9\u30A4\u30BB\u30F3\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u304C\u3042\u308A\u307E\u305B\u3093\u3002 -error.license-missing.advice="{0}"\u304C\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30EA\u30BD\u30FC\u30B9\u5185\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u53C2\u7167\u3057\u3001\u30D9\u30FC\u30B9\u30FB\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA"{1}"\u306B\u5BFE\u3057\u3066\u76F8\u5BFE\u7684\u3067\u3042\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002 -error.explicit-sign-no-cert=\u7F72\u540D\u304C\u660E\u793A\u7684\u306B\u8981\u6C42\u3055\u308C\u307E\u3057\u305F\u304C\u3001\u7F72\u540D\u8A3C\u660E\u66F8\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002 -error.explicit-sign-no-cert.advice=\u6709\u52B9\u306A\u8A3C\u660E\u66F8\u3092'mac.signing-key-developer-id-installer'\u3067\u6307\u5B9A\u3059\u308B\u304B\u3001'signBundle'\u3092\u8A2D\u5B9A\u89E3\u9664\u3059\u308B\u304B\u3001\u307E\u305F\u306F'signBundle'\u3092false\u306B\u8A2D\u5B9A\u3057\u307E\u3059\u3002 -error.cannot-create-output-dir=\u51FA\u529B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA{0}\u3092\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093\u3002 -error.cannot-write-to-output-dir=\u51FA\u529B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA{0}\u306F\u66F8\u8FBC\u307F\u4E0D\u53EF\u3067\u3059\u3002 - -message.building-pkg={0}\u306EPKG\u30D1\u30C3\u30B1\u30FC\u30B8\u3092\u4F5C\u6210\u3057\u3066\u3044\u307E\u3059 -message.running-script=\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30A4\u30E1\u30FC\u30B8[{0}]\u3067\u30B7\u30A7\u30EB\u30FB\u30B9\u30AF\u30EA\u30D7\u30C8\u3092\u5B9F\u884C\u3057\u3066\u3044\u307E\u3059 -message.preparing-scripts=\u30D1\u30C3\u30B1\u30FC\u30B8\u30FB\u30B9\u30AF\u30EA\u30D7\u30C8\u3092\u6E96\u5099\u3057\u3066\u3044\u307E\u3059 -message.preparing-distribution-dist=distribution.dist\u3092\u6E96\u5099\u3057\u3066\u3044\u307E\u3059: {0} -message.intermediate-image-location=[\u30C7\u30D0\u30C3\u30B0]\u4E2D\u9593\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30D0\u30F3\u30C9\u30EB\u30FB\u30A4\u30E1\u30FC\u30B8: {0} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/MacPkgBundler_zh_CN.properties --- a/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/MacPkgBundler_zh_CN.properties Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ -# -# Copyright (c) 2017, 2018, 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. -# -# - -bundler.name=PKG \u5B89\u88C5\u7A0B\u5E8F -bundler.description=Mac PKG \u5B89\u88C5\u7A0B\u5E8F\u5305\u3002 - -param.signing-key-developer-id-installer.name=Apple \u5F00\u53D1\u8005 ID \u5B89\u88C5\u7A0B\u5E8F\u7B7E\u540D\u5BC6\u94A5 -param.signing-key-developer-id-installer.description=Apple \u5F00\u53D1\u8005 ID \u5B89\u88C5\u7A0B\u5E8F\u7B7E\u540D\u5BC6\u94A5\u7684\u5168\u540D\u3002 - -param.packages-root.name=PKG Root Dir -param.packages-root.description=\u8FD9\u662F\u7EC4\u4EF6\u7A0B\u5E8F\u5305 (\u5E94\u7528\u7A0B\u5E8F\u548C\u5B88\u62A4\u7A0B\u5E8F) \u7684\u4E34\u65F6\u4F4D\u7F6E\u3002\u7A0B\u5E8F\u5305\u96C6\u6210\u5230\u6700\u7EC8\u4EA7\u54C1\u7A0B\u5E8F\u5305\u4E2D\u3002 - -param.installer-suffix.name=\u5B89\u88C5\u7A0B\u5E8F\u540E\u7F00 -param.installer-suffix.description=\u6B64\u7A0B\u5E8F\u5305\u7684\u5B89\u88C5\u6587\u4EF6\u540D\u79F0\u7684\u540E\u7F00\u3002<\u540D\u79F0><\u540E\u7F00>.pkg\u3002 - -param.scripts-dir.name= -param.scripts-dir.description=\u8FD9\u662F\u7A0B\u5E8F\u5305\u811A\u672C\u7684\u4E34\u65F6\u4F4D\u7F6E - -resource.pkg-preinstall-script=PKG \u5B89\u88C5\u524D\u811A\u672C -resource.pkg-postinstall-script=PKG \u5B89\u88C5\u540E\u811A\u672C -resource.pkg-background-image=pkg \u80CC\u666F\u56FE\u50CF -resource.post-install-script=\u8981\u5728\u586B\u5145\u5E94\u7528\u7A0B\u5E8F\u6620\u50CF\u4E4B\u540E\u8FD0\u884C\u7684\u811A\u672C - -error.parameters-null=\u53C2\u6570\u6620\u5C04\u4E3A\u7A7A\u503C\u3002 -error.parameters-null.advice=\u8BF7\u4F20\u5165\u975E\u7A7A\u53C2\u6570\u6620\u5C04\u3002 -error.license-missing=\u7F3A\u5C11\u6307\u5B9A\u7684\u8BB8\u53EF\u8BC1\u6587\u4EF6\u3002 -error.license-missing.advice=\u8BF7\u786E\u4FDD "{0}" \u5F15\u7528\u5E94\u7528\u7A0B\u5E8F\u8D44\u6E90\u4E2D\u7684\u6587\u4EF6, \u5E76\u4E14\u4F7F\u7528\u57FA\u76EE\u5F55 "{1}" \u7684\u76F8\u5BF9\u76EE\u5F55\u3002 -error.explicit-sign-no-cert=\u5DF2\u660E\u786E\u8BF7\u6C42\u7B7E\u540D, \u4F46\u672A\u6307\u5B9A\u7B7E\u540D\u8BC1\u4E66\u3002 -error.explicit-sign-no-cert.advice=\u5728 'mac.signing-key-developer-id-installer' \u4E2D\u6307\u5B9A\u6709\u6548\u7684\u8BC1\u4E66, \u6216\u8005\u53D6\u6D88\u8BBE\u7F6E 'signBundle', \u6216\u8005\u5C06 'signBundle' \u8BBE\u7F6E\u4E3A false\u3002 -error.cannot-create-output-dir=\u65E0\u6CD5\u521B\u5EFA\u8F93\u51FA\u76EE\u5F55 {0}\u3002 -error.cannot-write-to-output-dir=\u8F93\u51FA\u76EE\u5F55 {0} \u4E0D\u53EF\u5199\u3002 - -message.building-pkg=\u6B63\u5728\u4E3A {0} \u6784\u5EFA PKG \u7A0B\u5E8F\u5305 -message.running-script=\u6B63\u5728\u5E94\u7528\u7A0B\u5E8F\u6620\u50CF [{0}] \u4E0A\u8FD0\u884C shell \u811A\u672C -message.preparing-scripts=\u6B63\u5728\u51C6\u5907\u7A0B\u5E8F\u5305\u811A\u672C -message.preparing-distribution-dist=\u6B63\u5728\u51C6\u5907 distribution.dist: {0} -message.intermediate-image-location=[\u8C03\u8BD5] \u4E34\u65F6\u5E94\u7528\u7A0B\u5E8F\u5305\u6620\u50CF: {0} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/MacResources.java --- a/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/MacResources.java Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2011, 2018, 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.jpackager.internal.resources.mac; - -// no-op, use as anchor for resource loading -public class MacResources { - -} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/Runtime-Info.plist.template --- a/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/Runtime-Info.plist.template Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - libjli.dylib - CFBundleIdentifier - CF_BUNDLE_IDENTIFIER - CFBundleInfoDictionaryVersion - 7.0 - CFBundleName - CF_BUNDLE_NAME - CFBundlePackageType - BNDL - CFBundleShortVersionString - CF_BUNDLE_SHORT_VERSION_STRING - CFBundleSignature - ???? - CFBundleVersion - CF_BUNDLE_VERSION - - diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/background_dmg.png Binary file src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/background_dmg.png has changed diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/background_pkg.png Binary file src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/background_pkg.png has changed diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/launchd.plist.template --- a/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/launchd.plist.template Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ - - - - - Label - DEPLOY_DAEMON_IDENTIFIER - ProgramArguments - - DEPLOY_DAEMON_LAUNCHER_PATH - - RunAtLoad - KeepAlive - - diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/lic_template.plist --- a/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/lic_template.plist Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,244 +0,0 @@ - - - - - LPic - - - Attributes - 0x0000 - Data - AAAAAgAAAAAAAAAAAAQAAA== - ID - 5000 - Name - - - - STR# - - - Attributes - 0x0000 - Data - AAYPRW5nbGlzaCBkZWZhdWx0BUFncmVlCERpc2FncmVlBVByaW50B1NhdmUuLi56SWYgeW91IGFncmVlIHdpdGggdGhlIHRlcm1zIG9mIHRoaXMgbGljZW5zZSwgY2xpY2sgIkFncmVlIiB0byBhY2Nlc3MgdGhlIHNvZnR3YXJlLiAgSWYgeW91IGRvIG5vdCBhZ3JlZSwgcHJlc3MgIkRpc2FncmVlLiI= - ID - 5000 - Name - English buttons - - - Attributes - 0x0000 - Data - AAYHRGV1dHNjaAtBa3plcHRpZXJlbghBYmxlaG5lbgdEcnVja2VuClNpY2hlcm4uLi7nS2xpY2tlbiBTaWUgaW4g0kFremVwdGllcmVu0ywgd2VubiBTaWUgbWl0IGRlbiBCZXN0aW1tdW5nZW4gZGVzIFNvZnR3YXJlLUxpemVuenZlcnRyYWdzIGVpbnZlcnN0YW5kZW4gc2luZC4gRmFsbHMgbmljaHQsIGJpdHRlINJBYmxlaG5lbtMgYW5rbGlja2VuLiBTaWUga5pubmVuIGRpZSBTb2Z0d2FyZSBudXIgaW5zdGFsbGllcmVuLCB3ZW5uIFNpZSDSQWt6ZXB0aWVyZW7TIGFuZ2VrbGlja3QgaGFiZW4u - ID - 5001 - Name - German - - - Attributes - 0x0000 - Data - AAYHRW5nbGlzaAVBZ3JlZQhEaXNhZ3JlZQVQcmludAdTYXZlLi4ue0lmIHlvdSBhZ3JlZSB3aXRoIHRoZSB0ZXJtcyBvZiB0aGlzIGxpY2Vuc2UsIHByZXNzICJBZ3JlZSIgdG8gaW5zdGFsbCB0aGUgc29mdHdhcmUuICBJZiB5b3UgZG8gbm90IGFncmVlLCBwcmVzcyAiRGlzYWdyZWUiLg== - ID - 5002 - Name - English - - - Attributes - 0x0000 - Data - AAYHRXNwYZZvbAdBY2VwdGFyCk5vIGFjZXB0YXIISW1wcmltaXIKR3VhcmRhci4uLsBTaSBlc3SHIGRlIGFjdWVyZG8gY29uIGxvcyB0jnJtaW5vcyBkZSBlc3RhIGxpY2VuY2lhLCBwdWxzZSAiQWNlcHRhciIgcGFyYSBpbnN0YWxhciBlbCBzb2Z0d2FyZS4gRW4gZWwgc3VwdWVzdG8gZGUgcXVlIG5vIGVzdI4gZGUgYWN1ZXJkbyBjb24gbG9zIHSOcm1pbm9zIGRlIGVzdGEgbGljZW5jaWEsIHB1bHNlICJObyBhY2VwdGFyLiI= - ID - 5003 - Name - Spanish - - - Attributes - 0x0000 - Data - AAYIRnJhbo1haXMIQWNjZXB0ZXIHUmVmdXNlcghJbXByaW1lcg5FbnJlZ2lzdHJlci4uLrpTaSB2b3VzIGFjY2VwdGV6IGxlcyB0ZXJtZXMgZGUgbGEgcHKOc2VudGUgbGljZW5jZSwgY2xpcXVleiBzdXIgIkFjY2VwdGVyIiBhZmluIGQnaW5zdGFsbGVyIGxlIGxvZ2ljaWVsLiBTaSB2b3VzIG4nkHRlcyBwYXMgZCdhY2NvcmQgYXZlYyBsZXMgdGVybWVzIGRlIGxhIGxpY2VuY2UsIGNsaXF1ZXogc3VyICJSZWZ1c2VyIi4= - ID - 5004 - Name - French - - - Attributes - 0x0000 - Data - AAYISXRhbGlhbm8HQWNjZXR0bwdSaWZpdXRvBlN0YW1wYQtSZWdpc3RyYS4uLn9TZSBhY2NldHRpIGxlIGNvbmRpemlvbmkgZGkgcXVlc3RhIGxpY2VuemEsIGZhaSBjbGljIHN1ICJBY2NldHRvIiBwZXIgaW5zdGFsbGFyZSBpbCBzb2Z0d2FyZS4gQWx0cmltZW50aSBmYWkgY2xpYyBzdSAiUmlmaXV0byIu - ID - 5005 - Name - Italian - - - Attributes - 0x0000 - Data - AAYISmFwYW5lc2UKk6+I04K1gtyCtwyTr4jTgrWC3IK5gvEIiPON/IK3gukHlduRti4uLrSWe4Ncg3SDZ4NFg0eDQY5nl3CLlpH4jF+W8YLMj/CMj4LJk6+I04KzguqC6Y/qjYeCyYLNgUGDXIN0g2eDRYNHg0GC8INDg5ODWINngVuDi4K3gumCvYLfgsmBdZOviNOCtYLcgreBdoLwiZ+CtYLEgq2CvoKzgqKBQoFAk6+I04KzguqCyIKij+qNh4LJgs2BQYF1k6+I04K1gtyCuYLxgXaC8ImfgrWCxIKtgr6Cs4KigUI= - ID - 5006 - Name - Japanese - - - Attributes - 0x0000 - Data - AAYKTmVkZXJsYW5kcwJKYQNOZWUFUHJpbnQJQmV3YWFyLi4upEluZGllbiB1IGFra29vcmQgZ2FhdCBtZXQgZGUgdm9vcndhYXJkZW4gdmFuIGRlemUgbGljZW50aWUsIGt1bnQgdSBvcCAnSmEnIGtsaWtrZW4gb20gZGUgcHJvZ3JhbW1hdHV1ciB0ZSBpbnN0YWxsZXJlbi4gSW5kaWVuIHUgbmlldCBha2tvb3JkIGdhYXQsIGtsaWt0IHUgb3AgJ05lZScu - ID - 5007 - Name - Dutch - - - Attributes - 0x0000 - Data - AAYGU3ZlbnNrCEdvZGuKbm5zBkF2YppqcwhTa3JpdiB1dAhTcGFyYS4uLpNPbSBEdSBnb2Rrim5uZXIgbGljZW5zdmlsbGtvcmVuIGtsaWNrYSBwjCAiR29ka4pubnMiIGaaciBhdHQgaW5zdGFsbGVyYSBwcm9ncmFtcHJvZHVrdGVuLiBPbSBEdSBpbnRlIGdvZGuKbm5lciBsaWNlbnN2aWxsa29yZW4sIGtsaWNrYSBwjCAiQXZimmpzIi4= - ID - 5008 - Name - Swedish - - - Attributes - 0x0000 - Data - AAYRUG9ydHVndZBzLCBCcmFzaWwJQ29uY29yZGFyCURpc2NvcmRhcghJbXByaW1pcglTYWx2YXIuLi6MU2UgZXN0hyBkZSBhY29yZG8gY29tIG9zIHRlcm1vcyBkZXN0YSBsaWNlbo1hLCBwcmVzc2lvbmUgIkNvbmNvcmRhciIgcGFyYSBpbnN0YWxhciBvIHNvZnR3YXJlLiBTZSBui28gZXN0hyBkZSBhY29yZG8sIHByZXNzaW9uZSAiRGlzY29yZGFyIi4= - ID - 5009 - Name - Brazilian Portuguese - - - Attributes - 0x0000 - Data - AAYSU2ltcGxpZmllZCBDaGluZXNlBM2s0uIGsrvNrNLiBLTy06EGtOa0oqGtVMjnufvE+s2s0uKxvtDtv8nQrdLptcTM9b/uo6zH67C0obDNrNLiobHAtLCy17C0y8jtvP6ho8jnufvE+rK7zazS4qOsx+uwtKGwsrvNrNLiobGhow== - ID - 5010 - Name - Simplified Chinese - - - Attributes - 0x0000 - Data - AAYTVHJhZGl0aW9uYWwgQ2hpbmVzZQSmULdOBqSjplC3TgSmQ6ZMBsB4pnOhS1CmcKpHsXqmULdOpbuzXKVpw9K4zKq6sfi02qFBvdCr9qGnplC3TqGopUimd7jLs27F6aFDpnCqR6SjplC3TqFBvdCr9qGnpKOmULdOoaihQw== - ID - 5011 - Name - Traditional Chinese - - - Attributes - 0x0000 - Data - AAYFRGFuc2sERW5pZwVVZW5pZwdVZHNrcml2CkFya2l2ZXIuLi6YSHZpcyBkdSBhY2NlcHRlcmVyIGJldGluZ2Vsc2VybmUgaSBsaWNlbnNhZnRhbGVuLCBza2FsIGR1IGtsaWtrZSBwjCDSRW5pZ9MgZm9yIGF0IGluc3RhbGxlcmUgc29mdHdhcmVuLiBLbGlrIHCMINJVZW5pZ9MgZm9yIGF0IGFubnVsbGVyZSBpbnN0YWxsZXJpbmdlbi4= - ID - 5012 - Name - Danish - - - Attributes - 0x0000 - Data - AAYFU3VvbWkISHl2imtzeW4KRW4gaHl2imtzeQdUdWxvc3RhCVRhbGxlbm5hyW9IeXaKa3N5IGxpc2Vuc3Npc29waW11a3NlbiBlaGRvdCBvc29pdHRhbWFsbGEg1Uh5doprc3nVLiBKb3MgZXQgaHl2imtzeSBzb3BpbXVrc2VuIGVodG9qYSwgb3NvaXRhINVFbiBoeXaKa3N51S4= - ID - 5013 - Name - Finnish - - - Attributes - 0x0000 - Data - AAYRRnJhbo1haXMgY2FuYWRpZW4IQWNjZXB0ZXIHUmVmdXNlcghJbXByaW1lcg5FbnJlZ2lzdHJlci4uLrpTaSB2b3VzIGFjY2VwdGV6IGxlcyB0ZXJtZXMgZGUgbGEgcHKOc2VudGUgbGljZW5jZSwgY2xpcXVleiBzdXIgIkFjY2VwdGVyIiBhZmluIGQnaW5zdGFsbGVyIGxlIGxvZ2ljaWVsLiBTaSB2b3VzIG4nkHRlcyBwYXMgZCdhY2NvcmQgYXZlYyBsZXMgdGVybWVzIGRlIGxhIGxpY2VuY2UsIGNsaXF1ZXogc3VyICJSZWZ1c2VyIi4= - ID - 5014 - Name - French Canadian - - - Attributes - 0x0000 - Data - AAYGS29yZWFuBLW/wMcJtb/AxyC+yMfUBsfBuLDGrgfA+sDlLi4ufrvnv+sgsOi+4LytwMcgs7u/67+hILW/wMfHz7jpLCAitb/AxyIgtNzD37imILStt68gvNLHwcauv/6+7rimILyzxKHHz73KvcO/wC4gtb/Ax8fPwfYgvsq0wrTZuOksICK1v8DHIL7Ix9QiILTcw9+4piC0qbijvcq9w7/ALg== - ID - 5015 - Name - Korean - - - Attributes - 0x0000 - Data - AAYFTm9yc2sERW5pZwlJa2tlIGVuaWcIU2tyaXYgdXQKQXJraXZlci4uLqNIdmlzIERlIGVyIGVuaWcgaSBiZXN0ZW1tZWxzZW5lIGkgZGVubmUgbGlzZW5zYXZ0YWxlbiwga2xpa2tlciBEZSBwjCAiRW5pZyIta25hcHBlbiBmb3IgjCBpbnN0YWxsZXJlIHByb2dyYW12YXJlbi4gSHZpcyBEZSBpa2tlIGVyIGVuaWcsIGtsaWtrZXIgRGUgcIwgIklra2UgZW5pZyIu - ID - 5016 - Name - Norwegian - - - TEXT - - - Attributes - 0x0000 - Data - APPLICATION_LICENSE_TEXT - ID - 5000 - Name - English SLA - - - TMPL - - - Attributes - 0x0000 - Data - E0RlZmF1bHQgTGFuZ3VhZ2UgSUREV1JEBUNvdW50T0NOVAQqKioqTFNUQwtzeXMgbGFuZyBJRERXUkQebG9jYWwgcmVzIElEIChvZmZzZXQgZnJvbSA1MDAwRFdSRBAyLWJ5dGUgbGFuZ3VhZ2U/RFdSRAQqKioqTFNURQ== - ID - 128 - Name - LPic - - - plst - - - Attributes - 0x0050 - Data - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - ID - 0 - Name - - - - styl - - - Attributes - 0x0000 - Data - AAMAAAAAAAwACQAUAAAAAAAAAAAAAAAAACcADAAJABQBAAAAAAAAAAAAAAAAKgAMAAkAFAAAAAAAAAAAAAA= - ID - 5000 - Name - English SLA - - - - diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/postinstall.template --- a/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/postinstall.template Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ -#!/usr/bin/env sh - -set -e -launchctl load "/Library/LaunchDaemons/DEPLOY_LAUNCHD_PLIST_FILE" - -exit 0 diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/preinstall.template --- a/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/mac/preinstall.template Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ -#!/usr/bin/env sh - -set -e -if launchctl list "DEPLOY_DAEMON_IDENTIFIER" &> /dev/null; then - launchctl unload "/Library/LaunchDaemons/DEPLOY_LAUNCHD_PLIST_FILE" -fi - -exit 0 diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/postinstall.template --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/postinstall.template Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,6 @@ +#!/usr/bin/env sh + +set -e +launchctl load "/Library/LaunchDaemons/DEPLOY_LAUNCHD_PLIST_FILE" + +exit 0 diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/preinstall.template --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/macosx/classes/jdk/jpackager/internal/resources/preinstall.template Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,8 @@ +#!/usr/bin/env sh + +set -e +if launchctl list "DEPLOY_DAEMON_IDENTIFIER" &> /dev/null; then + launchctl unload "/Library/LaunchDaemons/DEPLOY_LAUNCHD_PLIST_FILE" +fi + +exit 0 diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/macosx/classes/module-info.java.extra --- a/src/jdk.jpackager/macosx/classes/module-info.java.extra Wed Nov 21 13:53:17 2018 -0500 +++ b/src/jdk.jpackager/macosx/classes/module-info.java.extra Wed Nov 21 17:50:46 2018 -0500 @@ -23,10 +23,9 @@ * questions. */ +provides jdk.jpackager.internal.Bundler with + jdk.jpackager.internal.MacAppBundler, + jdk.jpackager.internal.MacAppStoreBundler, + jdk.jpackager.internal.MacDmgBundler, + jdk.jpackager.internal.MacPkgBundler; -provides jdk.jpackager.internal.Bundler with - jdk.jpackager.internal.mac.MacAppBundler, - jdk.jpackager.internal.mac.MacAppStoreBundler, - jdk.jpackager.internal.mac.MacDmgBundler, - jdk.jpackager.internal.mac.MacPkgBundler; - diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/share/classes/jdk/jpackager/internal/AbstractAppImageBuilder.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/share/classes/jdk/jpackager/internal/AbstractAppImageBuilder.java Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,278 @@ +/* + * Copyright (c) 2015, 2018, 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.jpackager.internal; + +import jdk.jpackager.internal.IOUtils; +import jdk.jpackager.internal.Log; +import jdk.jpackager.internal.StandardBundlerParam; +import jdk.jpackager.internal.JLinkBundlerHelper; +import jdk.jpackager.internal.ModFile; + +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.PrintStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.text.MessageFormat; +import java.util.List; +import java.util.Map; +import java.util.ResourceBundle; +import java.util.ArrayList; + +import static jdk.jpackager.internal.StandardBundlerParam.*; +import static jdk.jpackager.internal.StandardBundlerParam.ARGUMENTS; + +public abstract class AbstractAppImageBuilder { + + private static final ResourceBundle I18N = + ResourceBundle.getBundle( + "jdk.jpackager.internal.resources.AbstractAppImageBuilder"); + + //do not use file separator - + // we use it for classpath lookup and there / are not platform specific + public final static String BUNDLER_PREFIX = "package/"; + + private final Map properties; + private final Path root; + protected List excludeFileList = new ArrayList<>(); + + public AbstractAppImageBuilder(Map properties, + Path root) throws IOException { + this.properties = properties; + this.root = root; + excludeFileList.add(".*\\.diz"); + } + + public abstract InputStream getResourceAsStream(String name); + public abstract void prepareApplicationFiles() throws IOException; + public abstract void prepareServerJreFiles() throws IOException; + + public Map getProperties() { + return this.properties; + } + + public Path getRoot() { + return this.root; + } + + public String getExcludeFileList() { + return String.join(",", excludeFileList); + } + + protected void copyEntry(Path appDir, File srcdir, String fname) + throws IOException { + Path dest = appDir.resolve(fname); + Files.createDirectories(dest.getParent()); + File src = new File(srcdir, fname); + if (src.isDirectory()) { + IOUtils.copyRecursive(src.toPath(), dest); + } else { + Files.copy(src.toPath(), dest); + } + } + + protected InputStream locateResource(String publicName, String category, + String defaultName, File customFile, + boolean verbose, File publicRoot) throws IOException { + InputStream is = null; + boolean customFromClasspath = false; + boolean customFromFile = false; + if (publicName != null) { + if (publicRoot != null) { + File publicResource = new File(publicRoot, publicName); + if (publicResource.exists() && publicResource.isFile()) { + is = new FileInputStream(publicResource); + } + } else { + is = getResourceAsStream(publicName); + } + customFromClasspath = (is != null); + } + if (is == null && customFile != null) { + is = new FileInputStream(customFile); + customFromFile = (is != null); + } + if (is == null && defaultName != null) { + is = getResourceAsStream(defaultName); + } + if (verbose) { + String msg = null; + if (customFromClasspath) { + msg = MessageFormat.format(I18N.getString( + "message.using-custom-resource-from-classpath"), + category == null ? "" : "[" + category + "] ", publicName); + } else if (customFromFile) { + msg = MessageFormat.format(I18N.getString( + "message.using-custom-resource-from-file"), + category == null ? "" : "[" + category + "] ", + customFile.getAbsoluteFile()); + } else if (is != null) { + msg = MessageFormat.format(I18N.getString( + "message.using-default-resource-from-classpath"), + category == null ? "" : "[" + category + "] ", publicName); + } else { + msg = MessageFormat.format(I18N.getString( + "message.using-default-resource"), + category == null ? "" : "[" + category + "] ", publicName); + } + if (msg != null) { + Log.verbose(msg); + } + } + return is; + } + + + protected String preprocessTextResource(String publicName, String category, + String defaultName, Map pairs, + boolean verbose, File publicRoot) throws IOException { + InputStream inp = locateResource(publicName, category, + defaultName, null, verbose, publicRoot); + if (inp == null) { + throw new RuntimeException( + "Module corrupt? No "+defaultName+" resource!"); + } + + try (InputStream is = inp) { + //read fully into memory + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + byte[] buffer = new byte[1024]; + int length; + while ((length = is.read(buffer)) != -1) { + baos.write(buffer, 0, length); + } + + //substitute + String result = new String(baos.toByteArray()); + for (Map.Entry e : pairs.entrySet()) { + if (e.getValue() != null) { + result = result.replace(e.getKey(), e.getValue()); + } + } + return result; + } + } + + public void writeCfgFile(Map params, + File cfgFileName, String runtimeLocation) throws IOException { + cfgFileName.delete(); + + File mainJar = JLinkBundlerHelper.getMainJar(params); + ModFile.ModType mainJarType = ModFile.ModType.Unknown; + + if (mainJar != null) { + mainJarType = new ModFile(mainJar).getModType(); + } + + String mainModule = StandardBundlerParam.MODULE.fetchFrom(params); + + PrintStream out = new PrintStream(cfgFileName); + + out.println("[Application]"); + out.println("app.name=" + APP_NAME.fetchFrom(params)); + out.println("app.version=" + VERSION.fetchFrom(params)); + out.println("app.preferences.id=" + PREFERENCES_ID.fetchFrom(params)); + out.println("app.runtime=" + runtimeLocation); + out.println("app.identifier=" + IDENTIFIER.fetchFrom(params)); + out.println("app.classpath=" + String.join(File.pathSeparator, + CLASSPATH.fetchFrom(params).split("[ :;]"))); + out.println("app.application.instance=" + + (SINGLETON.fetchFrom(params) ? "single" : "multiple")); + + // The main app is required to be a jar, modular or unnamed. + if (mainModule != null && + (mainJarType == ModFile.ModType.Unknown || + mainJarType == ModFile.ModType.ModularJar)) { + out.println("app.mainmodule=" + mainModule); + } else { + String mainClass = JLinkBundlerHelper.getMainClass(params); + // If the app is contained in an unnamed jar then launch it the + // legacy way and the main class string must be + // of the format com/foo/Main + if (mainJar != null) { + out.println("app.mainjar=" + + mainJar.toPath().getFileName().toString()); + } + if (mainClass != null) { + out.println("app.mainclass=" + + mainClass.replaceAll("\\.", "/")); + } + } + + String version = JLinkBundlerHelper.getJDKVersion(params); + + if (!version.isEmpty()) { + out.println("app.java.version=" + version); + } + + out.println("jpackager.java.version=" + + System.getProperty("java.version")); + + Integer port = JLinkBundlerHelper.DEBUG.fetchFrom(params); + + if (port != null) { + out.println( + "app.debug=-agentlib:jdwp=transport=dt_socket," + + "server=y,suspend=y,address=localhost:" + + port); + } + + out.println(); + out.println("[JVMOptions]"); + List jvmargs = JVM_OPTIONS.fetchFrom(params); + for (String arg : jvmargs) { + out.println(arg); + } + Map jvmProps = JVM_PROPERTIES.fetchFrom(params); + for (Map.Entry property : jvmProps.entrySet()) { + out.println("-D" + property.getKey() + "=" + property.getValue()); + } + + out.println(); + out.println("[ArgOptions]"); + List args = ARGUMENTS.fetchFrom(params); + for (String arg : args) { + if (arg.endsWith("=") && + (arg.indexOf("=") == arg.lastIndexOf("="))) { + out.print(arg.substring(0, arg.length() - 1)); + out.println("\\="); + } else { + out.println(arg); + } + } + + + out.close(); + } + + public String getPlatformSpecificModulesFile() { + return null; + } + +} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/share/classes/jdk/jpackager/internal/Arguments.java --- a/src/jdk.jpackager/share/classes/jdk/jpackager/internal/Arguments.java Wed Nov 21 13:53:17 2018 -0500 +++ b/src/jdk.jpackager/share/classes/jdk/jpackager/internal/Arguments.java Wed Nov 21 17:50:46 2018 -0500 @@ -24,8 +24,8 @@ */ package jdk.jpackager.internal; -import jdk.jpackager.internal.bundlers.BundlerType; -import jdk.jpackager.internal.bundlers.BundleParams; +import jdk.jpackager.internal.BundlerType; +import jdk.jpackager.internal.BundleParams; import java.io.File; import java.io.FileInputStream; diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/share/classes/jdk/jpackager/internal/BundleParams.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/share/classes/jdk/jpackager/internal/BundleParams.java Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,490 @@ +/* + * Copyright (c) 2012, 2018, 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.jpackager.internal; + +import jdk.jpackager.internal.*; +import jdk.jpackager.internal.BundlerType; +import jdk.jpackager.internal.JLinkBundlerHelper; + +import java.io.File; +import java.io.IOException; +import java.util.*; +import java.util.jar.Attributes; +import java.util.jar.JarFile; +import java.util.jar.Manifest; + +import static jdk.jpackager.internal.StandardBundlerParam.*; + +public class BundleParams { + + final protected Map params; + + // RelativeFileSet + public static final String PARAM_APP_RESOURCES = "appResources"; + + // BundlerType + public static final String PARAM_TYPE = "type"; + + // String + public static final String PARAM_BUNDLE_FORMAT = "bundleFormat"; + // String + public static final String PARAM_ICON = "icon"; + + // String - Name of bundle file and native launcher + public static final String PARAM_NAME = "name"; + + // String - application vendor, used by most of the bundlers + public static final String PARAM_VENDOR = "vendor"; + + // String - email name and email, only used for debian */ + public static final String PARAM_EMAIL = "email"; + + /* String - Copyright. Used on Mac */ + public static final String PARAM_COPYRIGHT = "copyright"; + + // String - GUID on windows for MSI, CFBundleIdentifier on Mac + // If not compatible with requirements then bundler either do not bundle + // or autogenerate + public static final String PARAM_IDENTIFIER = "identifier"; + + /* boolean - shortcut preferences */ + public static final String PARAM_SHORTCUT = "shortcutHint"; + // boolean - menu shortcut preference + public static final String PARAM_MENU = "menuHint"; + + // String - Application version. Format may differ for different bundlers + public static final String PARAM_VERSION = "appVersion"; + + // String - Application category. Used at least on Mac/Linux. + // Value is platform specific + public static final String PARAM_CATEGORY = "applicationCategory"; + + // String - Optional short application + public static final String PARAM_TITLE = "title"; + + // String - Optional application description. Used by MSI and on Linux + public static final String PARAM_DESCRIPTION = "description"; + + // String - License type. Needed on Linux (rpm) + public static final String PARAM_LICENSE_TYPE = "licenseType"; + + // List - File(s) with license. Format is OS/bundler specific + public static final String PARAM_LICENSE_FILE = "licenseFile"; + + // boolean - service/daemon install. null means "default" + public static final String PARAM_SERVICE_HINT = "serviceHint"; + + + // String Main application class. + // Not used directly but used to derive default values + public static final String PARAM_APPLICATION_CLASS = "applicationClass"; + + // boolean - Adds a dialog to let the user choose a directory + // where the product will be installed. + public static final String PARAM_INSTALLDIR_CHOOSER = "installdirChooser"; + + // boolean - Prevents from launching multiple instances of application. + public static final String PARAM_SINGLETON = "singleton"; + + /** + * create a new bundle with all default values + */ + public BundleParams() { + params = new HashMap<>(); + } + + /** + * Create a bundle params with a copy of the params + * @param params map of initial parameters to be copied in. + */ + public BundleParams(Map params) { + this.params = new HashMap<>(params); + } + + public void addAllBundleParams(Map p) { + params.putAll(p); + } + + public C fetchParam(BundlerParamInfo paramInfo) { + return paramInfo.fetchFrom(params); + } + + @SuppressWarnings("unchecked") + public C fetchParamWithDefault( + Class klass, C defaultValue, String... keys) { + for (String key : keys) { + Object o = params.get(key); + if (klass.isInstance(o)) { + return (C) o; + } else if (params.containsKey(key) && o == null) { + return null; + } else if (o != null) { + Log.debug("Bundle param " + key + " is not type " + klass); + } + } + return defaultValue; + } + + public C fetchParam(Class klass, String... keys) { + return fetchParamWithDefault(klass, null, keys); + } + + // NOTE: we do not care about application parameters here + // as they will be embeded into jar file manifest and + // java launcher will take care of them! + + public Map getBundleParamsAsMap() { + return new HashMap<>(params); + } + + public void setJvmargs(List jvmargs) { + putUnlessNullOrEmpty(JVM_OPTIONS.getID(), jvmargs); + } + + public void setJvmProperties(Map jvmProperties) { + putUnlessNullOrEmpty(JVM_PROPERTIES.getID(), jvmProperties); + } + + public void setArguments(List arguments) { + putUnlessNullOrEmpty(ARGUMENTS.getID(), arguments); + } + + public void setAddModules(String value) { + putUnlessNull(StandardBundlerParam.ADD_MODULES.getID(), value); + } + + public void setLimitModules(String value) { + putUnlessNull(StandardBundlerParam.LIMIT_MODULES.getID(), value); + } + + public void setStripNativeCommands(boolean value) { + putUnlessNull(StandardBundlerParam.STRIP_NATIVE_COMMANDS.getID(), + value); + } + + public void setModulePath(String value) { + putUnlessNull(StandardBundlerParam.MODULE_PATH.getID(), value); + } + + public void setMainModule(String value) { + putUnlessNull(StandardBundlerParam.MODULE.getID(), value); + } + + public void setDebug(String value) { + putUnlessNull(JLinkBundlerHelper.DEBUG.getID(), value); + } + + public String getApplicationID() { + return fetchParam(IDENTIFIER); + } + + public String getPreferencesID() { + return fetchParam(PREFERENCES_ID); + } + + public String getTitle() { + return fetchParam(TITLE); + } + + public void setTitle(String title) { + putUnlessNull(PARAM_TITLE, title); + } + + public String getApplicationClass() { + return fetchParam(MAIN_CLASS); + } + + public void setApplicationClass(String applicationClass) { + putUnlessNull(PARAM_APPLICATION_CLASS, applicationClass); + } + + public String getAppVersion() { + return fetchParam(VERSION); + } + + public void setAppVersion(String version) { + putUnlessNull(PARAM_VERSION, version); + } + + public String getDescription() { + return fetchParam(DESCRIPTION); + } + + public void setDescription(String s) { + putUnlessNull(PARAM_DESCRIPTION, s); + } + + //path is relative to the application root + public void addLicenseFile(String path) { + List licenseFiles = fetchParam(LICENSE_FILE); + if (licenseFiles == null || licenseFiles.isEmpty()) { + licenseFiles = new ArrayList<>(); + params.put(PARAM_LICENSE_FILE, licenseFiles); + } + licenseFiles.add(path); + } + + public void setServiceHint(Boolean b) { + putUnlessNull(PARAM_SERVICE_HINT, b); + } + + public void setInstalldirChooser(Boolean b) { + putUnlessNull(PARAM_INSTALLDIR_CHOOSER, b); + } + + public void setSingleton(Boolean b) { + putUnlessNull(PARAM_SINGLETON, b); + } + + public String getName() { + return fetchParam(APP_NAME); + } + + public void setName(String name) { + putUnlessNull(PARAM_NAME, name); + } + + @SuppressWarnings("deprecation") + public BundlerType getType() { + return fetchParam(BundlerType.class, PARAM_TYPE); + } + + @SuppressWarnings("deprecation") + public void setType(BundlerType type) { + putUnlessNull(PARAM_TYPE, type); + } + + public String getBundleFormat() { + return fetchParam(String.class, PARAM_BUNDLE_FORMAT); + } + + public void setBundleFormat(String t) { + putUnlessNull(PARAM_BUNDLE_FORMAT, t); + } + + public boolean getVerbose() { + return fetchParam(VERBOSE); + } + + public List getLicenseFile() { + return fetchParam(LICENSE_FILE); + } + + public List getJvmargs() { + return JVM_OPTIONS.fetchFrom(params); + } + + public List getArguments() { + return ARGUMENTS.fetchFrom(params); + } + + // Validation approach: + // - javac and + // + // - /jmods dir + // or + // - JRE marker (rt.jar) + // - FX marker (jfxrt.jar) + // - JDK marker (tools.jar) + private static boolean checkJDKRoot(File jdkRoot) { + String exe = (Platform.getPlatform() == Platform.WINDOWS) ? + ".exe" : ""; + File javac = new File(jdkRoot, "bin/javac" + exe); + if (!javac.exists()) { + Log.verbose("javac is not found at " + javac.getAbsolutePath()); + return false; + } + + File jmods = new File(jdkRoot, "jmods"); + if (!jmods.exists()) { + Log.verbose("jmods is not found in " + jdkRoot.getAbsolutePath()); + return false; + } + return true; + } + + public jdk.jpackager.internal.RelativeFileSet getAppResource() { + return fetchParam(APP_RESOURCES); + } + + public void setAppResource(jdk.jpackager.internal.RelativeFileSet fs) { + putUnlessNull(PARAM_APP_RESOURCES, fs); + } + + public void setAppResourcesList( + List rfs) { + putUnlessNull(APP_RESOURCES_LIST.getID(), rfs); + } + + public String getApplicationCategory() { + return fetchParam(CATEGORY); + } + + public void setApplicationCategory(String category) { + putUnlessNull(PARAM_CATEGORY, category); + } + + public String getMainClassName() { + String applicationClass = getApplicationClass(); + + if (applicationClass == null) { + return null; + } + + int idx = applicationClass.lastIndexOf("."); + if (idx >= 0) { + return applicationClass.substring(idx+1); + } + return applicationClass; + } + + public String getCopyright() { + return fetchParam(COPYRIGHT); + } + + public void setCopyright(String c) { + putUnlessNull(PARAM_COPYRIGHT, c); + } + + public String getIdentifier() { + return fetchParam(IDENTIFIER); + } + + public void setIdentifier(String s) { + putUnlessNull(PARAM_IDENTIFIER, s); + } + + private String mainJar = null; + private String mainJarClassPath = null; + private boolean useFXPackaging = true; + + // For regular executable Jars we need to take care of classpath + // For JavaFX executable jars we do not need to pay attention to + // ClassPath entry in manifest + public String getAppClassPath() { + if (mainJar == null) { + // this will find out answer + getMainApplicationJar(); + } + if (useFXPackaging || mainJarClassPath == null) { + return ""; + } + return mainJarClassPath; + } + + // assuming that application was packaged according to the rules + // we must have application jar, i.e. jar where we embed launcher + // and have main application class listed as main class! + // If there are more than one, or none - it will be treated as + // deployment error + // + // Note we look for both JavaFX executable jars and regular executable jars + // As long as main "application" entry point is the same it is main class + // (i.e. for FX jar we will use JavaFX manifest entry ...) + public String getMainApplicationJar() { + jdk.jpackager.internal.RelativeFileSet appResources = getAppResource(); + if (mainJar != null) { + if (getApplicationClass() == null) try { + if (appResources != null) { + File srcdir = appResources.getBaseDirectory(); + JarFile jf = new JarFile(new File(srcdir, mainJar)); + Manifest m = jf.getManifest(); + Attributes attrs = (m != null) ? + m.getMainAttributes() : null; + if (attrs != null) { + setApplicationClass( + attrs.getValue(Attributes.Name.MAIN_CLASS)); + } + } + } catch (IOException ignore) { + } + return mainJar; + } + + String applicationClass = getApplicationClass(); + + if (appResources == null || applicationClass == null) { + return null; + } + File srcdir = appResources.getBaseDirectory(); + for (String fname : appResources.getIncludedFiles()) { + JarFile jf; + try { + jf = new JarFile(new File(srcdir, fname)); + Manifest m = jf.getManifest(); + Attributes attrs = (m != null) ? m.getMainAttributes() : null; + if (attrs != null) { + boolean javaMain = applicationClass.equals( + attrs.getValue(Attributes.Name.MAIN_CLASS)); + + if (javaMain) { + mainJar = fname; + mainJarClassPath = attrs.getValue( + Attributes.Name.CLASS_PATH); + return mainJar; + } + } + } catch (IOException ignore) { + } + } + return null; + } + + public String getVendor() { + return fetchParam(VENDOR); + } + + public void setVendor(String vendor) { + putUnlessNull(PARAM_VENDOR, vendor); + } + + public String getEmail() { + return fetchParam(String.class, PARAM_EMAIL); + } + + public void setEmail(String email) { + putUnlessNull(PARAM_EMAIL, email); + } + + public void putUnlessNull(String param, Object value) { + if (value != null) { + params.put(param, value); + } + } + + public void putUnlessNullOrEmpty(String param, Collection value) { + if (value != null && !value.isEmpty()) { + params.put(param, value); + } + } + + public void putUnlessNullOrEmpty(String param, Map value) { + if (value != null && !value.isEmpty()) { + params.put(param, value); + } + } + +} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/share/classes/jdk/jpackager/internal/BundlerType.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/share/classes/jdk/jpackager/internal/BundlerType.java Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2012, 2018, 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.jpackager.internal; + +public enum BundlerType { + NONE, + IMAGE, // Generates app image only + INSTALLER // Generates installers +} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/share/classes/jdk/jpackager/internal/DeployParams.java --- a/src/jdk.jpackager/share/classes/jdk/jpackager/internal/DeployParams.java Wed Nov 21 13:53:17 2018 -0500 +++ b/src/jdk.jpackager/share/classes/jdk/jpackager/internal/DeployParams.java Wed Nov 21 17:50:46 2018 -0500 @@ -25,8 +25,8 @@ package jdk.jpackager.internal; -import jdk.jpackager.internal.bundlers.BundlerType; -import jdk.jpackager.internal.bundlers.BundleParams; +import jdk.jpackager.internal.BundlerType; +import jdk.jpackager.internal.BundleParams; import java.io.File; import java.nio.file.Files; diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/share/classes/jdk/jpackager/internal/JLinkBundlerHelper.java --- a/src/jdk.jpackager/share/classes/jdk/jpackager/internal/JLinkBundlerHelper.java Wed Nov 21 13:53:17 2018 -0500 +++ b/src/jdk.jpackager/share/classes/jdk/jpackager/internal/JLinkBundlerHelper.java Wed Nov 21 17:50:46 2018 -0500 @@ -45,7 +45,7 @@ import java.util.ResourceBundle; import java.util.Set; -import jdk.jpackager.internal.builders.AbstractAppImageBuilder; +import jdk.jpackager.internal.AbstractAppImageBuilder; import jdk.tools.jlink.internal.packager.AppRuntimeImageBuilder; public final class JLinkBundlerHelper { @@ -182,6 +182,7 @@ StandardBundlerParam.ADD_MODULES.fetchFrom(params), limitModules, JRE_MODULES_FILENAME); + if (javaBasePath != null && javaBasePath.toFile().exists()) { result = RedistributableModules.getModuleVersion( javaBasePath.toFile(), modulePath, addModules, limitModules); @@ -278,12 +279,10 @@ modularJars.toString())); } } - Set redistModules = getRedistributableModules( modulePath, addModules, limitModules, JRE_MODULES_FILENAME); addModules.addAll(redistModules); - if (imageBuilder.getPlatformSpecificModulesFile() != null) { Set platformModules = RedistributableModules.getRedistributableModules( diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/share/classes/jdk/jpackager/internal/StandardBundlerParam.java --- a/src/jdk.jpackager/share/classes/jdk/jpackager/internal/StandardBundlerParam.java Wed Nov 21 13:53:17 2018 -0500 +++ b/src/jdk.jpackager/share/classes/jdk/jpackager/internal/StandardBundlerParam.java Wed Nov 21 17:50:46 2018 -0500 @@ -25,8 +25,8 @@ package jdk.jpackager.internal; -import jdk.jpackager.internal.bundlers.BundleParams; -import jdk.jpackager.internal.builders.AbstractAppImageBuilder; +import jdk.jpackager.internal.BundleParams; +import jdk.jpackager.internal.AbstractAppImageBuilder; import java.io.File; import java.io.IOException; diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/share/classes/jdk/jpackager/internal/builders/AbstractAppImageBuilder.java --- a/src/jdk.jpackager/share/classes/jdk/jpackager/internal/builders/AbstractAppImageBuilder.java Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,278 +0,0 @@ -/* - * Copyright (c) 2015, 2018, 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.jpackager.internal.builders; - -import jdk.jpackager.internal.IOUtils; -import jdk.jpackager.internal.Log; -import jdk.jpackager.internal.StandardBundlerParam; -import jdk.jpackager.internal.JLinkBundlerHelper; -import jdk.jpackager.internal.ModFile; - -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.PrintStream; -import java.nio.file.Files; -import java.nio.file.Path; -import java.text.MessageFormat; -import java.util.List; -import java.util.Map; -import java.util.ResourceBundle; -import java.util.ArrayList; - -import static jdk.jpackager.internal.StandardBundlerParam.*; -import static jdk.jpackager.internal.StandardBundlerParam.ARGUMENTS; - -public abstract class AbstractAppImageBuilder { - - private static final ResourceBundle I18N = - ResourceBundle.getBundle( - "jdk.jpackager.internal.resources.builders.AbstractAppImageBuilder"); - - //do not use file separator - - // we use it for classpath lookup and there / are not platform specific - public final static String BUNDLER_PREFIX = "package/"; - - private final Map properties; - private final Path root; - protected List excludeFileList = new ArrayList<>(); - - public AbstractAppImageBuilder(Map properties, - Path root) throws IOException { - this.properties = properties; - this.root = root; - excludeFileList.add(".*\\.diz"); - } - - public abstract InputStream getResourceAsStream(String name); - public abstract void prepareApplicationFiles() throws IOException; - public abstract void prepareServerJreFiles() throws IOException; - - public Map getProperties() { - return this.properties; - } - - public Path getRoot() { - return this.root; - } - - public String getExcludeFileList() { - return String.join(",", excludeFileList); - } - - protected void copyEntry(Path appDir, File srcdir, String fname) - throws IOException { - Path dest = appDir.resolve(fname); - Files.createDirectories(dest.getParent()); - File src = new File(srcdir, fname); - if (src.isDirectory()) { - IOUtils.copyRecursive(src.toPath(), dest); - } else { - Files.copy(src.toPath(), dest); - } - } - - protected InputStream locateResource(String publicName, String category, - String defaultName, File customFile, - boolean verbose, File publicRoot) throws IOException { - InputStream is = null; - boolean customFromClasspath = false; - boolean customFromFile = false; - if (publicName != null) { - if (publicRoot != null) { - File publicResource = new File(publicRoot, publicName); - if (publicResource.exists() && publicResource.isFile()) { - is = new FileInputStream(publicResource); - } - } else { - is = getResourceAsStream(publicName); - } - customFromClasspath = (is != null); - } - if (is == null && customFile != null) { - is = new FileInputStream(customFile); - customFromFile = (is != null); - } - if (is == null && defaultName != null) { - is = getResourceAsStream(defaultName); - } - if (verbose) { - String msg = null; - if (customFromClasspath) { - msg = MessageFormat.format(I18N.getString( - "message.using-custom-resource-from-classpath"), - category == null ? "" : "[" + category + "] ", publicName); - } else if (customFromFile) { - msg = MessageFormat.format(I18N.getString( - "message.using-custom-resource-from-file"), - category == null ? "" : "[" + category + "] ", - customFile.getAbsoluteFile()); - } else if (is != null) { - msg = MessageFormat.format(I18N.getString( - "message.using-default-resource-from-classpath"), - category == null ? "" : "[" + category + "] ", publicName); - } else { - msg = MessageFormat.format(I18N.getString( - "message.using-default-resource"), - category == null ? "" : "[" + category + "] ", publicName); - } - if (msg != null) { - Log.verbose(msg); - } - } - return is; - } - - - protected String preprocessTextResource(String publicName, String category, - String defaultName, Map pairs, - boolean verbose, File publicRoot) throws IOException { - InputStream inp = locateResource(publicName, category, - defaultName, null, verbose, publicRoot); - if (inp == null) { - throw new RuntimeException( - "Module corrupt? No "+defaultName+" resource!"); - } - - try (InputStream is = inp) { - //read fully into memory - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - byte[] buffer = new byte[1024]; - int length; - while ((length = is.read(buffer)) != -1) { - baos.write(buffer, 0, length); - } - - //substitute - String result = new String(baos.toByteArray()); - for (Map.Entry e : pairs.entrySet()) { - if (e.getValue() != null) { - result = result.replace(e.getKey(), e.getValue()); - } - } - return result; - } - } - - public void writeCfgFile(Map params, - File cfgFileName, String runtimeLocation) throws IOException { - cfgFileName.delete(); - - File mainJar = JLinkBundlerHelper.getMainJar(params); - ModFile.ModType mainJarType = ModFile.ModType.Unknown; - - if (mainJar != null) { - mainJarType = new ModFile(mainJar).getModType(); - } - - String mainModule = StandardBundlerParam.MODULE.fetchFrom(params); - - PrintStream out = new PrintStream(cfgFileName); - - out.println("[Application]"); - out.println("app.name=" + APP_NAME.fetchFrom(params)); - out.println("app.version=" + VERSION.fetchFrom(params)); - out.println("app.preferences.id=" + PREFERENCES_ID.fetchFrom(params)); - out.println("app.runtime=" + runtimeLocation); - out.println("app.identifier=" + IDENTIFIER.fetchFrom(params)); - out.println("app.classpath=" + String.join(File.pathSeparator, - CLASSPATH.fetchFrom(params).split("[ :;]"))); - out.println("app.application.instance=" + - (SINGLETON.fetchFrom(params) ? "single" : "multiple")); - - // The main app is required to be a jar, modular or unnamed. - if (mainModule != null && - (mainJarType == ModFile.ModType.Unknown || - mainJarType == ModFile.ModType.ModularJar)) { - out.println("app.mainmodule=" + mainModule); - } else { - String mainClass = JLinkBundlerHelper.getMainClass(params); - // If the app is contained in an unnamed jar then launch it the - // legacy way and the main class string must be - // of the format com/foo/Main - if (mainJar != null) { - out.println("app.mainjar=" - + mainJar.toPath().getFileName().toString()); - } - if (mainClass != null) { - out.println("app.mainclass=" - + mainClass.replaceAll("\\.", "/")); - } - } - - String version = JLinkBundlerHelper.getJDKVersion(params); - - if (!version.isEmpty()) { - out.println("app.java.version=" + version); - } - - out.println("jpackager.java.version=" - + System.getProperty("java.version")); - - Integer port = JLinkBundlerHelper.DEBUG.fetchFrom(params); - - if (port != null) { - out.println( - "app.debug=-agentlib:jdwp=transport=dt_socket," - + "server=y,suspend=y,address=localhost:" - + port); - } - - out.println(); - out.println("[JVMOptions]"); - List jvmargs = JVM_OPTIONS.fetchFrom(params); - for (String arg : jvmargs) { - out.println(arg); - } - Map jvmProps = JVM_PROPERTIES.fetchFrom(params); - for (Map.Entry property : jvmProps.entrySet()) { - out.println("-D" + property.getKey() + "=" + property.getValue()); - } - - out.println(); - out.println("[ArgOptions]"); - List args = ARGUMENTS.fetchFrom(params); - for (String arg : args) { - if (arg.endsWith("=") && - (arg.indexOf("=") == arg.lastIndexOf("="))) { - out.print(arg.substring(0, arg.length() - 1)); - out.println("\\="); - } else { - out.println(arg); - } - } - - - out.close(); - } - - public String getPlatformSpecificModulesFile() { - return null; - } - -} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/share/classes/jdk/jpackager/internal/bundlers/BundleParams.java --- a/src/jdk.jpackager/share/classes/jdk/jpackager/internal/bundlers/BundleParams.java Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,490 +0,0 @@ -/* - * Copyright (c) 2012, 2018, 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.jpackager.internal.bundlers; - -import jdk.jpackager.internal.*; -import jdk.jpackager.internal.bundlers.BundlerType; -import jdk.jpackager.internal.JLinkBundlerHelper; - -import java.io.File; -import java.io.IOException; -import java.util.*; -import java.util.jar.Attributes; -import java.util.jar.JarFile; -import java.util.jar.Manifest; - -import static jdk.jpackager.internal.StandardBundlerParam.*; - -public class BundleParams { - - final protected Map params; - - // RelativeFileSet - public static final String PARAM_APP_RESOURCES = "appResources"; - - // BundlerType - public static final String PARAM_TYPE = "type"; - - // String - public static final String PARAM_BUNDLE_FORMAT = "bundleFormat"; - // String - public static final String PARAM_ICON = "icon"; - - // String - Name of bundle file and native launcher - public static final String PARAM_NAME = "name"; - - // String - application vendor, used by most of the bundlers - public static final String PARAM_VENDOR = "vendor"; - - // String - email name and email, only used for debian */ - public static final String PARAM_EMAIL = "email"; - - /* String - Copyright. Used on Mac */ - public static final String PARAM_COPYRIGHT = "copyright"; - - // String - GUID on windows for MSI, CFBundleIdentifier on Mac - // If not compatible with requirements then bundler either do not bundle - // or autogenerate - public static final String PARAM_IDENTIFIER = "identifier"; - - /* boolean - shortcut preferences */ - public static final String PARAM_SHORTCUT = "shortcutHint"; - // boolean - menu shortcut preference - public static final String PARAM_MENU = "menuHint"; - - // String - Application version. Format may differ for different bundlers - public static final String PARAM_VERSION = "appVersion"; - - // String - Application category. Used at least on Mac/Linux. - // Value is platform specific - public static final String PARAM_CATEGORY = "applicationCategory"; - - // String - Optional short application - public static final String PARAM_TITLE = "title"; - - // String - Optional application description. Used by MSI and on Linux - public static final String PARAM_DESCRIPTION = "description"; - - // String - License type. Needed on Linux (rpm) - public static final String PARAM_LICENSE_TYPE = "licenseType"; - - // List - File(s) with license. Format is OS/bundler specific - public static final String PARAM_LICENSE_FILE = "licenseFile"; - - // boolean - service/daemon install. null means "default" - public static final String PARAM_SERVICE_HINT = "serviceHint"; - - - // String Main application class. - // Not used directly but used to derive default values - public static final String PARAM_APPLICATION_CLASS = "applicationClass"; - - // boolean - Adds a dialog to let the user choose a directory - // where the product will be installed. - public static final String PARAM_INSTALLDIR_CHOOSER = "installdirChooser"; - - // boolean - Prevents from launching multiple instances of application. - public static final String PARAM_SINGLETON = "singleton"; - - /** - * create a new bundle with all default values - */ - public BundleParams() { - params = new HashMap<>(); - } - - /** - * Create a bundle params with a copy of the params - * @param params map of initial parameters to be copied in. - */ - public BundleParams(Map params) { - this.params = new HashMap<>(params); - } - - public void addAllBundleParams(Map p) { - params.putAll(p); - } - - public C fetchParam(BundlerParamInfo paramInfo) { - return paramInfo.fetchFrom(params); - } - - @SuppressWarnings("unchecked") - public C fetchParamWithDefault( - Class klass, C defaultValue, String... keys) { - for (String key : keys) { - Object o = params.get(key); - if (klass.isInstance(o)) { - return (C) o; - } else if (params.containsKey(key) && o == null) { - return null; - } else if (o != null) { - Log.debug("Bundle param " + key + " is not type " + klass); - } - } - return defaultValue; - } - - public C fetchParam(Class klass, String... keys) { - return fetchParamWithDefault(klass, null, keys); - } - - // NOTE: we do not care about application parameters here - // as they will be embeded into jar file manifest and - // java launcher will take care of them! - - public Map getBundleParamsAsMap() { - return new HashMap<>(params); - } - - public void setJvmargs(List jvmargs) { - putUnlessNullOrEmpty(JVM_OPTIONS.getID(), jvmargs); - } - - public void setJvmProperties(Map jvmProperties) { - putUnlessNullOrEmpty(JVM_PROPERTIES.getID(), jvmProperties); - } - - public void setArguments(List arguments) { - putUnlessNullOrEmpty(ARGUMENTS.getID(), arguments); - } - - public void setAddModules(String value) { - putUnlessNull(StandardBundlerParam.ADD_MODULES.getID(), value); - } - - public void setLimitModules(String value) { - putUnlessNull(StandardBundlerParam.LIMIT_MODULES.getID(), value); - } - - public void setStripNativeCommands(boolean value) { - putUnlessNull(StandardBundlerParam.STRIP_NATIVE_COMMANDS.getID(), - value); - } - - public void setModulePath(String value) { - putUnlessNull(StandardBundlerParam.MODULE_PATH.getID(), value); - } - - public void setMainModule(String value) { - putUnlessNull(StandardBundlerParam.MODULE.getID(), value); - } - - public void setDebug(String value) { - putUnlessNull(JLinkBundlerHelper.DEBUG.getID(), value); - } - - public String getApplicationID() { - return fetchParam(IDENTIFIER); - } - - public String getPreferencesID() { - return fetchParam(PREFERENCES_ID); - } - - public String getTitle() { - return fetchParam(TITLE); - } - - public void setTitle(String title) { - putUnlessNull(PARAM_TITLE, title); - } - - public String getApplicationClass() { - return fetchParam(MAIN_CLASS); - } - - public void setApplicationClass(String applicationClass) { - putUnlessNull(PARAM_APPLICATION_CLASS, applicationClass); - } - - public String getAppVersion() { - return fetchParam(VERSION); - } - - public void setAppVersion(String version) { - putUnlessNull(PARAM_VERSION, version); - } - - public String getDescription() { - return fetchParam(DESCRIPTION); - } - - public void setDescription(String s) { - putUnlessNull(PARAM_DESCRIPTION, s); - } - - //path is relative to the application root - public void addLicenseFile(String path) { - List licenseFiles = fetchParam(LICENSE_FILE); - if (licenseFiles == null || licenseFiles.isEmpty()) { - licenseFiles = new ArrayList<>(); - params.put(PARAM_LICENSE_FILE, licenseFiles); - } - licenseFiles.add(path); - } - - public void setServiceHint(Boolean b) { - putUnlessNull(PARAM_SERVICE_HINT, b); - } - - public void setInstalldirChooser(Boolean b) { - putUnlessNull(PARAM_INSTALLDIR_CHOOSER, b); - } - - public void setSingleton(Boolean b) { - putUnlessNull(PARAM_SINGLETON, b); - } - - public String getName() { - return fetchParam(APP_NAME); - } - - public void setName(String name) { - putUnlessNull(PARAM_NAME, name); - } - - @SuppressWarnings("deprecation") - public BundlerType getType() { - return fetchParam(BundlerType.class, PARAM_TYPE); - } - - @SuppressWarnings("deprecation") - public void setType(BundlerType type) { - putUnlessNull(PARAM_TYPE, type); - } - - public String getBundleFormat() { - return fetchParam(String.class, PARAM_BUNDLE_FORMAT); - } - - public void setBundleFormat(String t) { - putUnlessNull(PARAM_BUNDLE_FORMAT, t); - } - - public boolean getVerbose() { - return fetchParam(VERBOSE); - } - - public List getLicenseFile() { - return fetchParam(LICENSE_FILE); - } - - public List getJvmargs() { - return JVM_OPTIONS.fetchFrom(params); - } - - public List getArguments() { - return ARGUMENTS.fetchFrom(params); - } - - // Validation approach: - // - javac and - // - // - /jmods dir - // or - // - JRE marker (rt.jar) - // - FX marker (jfxrt.jar) - // - JDK marker (tools.jar) - private static boolean checkJDKRoot(File jdkRoot) { - String exe = (Platform.getPlatform() == Platform.WINDOWS) ? - ".exe" : ""; - File javac = new File(jdkRoot, "bin/javac" + exe); - if (!javac.exists()) { - Log.verbose("javac is not found at " + javac.getAbsolutePath()); - return false; - } - - File jmods = new File(jdkRoot, "jmods"); - if (!jmods.exists()) { - Log.verbose("jmods is not found in " + jdkRoot.getAbsolutePath()); - return false; - } - return true; - } - - public jdk.jpackager.internal.RelativeFileSet getAppResource() { - return fetchParam(APP_RESOURCES); - } - - public void setAppResource(jdk.jpackager.internal.RelativeFileSet fs) { - putUnlessNull(PARAM_APP_RESOURCES, fs); - } - - public void setAppResourcesList( - List rfs) { - putUnlessNull(APP_RESOURCES_LIST.getID(), rfs); - } - - public String getApplicationCategory() { - return fetchParam(CATEGORY); - } - - public void setApplicationCategory(String category) { - putUnlessNull(PARAM_CATEGORY, category); - } - - public String getMainClassName() { - String applicationClass = getApplicationClass(); - - if (applicationClass == null) { - return null; - } - - int idx = applicationClass.lastIndexOf("."); - if (idx >= 0) { - return applicationClass.substring(idx+1); - } - return applicationClass; - } - - public String getCopyright() { - return fetchParam(COPYRIGHT); - } - - public void setCopyright(String c) { - putUnlessNull(PARAM_COPYRIGHT, c); - } - - public String getIdentifier() { - return fetchParam(IDENTIFIER); - } - - public void setIdentifier(String s) { - putUnlessNull(PARAM_IDENTIFIER, s); - } - - private String mainJar = null; - private String mainJarClassPath = null; - private boolean useFXPackaging = true; - - // For regular executable Jars we need to take care of classpath - // For JavaFX executable jars we do not need to pay attention to - // ClassPath entry in manifest - public String getAppClassPath() { - if (mainJar == null) { - // this will find out answer - getMainApplicationJar(); - } - if (useFXPackaging || mainJarClassPath == null) { - return ""; - } - return mainJarClassPath; - } - - // assuming that application was packaged according to the rules - // we must have application jar, i.e. jar where we embed launcher - // and have main application class listed as main class! - // If there are more than one, or none - it will be treated as - // deployment error - // - // Note we look for both JavaFX executable jars and regular executable jars - // As long as main "application" entry point is the same it is main class - // (i.e. for FX jar we will use JavaFX manifest entry ...) - public String getMainApplicationJar() { - jdk.jpackager.internal.RelativeFileSet appResources = getAppResource(); - if (mainJar != null) { - if (getApplicationClass() == null) try { - if (appResources != null) { - File srcdir = appResources.getBaseDirectory(); - JarFile jf = new JarFile(new File(srcdir, mainJar)); - Manifest m = jf.getManifest(); - Attributes attrs = (m != null) ? - m.getMainAttributes() : null; - if (attrs != null) { - setApplicationClass( - attrs.getValue(Attributes.Name.MAIN_CLASS)); - } - } - } catch (IOException ignore) { - } - return mainJar; - } - - String applicationClass = getApplicationClass(); - - if (appResources == null || applicationClass == null) { - return null; - } - File srcdir = appResources.getBaseDirectory(); - for (String fname : appResources.getIncludedFiles()) { - JarFile jf; - try { - jf = new JarFile(new File(srcdir, fname)); - Manifest m = jf.getManifest(); - Attributes attrs = (m != null) ? m.getMainAttributes() : null; - if (attrs != null) { - boolean javaMain = applicationClass.equals( - attrs.getValue(Attributes.Name.MAIN_CLASS)); - - if (javaMain) { - mainJar = fname; - mainJarClassPath = attrs.getValue( - Attributes.Name.CLASS_PATH); - return mainJar; - } - } - } catch (IOException ignore) { - } - } - return null; - } - - public String getVendor() { - return fetchParam(VENDOR); - } - - public void setVendor(String vendor) { - putUnlessNull(PARAM_VENDOR, vendor); - } - - public String getEmail() { - return fetchParam(String.class, PARAM_EMAIL); - } - - public void setEmail(String email) { - putUnlessNull(PARAM_EMAIL, email); - } - - public void putUnlessNull(String param, Object value) { - if (value != null) { - params.put(param, value); - } - } - - public void putUnlessNullOrEmpty(String param, Collection value) { - if (value != null && !value.isEmpty()) { - params.put(param, value); - } - } - - public void putUnlessNullOrEmpty(String param, Map value) { - if (value != null && !value.isEmpty()) { - params.put(param, value); - } - } - -} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/share/classes/jdk/jpackager/internal/bundlers/BundlerType.java --- a/src/jdk.jpackager/share/classes/jdk/jpackager/internal/bundlers/BundlerType.java Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2012, 2018, 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.jpackager.internal.bundlers; - -public enum BundlerType { - NONE, - IMAGE, // Generates app image only - INSTALLER // Generates installers -} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/share/classes/jdk/jpackager/internal/resources/AbstractAppImageBuilder.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/share/classes/jdk/jpackager/internal/resources/AbstractAppImageBuilder.properties Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,30 @@ +# +# Copyright (c) 2017, 2018, 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. +# +# + +message.using-default-resource=Using default package resource {0} (add {1} to the class path to customize) +message.using-custom-resource-from-file=Using custom package resource {0} (loaded from file {1}) +message.using-custom-resource-from-classpath=Using custom package resource {0} (loaded from {1}) +message.using-default-resource-from-classpath=Using default package resource {0} (add {1} to the class path to customize) diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/share/classes/jdk/jpackager/internal/resources/AbstractAppImageBuilder_ja.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/share/classes/jdk/jpackager/internal/resources/AbstractAppImageBuilder_ja.properties Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,30 @@ +# +# Copyright (c) 2017, 2018, 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. +# +# + +message.using-default-resource=\u30C7\u30D5\u30A9\u30EB\u30C8\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u30FB\u30EA\u30BD\u30FC\u30B9{0}\u306E\u4F7F\u7528({1}\u3092\u30AF\u30E9\u30B9\u30FB\u30D1\u30B9\u306B\u8FFD\u52A0\u3057\u3066\u30AB\u30B9\u30BF\u30DE\u30A4\u30BA) +message.using-custom-resource-from-file=\u30AB\u30B9\u30BF\u30E0\u30FB\u30D1\u30C3\u30B1\u30FC\u30B8\u30FB\u30EA\u30BD\u30FC\u30B9{0}\u306E\u4F7F\u7528(\u30D5\u30A1\u30A4\u30EB{1}\u304B\u3089\u30ED\u30FC\u30C9\u6E08) +message.using-custom-resource-from-classpath=\u30AB\u30B9\u30BF\u30E0\u30FB\u30D1\u30C3\u30B1\u30FC\u30B8\u30FB\u30EA\u30BD\u30FC\u30B9{0}\u306E\u4F7F\u7528({1}\u304B\u3089\u30ED\u30FC\u30C9\u6E08) +message.using-default-resource-from-classpath=\u30C7\u30D5\u30A9\u30EB\u30C8\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u30FB\u30EA\u30BD\u30FC\u30B9{0}\u306E\u4F7F\u7528({1}\u3092\u30AF\u30E9\u30B9\u30FB\u30D1\u30B9\u306B\u8FFD\u52A0\u3057\u3066\u30AB\u30B9\u30BF\u30DE\u30A4\u30BA) diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/share/classes/jdk/jpackager/internal/resources/AbstractAppImageBuilder_zh_CN.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/share/classes/jdk/jpackager/internal/resources/AbstractAppImageBuilder_zh_CN.properties Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,30 @@ +# +# Copyright (c) 2017, 2018, 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. +# +# + +message.using-default-resource=\u4F7F\u7528\u9ED8\u8BA4\u7A0B\u5E8F\u5305\u8D44\u6E90 {0} (\u5C06 {1} \u6DFB\u52A0\u5230\u7C7B\u8DEF\u5F84\u4EE5\u5B9A\u5236) +message.using-custom-resource-from-file=\u4F7F\u7528\u5B9A\u5236\u7A0B\u5E8F\u5305\u8D44\u6E90 {0} (\u4ECE\u6587\u4EF6 {1} \u52A0\u8F7D) +message.using-custom-resource-from-classpath=\u4F7F\u7528\u5B9A\u5236\u7A0B\u5E8F\u5305\u8D44\u6E90 {0} (\u4ECE {1} \u52A0\u8F7D) +message.using-default-resource-from-classpath=\u4F7F\u7528\u9ED8\u8BA4\u7A0B\u5E8F\u5305\u8D44\u6E90 {0} (\u5C06 {1} \u6DFB\u52A0\u5230\u7C7B\u8DEF\u5F84\u4EE5\u5B9A\u5236) diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/share/classes/jdk/jpackager/internal/resources/builders/AbstractAppImageBuilder.properties --- a/src/jdk.jpackager/share/classes/jdk/jpackager/internal/resources/builders/AbstractAppImageBuilder.properties Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -# -# Copyright (c) 2017, 2018, 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. -# -# - -message.using-default-resource=Using default package resource {0} (add {1} to the class path to customize) -message.using-custom-resource-from-file=Using custom package resource {0} (loaded from file {1}) -message.using-custom-resource-from-classpath=Using custom package resource {0} (loaded from {1}) -message.using-default-resource-from-classpath=Using default package resource {0} (add {1} to the class path to customize) diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/share/classes/jdk/jpackager/internal/resources/builders/AbstractAppImageBuilder_ja.properties --- a/src/jdk.jpackager/share/classes/jdk/jpackager/internal/resources/builders/AbstractAppImageBuilder_ja.properties Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -# -# Copyright (c) 2017, 2018, 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. -# -# - -message.using-default-resource=\u30C7\u30D5\u30A9\u30EB\u30C8\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u30FB\u30EA\u30BD\u30FC\u30B9{0}\u306E\u4F7F\u7528({1}\u3092\u30AF\u30E9\u30B9\u30FB\u30D1\u30B9\u306B\u8FFD\u52A0\u3057\u3066\u30AB\u30B9\u30BF\u30DE\u30A4\u30BA) -message.using-custom-resource-from-file=\u30AB\u30B9\u30BF\u30E0\u30FB\u30D1\u30C3\u30B1\u30FC\u30B8\u30FB\u30EA\u30BD\u30FC\u30B9{0}\u306E\u4F7F\u7528(\u30D5\u30A1\u30A4\u30EB{1}\u304B\u3089\u30ED\u30FC\u30C9\u6E08) -message.using-custom-resource-from-classpath=\u30AB\u30B9\u30BF\u30E0\u30FB\u30D1\u30C3\u30B1\u30FC\u30B8\u30FB\u30EA\u30BD\u30FC\u30B9{0}\u306E\u4F7F\u7528({1}\u304B\u3089\u30ED\u30FC\u30C9\u6E08) -message.using-default-resource-from-classpath=\u30C7\u30D5\u30A9\u30EB\u30C8\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u30FB\u30EA\u30BD\u30FC\u30B9{0}\u306E\u4F7F\u7528({1}\u3092\u30AF\u30E9\u30B9\u30FB\u30D1\u30B9\u306B\u8FFD\u52A0\u3057\u3066\u30AB\u30B9\u30BF\u30DE\u30A4\u30BA) diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/share/classes/jdk/jpackager/internal/resources/builders/AbstractAppImageBuilder_zh_CN.properties --- a/src/jdk.jpackager/share/classes/jdk/jpackager/internal/resources/builders/AbstractAppImageBuilder_zh_CN.properties Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -# -# Copyright (c) 2017, 2018, 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. -# -# - -message.using-default-resource=\u4F7F\u7528\u9ED8\u8BA4\u7A0B\u5E8F\u5305\u8D44\u6E90 {0} (\u5C06 {1} \u6DFB\u52A0\u5230\u7C7B\u8DEF\u5F84\u4EE5\u5B9A\u5236) -message.using-custom-resource-from-file=\u4F7F\u7528\u5B9A\u5236\u7A0B\u5E8F\u5305\u8D44\u6E90 {0} (\u4ECE\u6587\u4EF6 {1} \u52A0\u8F7D) -message.using-custom-resource-from-classpath=\u4F7F\u7528\u5B9A\u5236\u7A0B\u5E8F\u5305\u8D44\u6E90 {0} (\u4ECE {1} \u52A0\u8F7D) -message.using-default-resource-from-classpath=\u4F7F\u7528\u9ED8\u8BA4\u7A0B\u5E8F\u5305\u8D44\u6E90 {0} (\u5C06 {1} \u6DFB\u52A0\u5230\u7C7B\u8DEF\u5F84\u4EE5\u5B9A\u5236) diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/WinAppBundler.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/WinAppBundler.java Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,342 @@ +/* + * Copyright (c) 2012, 2018, 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.jpackager.internal; + +import jdk.jpackager.internal.AbstractImageBundler; +import jdk.jpackager.internal.BundlerParamInfo; +import jdk.jpackager.internal.ConfigException; +import jdk.jpackager.internal.IOUtils; +import jdk.jpackager.internal.Log; +import jdk.jpackager.internal.Platform; +import jdk.jpackager.internal.StandardBundlerParam; +import jdk.jpackager.internal.UnsupportedPlatformException; +import jdk.jpackager.internal.WindowsAppImageBuilder; +import jdk.jpackager.internal.resources.WinResources; +import jdk.jpackager.internal.JLinkBundlerHelper; +import jdk.jpackager.internal.Arguments; +import jdk.jpackager.internal.AbstractAppImageBuilder; + +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.PrintStream; +import java.text.MessageFormat; +import java.util.Arrays; +import java.util.Collection; +import java.util.Map; +import java.util.ResourceBundle; + +import static jdk.jpackager.internal.WindowsBundlerParam.*; +import static jdk.jpackager.internal.WinMsiBundler.WIN_APP_IMAGE; + +public class WinAppBundler extends AbstractImageBundler { + + private static final ResourceBundle I18N = + ResourceBundle.getBundle( + "jdk.jpackager.internal.resources.WinAppBundler"); + + public static final BundlerParamInfo ICON_ICO = + new StandardBundlerParam<>( + I18N.getString("param.icon-ico.name"), + I18N.getString("param.icon-ico.description"), + "icon.ico", + File.class, + params -> { + File f = ICON.fetchFrom(params); + if (f != null && !f.getName().toLowerCase().endsWith(".ico")) { + Log.error(MessageFormat.format( + I18N.getString("message.icon-not-ico"), f)); + return null; + } + return f; + }, + (s, p) -> new File(s)); + + public WinAppBundler() { + super(); + baseResourceLoader = WinResources.class; + } + + public final static String WIN_BUNDLER_PREFIX = + BUNDLER_PREFIX + "windows/"; + + @Override + public boolean validate(Map params) + throws UnsupportedPlatformException, ConfigException { + try { + if (params == null) throw new ConfigException( + I18N.getString("error.parameters-null"), + I18N.getString("error.parameters-null.advice")); + + return doValidate(params); + } catch (RuntimeException re) { + if (re.getCause() instanceof ConfigException) { + throw (ConfigException) re.getCause(); + } else { + throw new ConfigException(re); + } + } + } + + // to be used by chained bundlers, e.g. by EXE bundler to avoid + // skipping validation if p.type does not include "image" + boolean doValidate(Map p) + throws UnsupportedPlatformException, ConfigException { + if (Platform.getPlatform() != Platform.WINDOWS) { + throw new UnsupportedPlatformException(); + } + + imageBundleValidation(p); + + if (StandardBundlerParam.getPredefinedAppImage(p) != null) { + return true; + } + + // Make sure that jpackager.exe exists. + File tool = new File( + System.getProperty("java.home") + "\\bin\\jpackager.exe"); + + if (!tool.exists()) { + throw new ConfigException( + I18N.getString("error.no-windows-resources"), + I18N.getString("error.no-windows-resources.advice")); + } + + // validate runtime bit-architectire + testRuntimeBitArchitecture(p); + + return true; + } + + private static void testRuntimeBitArchitecture( + Map params) throws ConfigException { + if ("true".equalsIgnoreCase(System.getProperty( + "fxpackager.disableBitArchitectureMismatchCheck"))) { + Log.debug(I18N.getString("message.disable-bit-architecture-check")); + return; + } + + if ((BIT_ARCH_64.fetchFrom(params) != + BIT_ARCH_64_RUNTIME.fetchFrom(params))) { + throw new ConfigException( + I18N.getString("error.bit-architecture-mismatch"), + I18N.getString("error.bit-architecture-mismatch.advice")); + } + } + + private static boolean usePredefineAppName(Map p) { + return (PREDEFINED_APP_IMAGE.fetchFrom(p) != null); + } + + private static String appName; + synchronized static String getAppName( + Map p) { + // If we building from predefined app image, then we should use names + // from image and not from CLI. + if (usePredefineAppName(p)) { + if (appName == null) { + // Use WIN_APP_IMAGE here, since we already copy pre-defined + // image to WIN_APP_IMAGE + File appImageDir = new File( + WIN_APP_IMAGE.fetchFrom(p).toString() + "\\app"); + File [] files = appImageDir.listFiles( + (File dir, String name) -> name.endsWith(".cfg")); + if (files == null || files.length == 0) { + throw new RuntimeException(MessageFormat.format( + I18N.getString("error.cannot-find-launcher"), + appImageDir)); + } else { + appName = files[0].getName(); + int index = appName.indexOf("."); + if (index != -1) { + appName = appName.substring(0, index); + } + if (files.length > 1) { + Log.error(MessageFormat.format(I18N.getString( + "message.multiple-launchers"), appName)); + } + } + return appName; + } else { + return appName; + } + } + + return APP_NAME.fetchFrom(p); + } + + public static String getLauncherName(Map p) { + return getAppName(p) + ".exe"; + } + + public static String getLauncherCfgName(Map p) { + return "app\\" + getAppName(p) +".cfg"; + } + + public boolean bundle(Map p, File outputDirectory) { + return doBundle(p, outputDirectory, false) != null; + } + + File doBundle(Map p, + File outputDirectory, boolean dependentTask) { + if (Arguments.CREATE_JRE_INSTALLER.fetchFrom(p)) { + return doJreBundle(p, outputDirectory, dependentTask); + } else { + return doAppBundle(p, outputDirectory, dependentTask); + } + } + + File doJreBundle(Map p, + File outputDirectory, boolean dependentTask) { + try { + File rootDirectory = createRoot(p, outputDirectory, dependentTask, + APP_NAME.fetchFrom(p), "windowsapp-image-builder"); + AbstractAppImageBuilder appBuilder = new WindowsAppImageBuilder( + APP_NAME.fetchFrom(p), + outputDirectory.toPath()); + File predefined = PREDEFINED_RUNTIME_IMAGE.fetchFrom(p); + if (predefined == null ) { + JLinkBundlerHelper.generateServerJre(p, appBuilder); + } else { + return predefined; + } + return rootDirectory; + } catch (Exception ex) { + Log.error("Exception: "+ex); + Log.verbose(ex); + return null; + } + } + + File doAppBundle(Map p, + File outputDirectory, boolean dependentTask) { + try { + File rootDirectory = createRoot(p, outputDirectory, dependentTask, + APP_NAME.fetchFrom(p), "windowsapp-image-builder"); + AbstractAppImageBuilder appBuilder = + new WindowsAppImageBuilder(p, outputDirectory.toPath()); + if (PREDEFINED_RUNTIME_IMAGE.fetchFrom(p) == null ) { + JLinkBundlerHelper.execute(p, appBuilder); + } else { + StandardBundlerParam.copyPredefinedRuntimeImage(p, appBuilder); + } + if (!dependentTask) { + Log.verbose(MessageFormat.format( + I18N.getString("message.result-dir"), + outputDirectory.getAbsolutePath())); + } + return rootDirectory; + } catch (Exception ex) { + Log.error("Exception: "+ex); + Log.verbose(ex); + return null; + } + } + + private static final String RUNTIME_AUTO_DETECT = ".runtime.autodetect"; + + public static void extractFlagsFromRuntime( + Map params) { + if (params.containsKey(".runtime.autodetect")) return; + + params.put(RUNTIME_AUTO_DETECT, "attempted"); + + String commandline; + File runtimePath = JLinkBundlerHelper.getJDKHome(params).toFile(); + File launcherPath = new File(runtimePath, "bin\\java.exe"); + + ProcessBuilder pb = + new ProcessBuilder(launcherPath.getAbsolutePath(), "-version"); + try (ByteArrayOutputStream baos = new ByteArrayOutputStream()) { + try (PrintStream pout = new PrintStream(baos)) { + IOUtils.exec(pb, Log.isDebug(), true, pout); + } + + commandline = baos.toString(); + } catch (IOException e) { + e.printStackTrace(); + params.put(RUNTIME_AUTO_DETECT, "failed"); + return; + } + + AbstractImageBundler.extractFlagsFromVersion(params, commandline); + params.put(RUNTIME_AUTO_DETECT, "succeeded"); + } + + @Override + public String getName() { + return I18N.getString("bundler.name"); + } + + @Override + public String getDescription() { + return I18N.getString("bundler.description"); + } + + @Override + public String getID() { + return "windows.app"; + } + + @Override + public String getBundleType() { + return "IMAGE"; + } + + @Override + public Collection> getBundleParameters() { + return getAppBundleParameters(); + } + + public static Collection> getAppBundleParameters() { + return Arrays.asList( + APP_NAME, + APP_RESOURCES, + ARGUMENTS, + CLASSPATH, + ICON_ICO, + JVM_OPTIONS, + JVM_PROPERTIES, + MAIN_CLASS, + MAIN_JAR, + PREFERENCES_ID, + VERSION, + VERBOSE + ); + } + + @Override + public File execute( + Map params, File outputParentDir) { + return doBundle(params, outputParentDir, false); + } + + @Override + public boolean supported() { + return (Platform.getPlatform() == Platform.WINDOWS); + } + +} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/WinExeBundler.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/WinExeBundler.java Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,969 @@ +/* + * Copyright (c) 2017, 2018, 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.jpackager.internal; + +import jdk.jpackager.internal.*; +import jdk.jpackager.internal.ConfigException; +import jdk.jpackager.internal.Arguments; +import jdk.jpackager.internal.UnsupportedPlatformException; +import jdk.jpackager.internal.resources.WinResources; + +import java.io.*; +import java.nio.charset.Charset; +import java.nio.file.Files; +import java.text.MessageFormat; +import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static jdk.jpackager.internal.WindowsBundlerParam.*; + +public class WinExeBundler extends AbstractBundler { + + private static final ResourceBundle I18N = ResourceBundle.getBundle( + "jdk.jpackager.internal.resources.WinExeBundler"); + + public static final BundlerParamInfo APP_BUNDLER = + new WindowsBundlerParam<>( + getString("param.app-bundler.name"), + getString("param.app-bundler.description"), + "win.app.bundler", + WinAppBundler.class, + params -> new WinAppBundler(), + null); + + public static final BundlerParamInfo CONFIG_ROOT = + new WindowsBundlerParam<>( + getString("param.config-root.name"), + getString("param.config-root.description"), + "configRoot", + File.class, + params -> { + File imagesRoot = + new File(BUILD_ROOT.fetchFrom(params), "windows"); + imagesRoot.mkdirs(); + return imagesRoot; + }, + (s, p) -> null); + + public static final BundlerParamInfo EXE_IMAGE_DIR = + new WindowsBundlerParam<>( + getString("param.image-dir.name"), + getString("param.image-dir.description"), + "win.exe.imageDir", + File.class, + params -> { + File imagesRoot = IMAGES_ROOT.fetchFrom(params); + if (!imagesRoot.exists()) imagesRoot.mkdirs(); + return new File(imagesRoot, "win-exe.image"); + }, + (s, p) -> null); + + public static final BundlerParamInfo WIN_APP_IMAGE = + new WindowsBundlerParam<>( + getString("param.app-dir.name"), + getString("param.app-dir.description"), + "win.app.image", + File.class, + null, + (s, p) -> null); + + + public static final StandardBundlerParam EXE_SYSTEM_WIDE = + new StandardBundlerParam<>( + getString("param.system-wide.name"), + getString("param.system-wide.description"), + Arguments.CLIOptions.WIN_PER_USER_INSTALLATION.getId(), + Boolean.class, + params -> true, // default to system wide + (s, p) -> (s == null || "null".equalsIgnoreCase(s))? null + : Boolean.valueOf(s) + ); + public static final StandardBundlerParam PRODUCT_VERSION = + new StandardBundlerParam<>( + getString("param.product-version.name"), + getString("param.product-version.description"), + "win.msi.productVersion", + String.class, + VERSION::fetchFrom, + (s, p) -> s + ); + + public static final StandardBundlerParam MENU_HINT = + new WindowsBundlerParam<>( + getString("param.menu-shortcut-hint.name"), + getString("param.menu-shortcut-hint.description"), + Arguments.CLIOptions.WIN_MENU_HINT.getId(), + Boolean.class, + params -> false, + (s, p) -> (s == null || + "null".equalsIgnoreCase(s))? true : Boolean.valueOf(s) + ); + + public static final StandardBundlerParam SHORTCUT_HINT = + new WindowsBundlerParam<>( + getString("param.desktop-shortcut-hint.name"), + getString("param.desktop-shortcut-hint.description"), + Arguments.CLIOptions.WIN_SHORTCUT_HINT.getId(), + Boolean.class, + params -> false, + (s, p) -> (s == null || + "null".equalsIgnoreCase(s))? false : Boolean.valueOf(s) + ); + + + + private final static String DEFAULT_EXE_PROJECT_TEMPLATE = "template.iss"; + private final static String DEFAULT_JRE_EXE_TEMPLATE = "template.jre.iss"; + private static final String TOOL_INNO_SETUP_COMPILER = "iscc.exe"; + + public static final BundlerParamInfo + TOOL_INNO_SETUP_COMPILER_EXECUTABLE = new WindowsBundlerParam<>( + getString("param.iscc-path.name"), + getString("param.iscc-path.description"), + "win.exe.iscc.exe", + String.class, + params -> { + for (String dirString : (System.getenv("PATH") + + ";C:\\Program Files (x86)\\Inno Setup 5;" + + "C:\\Program Files\\Inno Setup 5").split(";")) { + File f = new File(dirString.replace("\"", ""), + TOOL_INNO_SETUP_COMPILER); + if (f.isFile()) { + return f.toString(); + } + } + return null; + }, + null); + + public WinExeBundler() { + super(); + baseResourceLoader = WinResources.class; + } + + @Override + public String getName() { + return getString("bundler.name"); + } + + @Override + public String getDescription() { + return getString("bundler.description"); + } + + @Override + public String getID() { + return "exe"; + } + + @Override + public String getBundleType() { + return "INSTALLER"; + } + + @Override + public Collection> getBundleParameters() { + Collection> results = new LinkedHashSet<>(); + results.addAll(WinAppBundler.getAppBundleParameters()); + results.addAll(getExeBundleParameters()); + return results; + } + + public static Collection> getExeBundleParameters() { + return Arrays.asList( + DESCRIPTION, + COPYRIGHT, + LICENSE_FILE, + MENU_GROUP, + MENU_HINT, + SHORTCUT_HINT, + EXE_SYSTEM_WIDE, + TITLE, + VENDOR, + INSTALLDIR_CHOOSER + ); + } + + @Override + public File execute( + Map p, File outputParentDir) { + return bundle(p, outputParentDir); + } + + @Override + public boolean supported() { + return (Platform.getPlatform() == Platform.WINDOWS); + } + + static class VersionExtractor extends PrintStream { + double version = 0f; + + public VersionExtractor() { + super(new ByteArrayOutputStream()); + } + + double getVersion() { + if (version == 0f) { + String content = + new String(((ByteArrayOutputStream) out).toByteArray()); + Pattern pattern = Pattern.compile("Inno Setup (\\d+.?\\d*)"); + Matcher matcher = pattern.matcher(content); + if (matcher.find()) { + String v = matcher.group(1); + version = Double.parseDouble(v); + } + } + return version; + } + } + + private static double findToolVersion(String toolName) { + try { + if (toolName == null || "".equals(toolName)) return 0f; + + ProcessBuilder pb = new ProcessBuilder( + toolName, + "/?"); + VersionExtractor ve = new VersionExtractor(); + IOUtils.exec(pb, Log.isDebug(), true, ve); + // not interested in the output + double version = ve.getVersion(); + Log.verbose(MessageFormat.format( + getString("message.tool-version"), toolName, version)); + return version; + } catch (Exception e) { + if (Log.isDebug()) { + Log.verbose(e); + } + return 0f; + } + } + + @Override + public boolean validate(Map p) + throws UnsupportedPlatformException, ConfigException { + try { + if (p == 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); + + // make sure some key values don't have newlines + for (BundlerParamInfo pi : Arrays.asList( + APP_NAME, + COPYRIGHT, + DESCRIPTION, + MENU_GROUP, + TITLE, + VENDOR, + VERSION) + ) { + String v = pi.fetchFrom(p); + if (v.contains("\n") | v.contains("\r")) { + throw new ConfigException("Parmeter '" + pi.getID() + + "' cannot contain a newline.", + " Change the value of '" + pi.getID() + + " so that it does not contain any newlines"); + } + } + + // exe bundlers trim the copyright to 100 characters, + // tell them this will happen + if (COPYRIGHT.fetchFrom(p).length() > 100) { + throw new ConfigException( + getString("error.copyright-is-too-long"), + getString("error.copyright-is-too-long.advice")); + } + + double innoVersion = findToolVersion( + TOOL_INNO_SETUP_COMPILER_EXECUTABLE.fetchFrom(p)); + + //Inno Setup 5+ is required + double minVersion = 5.0f; + + if (innoVersion < minVersion) { + Log.error(MessageFormat.format( + getString("message.tool-wrong-version"), + TOOL_INNO_SETUP_COMPILER, innoVersion, minVersion)); + throw new ConfigException( + getString("error.iscc-not-found"), + getString("error.iscc-not-found.advice")); + } + + /********* validate bundle parameters *************/ + + // only one mime type per association, at least one file extension + List> associations = + FILE_ASSOCIATIONS.fetchFrom(p); + if (associations != null) { + for (int i = 0; i < associations.size(); i++) { + Map assoc = associations.get(i); + List mimes = FA_CONTENT_TYPE.fetchFrom(assoc); + if (mimes.size() > 1) { + throw new ConfigException(MessageFormat.format( + getString("error.too-many-content-" + + "types-for-file-association"), i), + getString("error.too-many-content-" + + "types-for-file-association.advice")); + } + } + } + + // validate license file, if used, exists in the proper place + if (p.containsKey(LICENSE_FILE.getID())) { + List appResourcesList = + APP_RESOURCES_LIST.fetchFrom(p); + for (String license : LICENSE_FILE.fetchFrom(p)) { + boolean found = false; + for (RelativeFileSet appResources : appResourcesList) { + found = found || appResources.contains(license); + } + if (!found) { + throw new ConfigException( + MessageFormat.format(getString( + "error.license-missing"), license), + MessageFormat.format(getString( + "error.license-missing.advice"), license)); + } + } + } + + return true; + } catch (RuntimeException re) { + if (re.getCause() instanceof ConfigException) { + throw (ConfigException) re.getCause(); + } else { + throw new ConfigException(re); + } + } + } + + private boolean prepareProto(Map p) + throws IOException { + File appImage = StandardBundlerParam.getPredefinedAppImage(p); + 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)); + // 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); + } + + if (appDir == null) { + return false; + } + + p.put(WIN_APP_IMAGE.getID(), appDir); + + List licenseFiles = LICENSE_FILE.fetchFrom(p); + if (licenseFiles != null) { + // need to copy license file to the root of win.app.image + outerLoop: + for (RelativeFileSet rfs : APP_RESOURCES_LIST.fetchFrom(p)) { + for (String s : licenseFiles) { + if (rfs.contains(s)) { + File lfile = new File(rfs.getBaseDirectory(), s); + File destFile = + new File(appDir.getParentFile(), lfile.getName()); + IOUtils.copyFile(lfile, destFile); + ensureByMutationFileIsRTF(destFile); + break outerLoop; + } + } + } + } + + // copy file association icons + List> fileAssociations = + FILE_ASSOCIATIONS.fetchFrom(p); + + for (Map fa : fileAssociations) { + File icon = FA_ICON.fetchFrom(fa); // TODO FA_ICON_ICO + if (icon == null) { + continue; + } + + File faIconFile = new File(appDir, icon.getName()); + + if (icon.exists()) { + try { + IOUtils.copyFile(icon, faIconFile); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + + return true; + } + + public File bundle(Map p, File outdir) { + if (!outdir.isDirectory() && !outdir.mkdirs()) { + throw new RuntimeException(MessageFormat.format( + getString("error.cannot-create-output-dir"), + outdir.getAbsolutePath())); + } + if (!outdir.canWrite()) { + throw new RuntimeException(MessageFormat.format( + getString("error.cannot-write-to-output-dir"), + outdir.getAbsolutePath())); + } + + if (WindowsDefender.isThereAPotentialWindowsDefenderIssue()) { + Log.error(MessageFormat.format( + getString("message.potential.windows.defender.issue"), + WindowsDefender.getUserTempDirectory())); + } + + // validate we have valid tools before continuing + String iscc = TOOL_INNO_SETUP_COMPILER_EXECUTABLE.fetchFrom(p); + if (iscc == null || !new File(iscc).isFile()) { + Log.error(getString("error.iscc-not-found")); + Log.error(MessageFormat.format( + getString("message.iscc-file-string"), iscc)); + return null; + } + + File imageDir = EXE_IMAGE_DIR.fetchFrom(p); + try { + imageDir.mkdirs(); + + boolean menuShortcut = MENU_HINT.fetchFrom(p); + boolean desktopShortcut = SHORTCUT_HINT.fetchFrom(p); + 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); + } + + if (prepareProto(p) && prepareProjectConfig(p)) { + File configScript = getConfig_Script(p); + if (configScript.exists()) { + Log.verbose(MessageFormat.format( + getString("message.running-wsh-script"), + configScript.getAbsolutePath())); + IOUtils.run("wscript", configScript, VERBOSE.fetchFrom(p)); + } + return buildEXE(p, outdir); + } + return null; + } catch (IOException ex) { + ex.printStackTrace(); + return null; + } finally { + try { + if (imageDir != null && + PREDEFINED_APP_IMAGE.fetchFrom(p) == null && + (PREDEFINED_RUNTIME_IMAGE.fetchFrom(p) == null || + !Arguments.CREATE_JRE_INSTALLER.fetchFrom(p)) && + !Log.isDebug() && + !Log.isVerbose()) { + IOUtils.deleteRecursive(imageDir); + } else if (imageDir != null) { + Log.verbose(MessageFormat.format( + I18N.getString("message.debug-working-directory"), + imageDir.getAbsolutePath())); + } + } catch (IOException ex) { + // noinspection ReturnInsideFinallyBlock + Log.debug(ex.getMessage()); + return null; + } + } + } + + // name of post-image script + private File getConfig_Script(Map p) { + return new File(EXE_IMAGE_DIR.fetchFrom(p), + APP_NAME.fetchFrom(p) + "-post-image.wsf"); + } + + private String getAppIdentifier(Map p) { + String nm = IDENTIFIER.fetchFrom(p); + + if (nm == null) { + nm = APP_NAME.fetchFrom(p); + } + + // limitation of innosetup + if (nm.length() > 126) { + Log.error(getString("message-truncating-id")); + nm = nm.substring(0, 126); + } + + return nm; + } + + + private String getLicenseFile(Map p) { + List licenseFiles = LICENSE_FILE.fetchFrom(p); + if (licenseFiles == null || licenseFiles.isEmpty()) { + return ""; + } else { + return licenseFiles.get(0); + } + } + + void validateValueAndPut(Map data, String key, + BundlerParamInfo param, + Map p) throws IOException { + String value = param.fetchFrom(p); + if (value.contains("\r") || value.contains("\n")) { + throw new IOException("Configuration Parameter " + + param.getID() + " cannot contain multiple lines of text"); + } + data.put(key, innosetupEscape(value)); + } + + private String innosetupEscape(String value) { + if (value.contains("\"") || !value.trim().equals(value)) { + value = "\"" + value.replace("\"", "\"\"") + "\""; + } + return value; + } + + boolean prepareMainProjectFile(Map p) + throws IOException { + Map data = new HashMap<>(); + data.put("PRODUCT_APP_IDENTIFIER", + innosetupEscape(getAppIdentifier(p))); + + + validateValueAndPut(data, "INSTALLER_NAME", APP_NAME, p); + validateValueAndPut(data, "APPLICATION_VENDOR", VENDOR, p); + validateValueAndPut(data, "APPLICATION_VERSION", VERSION, p); + validateValueAndPut(data, "INSTALLER_FILE_NAME", + INSTALLER_FILE_NAME, p); + + data.put("LAUNCHER_NAME", + innosetupEscape(WinAppBundler.getAppName(p))); + + data.put("APPLICATION_LAUNCHER_FILENAME", + innosetupEscape(WinAppBundler.getLauncherName(p))); + + data.put("APPLICATION_DESKTOP_SHORTCUT", + SHORTCUT_HINT.fetchFrom(p) ? "returnTrue" : "returnFalse"); + data.put("APPLICATION_MENU_SHORTCUT", + MENU_HINT.fetchFrom(p) ? "returnTrue" : "returnFalse"); + validateValueAndPut(data, "APPLICATION_GROUP", MENU_GROUP, p); + validateValueAndPut(data, "APPLICATION_COMMENTS", TITLE, p); + validateValueAndPut(data, "APPLICATION_COPYRIGHT", COPYRIGHT, p); + + data.put("APPLICATION_LICENSE_FILE", + innosetupEscape(getLicenseFile(p))); + data.put("DISABLE_DIR_PAGE", + INSTALLDIR_CHOOSER.fetchFrom(p) ? "No" : "Yes"); + + Boolean isSystemWide = EXE_SYSTEM_WIDE.fetchFrom(p); + + if (isSystemWide) { + data.put("APPLICATION_INSTALL_ROOT", "{pf}"); + data.put("APPLICATION_INSTALL_PRIVILEGE", "admin"); + } else { + data.put("APPLICATION_INSTALL_ROOT", "{localappdata}"); + data.put("APPLICATION_INSTALL_PRIVILEGE", "lowest"); + } + + if (BIT_ARCH_64.fetchFrom(p)) { + data.put("ARCHITECTURE_BIT_MODE", "x64"); + } else { + data.put("ARCHITECTURE_BIT_MODE", ""); + } + validateValueAndPut(data, "RUN_FILENAME", APP_NAME, p); + + validateValueAndPut(data, "APPLICATION_DESCRIPTION", + DESCRIPTION, p); + + data.put("APPLICATION_SERVICE", "returnFalse"); + data.put("APPLICATION_NOT_SERVICE", "returnFalse"); + data.put("APPLICATION_APP_CDS_INSTALL", "returnFalse"); + data.put("START_ON_INSTALL", ""); + data.put("STOP_ON_UNINSTALL", ""); + data.put("RUN_AT_STARTUP", ""); + + StringBuilder secondaryLaunchersCfg = new StringBuilder(); + for (Map + launcher : SECONDARY_LAUNCHERS.fetchFrom(p)) { + String application_name = APP_NAME.fetchFrom(launcher); + if (MENU_HINT.fetchFrom(launcher)) { + // Name: "{group}\APPLICATION_NAME"; + // Filename: "{app}\APPLICATION_NAME.exe"; + // IconFilename: "{app}\APPLICATION_NAME.ico" + secondaryLaunchersCfg.append("Name: \"{group}\\"); + secondaryLaunchersCfg.append(application_name); + secondaryLaunchersCfg.append("\"; Filename: \"{app}\\"); + secondaryLaunchersCfg.append(application_name); + secondaryLaunchersCfg.append(".exe\"; IconFilename: \"{app}\\"); + secondaryLaunchersCfg.append(application_name); + secondaryLaunchersCfg.append(".ico\"\r\n"); + } + if (SHORTCUT_HINT.fetchFrom(launcher)) { + // Name: "{commondesktop}\APPLICATION_NAME"; + // Filename: "{app}\APPLICATION_NAME.exe"; + // IconFilename: "{app}\APPLICATION_NAME.ico" + secondaryLaunchersCfg.append("Name: \"{commondesktop}\\"); + secondaryLaunchersCfg.append(application_name); + secondaryLaunchersCfg.append("\"; Filename: \"{app}\\"); + secondaryLaunchersCfg.append(application_name); + secondaryLaunchersCfg.append(".exe\"; IconFilename: \"{app}\\"); + secondaryLaunchersCfg.append(application_name); + secondaryLaunchersCfg.append(".ico\"\r\n"); + } + } + data.put("SECONDARY_LAUNCHERS", secondaryLaunchersCfg.toString()); + + StringBuilder registryEntries = new StringBuilder(); + String regName = APP_REGISTRY_NAME.fetchFrom(p); + List> fetchFrom = + FILE_ASSOCIATIONS.fetchFrom(p); + for (int i = 0; i < fetchFrom.size(); i++) { + Map fileAssociation = fetchFrom.get(i); + String description = FA_DESCRIPTION.fetchFrom(fileAssociation); + File icon = FA_ICON.fetchFrom(fileAssociation); //TODO FA_ICON_ICO + + List extensions = FA_EXTENSIONS.fetchFrom(fileAssociation); + String entryName = regName + "File"; + if (i > 0) { + entryName += "." + i; + } + + if (extensions == null) { + Log.verbose(getString( + "message.creating-association-with-null-extension")); + } else { + for (String ext : extensions) { + if (isSystemWide) { + // "Root: HKCR; Subkey: \".myp\"; + // ValueType: string; ValueName: \"\"; + // ValueData: \"MyProgramFile\"; + // Flags: uninsdeletevalue" + registryEntries.append("Root: HKCR; Subkey: \".") + .append(ext) + .append("\"; ValueType: string;" + + " ValueName: \"\"; ValueData: \"") + .append(entryName) + .append("\"; Flags: uninsdeletevalue\r\n"); + } else { + registryEntries.append( + "Root: HKCU; Subkey: \"Software\\Classes\\.") + .append(ext) + .append("\"; ValueType: string;" + + " ValueName: \"\"; ValueData: \"") + .append(entryName) + .append("\"; Flags: uninsdeletevalue\r\n"); + } + } + } + + if (extensions != null && !extensions.isEmpty()) { + String ext = extensions.get(0); + List mimeTypes = + FA_CONTENT_TYPE.fetchFrom(fileAssociation); + for (String mime : mimeTypes) { + if (isSystemWide) { + // "Root: HKCR; + // Subkey: HKCR\\Mime\\Database\\ + // Content Type\\application/chaos; + // ValueType: string; + // ValueName: Extension; + // ValueData: .chaos; + // Flags: uninsdeletevalue" + registryEntries.append("Root: HKCR; Subkey: " + + "\"Mime\\Database\\Content Type\\") + .append(mime) + .append("\"; ValueType: string; ValueName: " + + "\"Extension\"; ValueData: \".") + .append(ext) + .append("\"; Flags: uninsdeletevalue\r\n"); + } else { + registryEntries.append( + "Root: HKCU; Subkey: \"Software\\" + + "Classes\\Mime\\Database\\Content Type\\") + .append(mime) + .append("\"; ValueType: string; " + + "ValueName: \"Extension\"; ValueData: \".") + .append(ext) + .append("\"; Flags: uninsdeletevalue\r\n"); + } + } + } + + if (isSystemWide) { + // "Root: HKCR; + // Subkey: \"MyProgramFile\"; + // ValueType: string; + // ValueName: \"\"; + // ValueData: \"My Program File\"; + // Flags: uninsdeletekey" + registryEntries.append("Root: HKCR; Subkey: \"") + .append(entryName) + .append( + "\"; ValueType: string; ValueName: \"\"; ValueData: \"") + .append(removeQuotes(description)) + .append("\"; Flags: uninsdeletekey\r\n"); + } else { + registryEntries.append( + "Root: HKCU; Subkey: \"Software\\Classes\\") + .append(entryName) + .append( + "\"; ValueType: string; ValueName: \"\"; ValueData: \"") + .append(removeQuotes(description)) + .append("\"; Flags: uninsdeletekey\r\n"); + } + + if (icon != null && icon.exists()) { + if (isSystemWide) { + // "Root: HKCR; + // Subkey: \"MyProgramFile\\DefaultIcon\"; + // ValueType: string; + // ValueName: \"\"; + // ValueData: \"{app}\\MYPROG.EXE,0\"\n" + + registryEntries.append("Root: HKCR; Subkey: \"") + .append(entryName) + .append("\\DefaultIcon\"; ValueType: string; " + + "ValueName: \"\"; ValueData: \"{app}\\") + .append(icon.getName()) + .append("\"\r\n"); + } else { + registryEntries.append( + "Root: HKCU; Subkey: \"Software\\Classes\\") + .append(entryName) + .append("\\DefaultIcon\"; ValueType: string; " + + "ValueName: \"\"; ValueData: \"{app}\\") + .append(icon.getName()) + .append("\"\r\n"); + } + } + + if (isSystemWide) { + // "Root: HKCR; + // Subkey: \"MyProgramFile\\shell\\open\\command\"; + // ValueType: string; + // ValueName: \"\"; + // ValueData: \"\"\"{app}\\MYPROG.EXE\"\" \"\"%1\"\"\"\n" + registryEntries.append("Root: HKCR; Subkey: \"") + .append(entryName) + .append("\\shell\\open\\command\"; ValueType: " + + "string; ValueName: \"\"; ValueData: \"\"\"{app}\\") + .append(APP_NAME.fetchFrom(p)) + .append("\"\" \"\"%1\"\"\"\r\n"); + } else { + registryEntries.append( + "Root: HKCU; Subkey: \"Software\\Classes\\") + .append(entryName) + .append("\\shell\\open\\command\"; ValueType: " + + "string; ValueName: \"\"; ValueData: \"\"\"{app}\\") + .append(APP_NAME.fetchFrom(p)) + .append("\"\" \"\"%1\"\"\"\r\n"); + } + } + if (registryEntries.length() > 0) { + data.put("FILE_ASSOCIATIONS", + "ChangesAssociations=yes\r\n\r\n[Registry]\r\n" + + registryEntries.toString()); + } else { + data.put("FILE_ASSOCIATIONS", ""); + } + + // TODO - alternate template for JRE installer + String iss = Arguments.CREATE_JRE_INSTALLER.fetchFrom(p) ? + DEFAULT_JRE_EXE_TEMPLATE : DEFAULT_EXE_PROJECT_TEMPLATE; + + Writer w = new BufferedWriter(new FileWriter( + getConfig_ExeProjectFile(p))); + + String content = preprocessTextResource( + WinAppBundler.WIN_BUNDLER_PREFIX + + getConfig_ExeProjectFile(p).getName(), + getString("resource.inno-setup-project-file"), + iss, data, VERBOSE.fetchFrom(p), + DROP_IN_RESOURCES_ROOT.fetchFrom(p)); + w.write(content); + w.close(); + return true; + } + + private final static String removeQuotes(String s) { + if (s.length() > 2 && s.startsWith("\"") && s.endsWith("\"")) { + // special case for '"XXX"' return 'XXX' not '-XXX-' + // note '"' and '""' are excluded from this special case + s = s.substring(1, s.length() - 1); + } + // if there interior double quotes replace them with '-' + return s.replaceAll("\"", "-"); + } + + private final static String DEFAULT_INNO_SETUP_ICON = + "icon_inno_setup.bmp"; + + private boolean prepareProjectConfig(Map p) + throws IOException { + prepareMainProjectFile(p); + + // prepare installer icon + File iconTarget = getConfig_SmallInnoSetupIcon(p); + fetchResource(WinAppBundler.WIN_BUNDLER_PREFIX + iconTarget.getName(), + getString("resource.setup-icon"), + DEFAULT_INNO_SETUP_ICON, + iconTarget, + VERBOSE.fetchFrom(p), + DROP_IN_RESOURCES_ROOT.fetchFrom(p)); + + fetchResource(WinAppBundler.WIN_BUNDLER_PREFIX + + getConfig_Script(p).getName(), + getString("resource.post-install-script"), + (String) null, + getConfig_Script(p), + VERBOSE.fetchFrom(p), + DROP_IN_RESOURCES_ROOT.fetchFrom(p)); + return true; + } + + private File getConfig_SmallInnoSetupIcon( + Map p) { + return new File(EXE_IMAGE_DIR.fetchFrom(p), + APP_NAME.fetchFrom(p) + "-setup-icon.bmp"); + } + + private File getConfig_ExeProjectFile(Map p) { + return new File(EXE_IMAGE_DIR.fetchFrom(p), + APP_NAME.fetchFrom(p) + ".iss"); + } + + + private File buildEXE(Map p, File outdir) + throws IOException { + Log.verbose(MessageFormat.format( + getString("message.outputting-to-location"), + outdir.getAbsolutePath())); + + outdir.mkdirs(); + + // run Inno Setup + ProcessBuilder pb = new ProcessBuilder( + TOOL_INNO_SETUP_COMPILER_EXECUTABLE.fetchFrom(p), + "/q", // turn off inno setup output + "/o"+outdir.getAbsolutePath(), + getConfig_ExeProjectFile(p).getAbsolutePath()); + pb = pb.directory(EXE_IMAGE_DIR.fetchFrom(p)); + IOUtils.exec(pb, VERBOSE.fetchFrom(p)); + + Log.verbose(MessageFormat.format( + getString("message.output-location"), + outdir.getAbsolutePath())); + + // presume the result is the ".exe" file with the newest modified time + // not the best solution, but it is the most reliable + File result = null; + long lastModified = 0; + File[] list = outdir.listFiles(); + if (list != null) { + for (File f : list) { + if (f.getName().endsWith(".exe") && + f.lastModified() > lastModified) { + result = f; + lastModified = f.lastModified(); + } + } + } + + return result; + } + + public static void ensureByMutationFileIsRTF(File f) { + if (f == null || !f.isFile()) return; + + try { + boolean existingLicenseIsRTF = false; + + try (FileInputStream fin = new FileInputStream(f)) { + byte[] firstBits = new byte[7]; + + if (fin.read(firstBits) == firstBits.length) { + String header = new String(firstBits); + existingLicenseIsRTF = "{\\rtf1\\".equals(header); + } + } + + if (!existingLicenseIsRTF) { + List oldLicense = Files.readAllLines(f.toPath()); + try (Writer w = Files.newBufferedWriter( + f.toPath(), Charset.forName("Windows-1252"))) { + w.write("{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033" + + "{\\fonttbl{\\f0\\fnil\\fcharset0 Arial;}}\n" + + "\\viewkind4\\uc1\\pard\\sa200\\sl276" + + "\\slmult1\\lang9\\fs20 "); + oldLicense.forEach(l -> { + try { + for (char c : l.toCharArray()) { + if (c < 0x10) { + w.write("\\'0"); + w.write(Integer.toHexString(c)); + } else if (c > 0xff) { + w.write("\\ud"); + w.write(Integer.toString(c)); + w.write("?"); + } else if ((c < 0x20) || (c >= 0x80) || + (c == 0x5C) || (c == 0x7B) || + (c == 0x7D)) { + w.write("\\'"); + w.write(Integer.toHexString(c)); + } else { + w.write(c); + } + } + if (l.length() < 1) { + w.write("\\par"); + } else { + w.write(" "); + } + w.write("\r\n"); + } catch (IOException e) { + Log.verbose(e); + } + }); + w.write("}\r\n"); + } + } + } catch (IOException e) { + Log.verbose(e); + } + } + + private static String getString(String key) + throws MissingResourceException { + return I18N.getString(key); + } +} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/WinMsiBundler.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/WinMsiBundler.java Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,1270 @@ +/* + * Copyright (c) 2012, 2018, 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.jpackager.internal; + +import jdk.jpackager.internal.*; +import jdk.jpackager.internal.ConfigException; +import jdk.jpackager.internal.Arguments; +import jdk.jpackager.internal.UnsupportedPlatformException; +import jdk.jpackager.internal.resources.WinResources; + +import java.io.*; +import java.nio.charset.Charset; +import java.nio.file.Files; +import java.text.MessageFormat; +import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static jdk.jpackager.internal.WindowsBundlerParam.*; + +public class WinMsiBundler extends AbstractBundler { + + private static final ResourceBundle I18N = + ResourceBundle.getBundle( + "jdk.jpackager.internal.resources.WinMsiBundler"); + + public static final BundlerParamInfo APP_BUNDLER = + new WindowsBundlerParam<>( + I18N.getString("param.app-bundler.name"), + I18N.getString("param.app-bundler.description"), + "win.app.bundler", + WinAppBundler.class, + params -> new WinAppBundler(), + null); + + public static final BundlerParamInfo 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 CONFIG_ROOT = + new WindowsBundlerParam<>( + I18N.getString("param.config-root.name"), + I18N.getString("param.config-root.description"), + "configRoot", + File.class, + params -> { + File imagesRoot = + new File(BUILD_ROOT.fetchFrom(params), "windows"); + imagesRoot.mkdirs(); + return imagesRoot; + }, + (s, p) -> null); + + public static final BundlerParamInfo 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(); + return new File(imagesRoot, "win-msi.image"); + }, + (s, p) -> null); + + public static final BundlerParamInfo 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 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 + (s, p) -> (s == null || "null".equalsIgnoreCase(s))? null + : Boolean.valueOf(s) + ); + + + public static final StandardBundlerParam 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 UPGRADE_UUID = + new WindowsBundlerParam<>( + I18N.getString("param.upgrade-uuid.name"), + I18N.getString("param.upgrade-uuid.description"), + Arguments.CLIOptions.WIN_MSI_UPGRADE_UUID.getId(), + UUID.class, + params -> UUID.randomUUID(), // TODO check to see + // if identifier is a valid UUID during default + (s, p) -> UUID.fromString(s)); + + private static final String TOOL_CANDLE = "candle.exe"; + private static final String TOOL_LIGHT = "light.exe"; + // autodetect just v3.7, v3.8, 3.9, 3.10 and 3.11 + private static final String AUTODETECT_DIRS = + ";C:\\Program Files (x86)\\WiX Toolset v3.11\\bin;" + + "C:\\Program Files\\WiX Toolset v3.11\\bin;" + + "C:\\Program Files (x86)\\WiX Toolset v3.10\\bin;" + + "C:\\Program Files\\WiX Toolset v3.10\\bin;" + + "C:\\Program Files (x86)\\WiX Toolset v3.9\\bin;" + + "C:\\Program Files\\WiX Toolset v3.9\\bin;" + + "C:\\Program Files (x86)\\WiX Toolset v3.8\\bin;" + + "C:\\Program Files\\WiX Toolset v3.8\\bin;" + + "C:\\Program Files (x86)\\WiX Toolset v3.7\\bin;" + + "C:\\Program Files\\WiX Toolset v3.7\\bin"; + + public static final BundlerParamInfo 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(";")) { + File f = new File(dirString.replace("\"", ""), TOOL_CANDLE); + if (f.isFile()) { + return f.toString(); + } + } + return null; + }, + null); + + public static final BundlerParamInfo 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(";")) { + File f = new File(dirString.replace("\"", ""), TOOL_LIGHT); + if (f.isFile()) { + return f.toString(); + } + } + return null; + }, + null); + + public static final StandardBundlerParam 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 + (s, p) -> (s == null || + "null".equalsIgnoreCase(s))? true : Boolean.valueOf(s) + ); + + public static final StandardBundlerParam 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 + (s, p) -> (s == null || + "null".equalsIgnoreCase(s))? false : Boolean.valueOf(s) + ); + + public WinMsiBundler() { + super(); + baseResourceLoader = WinResources.class; + } + + + @Override + public String getName() { + return I18N.getString("bundler.name"); + } + + @Override + public String getDescription() { + return I18N.getString("bundler.description"); + } + + @Override + public String getID() { + return "msi"; + } + + @Override + public String getBundleType() { + return "INSTALLER"; + } + + @Override + public Collection> getBundleParameters() { + Collection> results = new LinkedHashSet<>(); + results.addAll(WinAppBundler.getAppBundleParameters()); + results.addAll(getMsiBundleParameters()); + return results; + } + + public static Collection> getMsiBundleParameters() { + return Arrays.asList( + DESCRIPTION, + MENU_GROUP, + MENU_HINT, + PRODUCT_VERSION, + SHORTCUT_HINT, + MSI_SYSTEM_WIDE, + VENDOR, + LICENSE_FILE, + INSTALLDIR_CHOOSER + ); + } + + @Override + public File execute( + Map params, File outputParentDir) { + return bundle(params, outputParentDir); + } + + @Override + public boolean supported() { + return (Platform.getPlatform() == Platform.WINDOWS); + } + + static class VersionExtractor extends PrintStream { + double version = 0f; + + public VersionExtractor() { + super(new ByteArrayOutputStream()); + } + + double getVersion() { + if (version == 0f) { + String content = + new String(((ByteArrayOutputStream) out).toByteArray()); + Pattern pattern = Pattern.compile("version (\\d+.\\d+)"); + Matcher matcher = pattern.matcher(content); + if (matcher.find()) { + String v = matcher.group(1); + version = Double.parseDouble(v); + } + } + return version; + } + } + + private static double findToolVersion(String toolName) { + try { + if (toolName == null || "".equals(toolName)) return 0f; + + ProcessBuilder pb = new ProcessBuilder( + toolName, + "/?"); + VersionExtractor ve = new VersionExtractor(); + // not interested in the output + IOUtils.exec(pb, Log.isDebug(), true, ve); + double version = ve.getVersion(); + Log.verbose(MessageFormat.format( + I18N.getString("message.tool-version"), + toolName, version)); + return version; + } catch (Exception e) { + if (Log.isDebug()) { + Log.verbose(e); + } + return 0f; + } + } + + @Override + public boolean validate(Map p) + throws UnsupportedPlatformException, ConfigException { + try { + if (p == 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).doValidate(p); + + double candleVersion = + findToolVersion(TOOL_CANDLE_EXECUTABLE.fetchFrom(p)); + double lightVersion = + findToolVersion(TOOL_LIGHT_EXECUTABLE.fetchFrom(p)); + + // WiX 3.0+ is required + double minVersion = 3.0f; + boolean bad = false; + + if (candleVersion < minVersion) { + Log.verbose(MessageFormat.format( + I18N.getString("message.wrong-tool-version"), + TOOL_CANDLE, candleVersion, minVersion)); + bad = true; + } + if (lightVersion < minVersion) { + Log.verbose(MessageFormat.format( + I18N.getString("message.wrong-tool-version"), + TOOL_LIGHT, lightVersion, minVersion)); + bad = true; + } + + if (bad){ + throw new ConfigException( + I18N.getString("error.no-wix-tools"), + I18N.getString("error.no-wix-tools.advice")); + } + + if (lightVersion >= 3.6f) { + Log.verbose(I18N.getString("message.use-wix36-features")); + p.put(CAN_USE_WIX36.getID(), Boolean.TRUE); + } + + /********* validate bundle parameters *************/ + + String version = PRODUCT_VERSION.fetchFrom(p); + if (!isVersionStringValid(version)) { + throw new ConfigException( + MessageFormat.format(I18N.getString( + "error.version-string-wrong-format"), version), + MessageFormat.format(I18N.getString( + "error.version-string-wrong-format.advice"), + PRODUCT_VERSION.getID())); + } + + // only one mime type per association, at least one file extension + List> associations = + FILE_ASSOCIATIONS.fetchFrom(p); + if (associations != null) { + for (int i = 0; i < associations.size(); i++) { + Map assoc = associations.get(i); + List mimes = FA_CONTENT_TYPE.fetchFrom(assoc); + if (mimes.size() > 1) { + throw new ConfigException(MessageFormat.format( + I18N.getString("error.too-many-content-" + + "types-for-file-association"), i), + I18N.getString("error.too-many-content-" + + "types-for-file-association.advice")); + } + } + } + + // validate license file, if used, exists in the proper place + if (p.containsKey(LICENSE_FILE.getID())) { + List appResourcesList = + APP_RESOURCES_LIST.fetchFrom(p); + for (String license : LICENSE_FILE.fetchFrom(p)) { + boolean found = false; + for (RelativeFileSet appResources : appResourcesList) { + found = found || appResources.contains(license); + } + if (!found) { + throw new ConfigException( + MessageFormat.format(I18N.getString( + "error.license-missing"), license), + MessageFormat.format(I18N.getString( + "error.license-missing.advice"), license)); + } + } + } + + return true; + } catch (RuntimeException re) { + if (re.getCause() instanceof ConfigException) { + throw (ConfigException) re.getCause(); + } else { + throw new ConfigException(re); + } + } + } + + // http://msdn.microsoft.com/en-us/library/aa370859%28v=VS.85%29.aspx + // The format of the string is as follows: + // major.minor.build + // The first field is the major version and has a maximum value of 255. + // The second field is the minor version and has a maximum value of 255. + // The third field is called the build version or the update version and + // has a maximum value of 65,535. + static boolean isVersionStringValid(String v) { + if (v == null) { + return true; + } + + String p[] = v.split("\\."); + if (p.length > 3) { + Log.verbose(I18N.getString( + "message.version-string-too-many-components")); + return false; + } + + try { + int val = Integer.parseInt(p[0]); + if (val < 0 || val > 255) { + Log.verbose(I18N.getString( + "error.version-string-major-out-of-range")); + return false; + } + if (p.length > 1) { + val = Integer.parseInt(p[1]); + if (val < 0 || val > 255) { + Log.verbose(I18N.getString( + "error.version-string-minor-out-of-range")); + return false; + } + } + if (p.length > 2) { + val = Integer.parseInt(p[2]); + if (val < 0 || val > 65535) { + Log.verbose(I18N.getString( + "error.version-string-build-out-of-range")); + return false; + } + } + } catch (NumberFormatException ne) { + Log.verbose(I18N.getString("error.version-string-part-not-number")); + Log.verbose(ne); + return false; + } + + return true; + } + + private boolean prepareProto(Map p) + throws IOException { + File appImage = StandardBundlerParam.getPredefinedAppImage(p); + 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)); + // 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); + } + + p.put(WIN_APP_IMAGE.getID(), appDir); + + List licenseFiles = LICENSE_FILE.fetchFrom(p); + if (licenseFiles != null) { + // need to copy license file to the root of win.app.image + outerLoop: + for (RelativeFileSet rfs : APP_RESOURCES_LIST.fetchFrom(p)) { + for (String s : licenseFiles) { + if (rfs.contains(s)) { + File lfile = new File(rfs.getBaseDirectory(), s); + File destFile = new File(appDir, lfile.getName()); + IOUtils.copyFile(lfile, destFile); + ensureByMutationFileIsRTF(destFile); + break outerLoop; + } + } + } + } + + // copy file association icons + List> fileAssociations = + FILE_ASSOCIATIONS.fetchFrom(p); + for (Map fa : fileAssociations) { + File icon = FA_ICON.fetchFrom(fa); // TODO FA_ICON_ICO + if (icon == null) { + continue; + } + + File faIconFile = new File(appDir, icon.getName()); + + if (icon.exists()) { + try { + IOUtils.copyFile(icon, faIconFile); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + + return appDir != null; + } + + public File bundle(Map p, File outdir) { + if (!outdir.isDirectory() && !outdir.mkdirs()) { + throw new RuntimeException(MessageFormat.format( + I18N.getString("error.cannot-create-output-dir"), + outdir.getAbsolutePath())); + } + if (!outdir.canWrite()) { + throw new RuntimeException(MessageFormat.format( + I18N.getString("error.cannot-write-to-output-dir"), + outdir.getAbsolutePath())); + } + + // validate we have valid tools before continuing + String light = TOOL_LIGHT_EXECUTABLE.fetchFrom(p); + String candle = TOOL_CANDLE_EXECUTABLE.fetchFrom(p); + if (light == null || !new File(light).isFile() || + candle == null || !new File(candle).isFile()) { + Log.error(I18N.getString("error.no-wix-tools")); + Log.verbose(MessageFormat.format( + I18N.getString("message.light-file-string"), light)); + Log.verbose(MessageFormat.format( + I18N.getString("message.candle-file-string"), candle)); + return null; + } + + File imageDir = MSI_IMAGE_DIR.fetchFrom(p); + try { + imageDir.mkdirs(); + + boolean menuShortcut = MENU_HINT.fetchFrom(p); + boolean desktopShortcut = SHORTCUT_HINT.fetchFrom(p); + 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); + } + + if (prepareProto(p) && prepareWiXConfig(p) + && prepareBasicProjectConfig(p)) { + File configScriptSrc = getConfig_Script(p); + if (configScriptSrc.exists()) { + // we need to be running post script in the image folder + + // NOTE: Would it be better to generate it to the image + // folder and save only if "verbose" is requested? + + // for now we replicate it + File configScript = + new File(imageDir, configScriptSrc.getName()); + IOUtils.copyFile(configScriptSrc, configScript); + Log.verbose(MessageFormat.format( + I18N.getString("message.running-wsh-script"), + configScript.getAbsolutePath())); + IOUtils.run("wscript", + configScript, false); + } + return buildMSI(p, outdir); + } + return null; + } catch (IOException ex) { + Log.verbose(ex); + return null; + } finally { + try { + if (imageDir != null && + PREDEFINED_APP_IMAGE.fetchFrom(p) == null && + (PREDEFINED_RUNTIME_IMAGE.fetchFrom(p) == null || + !Arguments.CREATE_JRE_INSTALLER.fetchFrom(p)) && + !Log.isDebug() && + !Log.isVerbose()) { + IOUtils.deleteRecursive(imageDir); + } else if (imageDir != null) { + Log.verbose(MessageFormat.format( + I18N.getString("message.debug-working-directory"), + imageDir.getAbsolutePath())); + } + + cleanupConfigFiles(p); + } catch (IOException ex) { + // noinspection ReturnInsideFinallyBlock + Log.debug(ex.getMessage()); + return null; + } + } + } + + protected void cleanupConfigFiles(Map params) { + if (Log.isDebug() || Log.isVerbose()) { + return; + } + + if (getConfig_ProjectFile(params) != null) { + getConfig_ProjectFile(params).delete(); + } + if (getConfig_Script(params) != null) { + getConfig_Script(params).delete(); + } + } + + // name of post-image script + private File getConfig_Script(Map params) { + return new File(CONFIG_ROOT.fetchFrom(params), + APP_FS_NAME.fetchFrom(params) + "-post-image.wsf"); + } + + private boolean prepareBasicProjectConfig( + Map params) throws IOException { + fetchResource(WinAppBundler.WIN_BUNDLER_PREFIX + + getConfig_Script(params).getName(), + I18N.getString("resource.post-install-script"), + (String) null, + getConfig_Script(params), + VERBOSE.fetchFrom(params), + DROP_IN_RESOURCES_ROOT.fetchFrom(params)); + return true; + } + + private String relativePath(File basedir, File file) { + return file.getAbsolutePath().substring( + basedir.getAbsolutePath().length() + 1); + } + + boolean prepareMainProjectFile( + Map params) throws IOException { + Map data = new HashMap<>(); + + UUID productGUID = UUID.randomUUID(); + + Log.verbose(MessageFormat.format( + I18N.getString("message.generated-product-guid"), + productGUID.toString())); + + // we use random GUID for product itself but + // user provided for upgrade guid + // Upgrade guid is important to decide whether it is an upgrade of + // installed app. I.e. we need it to be the same for + // 2 different versions of app if possible + data.put("PRODUCT_GUID", productGUID.toString()); + data.put("PRODUCT_UPGRADE_GUID", + UPGRADE_UUID.fetchFrom(params).toString()); + + data.put("APPLICATION_NAME", APP_NAME.fetchFrom(params)); + data.put("APPLICATION_DESCRIPTION", DESCRIPTION.fetchFrom(params)); + data.put("APPLICATION_VENDOR", VENDOR.fetchFrom(params)); + data.put("APPLICATION_VERSION", PRODUCT_VERSION.fetchFrom(params)); + + // WinAppBundler will add application folder again => step out + File imageRootDir = WIN_APP_IMAGE.fetchFrom(params); + File launcher = new File(imageRootDir, + WinAppBundler.getLauncherName(params)); + + String launcherPath = relativePath(imageRootDir, launcher); + data.put("APPLICATION_LAUNCHER", launcherPath); + + String iconPath = launcherPath.replace(".exe", ".ico"); + + data.put("APPLICATION_ICON", iconPath); + + data.put("REGISTRY_ROOT", getRegistryRoot(params)); + + boolean canUseWix36Features = CAN_USE_WIX36.fetchFrom(params); + data.put("WIX36_ONLY_START", + canUseWix36Features ? "" : ""); + + if (MSI_SYSTEM_WIDE.fetchFrom(params)) { + data.put("INSTALL_SCOPE", "perMachine"); + } else { + data.put("INSTALL_SCOPE", "perUser"); + } + + if (BIT_ARCH_64.fetchFrom(params)) { + data.put("PLATFORM", "x64"); + data.put("WIN64", "yes"); + } else { + data.put("PLATFORM", "x86"); + data.put("WIN64", "no"); + } + + data.put("UI_BLOCK", getUIBlock(params)); + + List> secondaryLaunchers = + SECONDARY_LAUNCHERS.fetchFrom(params); + + StringBuilder secondaryLauncherIcons = new StringBuilder(); + for (int i = 0; i < secondaryLaunchers.size(); i++) { + Map sl = secondaryLaunchers.get(i); + // + 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(" \r\n"); + } + } + data.put("SECONDARY_LAUNCHER_ICONS", secondaryLauncherIcons.toString()); + + String wxs = Arguments.CREATE_JRE_INSTALLER.fetchFrom(params) ? + MSI_PROJECT_TEMPLATE_SERVER_JRE : MSI_PROJECT_TEMPLATE; + + Writer w = new BufferedWriter( + new FileWriter(getConfig_ProjectFile(params))); + + String content = preprocessTextResource( + WinAppBundler.WIN_BUNDLER_PREFIX + + getConfig_ProjectFile(params).getName(), + I18N.getString("resource.wix-config-file"), + wxs, data, VERBOSE.fetchFrom(params), + DROP_IN_RESOURCES_ROOT.fetchFrom(params)); + w.write(content); + w.close(); + return true; + } + private int id; + private int compId; + private final static String LAUNCHER_ID = "LauncherId"; + private final static String LAUNCHER_SVC_ID = "LauncherSvcId"; + + /** + * Overrides the dialog sequence in built-in dialog set "WixUI_InstallDir" + * to exclude license dialog + */ + private static final String TWEAK_FOR_EXCLUDING_LICENSE = + " 1" + + " \n" + + " 1" + + " \n"; + + /** + * Creates UI element using WiX built-in dialog sets + * - WixUI_InstallDir/WixUI_Minimal. + * The dialog sets are the closest to what we want to implement. + * + * WixUI_Minimal for license dialog only + * WixUI_InstallDir for installdir dialog only or for both + * installdir/license dialogs + */ + private String getUIBlock(Map params) { + String uiBlock = " \n"; // UI-less element + + if (INSTALLDIR_CHOOSER.fetchFrom(params)) { + boolean enableTweakForExcludingLicense = + (getLicenseFile(params) == null); + uiBlock = " \n" + + " \n" + + " \n" + + (enableTweakForExcludingLicense ? + TWEAK_FOR_EXCLUDING_LICENSE : "") + +" \n"; + } else if (getLicenseFile(params) != null) { + uiBlock = " \n" + + " \n" + + " \n"; + } + + return uiBlock; + } + + private void walkFileTree(Map params, + File root, PrintStream out, String prefix) { + List dirs = new ArrayList<>(); + List files = new ArrayList<>(); + + if (!root.isDirectory()) { + throw new RuntimeException( + MessageFormat.format( + I18N.getString("error.cannot-walk-directory"), + root.getAbsolutePath())); + } + + // sort to files and dirs + File[] children = root.listFiles(); + if (children != null) { + for (File f : children) { + if (f.isDirectory()) { + dirs.add(f); + } else { + files.add(f); + } + } + } + + // have files => need to output component + out.println(prefix + " "); + out.println(prefix + " "); + out.println(prefix + " "); + + boolean needRegistryKey = !MSI_SYSTEM_WIDE.fetchFrom(params); + File imageRootDir = WIN_APP_IMAGE.fetchFrom(params); + File launcherFile = + new File(imageRootDir, WinAppBundler.getLauncherName(params)); + + // Find out if we need to use registry. We need it if + // - we doing user level install as file can not serve as KeyPath + // - if we adding shortcut in this component + + for (File f: files) { + boolean isLauncher = f.equals(launcherFile); + if (isLauncher) { + needRegistryKey = true; + } + } + + if (needRegistryKey) { + // has to be under HKCU to make WiX happy + out.println(prefix + " " : " Action=\"createAndRemoveOnUninstall\">")); + out.println(prefix + + " "); + out.println(prefix + " "); + } + + boolean menuShortcut = MENU_HINT.fetchFrom(params); + boolean desktopShortcut = SHORTCUT_HINT.fetchFrom(params); + + Map idToFileMap = new TreeMap<>(); + boolean launcherSet = false; + + for (File f : files) { + boolean isLauncher = f.equals(launcherFile); + + launcherSet = launcherSet || isLauncher; + + boolean doShortcuts = + isLauncher && (menuShortcut || desktopShortcut); + + String thisFileId = isLauncher ? LAUNCHER_ID : ("FileId" + (id++)); + idToFileMap.put(f.getName(), thisFileId); + + out.println(prefix + " "); + if (doShortcuts && desktopShortcut) { + out.println(prefix + + " "); + } + if (doShortcuts && menuShortcut) { + out.println(prefix + + " "); + } + + List> secondaryLaunchers = + SECONDARY_LAUNCHERS.fetchFrom(params); + for (int i = 0; i < secondaryLaunchers.size(); i++) { + Map sl = secondaryLaunchers.get(i); + File secondaryLauncherFile = new File(imageRootDir, + WinAppBundler.getLauncherName(sl)); + if (f.equals(secondaryLauncherFile)) { + if (SHORTCUT_HINT.fetchFrom(sl)) { + out.println(prefix + + " "); + } + if (MENU_HINT.fetchFrom(sl)) { + out.println(prefix + + " "); + // Should we allow different menu groups? Not for now. + } + } + } + out.println(prefix + " "); + } + + if (launcherSet) { + List> fileAssociations = + FILE_ASSOCIATIONS.fetchFrom(params); + String regName = APP_REGISTRY_NAME.fetchFrom(params); + Set defaultedMimes = new TreeSet<>(); + int count = 0; + for (Map fa : fileAssociations) { + String description = FA_DESCRIPTION.fetchFrom(fa); + List extensions = FA_EXTENSIONS.fetchFrom(fa); + List mimeTypes = FA_CONTENT_TYPE.fetchFrom(fa); + File icon = FA_ICON.fetchFrom(fa); // TODO FA_ICON_ICO + + String mime = (mimeTypes == null || + mimeTypes.isEmpty()) ? null : mimeTypes.get(0); + + if (extensions == null) { + Log.verbose(I18N.getString( + "message.creating-association-with-null-extension")); + + String entryName = regName + "File"; + if (count > 0) { + entryName += "." + count; + } + count++; + out.print(prefix + " "); + } else { + for (String ext : extensions) { + String entryName = regName + "File"; + if (count > 0) { + entryName += "." + count; + } + count++; + + out.print(prefix + " "); + + if (extensions == null) { + Log.verbose(I18N.getString( + "message.creating-association-with-null-extension")); + } else { + out.print(prefix + " "); + } else { + out.println(" ContentType='" + mime + "'>"); + if (!defaultedMimes.contains(mime)) { + out.println(prefix + + " "); + defaultedMimes.add(mime); + } + } + out.println(prefix + + " "); + out.println(prefix + " "); + } + out.println(prefix + " "); + } + } + } + } + + out.println(prefix + " "); + + for (File d : dirs) { + out.println(prefix + " "); + walkFileTree(params, d, out, prefix + " "); + out.println(prefix + " "); + } + } + + String getRegistryRoot(Map params) { + if (MSI_SYSTEM_WIDE.fetchFrom(params)) { + return "HKLM"; + } else { + return "HKCU"; + } + } + + boolean prepareContentList(Map params) + throws FileNotFoundException { + File f = new File( + CONFIG_ROOT.fetchFrom(params), MSI_PROJECT_CONTENT_FILE); + PrintStream out = new PrintStream(f); + + // opening + out.println(""); + out.println(""); + + out.println(" "); + if (MSI_SYSTEM_WIDE.fetchFrom(params)) { + // install to programfiles + if (BIT_ARCH_64.fetchFrom(params)) { + out.println(" "); + } else { + out.println(" "); + } + } else { + // install to user folder + out.println( + " "); + } + out.println(" "); + + // dynamic part + id = 0; + compId = 0; // reset counters + walkFileTree(params, WIN_APP_IMAGE.fetchFrom(params), out, " "); + + // closing + out.println(" "); + out.println(" "); + + // for shortcuts + if (SHORTCUT_HINT.fetchFrom(params)) { + out.println(" "); + } + if (MENU_HINT.fetchFrom(params)) { + out.println(" "); + out.println(" "); + out.println(" "); + out.println(" "); + // This has to be under HKCU to make WiX happy. + // There are numberous discussions on this amoung WiX users + // (if user A installs and user B uninstalls key is left behind) + // there are suggested workarounds but none of them are appealing. + // Leave it for now + out.println( + " "); + out.println(" "); + out.println(" "); + out.println(" "); + } + + out.println(" "); + + out.println(" "); + for (int j = 0; j < compId; j++) { + out.println(" "); + } + // component is defined in the template.wsx + out.println(" "); + out.println(" "); + out.println(""); + + out.close(); + return true; + } + + private File getConfig_ProjectFile(Map params) { + return new File(CONFIG_ROOT.fetchFrom(params), + APP_NAME.fetchFrom(params) + ".wxs"); + } + + private String getLicenseFile(Map params) { + List licenseFiles = LICENSE_FILE.fetchFrom(params); + if (licenseFiles == null || licenseFiles.isEmpty()) { + return null; + } else { + return licenseFiles.get(0); + } + } + + private boolean prepareWiXConfig( + Map params) throws IOException { + return prepareMainProjectFile(params) && prepareContentList(params); + + } + private final static String MSI_PROJECT_TEMPLATE = "template.wxs"; + private final static String MSI_PROJECT_TEMPLATE_SERVER_JRE = + "template.jre.wxs"; + private final static String MSI_PROJECT_CONTENT_FILE = "bundle.wxi"; + + private File buildMSI(Map 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"); + + Log.verbose(MessageFormat.format(I18N.getString( + "message.preparing-msi-config"), msiOut.getAbsolutePath())); + + msiOut.getParentFile().mkdirs(); + + // run candle + ProcessBuilder pb = new ProcessBuilder( + TOOL_CANDLE_EXECUTABLE.fetchFrom(params), + "-nologo", + getConfig_ProjectFile(params).getAbsolutePath(), + "-ext", "WixUtilExtension", + "-out", candleOut.getAbsolutePath()); + pb = pb.directory(WIN_APP_IMAGE.fetchFrom(params)); + IOUtils.exec(pb, false); + + Log.verbose(MessageFormat.format(I18N.getString( + "message.generating-msi"), msiOut.getAbsolutePath())); + + boolean enableLicenseUI = (getLicenseFile(params) != null); + boolean enableInstalldirUI = INSTALLDIR_CHOOSER.fetchFrom(params); + + List commandLine = new ArrayList<>(); + + commandLine.add(TOOL_LIGHT_EXECUTABLE.fetchFrom(params)); + if (enableLicenseUI) { + commandLine.add("-dWixUILicenseRtf="+getLicenseFile(params)); + } + commandLine.add("-nologo"); + commandLine.add("-spdb"); + commandLine.add("-sice:60"); + // ignore warnings due to "missing launcguage info" (ICE60) + commandLine.add(candleOut.getAbsolutePath()); + commandLine.add("-ext"); + commandLine.add("WixUtilExtension"); + if (enableLicenseUI || enableInstalldirUI) { + commandLine.add("-ext"); + commandLine.add("WixUIExtension.dll"); + } + commandLine.add("-out"); + commandLine.add(msiOut.getAbsolutePath()); + + // create .msi + pb = new ProcessBuilder(commandLine); + + pb = pb.directory(WIN_APP_IMAGE.fetchFrom(params)); + IOUtils.exec(pb, false); + + candleOut.delete(); + IOUtils.deleteRecursive(tmpDir); + + return msiOut; + } + + public static void ensureByMutationFileIsRTF(File f) { + if (f == null || !f.isFile()) return; + + try { + boolean existingLicenseIsRTF = false; + + try (FileInputStream fin = new FileInputStream(f)) { + byte[] firstBits = new byte[7]; + + if (fin.read(firstBits) == firstBits.length) { + String header = new String(firstBits); + existingLicenseIsRTF = "{\\rtf1\\".equals(header); + } + } + + if (!existingLicenseIsRTF) { + List oldLicense = Files.readAllLines(f.toPath()); + try (Writer w = Files.newBufferedWriter( + f.toPath(), Charset.forName("Windows-1252"))) { + w.write("{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033" + + "{\\fonttbl{\\f0\\fnil\\fcharset0 Arial;}}\n" + + "\\viewkind4\\uc1\\pard\\sa200\\sl276" + + "\\slmult1\\lang9\\fs20 "); + oldLicense.forEach(l -> { + try { + for (char c : l.toCharArray()) { + // 0x00 <= ch < 0x20 Escaped (\'hh) + // 0x20 <= ch < 0x80 Raw(non - escaped) char + // 0x80 <= ch <= 0xFF Escaped(\ 'hh) + // 0x5C, 0x7B, 0x7D (special RTF characters + // \,{,})Escaped(\'hh) + // ch > 0xff Escaped (\\ud###?) + if (c < 0x10) { + w.write("\\'0"); + w.write(Integer.toHexString(c)); + } else if (c > 0xff) { + w.write("\\ud"); + w.write(Integer.toString(c)); + // \\uc1 is in the header and in effect + // so we trail with a replacement char if + // the font lacks that character - '?' + w.write("?"); + } else if ((c < 0x20) || (c >= 0x80) || + (c == 0x5C) || (c == 0x7B) || + (c == 0x7D)) { + w.write("\\'"); + w.write(Integer.toHexString(c)); + } else { + w.write(c); + } + } + // blank lines are interpreted as paragraph breaks + if (l.length() < 1) { + w.write("\\par"); + } else { + w.write(" "); + } + w.write("\r\n"); + } catch (IOException e) { + Log.verbose(e); + } + }); + w.write("}\r\n"); + } + } + } catch (IOException e) { + Log.verbose(e); + } + + } +} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/WindowsAppImageBuilder.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/WindowsAppImageBuilder.java Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,488 @@ +/* + * Copyright (c) 2015, 2018, 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.jpackager.internal; + +import jdk.jpackager.internal.BundlerParamInfo; +import jdk.jpackager.internal.Log; +import jdk.jpackager.internal.RelativeFileSet; +import jdk.jpackager.internal.IOUtils; +import jdk.jpackager.internal.StandardBundlerParam; +import jdk.jpackager.internal.resources.WinResources; +import jdk.jpackager.internal.WindowsBundlerParam; +import jdk.jpackager.internal.AbstractAppImageBuilder; +import jdk.jpackager.internal.WindowsDefender; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.UncheckedIOException; +import java.io.Writer; +import java.io.BufferedWriter; +import java.io.FileWriter; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.attribute.PosixFilePermission; +import java.text.MessageFormat; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.ResourceBundle; +import java.util.Set; +import java.util.concurrent.atomic.AtomicReference; +import java.util.regex.Pattern; +import java.util.stream.Stream; +import jdk.jpackager.internal.Arguments; + +import static jdk.jpackager.internal.StandardBundlerParam.*; + +public class WindowsAppImageBuilder extends AbstractAppImageBuilder { + + private static final ResourceBundle I18N = + ResourceBundle.getBundle( + "jdk.jpackager.internal.resources.WindowsAppImageBuilder"); + + private static final String MODULES_FILENAME = + "jdk/jpackager/internal/resources/windows.jre.list"; + + private final static String EXECUTABLE_NAME = "WinLauncher.exe"; + private final static String LIBRARY_NAME = "jpackager.dll"; + private final static String REDIST_MSVCR = "vcruntimeVS_VER.dll"; + private final static String REDIST_MSVCP = "msvcpVS_VER.dll"; + + private final static String TEMPLATE_APP_ICON ="javalogo_white_48.ico"; + + private static final String EXECUTABLE_PROPERTIES_TEMPLATE = + "WinLauncher.properties"; + + private final Path root; + private final Path appDir; + private final Path runtimeDir; + private final Path mdir; + + private final Map params; + + public static final BundlerParamInfo CONFIG_ROOT = + new WindowsBundlerParam<>( + I18N.getString("param.config-root.name"), + I18N.getString("param.config-root.description"), + "configRoot", + File.class, + params -> { + File imagesRoot = + new File(BUILD_ROOT.fetchFrom(params), "windows"); + imagesRoot.mkdirs(); + return imagesRoot; + }, + (s, p) -> null); + + public static final BundlerParamInfo REBRAND_EXECUTABLE = + new WindowsBundlerParam<>( + I18N.getString("param.rebrand-executable.name"), + I18N.getString("param.rebrand-executable.description"), + "win.launcher.rebrand", + Boolean.class, + params -> Boolean.TRUE, + (s, p) -> Boolean.valueOf(s)); + + public static final BundlerParamInfo ICON_ICO = + new StandardBundlerParam<>( + I18N.getString("param.icon-ico.name"), + I18N.getString("param.icon-ico.description"), + "icon.ico", + File.class, + params -> { + File f = ICON.fetchFrom(params); + if (f != null && !f.getName().toLowerCase().endsWith(".ico")) { + Log.error(MessageFormat.format( + I18N.getString("message.icon-not-ico"), f)); + return null; + } + return f; + }, + (s, p) -> new File(s)); + + public static final StandardBundlerParam CONSOLE_HINT = + new WindowsBundlerParam<>( + I18N.getString("param.console-hint.name"), + I18N.getString("param.console-hint.description"), + Arguments.CLIOptions.WIN_CONSOLE_HINT.getId(), + Boolean.class, + params -> false, + // valueOf(null) is false, + // and we actually do want null in some cases + (s, p) -> (s == null + || "null".equalsIgnoreCase(s)) ? true : Boolean.valueOf(s)); + + public WindowsAppImageBuilder(Map config, Path imageOutDir) + throws IOException { + super(config, + imageOutDir.resolve(APP_NAME.fetchFrom(config) + "/runtime")); + + Objects.requireNonNull(imageOutDir); + + this.params = config; + + this.root = imageOutDir.resolve(APP_NAME.fetchFrom(params)); + this.appDir = root.resolve("app"); + this.runtimeDir = root.resolve("runtime"); + this.mdir = runtimeDir.resolve("lib"); + Files.createDirectories(appDir); + Files.createDirectories(runtimeDir); + } + + public WindowsAppImageBuilder(String jreName, Path imageOutDir) + throws IOException { + super(null, imageOutDir.resolve(jreName)); + + Objects.requireNonNull(imageOutDir); + + this.params = null; + this.root = imageOutDir.resolve(jreName); + this.appDir = null; + this.runtimeDir = root; + this.mdir = runtimeDir.resolve("lib"); + Files.createDirectories(runtimeDir); + } + + private Path destFile(String dir, String filename) { + return runtimeDir.resolve(dir).resolve(filename); + } + + private void writeEntry(InputStream in, Path dstFile) throws IOException { + Files.createDirectories(dstFile.getParent()); + Files.copy(in, dstFile); + } + + private void writeSymEntry(Path dstFile, Path target) throws IOException { + Files.createDirectories(dstFile.getParent()); + Files.createLink(dstFile, target); + } + + /** + * chmod ugo+x file + */ + private void setExecutable(Path file) { + try { + Set perms = + Files.getPosixFilePermissions(file); + perms.add(PosixFilePermission.OWNER_EXECUTE); + perms.add(PosixFilePermission.GROUP_EXECUTE); + perms.add(PosixFilePermission.OTHERS_EXECUTE); + Files.setPosixFilePermissions(file, perms); + } catch (IOException ioe) { + throw new UncheckedIOException(ioe); + } + } + + private static void createUtf8File(File file, String content) + throws IOException { + try (OutputStream fout = new FileOutputStream(file); + Writer output = new OutputStreamWriter(fout, "UTF-8")) { + output.write(content); + } + } + + public static String getLauncherName(Map p) { + return APP_FS_NAME.fetchFrom(p) + ".exe"; + } + + // Returns launcher resource name for launcher we need to use. + public static String getLauncherResourceName(Map p) { + if (CONSOLE_HINT.fetchFrom(p)) { + return "papplauncherc.exe"; + } + + return "papplauncher.exe"; + } + + public static String getLauncherCfgName(Map p) { + return "app/" + APP_FS_NAME.fetchFrom(p) +".cfg"; + } + + private File getConfig_AppIcon(Map params) { + return new File(getConfigRoot(params), + APP_FS_NAME.fetchFrom(params) + ".ico"); + } + + private File getConfig_ExecutableProperties( + Map params) { + return new File(getConfigRoot(params), + APP_FS_NAME.fetchFrom(params) + ".properties"); + } + + File getConfigRoot(Map params) { + return CONFIG_ROOT.fetchFrom(params); + } + + protected void cleanupConfigFiles(Map params) { + if (Log.isDebug() || Log.isVerbose()) { + return; + } + + getConfig_AppIcon(params).delete(); + getConfig_ExecutableProperties(params).delete(); + } + + @Override + public InputStream getResourceAsStream(String name) { + return WinResources.class.getResourceAsStream(name); + } + + @Override + public void prepareApplicationFiles() throws IOException { + Map originalParams = new HashMap<>(params); + File rootFile = root.toFile(); + if (!rootFile.isDirectory() && !rootFile.mkdirs()) { + throw new RuntimeException(MessageFormat.format(I18N.getString( + "error.cannot-create-output-dir"), rootFile.getAbsolutePath())); + } + if (!rootFile.canWrite()) { + throw new RuntimeException(MessageFormat.format( + I18N.getString("error.cannot-write-to-output-dir"), + rootFile.getAbsolutePath())); + } + try { + // create the .exe launchers + createLauncherForEntryPoint(params); + + // copy the jars + copyApplication(params); + + // copy in the needed libraries + try (InputStream is_lib = getResourceAsStream("jpackager.dll")) { + Files.copy(is_lib, root.resolve(LIBRARY_NAME)); + } + + copyMSVCDLLs(); + + // create the secondary launchers, if any + List> entryPoints = + StandardBundlerParam.SECONDARY_LAUNCHERS.fetchFrom(params); + for (Map entryPoint : entryPoints) { + Map tmp = new HashMap<>(originalParams); + tmp.putAll(entryPoint); + createLauncherForEntryPoint(tmp); + } + } finally { + cleanupConfigFiles(params); + } + } + + @Override + public void prepareServerJreFiles() throws IOException {} + + private void copyMSVCDLLs() throws IOException { + AtomicReference ioe = new AtomicReference<>(); + try (Stream files = Files.list(runtimeDir.resolve("bin"))) { + files.filter(p -> Pattern.matches( + "^(vcruntime|msvcp|msvcr|ucrtbase|api-ms-win-).*\\.dll$", + p.toFile().getName().toLowerCase())) + .forEach(p -> { + try { + Files.copy(p, root.resolve((p.toFile().getName()))); + } catch (IOException e) { + ioe.set(e); + } + }); + } + + IOException e = ioe.get(); + if (e != null) { + throw e; + } + } + + // TODO: do we still need this? + private boolean copyMSVCDLLs(String VS_VER) throws IOException { + final InputStream REDIST_MSVCR_URL = + WinResources.class.getResourceAsStream( + REDIST_MSVCR.replaceAll("VS_VER", VS_VER)); + final InputStream REDIST_MSVCP_URL = + WinResources.class.getResourceAsStream( + REDIST_MSVCP.replaceAll("VS_VER", VS_VER)); + + if (REDIST_MSVCR_URL != null && REDIST_MSVCP_URL != null) { + Files.copy( + REDIST_MSVCR_URL, + root.resolve(REDIST_MSVCR.replaceAll("VS_VER", VS_VER))); + Files.copy( + REDIST_MSVCP_URL, + root.resolve(REDIST_MSVCP.replaceAll("VS_VER", VS_VER))); + return true; + } + + return false; + } + + private void validateValueAndPut( + Map data, String key, + BundlerParamInfo param, + Map params) { + String value = param.fetchFrom(params); + if (value.contains("\r") || value.contains("\n")) { + Log.error("Configuration Parameter " + param.getID() + + " contains multiple lines of text, ignore it"); + data.put(key, ""); + return; + } + data.put(key, value); + } + + protected void prepareExecutableProperties( + Map params) throws IOException { + Map data = new HashMap<>(); + + // mapping Java parameters in strings for version resource + data.put("COMMENTS", ""); + validateValueAndPut(data, "COMPANY_NAME", VENDOR, params); + validateValueAndPut(data, "FILE_DESCRIPTION", DESCRIPTION, params); + validateValueAndPut(data, "FILE_VERSION", VERSION, params); + data.put("INTERNAL_NAME", getLauncherName(params)); + validateValueAndPut(data, "LEGAL_COPYRIGHT", COPYRIGHT, params); + data.put("LEGAL_TRADEMARK", ""); + data.put("ORIGINAL_FILENAME", getLauncherName(params)); + data.put("PRIVATE_BUILD", ""); + validateValueAndPut(data, "PRODUCT_NAME", APP_NAME, params); + validateValueAndPut(data, "PRODUCT_VERSION", VERSION, params); + data.put("SPECIAL_BUILD", ""); + + Writer w = new BufferedWriter( + new FileWriter(getConfig_ExecutableProperties(params))); + String content = preprocessTextResource(BUNDLER_PREFIX + + getConfig_ExecutableProperties(params).getName(), + I18N.getString("resource.executable-properties-template"), + EXECUTABLE_PROPERTIES_TEMPLATE, data, + VERBOSE.fetchFrom(params), + DROP_IN_RESOURCES_ROOT.fetchFrom(params)); + w.write(content); + w.close(); + } + + private void createLauncherForEntryPoint( + Map 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( + "package/windows/" + APP_NAME.fetchFrom(params) + ".ico", + "icon", + TEMPLATE_APP_ICON, + icon, + VERBOSE.fetchFrom(params), + DROP_IN_RESOURCES_ROOT.fetchFrom(params)); + Files.copy(in, iconTarget.toPath()); + + 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)) { + File tool = new File( + System.getProperty("java.home") + "\\bin\\jpackager.exe"); + + // Run tool on launcher file to change the icon and the metadata. + try { + if (WindowsDefender.isThereAPotentialWindowsDefenderIssue()) { + Log.error(MessageFormat.format(I18N.getString( + "message.potential.windows.defender.issue"), + WindowsDefender.getUserTempDirectory())); + } + + launcher.setWritable(true); + + if (iconTarget.exists()) { + ProcessBuilder pb = new ProcessBuilder( + tool.getAbsolutePath(), + "--icon-swap", + iconTarget.getAbsolutePath(), + launcher.getAbsolutePath()); + IOUtils.exec(pb, false); + } + + File executableProperties = getConfig_ExecutableProperties(p); + + if (executableProperties.exists()) { + ProcessBuilder pb = new ProcessBuilder( + tool.getAbsolutePath(), + "--version-swap", + executableProperties.getAbsolutePath(), + launcher.getAbsolutePath()); + IOUtils.exec(pb, false); + } + } + finally { + executableFile.toFile().setReadOnly(); + } + } + + Files.copy(iconTarget.toPath(), + root.resolve(APP_NAME.fetchFrom(p) + ".ico")); + } + + private void copyApplication(Map params) + throws IOException { + List appResourcesList = + APP_RESOURCES_LIST.fetchFrom(params); + if (appResourcesList == null) { + throw new RuntimeException("Null app resources?"); + } + for (RelativeFileSet appResources : appResourcesList) { + if (appResources == null) { + throw new RuntimeException("Null app resources?"); + } + File srcdir = appResources.getBaseDirectory(); + for (String fname : appResources.getIncludedFiles()) { + copyEntry(appDir, srcdir, fname); + } + } + } + + @Override + public String getPlatformSpecificModulesFile() { + return MODULES_FILENAME; + } + +} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/WindowsBundlerParam.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/WindowsBundlerParam.java Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2014, 2018, 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.jpackager.internal; + +import jdk.jpackager.internal.BundlerParamInfo; +import jdk.jpackager.internal.StandardBundlerParam; +import jdk.jpackager.internal.Arguments; +import jdk.jpackager.internal.RelativeFileSet; +import jdk.jpackager.internal.BundleParams; + +import java.util.Map; +import java.util.ResourceBundle; +import java.util.function.BiFunction; +import java.util.function.Function; + +public class WindowsBundlerParam extends StandardBundlerParam { + + private static final ResourceBundle I18N = ResourceBundle.getBundle( + "jdk.jpackager.internal.resources.WindowsBundlerParam"); + + public WindowsBundlerParam(String name, String description, String id, + Class valueType, + Function, T> defaultValueFunction, + BiFunction, T> stringConverter) { + super(name, description, id, valueType, + defaultValueFunction, stringConverter); + } + + public static final BundlerParamInfo INSTALLER_FILE_NAME = + new StandardBundlerParam<> ( + I18N.getString("param.installer-name.name"), + I18N.getString("param.installer-name.description"), + "win.installerName", + String.class, + params -> { + String nm = APP_NAME.fetchFrom(params); + if (nm == null) return null; + + String version = VERSION.fetchFrom(params); + if (version == null) { + return nm; + } else { + return nm + "-" + version; + } + }, + (s, p) -> s); + + public static final BundlerParamInfo APP_REGISTRY_NAME = + new StandardBundlerParam<> ( + I18N.getString("param.registry-name.name"), + I18N.getString("param.registry-name.description"), + Arguments.CLIOptions.WIN_REGISTRY_NAME.getId(), + String.class, + params -> { + String nm = APP_NAME.fetchFrom(params); + if (nm == null) return null; + + return nm.replaceAll("[^-a-zA-Z\\.0-9]", ""); + }, + (s, p) -> s); + + public static final StandardBundlerParam MENU_GROUP = + new StandardBundlerParam<>( + I18N.getString("param.menu-group.name"), + I18N.getString("param.menu-group.description"), + Arguments.CLIOptions.WIN_MENU_GROUP.getId(), + String.class, + params -> params.containsKey(VENDOR.getID()) + ? VENDOR.fetchFrom(params) + : params.containsKey(CATEGORY.getID()) + ? CATEGORY.fetchFrom(params) + : I18N.getString("param.menu-group.default"), + (s, p) -> s + ); + + public static final StandardBundlerParam BIT_ARCH_64 = + new StandardBundlerParam<>( + I18N.getString("param.64-bit.name"), + I18N.getString("param.64-bit.description"), + "win.64Bit", + Boolean.class, + params -> System.getProperty("os.arch").contains("64"), + (s, p) -> Boolean.valueOf(s) + ); + + public static final StandardBundlerParam BIT_ARCH_64_RUNTIME = + new StandardBundlerParam<>( + I18N.getString("param.runtime-64-bit.name"), + I18N.getString("param.runtime-64-bit.description"), + "win.64BitJreRuntime", + Boolean.class, + params -> { + WinAppBundler.extractFlagsFromRuntime(params); + return "64".equals(params.get(".runtime.bit-arch")); + }, + (s, p) -> Boolean.valueOf(s) + ); + + public static final BundlerParamInfo INSTALLDIR_CHOOSER = + new StandardBundlerParam<> ( + I18N.getString("param.installdir-chooser.name"), + I18N.getString("param.installdir-chooser.description"), + Arguments.CLIOptions.WIN_DIR_CHOOSER.getId(), + Boolean.class, + params -> Boolean.FALSE, + (s, p) -> Boolean.valueOf(s) + ); +} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/WindowsDefender.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/WindowsDefender.java Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2012, 2018, 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.jpackager.internal; + +import jdk.jpackager.internal.Platform; +import java.util.List; + +public final class WindowsDefender { + + private WindowsDefender() {} + + public static final boolean isThereAPotentialWindowsDefenderIssue() { + boolean result = false; + + if (Platform.getPlatform() == Platform.WINDOWS && + Platform.getMajorVersion() == 10) { + + // If DisableRealtimeMonitoring is not enabled then there + // may be a problem. + if (!WindowsRegistry.readDisableRealtimeMonitoring() && + !isTempDirectoryInExclusionPath()) { + result = true; + } + } + + return result; + } + + private static boolean isTempDirectoryInExclusionPath() { + boolean result = false; + // If the user temp directory is not found in the exclusion + // list then there may be a problem. + List paths = WindowsRegistry.readExclusionsPaths(); + String tempDirectory = getUserTempDirectory(); + + for (String s : paths) { + if (s.equals(tempDirectory)) { + result = true; + break; + } + } + + return result; + } + + public static final String getUserTempDirectory() { + String tempDirectory = System.getProperty("java.io.tmpdir"); + return tempDirectory; + } +} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/WindowsRegistry.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/WindowsRegistry.java Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,150 @@ +/* + * Copyright (c) 2012, 2018, 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.jpackager.internal; + +import java.io.BufferedReader; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.PrintStream; +import java.util.ArrayList; +import java.util.List; + +import static jdk.jpackager.internal.IOUtils.exec; + +public final class WindowsRegistry { + + private WindowsRegistry() {} + + /** + * Reads the registry value for DisableRealtimeMonitoring. + * @return true if DisableRealtimeMonitoring is set to 0x1, + * false otherwise. + */ + public static final boolean readDisableRealtimeMonitoring() { + boolean result = false; + final String key = "HKEY_LOCAL_MACHINE\\Software\\Microsoft\\" + + "Windows Defender\\Real-Time Protection"; + final String subkey = "DisableRealtimeMonitoring"; + String value = readRegistry(key, subkey); + + if (!value.isEmpty()) { + // This code could be written better but this works. It validates + // that the result of readRegistry returned what we expect and then + // checks for a 0x0 or 0x1. 0x0 means real time monitoring is + // on, 0x1 means it is off. So this function returns true if + // real-time-monitoring is disabled. + int index = value.indexOf(subkey); + value = value.substring(index + subkey.length()); + String reg = "REG_DWORD"; + index = value.indexOf(reg); + value = value.substring(index + reg.length()); + String hex = "0x"; + index = value.indexOf(hex); + value = value.substring(index + hex.length()); + + if (value.equals("1")) { + result = true; + } + } + + return result; + } + + public static final List readExclusionsPaths() { + List result = new ArrayList(); + final String key = "HKEY_LOCAL_MACHINE\\Software\\Microsoft\\" + + "Windows Defender\\Exclusions\\Paths"; + String value = readRegistry(key, ""); + + if (!value.isEmpty()) { + final String reg = "REG_DWORD"; + final String hex = "0x0"; + + int index = value.indexOf(key); + if (index == 0) { + value = value.substring(index + key.length()); + + while (value.length() > 0) { + index = value.indexOf(reg); + String name = value.substring(0, index); + value = value.substring(index + reg.length()); + index = value.indexOf(hex); + value = value.substring(index + hex.length()); + + if (index > 0) { + name = name.trim(); + result.add(name); + } + } + } + } + + return result; + } + + /** + * @param key in the registry + * @param subkey in the registry key + * @return registry value or null if not found + */ + public static final String readRegistry(String key, String subkey){ + String result = ""; + + try { + List buildOptions = new ArrayList<>(); + buildOptions.add("reg"); + buildOptions.add("query"); + buildOptions.add("\"" + key + "\""); + + if (!subkey.isEmpty()) { + buildOptions.add("/v"); + buildOptions.add(subkey); + } + + try (ByteArrayOutputStream baos = new ByteArrayOutputStream(); + PrintStream ps = new PrintStream(baos)) { + ProcessBuilder security = new ProcessBuilder(buildOptions); + exec(security, false, false, ps); + BufferedReader bfReader = new BufferedReader( + new InputStreamReader( + new ByteArrayInputStream(baos.toByteArray()))); + String line = null; + + while((line = bfReader.readLine()) != null){ + result += line; + } + } + catch (IOException e) { + } + } + catch (Exception e) { + } + + return result; + } +} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/builders/windows/WindowsAppImageBuilder.java --- a/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/builders/windows/WindowsAppImageBuilder.java Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,491 +0,0 @@ -/* - * Copyright (c) 2015, 2018, 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.jpackager.internal.builders.windows; - -import jdk.jpackager.internal.BundlerParamInfo; -import jdk.jpackager.internal.Log; -import jdk.jpackager.internal.RelativeFileSet; -import jdk.jpackager.internal.IOUtils; -import jdk.jpackager.internal.StandardBundlerParam; -import jdk.jpackager.internal.resources.windows.WinResources; -import jdk.jpackager.internal.windows.WindowsBundlerParam; -import jdk.jpackager.internal.builders.AbstractAppImageBuilder; -import jdk.jpackager.internal.windows.WindowsDefender; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.io.UncheckedIOException; -import java.io.Writer; -import java.io.BufferedWriter; -import java.io.FileWriter; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.attribute.PosixFilePermission; -import java.text.MessageFormat; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.ResourceBundle; -import java.util.Set; -import java.util.concurrent.atomic.AtomicReference; -import java.util.regex.Pattern; -import java.util.stream.Stream; -import jdk.jpackager.internal.Arguments; - -import static jdk.jpackager.internal.StandardBundlerParam.*; - -public class WindowsAppImageBuilder extends AbstractAppImageBuilder { - - private static final ResourceBundle I18N = - ResourceBundle.getBundle( - "jdk.jpackager.internal.resources.builders.windows.WindowsAppImageBuilder"); - - private static final String MODULES_FILENAME = - "jdk/jpackager/internal/resources/windows/windows.jre.list"; - - protected static final String WINDOWS_BUNDLER_PREFIX = - BUNDLER_PREFIX + "windows" + File.separator; - - private final static String EXECUTABLE_NAME = "WinLauncher.exe"; - private final static String LIBRARY_NAME = "jpackager.dll"; - private final static String REDIST_MSVCR = "vcruntimeVS_VER.dll"; - private final static String REDIST_MSVCP = "msvcpVS_VER.dll"; - - private final static String TEMPLATE_APP_ICON ="javalogo_white_48.ico"; - - private static final String EXECUTABLE_PROPERTIES_TEMPLATE = - "WinLauncher.properties"; - - private final Path root; - private final Path appDir; - private final Path runtimeDir; - private final Path mdir; - - private final Map params; - - public static final BundlerParamInfo CONFIG_ROOT = - new WindowsBundlerParam<>( - I18N.getString("param.config-root.name"), - I18N.getString("param.config-root.description"), - "configRoot", - File.class, - params -> { - File imagesRoot = - new File(BUILD_ROOT.fetchFrom(params), "windows"); - imagesRoot.mkdirs(); - return imagesRoot; - }, - (s, p) -> null); - - public static final BundlerParamInfo REBRAND_EXECUTABLE = - new WindowsBundlerParam<>( - I18N.getString("param.rebrand-executable.name"), - I18N.getString("param.rebrand-executable.description"), - "win.launcher.rebrand", - Boolean.class, - params -> Boolean.TRUE, - (s, p) -> Boolean.valueOf(s)); - - public static final BundlerParamInfo ICON_ICO = - new StandardBundlerParam<>( - I18N.getString("param.icon-ico.name"), - I18N.getString("param.icon-ico.description"), - "icon.ico", - File.class, - params -> { - File f = ICON.fetchFrom(params); - if (f != null && !f.getName().toLowerCase().endsWith(".ico")) { - Log.error(MessageFormat.format( - I18N.getString("message.icon-not-ico"), f)); - return null; - } - return f; - }, - (s, p) -> new File(s)); - - public static final StandardBundlerParam CONSOLE_HINT = - new WindowsBundlerParam<>( - I18N.getString("param.console-hint.name"), - I18N.getString("param.console-hint.description"), - Arguments.CLIOptions.WIN_CONSOLE_HINT.getId(), - Boolean.class, - params -> false, - // valueOf(null) is false, - // and we actually do want null in some cases - (s, p) -> (s == null - || "null".equalsIgnoreCase(s)) ? true : Boolean.valueOf(s)); - - public WindowsAppImageBuilder(Map config, Path imageOutDir) - throws IOException { - super(config, - imageOutDir.resolve(APP_NAME.fetchFrom(config) + "/runtime")); - - Objects.requireNonNull(imageOutDir); - - this.params = config; - - this.root = imageOutDir.resolve(APP_NAME.fetchFrom(params)); - this.appDir = root.resolve("app"); - this.runtimeDir = root.resolve("runtime"); - this.mdir = runtimeDir.resolve("lib"); - Files.createDirectories(appDir); - Files.createDirectories(runtimeDir); - } - - public WindowsAppImageBuilder(String jreName, Path imageOutDir) - throws IOException { - super(null, imageOutDir.resolve(jreName)); - - Objects.requireNonNull(imageOutDir); - - this.params = null; - this.root = imageOutDir.resolve(jreName); - this.appDir = null; - this.runtimeDir = root; - this.mdir = runtimeDir.resolve("lib"); - Files.createDirectories(runtimeDir); - } - - private Path destFile(String dir, String filename) { - return runtimeDir.resolve(dir).resolve(filename); - } - - private void writeEntry(InputStream in, Path dstFile) throws IOException { - Files.createDirectories(dstFile.getParent()); - Files.copy(in, dstFile); - } - - private void writeSymEntry(Path dstFile, Path target) throws IOException { - Files.createDirectories(dstFile.getParent()); - Files.createLink(dstFile, target); - } - - /** - * chmod ugo+x file - */ - private void setExecutable(Path file) { - try { - Set perms = - Files.getPosixFilePermissions(file); - perms.add(PosixFilePermission.OWNER_EXECUTE); - perms.add(PosixFilePermission.GROUP_EXECUTE); - perms.add(PosixFilePermission.OTHERS_EXECUTE); - Files.setPosixFilePermissions(file, perms); - } catch (IOException ioe) { - throw new UncheckedIOException(ioe); - } - } - - private static void createUtf8File(File file, String content) - throws IOException { - try (OutputStream fout = new FileOutputStream(file); - Writer output = new OutputStreamWriter(fout, "UTF-8")) { - output.write(content); - } - } - - public static String getLauncherName(Map p) { - return APP_FS_NAME.fetchFrom(p) + ".exe"; - } - - // Returns launcher resource name for launcher we need to use. - public static String getLauncherResourceName(Map p) { - if (CONSOLE_HINT.fetchFrom(p)) { - return "papplauncherc.exe"; - } - - return "papplauncher.exe"; - } - - public static String getLauncherCfgName(Map p) { - return "app/" + APP_FS_NAME.fetchFrom(p) +".cfg"; - } - - private File getConfig_AppIcon(Map params) { - return new File(getConfigRoot(params), - APP_FS_NAME.fetchFrom(params) + ".ico"); - } - - private File getConfig_ExecutableProperties( - Map params) { - return new File(getConfigRoot(params), - APP_FS_NAME.fetchFrom(params) + ".properties"); - } - - File getConfigRoot(Map params) { - return CONFIG_ROOT.fetchFrom(params); - } - - protected void cleanupConfigFiles(Map params) { - if (Log.isDebug() || Log.isVerbose()) { - return; - } - - getConfig_AppIcon(params).delete(); - getConfig_ExecutableProperties(params).delete(); - } - - @Override - public InputStream getResourceAsStream(String name) { - return WinResources.class.getResourceAsStream(name); - } - - @Override - public void prepareApplicationFiles() throws IOException { - Map originalParams = new HashMap<>(params); - File rootFile = root.toFile(); - if (!rootFile.isDirectory() && !rootFile.mkdirs()) { - throw new RuntimeException(MessageFormat.format(I18N.getString( - "error.cannot-create-output-dir"), rootFile.getAbsolutePath())); - } - if (!rootFile.canWrite()) { - throw new RuntimeException(MessageFormat.format( - I18N.getString("error.cannot-write-to-output-dir"), - rootFile.getAbsolutePath())); - } - try { - // create the .exe launchers - createLauncherForEntryPoint(params); - - // copy the jars - copyApplication(params); - - // copy in the needed libraries - try (InputStream is_lib = getResourceAsStream("jpackager.dll")) { - Files.copy(is_lib, root.resolve(LIBRARY_NAME)); - } - - copyMSVCDLLs(); - - // create the secondary launchers, if any - List> entryPoints = - StandardBundlerParam.SECONDARY_LAUNCHERS.fetchFrom(params); - for (Map entryPoint : entryPoints) { - Map tmp = new HashMap<>(originalParams); - tmp.putAll(entryPoint); - createLauncherForEntryPoint(tmp); - } - } finally { - cleanupConfigFiles(params); - } - } - - @Override - public void prepareServerJreFiles() throws IOException {} - - private void copyMSVCDLLs() throws IOException { - AtomicReference ioe = new AtomicReference<>(); - try (Stream files = Files.list(runtimeDir.resolve("bin"))) { - files.filter(p -> Pattern.matches( - "^(vcruntime|msvcp|msvcr|ucrtbase|api-ms-win-).*\\.dll$", - p.toFile().getName().toLowerCase())) - .forEach(p -> { - try { - Files.copy(p, root.resolve((p.toFile().getName()))); - } catch (IOException e) { - ioe.set(e); - } - }); - } - - IOException e = ioe.get(); - if (e != null) { - throw e; - } - } - - // TODO: do we still need this? - private boolean copyMSVCDLLs(String VS_VER) throws IOException { - final InputStream REDIST_MSVCR_URL = - WinResources.class.getResourceAsStream( - REDIST_MSVCR.replaceAll("VS_VER", VS_VER)); - final InputStream REDIST_MSVCP_URL = - WinResources.class.getResourceAsStream( - REDIST_MSVCP.replaceAll("VS_VER", VS_VER)); - - if (REDIST_MSVCR_URL != null && REDIST_MSVCP_URL != null) { - Files.copy( - REDIST_MSVCR_URL, - root.resolve(REDIST_MSVCR.replaceAll("VS_VER", VS_VER))); - Files.copy( - REDIST_MSVCP_URL, - root.resolve(REDIST_MSVCP.replaceAll("VS_VER", VS_VER))); - return true; - } - - return false; - } - - private void validateValueAndPut( - Map data, String key, - BundlerParamInfo param, - Map params) { - String value = param.fetchFrom(params); - if (value.contains("\r") || value.contains("\n")) { - Log.error("Configuration Parameter " + param.getID() - + " contains multiple lines of text, ignore it"); - data.put(key, ""); - return; - } - data.put(key, value); - } - - protected void prepareExecutableProperties( - Map params) throws IOException { - Map data = new HashMap<>(); - - // mapping Java parameters in strings for version resource - data.put("COMMENTS", ""); - validateValueAndPut(data, "COMPANY_NAME", VENDOR, params); - validateValueAndPut(data, "FILE_DESCRIPTION", DESCRIPTION, params); - validateValueAndPut(data, "FILE_VERSION", VERSION, params); - data.put("INTERNAL_NAME", getLauncherName(params)); - validateValueAndPut(data, "LEGAL_COPYRIGHT", COPYRIGHT, params); - data.put("LEGAL_TRADEMARK", ""); - data.put("ORIGINAL_FILENAME", getLauncherName(params)); - data.put("PRIVATE_BUILD", ""); - validateValueAndPut(data, "PRODUCT_NAME", APP_NAME, params); - validateValueAndPut(data, "PRODUCT_VERSION", VERSION, params); - data.put("SPECIAL_BUILD", ""); - - Writer w = new BufferedWriter( - new FileWriter(getConfig_ExecutableProperties(params))); - String content = preprocessTextResource(WINDOWS_BUNDLER_PREFIX - + getConfig_ExecutableProperties(params).getName(), - I18N.getString("resource.executable-properties-template"), - EXECUTABLE_PROPERTIES_TEMPLATE, data, - VERBOSE.fetchFrom(params), - DROP_IN_RESOURCES_ROOT.fetchFrom(params)); - w.write(content); - w.close(); - } - - private void createLauncherForEntryPoint( - Map 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( - "package/windows/" + APP_NAME.fetchFrom(params) + ".ico", - "icon", - TEMPLATE_APP_ICON, - icon, - VERBOSE.fetchFrom(params), - DROP_IN_RESOURCES_ROOT.fetchFrom(params)); - Files.copy(in, iconTarget.toPath()); - - 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)) { - File tool = new File( - System.getProperty("java.home") + "\\bin\\jpackager.exe"); - - // Run tool on launcher file to change the icon and the metadata. - try { - if (WindowsDefender.isThereAPotentialWindowsDefenderIssue()) { - Log.error(MessageFormat.format(I18N.getString( - "message.potential.windows.defender.issue"), - WindowsDefender.getUserTempDirectory())); - } - - launcher.setWritable(true); - - if (iconTarget.exists()) { - ProcessBuilder pb = new ProcessBuilder( - tool.getAbsolutePath(), - "--icon-swap", - iconTarget.getAbsolutePath(), - launcher.getAbsolutePath()); - IOUtils.exec(pb, false); - } - - File executableProperties = getConfig_ExecutableProperties(p); - - if (executableProperties.exists()) { - ProcessBuilder pb = new ProcessBuilder( - tool.getAbsolutePath(), - "--version-swap", - executableProperties.getAbsolutePath(), - launcher.getAbsolutePath()); - IOUtils.exec(pb, false); - } - } - finally { - executableFile.toFile().setReadOnly(); - } - } - - Files.copy(iconTarget.toPath(), - root.resolve(APP_NAME.fetchFrom(p) + ".ico")); - } - - private void copyApplication(Map params) - throws IOException { - List appResourcesList = - APP_RESOURCES_LIST.fetchFrom(params); - if (appResourcesList == null) { - throw new RuntimeException("Null app resources?"); - } - for (RelativeFileSet appResources : appResourcesList) { - if (appResources == null) { - throw new RuntimeException("Null app resources?"); - } - File srcdir = appResources.getBaseDirectory(); - for (String fname : appResources.getIncludedFiles()) { - copyEntry(appDir, srcdir, fname); - } - } - } - - @Override - public String getPlatformSpecificModulesFile() { - return MODULES_FILENAME; - } - -} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/WinAppBundler.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/WinAppBundler.properties Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,55 @@ +# +# Copyright (c) 2017, 2018, 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. +# +# + +bundler.name=Windows Application Image +bundler.description=A Directory based image of a windows Application with an optionally co-bundled JRE. Used as a base for the Installer bundlers + +param.config-root.name=Config Root Dir +param.config-root.description=Config Root Dir + +param.raw-executable-url.name=Launcher URL +param.raw-executable-url.description=Override the jpackager default launcher with a custom launcher. + +param.rebrand-executable.name=Rebrand Launcher +param.rebrand-executable.description=Update the launcher with the application icon and update ownership information. + +param.icon-ico.name=.ico Icon +param.icon-ico.description=Icon for the application, in ICO format. + +resource.application-icon=application icon + +error.parameters-null=Parameters map is null. +error.parameters-null.advice=Pass in a non-null parameters map. +error.no-windows-resources=This copy of the JDK does not support Windows. +error.no-windows-resources.advice=Please use the Oracle JDK for Windows. +error.bit-architecture-mismatch=Bit architecture mismatch between FX SDK and JRE runtime. +error.bit-architecture-mismatch.advice=Make sure to use JRE runtime with correct bit architecture. +error.cannot-find-launcher=Cannot find cfg file in predefined app image directory {0}. + +message.result-dir=Result application bundle\: {0} +message.disable-bit-architecture-check=Disabled check for bit architecture mismatch. +message.icon-not-ico=The specified icon "{0}" is not an ICO file and will not be used. The default icon will be used in it's place. +message.multiple-launchers=Multiple launchers found in predefined app-image. {0} will be used as primary launcher. diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/WinAppBundler_ja.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/WinAppBundler_ja.properties Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,55 @@ +# +# Copyright (c) 2017, 2018, 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. +# +# + +bundler.name=Windows\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30A4\u30E1\u30FC\u30B8 +bundler.description=\u30AA\u30D7\u30B7\u30E7\u30F3\u3067JRE\u304C\u30D0\u30F3\u30C9\u30EB\u3055\u308C\u3066\u3044\u308BWindows\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u30FB\u30D9\u30FC\u30B9\u306E\u30A4\u30E1\u30FC\u30B8\u3002\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9\u30FB\u30D0\u30F3\u30C9\u30E9\u306E\u30D9\u30FC\u30B9\u3068\u3057\u3066\u4F7F\u7528\u3055\u308C\u307E\u3059 + +param.config-root.name=Config Root Dir +param.config-root.description=Config Root Dir + +param.raw-executable-url.name=\u30E9\u30F3\u30C1\u30E3URL +param.raw-executable-url.description=\u30D1\u30C3\u30B1\u30FC\u30B8\u30E3\u306E\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30E9\u30F3\u30C1\u30E3\u3092\u30AB\u30B9\u30BF\u30E0\u30FB\u30E9\u30F3\u30C1\u30E3\u3067\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3057\u307E\u3059\u3002 + +param.rebrand-executable.name=\u30E9\u30F3\u30C1\u30E3\u306E\u30EA\u30D6\u30E9\u30F3\u30C9 +param.rebrand-executable.description=\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30A2\u30A4\u30B3\u30F3\u3092\u542B\u3080\u30E9\u30F3\u30C1\u30E3\u304A\u3088\u3073\u6240\u6709\u8005\u60C5\u5831\u3092\u66F4\u65B0\u3057\u307E\u3059\u3002 + +param.icon-ico.name=.ico\u30A2\u30A4\u30B3\u30F3 +param.icon-ico.description=ICO\u5F62\u5F0F\u3067\u306E\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u30A2\u30A4\u30B3\u30F3\u3002 + +resource.application-icon=\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30A2\u30A4\u30B3\u30F3 + +error.parameters-null=\u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30DE\u30C3\u30D7\u304Cnull\u3067\u3059\u3002 +error.parameters-null.advice=\u975Enull\u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30DE\u30C3\u30D7\u3067\u6E21\u3057\u3066\u304F\u3060\u3055\u3044\u3002 +error.no-windows-resources=\u3053\u306EJDK\u306E\u30B3\u30D4\u30FC\u3067\u306F\u3001Windows\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002 +error.no-windows-resources.advice=Oracle JDK for Windows\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044\u3002 +error.bit-architecture-mismatch=FX SDK\u3068JRE\u30E9\u30F3\u30BF\u30A4\u30E0\u9593\u306E\u30D3\u30C3\u30C8\u30FB\u30A2\u30FC\u30AD\u30C6\u30AF\u30C1\u30E3\u304C\u4E00\u81F4\u3057\u307E\u305B\u3093\u3002 +error.bit-architecture-mismatch.advice=\u6B63\u3057\u3044\u30D3\u30C3\u30C8\u30FB\u30A2\u30FC\u30AD\u30C6\u30AF\u30C1\u30E3\u3092\u6301\u3064JRE\u30E9\u30F3\u30BF\u30A4\u30E0\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044\u3002 +error.cannot-find-launcher=Cannot find cfg file in predefined app image directory {0}. + +message.result-dir=\u7D50\u679C\u306E\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30D0\u30F3\u30C9\u30EB: {0} +message.disable-bit-architecture-check=\u30D3\u30C3\u30C8\u30FB\u30A2\u30FC\u30AD\u30C6\u30AF\u30C1\u30E3\u306E\u4E0D\u4E00\u81F4\u30C1\u30A7\u30C3\u30AF\u304C\u7121\u52B9\u306B\u306A\u3063\u3066\u3044\u307E\u3059\u3002 +message.icon-not-ico=\u6307\u5B9A\u3057\u305F\u30A2\u30A4\u30B3\u30F3"{0}"\u306FICO\u30D5\u30A1\u30A4\u30EB\u3067\u306F\u306A\u304F\u3001\u4F7F\u7528\u3055\u308C\u307E\u305B\u3093\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30A2\u30A4\u30B3\u30F3\u304C\u305D\u306E\u4F4D\u7F6E\u306B\u4F7F\u7528\u3055\u308C\u307E\u3059\u3002 +message.multiple-launchers=Multiple launchers found in predefined app-image. {0} will be used as primary launcher. diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/WinAppBundler_zh_CN.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/WinAppBundler_zh_CN.properties Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,55 @@ +# +# Copyright (c) 2017, 2018, 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. +# +# + +bundler.name=Windows \u5E94\u7528\u7A0B\u5E8F\u6620\u50CF +bundler.description=\u4E00\u4E2A\u57FA\u4E8E\u76EE\u5F55\u7684 Windows \u5E94\u7528\u7A0B\u5E8F\u6620\u50CF, \u53EF\u4EE5\u9009\u62E9\u6027\u5730\u5E26\u6709\u5171\u540C\u6253\u5305\u7684 JRE\u3002\u7528\u4F5C\u5B89\u88C5\u7A0B\u5E8F\u6253\u5305\u7A0B\u5E8F\u7684\u57FA\u7840 + +param.config-root.name=Config Root Dir +param.config-root.description=Config Root Dir + +param.raw-executable-url.name=\u542F\u52A8\u7A0B\u5E8F URL +param.raw-executable-url.description=\u4F7F\u7528\u5B9A\u5236\u542F\u52A8\u7A0B\u5E8F\u8986\u76D6\u6253\u5305\u7A0B\u5E8F\u9ED8\u8BA4\u542F\u52A8\u7A0B\u5E8F\u3002 + +param.rebrand-executable.name=\u66F4\u6539\u542F\u52A8\u7A0B\u5E8F\u54C1\u724C +param.rebrand-executable.description=\u4F7F\u7528\u5E94\u7528\u7A0B\u5E8F\u56FE\u6807\u66F4\u65B0\u542F\u52A8\u7A0B\u5E8F\u5E76\u66F4\u65B0\u6240\u6709\u6743\u4FE1\u606F\u3002 + +param.icon-ico.name=.ico \u56FE\u6807 +param.icon-ico.description=\u5E94\u7528\u7A0B\u5E8F\u7684\u56FE\u6807, \u91C7\u7528 ICO \u683C\u5F0F\u3002 + +resource.application-icon=\u5E94\u7528\u7A0B\u5E8F\u56FE\u6807 + +error.parameters-null=\u53C2\u6570\u6620\u5C04\u4E3A\u7A7A\u503C\u3002 +error.parameters-null.advice=\u8BF7\u4F20\u5165\u975E\u7A7A\u53C2\u6570\u6620\u5C04\u3002 +error.no-windows-resources=\u6B64 JDK \u7684\u526F\u672C\u4E0D\u652F\u6301 Windows\u3002 +error.no-windows-resources.advice=\u8BF7\u4F7F\u7528 Oracle JDK for Windows\u3002 +error.bit-architecture-mismatch=FX SDK \u4E0E JRE \u8FD0\u884C\u65F6\u4E4B\u95F4\u7684\u4F4D\u4F53\u7CFB\u7ED3\u6784\u4E0D\u5339\u914D\u3002 +error.bit-architecture-mismatch.advice=\u8BF7\u786E\u4FDD\u4F7F\u7528\u5E26\u6709\u6B63\u786E\u4F4D\u4F53\u7CFB\u7ED3\u6784\u7684 JRE \u8FD0\u884C\u65F6\u3002 +error.cannot-find-launcher=Cannot find cfg file in predefined app image directory {0}. + +message.result-dir=\u751F\u6210\u7684\u5E94\u7528\u7A0B\u5E8F\u5305: {0} +message.disable-bit-architecture-check=\u5DF2\u7981\u7528\u4F4D\u4F53\u7CFB\u7ED3\u6784\u4E0D\u5339\u914D\u68C0\u67E5\u3002 +message.icon-not-ico=\u6307\u5B9A\u7684\u56FE\u6807 "{0}" \u4E0D\u662F ICO \u6587\u4EF6, \u4E0D\u4F1A\u4F7F\u7528\u3002\u5C06\u4F7F\u7528\u9ED8\u8BA4\u56FE\u6807\u4EE3\u66FF\u3002 +message.multiple-launchers=Multiple launchers found in predefined app-image. {0} will be used as primary launcher. diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/WinExeBundler.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/WinExeBundler.properties Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,103 @@ +# +# Copyright (c) 2017, 2018, 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. +# +# + +bundler.name=EXE Installer +bundler.description=Microsoft Windows EXE Installer, via InnoIDE. + +param.system-wide.name=System Wide +param.system-wide.description=Should this application attempt to install itself system wide, or only for each user? Null means use the system default. + +param.app-bundler.name=Exe Installer Bundler +param.app-bundler.description=Exe Installer Bundler + +param.config-root.name=Config Root +param.config-root.description=Config Root + +param.image-dir.name=Image Dir +param.image-dir.description=Image Dir + +param.app-dir.name=App Dir +param.app-dir.description=App Dir + +param.menu-shortcut-hint.name=Menu Hint +param.menu-shortcut-hint.description=If the bundler can add the application to the system menu, should it? + +param.desktop-shortcut-hint.name=Shortcut Hint +param.desktop-shortcut-hint.description=If the bundler can create desktop shortcuts, should it make one? + +param.upgrade-uuid.name=Upgrade UUID +param.upgrade-uuid.description=The UUID associated with upgrades for this package. + +param.product-version.name=Product Version +param.product-version.description=The version of the application as seen by Windows and MSI, of the form "1.2.3" + +param.iscc-path.name=InnoSetup iscc.exe location +param.iscc-path.description=File path to iscc.exe from the InnoSetup tool. + +resource.inno-setup-project-file=Inno Setup project file +resource.setup-icon=setup dialog icon +resource.post-install-script=script to run after application image is populated + +error.parameters-null=Parameters map is null. +error.parameters-null.advice=Pass in a non-null parameters map. + +error.iscc-not-found=Can not find Inno Setup Compiler (iscc.exe). +error.iscc-not-found.advice=Download Inno Setup 5 or later from http\://www.jrsoftware.org and add it to the PATH. + +error.license-missing=Specified license file is missing. +error.license-missing.advice=Make sure that "{0}" references a file in the app resources, and that it is relative file reference. + +error.copyright-is-too-long=The copyright string is too long for InnoSetup. +error.copyright-is-too-long.advice=Provide a copyright string shorter than 100 characters. + +error.too-many-content-types-for-file-association=More than one MIME types was specified for File Association number {0}. +error.too-many-content-types-for-file-association.advice=Specify one and only one MIME type for each file association. + +error.cannot-create-output-dir=Output directory {0} cannot be created. +error.cannot-write-to-output-dir=Output directory {0} is not writable. + +message.tool-wrong-version=Detected [{0}] version {1} but version {2} is required. +message.debug-working-directory=Kept working directory for debug\: {0} +message.outputting-to-location=Generating EXE for installer to\: {0} +message.output-location=Installer (.exe) saved to\: {0} +message.tool-version=\ Detected [{0}] version [{1}] +message.one-shortcut-required=At least one type of shortcut is required. Enabling menu shortcut. +message.running-wsh-script=Running WSH script on application image [{0}] +message.iscc-file-string=\ InnoSetup compiler set to {0} +message.creating-association-with-null-extension=Creating association with null extension. +message.potential.windows.defender.issue=Warning: Windows Defender may prevent the Java Packager from functioning. If there is an issue, it can be addressed by either disabling realtime monitoring, or adding an exclusion for the directory "{0}". + + + +message.tool-version=Detected [{0}] version [{1}] +message.running-wsh-script=Running WSH script on application image [{0}] +message.wrong-tool-version=Detected [{0}] version {1} but version {2} is required. +message.use-wix36-features=WiX 3.6 detected. Enabling advanced cleanup action. +message.version-string-too-many-components=Version sting may have up to 3 components - major.minor.build . +message.debug-working-directory=Kept working directory for debug\: {0} +message.one-shortcut-required=At least one type of shortcut is required. Enabling menu shortcut. +message.creating-association-with-null-extension=Creating association with null extension. +message.truncating.id=Truncating Application ID to 126 chars for Inno Setup. diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/WinExeBundler_ja.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/WinExeBundler_ja.properties Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,90 @@ +# +# Copyright (c) 2017, 2018, 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. +# +# + +bundler.name=EXE Installer +bundler.description=Microsoft Windows EXE Installer, via InnoIDE. + +param.system-wide.name=System Wide +param.system-wide.description=Should this application attempt to install itself system wide, or only for each user? Null means use the system default. + +param.app-bundler.name=Exe Installer Bundler +param.app-bundler.description=Exe Installer Bundler + +param.config-root.name=Config Root +param.config-root.description=Config Root + +param.image-dir.name=Image Dir +param.image-dir.description=Image Dir + +param.app-dir.name=App Dir +param.app-dir.description=App Dir + +param.menu-shortcut-hint.name=Menu Hint +param.menu-shortcut-hint.description=If the bundler can add the application to the system menu, should it? + +param.desktop-shortcut-hint.name=Shortcut Hint +param.desktop-shortcut-hint.description=If the bundler can create desktop shortcuts, should it make one? + +param.upgrade-uuid.name=Upgrade UUID +param.upgrade-uuid.description=The UUID associated with upgrades for this package. + +param.product-version.name=Product Version +param.product-version.description=The version of the application as seen by Windows and MSI, of the form "1.2.3" + +param.iscc-path.name=InnoSetup iscc.exe location +param.iscc-path.description=File path to iscc.exe from the InnoSetup tool. + +resource.inno-setup-project-file=Inno Setup project file +resource.setup-icon=setup dialog icon +resource.post-install-script=script to run after application image is populated + +error.parameters-null=Parameters map is null. +error.parameters-null.advice=Pass in a non-null parameters map. + +error.iscc-not-found=Can not find Inno Setup Compiler (iscc.exe). +error.iscc-not-found.advice=Download Inno Setup 5 or later from http\://www.jrsoftware.org and add it to the PATH. + +error.license-missing=Specified license file is missing. +error.license-missing.advice=Make sure that "{0}" references a file in the app resources, and that it is relative file reference. + +error.copyright-is-too-long=The copyright string is too long for InnoSetup. +error.copyright-is-too-long.advice=Provide a copyright string shorter than 100 characters. + +error.too-many-content-types-for-file-association=More than one MIME types was specified for File Association number {0}. +error.too-many-content-types-for-file-association.advice=Specify one and only one MIME type for each file association. + +error.cannot-create-output-dir=Output directory {0} cannot be created. +error.cannot-write-to-output-dir=Output directory {0} is not writable. + +message.tool-version=Detected [{0}] version [{1}] +message.running-wsh-script=Running WSH script on application image [{0}] +message.wrong-tool-version=Detected [{0}] version {1} but version {2} is required. +message.use-wix36-features=WiX 3.6 detected. Enabling advanced cleanup action. +message.version-string-too-many-components=Version sting may have up to 3 components - major.minor.build . +message.debug-working-directory=Kept working directory for debug\: {0} +message.one-shortcut-required=At least one type of shortcut is required. Enabling menu shortcut. +message.creating-association-with-null-extension=Creating association with null extension. +message.truncating.id=Truncating Application ID to 126 chars for Inno Setup. diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/WinExeBundler_zh_CN.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/WinExeBundler_zh_CN.properties Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,91 @@ +# +# Copyright (c) 2017, 2018, 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. +# +# + +bundler.name=EXE Installer +bundler.description=Microsoft Windows EXE Installer, via InnoIDE. + +param.system-wide.name=System Wide +param.system-wide.description=Should this application attempt to install itself system wide, or only for each user? Null means use the system default. + +param.app-bundler.name=Exe Installer Bundler +param.app-bundler.description=Exe Installer Bundler + +param.config-root.name=Config Root +param.config-root.description=Config Root + +param.image-dir.name=Image Dir +param.image-dir.description=Image Dir + +param.app-dir.name=App Dir +param.app-dir.description=App Dir + +param.menu-shortcut-hint.name=Menu Hint +param.menu-shortcut-hint.description=If the bundler can add the application to the system menu, should it? + +param.desktop-shortcut-hint.name=Shortcut Hint +param.desktop-shortcut-hint.description=If the bundler can create desktop shortcuts, should it make one? + +param.upgrade-uuid.name=Upgrade UUID +param.upgrade-uuid.description=The UUID associated with upgrades for this package. + +param.product-version.name=Product Version +param.product-version.description=The version of the application as seen by Windows and MSI, of the form "1.2.3" + +param.iscc-path.name=InnoSetup iscc.exe location +param.iscc-path.description=File path to iscc.exe from the InnoSetup tool. + +resource.inno-setup-project-file=Inno Setup project file +resource.setup-icon=setup dialog icon +resource.post-install-script=script to run after application image is populated + +error.parameters-null=Parameters map is null. +error.parameters-null.advice=Pass in a non-null parameters map. + +error.iscc-not-found=Can not find Inno Setup Compiler (iscc.exe). +error.iscc-not-found.advice=Download Inno Setup 5 or later from http\://www.jrsoftware.org and add it to the PATH. + +error.license-missing=Specified license file is missing. +error.license-missing.advice=Make sure that "{0}" references a file in the app resources, and that it is relative file reference. + +error.copyright-is-too-long=The copyright string is too long for InnoSetup. +error.copyright-is-too-long.advice=Provide a copyright string shorter than 100 characters. + +error.too-many-content-types-for-file-association=More than one MIME types was specified for File Association number {0}. +error.too-many-content-types-for-file-association.advice=Specify one and only one MIME type for each file association. + +error.cannot-create-output-dir=Output directory {0} cannot be created. +error.cannot-write-to-output-dir=Output directory {0} is not writable. + +message.tool-wrong-version=Detected [{0}] version {1} but version {2} is required. +message.debug-working-directory=Kept working directory for debug\: {0} +message.outputting-to-location=Generating EXE for installer to\: {0} +message.output-location=Installer (.exe) saved to\: {0} +message.tool-version=\ Detected [{0}] version [{1}] +message.one-shortcut-required=At least one type of shortcut is required. Enabling menu shortcut. +message.running-wsh-script=Running WSH script on application image [{0}] +message.iscc-file-string=\ InnoSetup compiler set to {0} +message.creating-association-with-null-extension=Creating association with null extension. +message.potential.windows.defender.issue=Warning: Windows Defender may prevent the Java Packager from functioning. If there is an issue, it can be addressed by either disabling realtime monitoring, or adding an exclusion for the directory "{0}". diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/WinLauncher.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/WinLauncher.properties Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,38 @@ +# +# Copyright (c) 2017, 2018, 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. +# +# + +Comments=COMMENTS +CompanyName=COMPANY_NAME +FileDescription=FILE_DESCRIPTION +FileVersion=FILE_VERSION +InternalName=INTERNAL_NAME +LegalCopyright=LEGAL_COPYRIGHT +LegalTrademarks=LEGAL_TRADEMARK +OriginalFilename=ORIGINAL_FILENAME +PrivateBuild=PRIVATE_BUILD +ProductName=PRODUCT_NAME +ProductVersion=PRODUCT_VERSION +SpecialBuild=SPECIAL_BUILD diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/WinMsiBundler.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/WinMsiBundler.properties Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,100 @@ +# +# Copyright (c) 2017, 2018, 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. +# +# + +bundler.name=MSI Installer +bundler.description=Microsoft Windows MSI Installer, via WiX. + +param.system-wide.name=System Wide +param.system-wide.description=Should this application attempt to install itself system wide, or only for each user? Null means use the system default. + +param.app-bundler.name=MSI App Bundler +param.app-bundler.description=MSI App Bundler + +param.can-use-wix36.name=Can Use Wix +param.can-use-wix36.description=Can Use Wix + +param.config-root.name=Config Root Dir +param.config-root.description=Config Root Dir + +param.image-dir.name=Image Dir +param.image-dir.description=Image Dir + +param.app-dir.name=App Dir +param.app-dir.description=App Dir + +param.menu-shortcut-hint.name=Menu Hint +param.menu-shortcut-hint.description=If the bundler can add the application to the system menu, should it? + +param.desktop-shortcut-hint.name=Shortcut Hint +param.desktop-shortcut-hint.description=If the bundler can create desktop shortcuts, should it make one? + +param.upgrade-uuid.name=Upgrade UUID +param.upgrade-uuid.description=The UUID associated with upgrades for this package. + +param.product-version.name=Product Version +param.product-version.description=The version of the application as seen by Windows and MSI, of the form "1.2.3" + +param.candle-path.name=WiX candle.exe location +param.candle-path.description=File path to candle.exe from the WiX toolset. + +param.light-path.name=WiX light.exe location +param.light-path.description=File path to light.exe from the WiX toolset. + +resource.post-install-script=script to run after application image is populated +resource.wix-config-file=WiX config file + +error.parameters-null=Parameters map is null. +error.parameters-null.advice=Pass in a non-null parameters map. +error.no-wix-tools=Can not find WiX tools (light.exe, candle.exe). +error.no-wix-tools.advice=Download WiX 3.0 or later from http\://wix.sf.net and add it to the PATH. +error.version-string-wrong-format=Version string is not compatible with MSI rules [{0}]. +error.version-string-wrong-format.advice=Set the bundler argument "{0}" according to these rules: http\://msdn.microsoft.com/en-us/library/aa370859%28v\=VS.85%29.aspx +error.version-string-major-out-of-range=Major version must be in the range [0, 255] +error.version-string-build-out-of-range=Build part of version must be in the range [0, 65535] +error.version-string-minor-out-of-range=Minor version must be in the range [0, 255] +error.version-string-part-not-number=Failed to convert version component to int. +error.cannot-walk-directory=Can not walk [{0}] - it is not a valid directory +error.cannot-create-output-dir=Output directory {0} cannot be created. +error.cannot-write-to-output-dir=Output directory {0} is not writable. +error.too-many-content-types-for-file-association=More than one MIME types was specified for File Association number {0}. +error.too-many-content-types-for-file-association.advice=Specify one and only one MIME type for each file association. +error.license-missing=can not find license file {0}. +error.license-missing.advice=include license file {0} in the --files argument. + + +message.tool-version=Detected [{0}] version [{1}] +message.running-wsh-script=Running WSH script on application image [{0}] +message.wrong-tool-version=Detected [{0}] version {1} but version {2} is required. +message.use-wix36-features=WiX 3.6 detected. Enabling advanced cleanup action. +message.version-string-too-many-components=Version sting may have up to 3 components - major.minor.build . +message.debug-working-directory=Kept working directory for debug\: {0} +message.generated-product-guid=Generated product GUID\: {0} +message.preparing-msi-config=Preparing MSI config\: {0} +message.generating-msi=Generating MSI\: {0} +message.one-shortcut-required=At least one type of shortcut is required. Enabling menu shortcut. +message.light-file-string=WiX light tool set to {0} +message.candle-file-string=WiX candle tool set to {0} +message.creating-association-with-null-extension=Creating association with null extension. diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/WinMsiBundler_ja.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/WinMsiBundler_ja.properties Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,91 @@ +# +# Copyright (c) 2017, 2018, 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. +# +# + +bundler.name=MSI\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9 +bundler.description=WiX\u3092\u4F7F\u7528\u3057\u305FMicrosoft Windows MSI\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9\u3002 + +param.system-wide.name=\u30B7\u30B9\u30C6\u30E0\u5168\u4F53 +param.system-wide.description=\u3053\u306E\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306F\u3001\u305D\u308C\u81EA\u4F53\u3092\u30B7\u30B9\u30C6\u30E0\u5168\u4F53\u306B\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3057\u307E\u3059\u304B\u3001\u307E\u305F\u306F\u5404\u30E6\u30FC\u30B6\u30FC\u306B\u5BFE\u3057\u3066\u306E\u307F\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3057\u307E\u3059\u304B\u3002Null\u306F\u30B7\u30B9\u30C6\u30E0\u30FB\u30C7\u30D5\u30A9\u30EB\u30C8\u3092\u4F7F\u7528\u3059\u308B\u3053\u3068\u3092\u610F\u5473\u3057\u307E\u3059\u3002 + +param.app-bundler.name=MSI App Bundler +param.app-bundler.description=MSI App Bundler + +param.can-use-wix36.name=Can Use Wix +param.can-use-wix36.description=Can Use Wix + +param.config-root.name=Config Root Dir +param.config-root.description=Config Root Dir + +param.image-dir.name=Image Dir +param.image-dir.description=Image Dir + +param.app-dir.name=App Dir +param.app-dir.description=App Dir + +param.upgrade-uuid.name=\u30A2\u30C3\u30D7\u30B0\u30EC\u30FC\u30C9UUID +param.upgrade-uuid.description=\u3053\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u30A2\u30C3\u30D7\u30B0\u30EC\u30FC\u30C9\u306B\u95A2\u9023\u4ED8\u3051\u3089\u308C\u3066\u3044\u308BUUID\u3002 + +param.product-version.name=\u88FD\u54C1\u30D0\u30FC\u30B8\u30E7\u30F3 +param.product-version.description=Windows\u304A\u3088\u3073MSI\u306B\u8868\u793A\u3055\u308C\u308B\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u30D0\u30FC\u30B8\u30E7\u30F3(\u5F62\u5F0F\u306F"1.2.3") + +param.candle-path.name=WiX candle.exe\u306E\u5834\u6240 +param.candle-path.description=WiX\u30C4\u30FC\u30EB\u30BB\u30C3\u30C8\u304B\u3089\u306Ecandle.exe\u3078\u306E\u30D5\u30A1\u30A4\u30EB\u30FB\u30D1\u30B9\u3002 + +param.light-path.name=WiX light.exe\u306E\u5834\u6240 +param.light-path.description=WiX\u30C4\u30FC\u30EB\u30BB\u30C3\u30C8\u304B\u3089\u306Elight.exe\u3078\u306E\u30D5\u30A1\u30A4\u30EB\u30FB\u30D1\u30B9\u3002 + +resource.post-install-script=\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30A4\u30E1\u30FC\u30B8\u3092\u79FB\u5165\u3057\u305F\u5F8C\u306B\u5B9F\u884C\u3059\u308B\u30B9\u30AF\u30EA\u30D7\u30C8 +resource.wix-config-file=WiX\u69CB\u6210\u30D5\u30A1\u30A4\u30EB + +error.parameters-null=\u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30DE\u30C3\u30D7\u304Cnull\u3067\u3059\u3002 +error.parameters-null.advice=\u975Enull\u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30DE\u30C3\u30D7\u3067\u6E21\u3057\u3066\u304F\u3060\u3055\u3044\u3002 +error.no-wix-tools=WiX\u30C4\u30FC\u30EB(light.exe\u3001candle.exe)\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002 +error.no-wix-tools.advice=WiX 3.0\u4EE5\u964D\u3092http://wix.sf.net\u304B\u3089\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u3057\u3001PATH\u306B\u8FFD\u52A0\u3057\u307E\u3059\u3002 +error.version-string-wrong-format=\u30D0\u30FC\u30B8\u30E7\u30F3\u6587\u5B57\u5217\u306FMSI\u898F\u5247[{0}]\u3068\u4E92\u63DB\u6027\u304C\u3042\u308A\u307E\u305B\u3093\u3002 +error.version-string-wrong-format.advice=\u30D0\u30F3\u30C9\u30E9\u5F15\u6570"{0}"\u3092\u6B21\u306E\u898F\u5247\u306B\u5F93\u3063\u3066\u8A2D\u5B9A\u3057\u307E\u3059: http://msdn.microsoft.com/en-us/library/aa370859%28v=VS.85%29.aspx +error.version-string-major-out-of-range=\u30E1\u30B8\u30E3\u30FC\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3\u306F\u7BC4\u56F2[0, 255]\u5185\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059 +error.version-string-build-out-of-range=\u30D0\u30FC\u30B8\u30E7\u30F3\u306E\u30D3\u30EB\u30C9\u90E8\u5206\u306F\u7BC4\u56F2[0, 65535]\u5185\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059 +error.version-string-minor-out-of-range=\u30DE\u30A4\u30CA\u30FC\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3\u306F\u7BC4\u56F2[0, 255]\u5185\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059 +error.version-string-part-not-number=\u30D0\u30FC\u30B8\u30E7\u30F3\u30FB\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306Eint\u3078\u306E\u5909\u63DB\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002 +error.cannot-walk-directory=[{0}]\u3067\u79FB\u52D5\u3067\u304D\u307E\u305B\u3093 - \u6709\u52B9\u306A\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3067\u306F\u3042\u308A\u307E\u305B\u3093 +error.cannot-create-output-dir=\u51FA\u529B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA{0}\u3092\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093\u3002 +error.cannot-write-to-output-dir=\u51FA\u529B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA{0}\u306F\u66F8\u8FBC\u307F\u4E0D\u53EF\u3067\u3059\u3002 +error.too-many-content-types-for-file-association=\u30D5\u30A1\u30A4\u30EB\u30FB\u30A2\u30BD\u30B7\u30A8\u30FC\u30B7\u30E7\u30F3\u756A\u53F7{0}\u306B\u8907\u6570\u306EMIME\u30BF\u30A4\u30D7\u304C\u6307\u5B9A\u3055\u308C\u307E\u3057\u305F\u3002 +error.too-many-content-types-for-file-association.advice=Linux\u30D0\u30F3\u30C9\u30EB\u306E\u5834\u5408\u3001\u5404\u30D5\u30A1\u30A4\u30EB\u30FB\u30A2\u30BD\u30B7\u30A8\u30FC\u30B7\u30E7\u30F3\u306BMIME\u30BF\u30A4\u30D7\u30921\u3064\u3060\u3051\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002 + +message.tool-version=[{0}]\u30D0\u30FC\u30B8\u30E7\u30F3[{1}]\u304C\u691C\u51FA\u3055\u308C\u307E\u3057\u305F +message.running-wsh-script=\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30A4\u30E1\u30FC\u30B8[{0}]\u3067WSH\u30B9\u30AF\u30EA\u30D7\u30C8\u3092\u5B9F\u884C\u3057\u3066\u3044\u307E\u3059 +message.wrong-tool-version=[{0}]\u30D0\u30FC\u30B8\u30E7\u30F3{1}\u304C\u691C\u51FA\u3055\u308C\u307E\u3057\u305F\u304C\u3001\u30D0\u30FC\u30B8\u30E7\u30F3{2}\u304C\u5FC5\u8981\u3067\u3059\u3002 +message.use-wix36-features=WiX 3.6\u304C\u691C\u51FA\u3055\u308C\u307E\u3057\u305F\u3002\u62E1\u5F35\u30AF\u30EA\u30FC\u30F3\u30A2\u30C3\u30D7\u30FB\u30A2\u30AF\u30B7\u30E7\u30F3\u3092\u6709\u52B9\u5316\u3057\u3066\u3044\u307E\u3059\u3002 +message.version-string-too-many-components=\u30D0\u30FC\u30B8\u30E7\u30F3\u6587\u5B57\u5217\u306B\u306F\u3001\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u30923\u3064(\u30E1\u30B8\u30E3\u30FC.\u30DE\u30A4\u30CA\u30FC.\u30D3\u30EB\u30C9)\u307E\u3067\u542B\u3081\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002 +message.debug-working-directory=\u30C7\u30D0\u30C3\u30B0\u306E\u4F5C\u696D\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304C\u4FDD\u6301\u3055\u308C\u307E\u3057\u305F: {0} +message.generated-product-guid=\u88FD\u54C1GUID\u3092\u751F\u6210\u3057\u307E\u3057\u305F: {0} +message.preparing-msi-config=MSI\u69CB\u6210\u3092\u6E96\u5099\u3057\u3066\u3044\u307E\u3059: {0} +message.generating-msi=MSI\u3092\u751F\u6210\u3057\u3066\u3044\u307E\u3059: {0} +message.one-shortcut-required=\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u30B7\u30E7\u30FC\u30C8\u30AB\u30C3\u30C8\u30FB\u30BF\u30A4\u30D7\u304C\u5FC5\u8981\u3067\u3059\u3002\u30E1\u30CB\u30E5\u30FC\u30FB\u30B7\u30E7\u30FC\u30C8\u30AB\u30C3\u30C8\u3092\u6709\u52B9\u5316\u3057\u3066\u3044\u307E\u3059\u3002 +message.light-file-string=WiX light\u30C4\u30FC\u30EB\u304C{0}\u306B\u8A2D\u5B9A\u3055\u308C\u307E\u3057\u305F +message.candle-file-string=WiX candle\u30C4\u30FC\u30EB\u304C{0}\u306B\u8A2D\u5B9A\u3055\u308C\u307E\u3057\u305F +message.creating-association-with-null-extension=null\u62E1\u5F35\u5B50\u3068\u306E\u95A2\u9023\u4ED8\u3051\u3092\u4F5C\u6210\u3057\u3066\u3044\u307E\u3059\u3002 diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/WinMsiBundler_zh_CN.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/WinMsiBundler_zh_CN.properties Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,91 @@ +# +# Copyright (c) 2017, 2018, 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. +# +# + +bundler.name=MSI \u5B89\u88C5\u7A0B\u5E8F +bundler.description=Microsoft Windows MSI \u5B89\u88C5\u7A0B\u5E8F, \u901A\u8FC7 WiX\u3002 + +param.system-wide.name=\u7CFB\u7EDF\u8303\u56F4 +param.system-wide.description=\u6B64\u5E94\u7528\u7A0B\u5E8F\u662F\u5E94\u5C1D\u8BD5\u5728\u7CFB\u7EDF\u8303\u56F4\u5185\u5B89\u88C5, \u8FD8\u662F\u4EC5\u4E3A\u6BCF\u4E2A\u7528\u6237\u5B89\u88C5? \u7A7A\u503C\u8868\u793A\u4F7F\u7528\u7CFB\u7EDF\u9ED8\u8BA4\u503C\u3002 + +param.app-bundler.name=MSI App Bundler +param.app-bundler.description=MSI App Bundler + +param.can-use-wix36.name=Can Use Wix +param.can-use-wix36.description=Can Use Wix + +param.config-root.name=Config Root Dir +param.config-root.description=Config Root Dir + +param.image-dir.name=Image Dir +param.image-dir.description=Image Dir + +param.app-dir.name=App Dir +param.app-dir.description=App Dir + +param.upgrade-uuid.name=\u5347\u7EA7 UUID +param.upgrade-uuid.description=\u4E0E\u6B64\u7A0B\u5E8F\u5305\u7684\u5347\u7EA7\u5173\u8054\u7684 UUID\u3002 + +param.product-version.name=\u4EA7\u54C1\u7248\u672C +param.product-version.description=\u5411 Windows \u548C MSI \u663E\u793A\u7684\u5E94\u7528\u7A0B\u5E8F\u7684\u7248\u672C, \u5F62\u5F0F\u4E3A "1.2.3" + +param.candle-path.name=WiX candle.exe \u4F4D\u7F6E +param.candle-path.description=WiX \u5DE5\u5177\u96C6\u4E2D candle.exe \u7684\u6587\u4EF6\u8DEF\u5F84\u3002 + +param.light-path.name=WiX light.exe \u4F4D\u7F6E +param.light-path.description=WiX \u5DE5\u5177\u96C6\u4E2D light.exe \u7684\u6587\u4EF6\u8DEF\u5F84\u3002 + +resource.post-install-script=\u8981\u5728\u586B\u5145\u5E94\u7528\u7A0B\u5E8F\u6620\u50CF\u4E4B\u540E\u8FD0\u884C\u7684\u811A\u672C +resource.wix-config-file=WiX \u914D\u7F6E\u6587\u4EF6 + +error.parameters-null=\u53C2\u6570\u6620\u5C04\u4E3A\u7A7A\u503C\u3002 +error.parameters-null.advice=\u8BF7\u4F20\u5165\u975E\u7A7A\u53C2\u6570\u6620\u5C04\u3002 +error.no-wix-tools=\u627E\u4E0D\u5230 WiX \u5DE5\u5177 (light.exe, candle.exe)\u3002 +error.no-wix-tools.advice=\u4ECE http://wix.sf.net \u4E0B\u8F7D WiX 3.0 \u6216\u66F4\u9AD8\u7248\u672C, \u7136\u540E\u5C06\u5176\u6DFB\u52A0\u5230 PATH\u3002 +error.version-string-wrong-format=\u7248\u672C\u5B57\u7B26\u4E32\u4E0D\u7B26\u5408 MSI \u89C4\u5219 [{0}]\u3002 +error.version-string-wrong-format.advice=\u6839\u636E\u4EE5\u4E0B\u89C4\u5219\u8BBE\u7F6E\u6253\u5305\u7A0B\u5E8F\u53C2\u6570 "{0}": http://msdn.microsoft.com/en-us/library/aa370859%28v=VS.85%29.aspx +error.version-string-major-out-of-range=\u4E3B\u7248\u672C\u5FC5\u987B\u4F4D\u4E8E [0, 255] \u8303\u56F4\u4E2D +error.version-string-build-out-of-range=\u7248\u672C\u7684\u5DE5\u4F5C\u7248\u672C\u90E8\u5206\u5FC5\u987B\u4F4D\u4E8E [0, 65535] \u8303\u56F4\u4E2D +error.version-string-minor-out-of-range=\u6B21\u7248\u672C\u5FC5\u987B\u4F4D\u4E8E [0, 255] \u8303\u56F4\u4E2D +error.version-string-part-not-number=\u65E0\u6CD5\u5C06\u7248\u672C\u7EC4\u6210\u90E8\u5206\u8F6C\u6362\u4E3A\u6574\u6570\u3002 +error.cannot-walk-directory=\u65E0\u6CD5\u904D\u5386 [{0}] - \u5B83\u4E0D\u662F\u6709\u6548\u7684\u76EE\u5F55 +error.cannot-create-output-dir=\u65E0\u6CD5\u521B\u5EFA\u8F93\u51FA\u76EE\u5F55 {0}\u3002 +error.cannot-write-to-output-dir=\u8F93\u51FA\u76EE\u5F55 {0} \u4E0D\u53EF\u5199\u3002 +error.too-many-content-types-for-file-association=\u4E3A\u6587\u4EF6\u5173\u8054\u53F7{0}\u6307\u5B9A\u4E86\u591A\u4E2A MIME \u7C7B\u578B\u3002 +error.too-many-content-types-for-file-association.advice=\u5BF9\u4E8E Linux \u6253\u5305, \u8BF7\u4E3A\u6BCF\u4E2A\u6587\u4EF6\u5173\u8054\u6307\u5B9A\u4E00\u4E2A\u4E14\u4EC5\u6307\u5B9A\u4E00\u4E2A MIME \u7C7B\u578B\u3002 + +message.tool-version=\u68C0\u6D4B\u5230 [{0}] \u7248\u672C [{1}] +message.running-wsh-script=\u5728\u5E94\u7528\u7A0B\u5E8F\u6620\u50CF [{0}] \u4E0A\u8FD0\u884C WSH \u811A\u672C +message.wrong-tool-version=\u68C0\u6D4B\u5230 [{0}] \u7248\u672C {1}, \u4F46\u9700\u8981\u7248\u672C {2}\u3002 +message.use-wix36-features=\u68C0\u6D4B\u5230 WiX 3.6\u3002\u6B63\u5728\u542F\u7528\u9AD8\u7EA7\u6E05\u9664\u64CD\u4F5C\u3002 +message.version-string-too-many-components=\u7248\u672C\u5B57\u7B26\u4E32\u6700\u591A\u53EF\u4EE5\u5177\u6709 3 \u4E2A\u7EC4\u6210\u90E8\u5206 - major.minor.build\u3002 +message.debug-working-directory=\u7528\u4E8E\u8C03\u8BD5\u7684\u5DF2\u4FDD\u7559\u5DE5\u4F5C\u76EE\u5F55: {0} +message.generated-product-guid=\u5DF2\u751F\u6210\u4EA7\u54C1 GUID: {0} +message.preparing-msi-config=\u6B63\u5728\u51C6\u5907 MSI \u914D\u7F6E: {0} +message.generating-msi=\u6B63\u5728\u751F\u6210 MSI: {0} +message.one-shortcut-required=\u81F3\u5C11\u9700\u8981\u4E00\u79CD\u7C7B\u578B\u7684\u5FEB\u6377\u65B9\u5F0F\u3002\u6B63\u5728\u542F\u7528\u83DC\u5355\u5FEB\u6377\u65B9\u5F0F\u3002 +message.light-file-string=WiX light \u5DE5\u5177\u8BBE\u7F6E\u4E3A{0} +message.candle-file-string=WiX candle \u5DE5\u5177\u8BBE\u7F6E\u4E3A{0} +message.creating-association-with-null-extension=\u6B63\u5728\u4F7F\u7528\u7A7A\u6269\u5C55\u540D\u521B\u5EFA\u5173\u8054\u3002 diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/WinResources.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/WinResources.java Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2011, 2018, 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.jpackager.internal.resources; + +public class WinResources { + +} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/WindowsAppImageBuilder.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/WindowsAppImageBuilder.properties Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,45 @@ +# +# Copyright (c) 2017, 2018, 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. +# +# + +param.rebrand-executable.name = Rebrand Launcher +param.rebrand-executable.description = Update the launcher with the application icon and update ownership information. + +param.icon-ico.name=.ico Icon +param.icon-ico.description=Icon for the application, in ICO format. + +param.console-hint.name=Console Hint +param.console-hint.description=Indicates if the bundler should use console launcher + +param.config-root.name=Config Root Dir +param.config-root.description=Config Root Dir + +error.cannot-create-output-dir=Output directory {0} cannot be created. +error.cannot-write-to-output-dir=Output directory {0} is not writable. + +message.potential.windows.defender.issue=Warning: Windows Defender may prevent the Java Packager from functioning. If there is an issue, it can be addressed by either disabling realtime monitoring, or adding an exclusion for the directory "{0}". +message.icon-not-ico=The specified icon "{0}" is not an ICO file and will not be used. The default icon will be used in it's place. + +resource.executable-properties-template=Template for creating executable properties file. diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/WindowsAppImageBuilder_ja.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/WindowsAppImageBuilder_ja.properties Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,45 @@ +# +# Copyright (c) 2017, 2018, 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. +# +# + +param.rebrand-executable.name = \u30E9\u30F3\u30C1\u30E3\u306E\u30EA\u30D6\u30E9\u30F3\u30C9 +param.rebrand-executable.description = \u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30A2\u30A4\u30B3\u30F3\u3092\u542B\u3080\u30E9\u30F3\u30C1\u30E3\u304A\u3088\u3073\u6240\u6709\u8005\u60C5\u5831\u3092\u66F4\u65B0\u3057\u307E\u3059\u3002 + +param.icon-ico.name=.ico\u30A2\u30A4\u30B3\u30F3 +param.icon-ico.description=ICO\u5F62\u5F0F\u3067\u306E\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u30A2\u30A4\u30B3\u30F3\u3002 + +param.console-hint.name=Console Hint +param.console-hint.description=Indicates if the bundler should use console launcher + +param.config-root.name=Config Root Dir +param.config-root.description=Config Root Dir + +error.cannot-create-output-dir=\u51FA\u529B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA{0}\u3092\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093\u3002 +error.cannot-write-to-output-dir=\u51FA\u529B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA{0}\u306F\u66F8\u8FBC\u307F\u4E0D\u53EF\u3067\u3059\u3002 + +message.potential.windows.defender.issue=\u8B66\u544A: Windows Defender\u304C\u539F\u56E0\u3067Java\u30D1\u30C3\u30B1\u30FC\u30B8\u30E3\u304C\u6A5F\u80FD\u3057\u306A\u3044\u3053\u3068\u304C\u3042\u308A\u307E\u3059\u3002\u554F\u984C\u304C\u767A\u751F\u3057\u305F\u5834\u5408\u306F\u3001\u30EA\u30A2\u30EB\u30BF\u30A4\u30E0\u30FB\u30E2\u30CB\u30BF\u30EA\u30F3\u30B0\u3092\u7121\u52B9\u306B\u3059\u308B\u304B\u3001\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA"{0}"\u306E\u9664\u5916\u3092\u8FFD\u52A0\u3059\u308B\u3053\u3068\u306B\u3088\u308A\u3001\u554F\u984C\u306B\u5BFE\u51E6\u3067\u304D\u307E\u3059\u3002 +message.icon-not-ico=The specified icon "{0}" is not an ICO file and will not be used. The default icon will be used in it's place. + +resource.executable-properties-template=\u5B9F\u884C\u53EF\u80FD\u306A\u30D7\u30ED\u30D1\u30C6\u30A3\u30FB\u30D5\u30A1\u30A4\u30EB\u4F5C\u6210\u7528\u306E\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u3002 diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/WindowsAppImageBuilder_zh_CN.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/WindowsAppImageBuilder_zh_CN.properties Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,45 @@ +# +# Copyright (c) 2017, 2018, 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. +# +# + +param.rebrand-executable.name = \u66F4\u6539\u542F\u52A8\u7A0B\u5E8F\u54C1\u724C +param.rebrand-executable.description = \u4F7F\u7528\u5E94\u7528\u7A0B\u5E8F\u56FE\u6807\u66F4\u65B0\u542F\u52A8\u7A0B\u5E8F\u5E76\u66F4\u65B0\u6240\u6709\u6743\u4FE1\u606F\u3002 + +param.icon-ico.name=.ico \u56FE\u6807 +param.icon-ico.description=\u5E94\u7528\u7A0B\u5E8F\u7684\u56FE\u6807, \u91C7\u7528 ICO \u683C\u5F0F\u3002 + +param.console-hint.name=Console Hint +param.console-hint.description=Indicates if the bundler should use console launcher + +param.config-root.name=Config Root Dir +param.config-root.description=Config Root Dir + +error.cannot-create-output-dir=\u65E0\u6CD5\u521B\u5EFA\u8F93\u51FA\u76EE\u5F55 {0}\u3002 +error.cannot-write-to-output-dir=\u8F93\u51FA\u76EE\u5F55 {0} \u4E0D\u53EF\u5199\u3002 + +message.potential.windows.defender.issue=\u8B66\u544A: Windows Defender \u53EF\u80FD\u4F1A\u963B\u6B62 Java \u6253\u5305\u7A0B\u5E8F\u6B63\u5E38\u5DE5\u4F5C\u3002\u5982\u679C\u5B58\u5728\u95EE\u9898, \u53EF\u4EE5\u901A\u8FC7\u7981\u7528\u5B9E\u65F6\u76D1\u89C6\u6216\u8005\u4E3A\u76EE\u5F55 "{0}" \u6DFB\u52A0\u6392\u9664\u9879\u8FDB\u884C\u89E3\u51B3\u3002 +message.icon-not-ico=The specified icon "{0}" is not an ICO file and will not be used. The default icon will be used in it's place. + +resource.executable-properties-template=\u7528\u4E8E\u521B\u5EFA\u53EF\u6267\u884C\u5C5E\u6027\u6587\u4EF6\u7684\u6A21\u677F\u3002 diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/WindowsBundlerParam.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/WindowsBundlerParam.properties Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,44 @@ +# +# Copyright (c) 2017, 2018, 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. +# +# + +param.menu-group.name=Menu Group +param.menu-group.description=The Start Menu group this application should be placed in +param.menu-group.default=Unknown + +param.64-bit.name=64-bit +param.64-bit.description=Prepare the bundles for 64 bit windows. + +param.runtime-64-bit.name=runtime 64-bit +param.runtime-64-bit.description=Embedded JRE runtime is 64-bit, used to detect bit architecture mismatches. + +param.installer-name.name=Installer Name +param.installer-name.description=The filename of the generated installer without the file type extension. Default is -. + +param.registry-name.name=Registry Name +param.registry-name.description=The name of the application for registry references. Default is the Application Name with only alphanumerics, dots, and dashes (no whitespace). + +param.installdir-chooser.name=Install Directory Chooser +param.installdir-chooser.description=Adds a dialog to let the user choose a directory where the product will be installed. diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/WindowsBundlerParam_ja.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/WindowsBundlerParam_ja.properties Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,44 @@ +# +# Copyright (c) 2017, 2018, 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. +# +# + +param.menu-group.name=\u30E1\u30CB\u30E5\u30FC\u30FB\u30B0\u30EB\u30FC\u30D7 +param.menu-group.description=\u3053\u306E\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u3092\u914D\u7F6E\u3059\u308B\u5FC5\u8981\u304C\u3042\u308B\u8D77\u52D5\u30E1\u30CB\u30E5\u30FC\u30FB\u30B0\u30EB\u30FC\u30D7 +param.menu-group.default=\u4E0D\u660E + +param.64-bit.name=64\u30D3\u30C3\u30C8 +param.64-bit.description=64\u30D3\u30C3\u30C8\u306EWindows\u7528\u306E\u30D0\u30F3\u30C9\u30EB\u3092\u6E96\u5099\u3057\u307E\u3059\u3002 + +param.runtime-64-bit.name=\u30E9\u30F3\u30BF\u30A4\u30E064\u30D3\u30C3\u30C8 +param.runtime-64-bit.description=\u57CB\u8FBC\u307FJRE\u30E9\u30F3\u30BF\u30A4\u30E0\u306F64\u30D3\u30C3\u30C8\u3067\u3001\u30D3\u30C3\u30C8\u30FB\u30A2\u30FC\u30AD\u30C6\u30AF\u30C1\u30E3\u306E\u4E0D\u4E00\u81F4\u306E\u691C\u51FA\u306B\u4F7F\u7528\u3055\u308C\u307E\u3059\u3002 + +param.installer-name.name=\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9\u540D +param.installer-name.description=\u30D5\u30A1\u30A4\u30EB\u30FB\u30BF\u30A4\u30D7\u62E1\u5F35\u5B50\u306A\u3057\u306E\u751F\u6210\u3055\u308C\u305F\u30A4\u30F3\u30B9\u30C8\uFF0D\u30E9\u306E\u30D5\u30A1\u30A4\u30EB\u540D\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u306F-\u3067\u3059\u3002 + +param.registry-name.name=\u30EC\u30B8\u30B9\u30C8\u30EA\u540D +param.registry-name.description=\u30EC\u30B8\u30B9\u30C8\u30EA\u53C2\u7167\u7528\u306E\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u540D\u524D\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u306F\u3001\u82F1\u6570\u5B57\u3001\u30C9\u30C3\u30C8\u304A\u3088\u3073\u30C0\u30C3\u30B7\u30E5(\u7A7A\u767D\u306A\u3057)\u306E\u307F\u3092\u4F7F\u7528\u3057\u305F\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u540D\u3067\u3059\u3002 + +param.installdir-chooser.name=\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u30FB\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u9078\u629E +param.installdir-chooser.description=\u30E6\u30FC\u30B6\u30FC\u304C\u88FD\u54C1\u3092\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3059\u308B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u9078\u629E\u3059\u308B\u305F\u3081\u306E\u30C0\u30A4\u30A2\u30ED\u30B0\u3092\u8FFD\u52A0\u3057\u307E\u3059\u3002 diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/WindowsBundlerParam_zh_CN.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/WindowsBundlerParam_zh_CN.properties Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,44 @@ +# +# Copyright (c) 2017, 2018, 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. +# +# + +param.menu-group.name=\u83DC\u5355\u7EC4 +param.menu-group.description=\u5E94\u5C06\u6B64\u5E94\u7528\u7A0B\u5E8F\u653E\u7F6E\u5230\u7684\u5F00\u59CB\u83DC\u5355\u7EC4 +param.menu-group.default=\u672A\u77E5 + +param.64-bit.name=64 \u4F4D +param.64-bit.description=\u51C6\u5907\u9002\u7528\u4E8E 64 \u4F4D Windows \u7684\u5305\u3002 + +param.runtime-64-bit.name=\u8FD0\u884C\u65F6 64 \u4F4D +param.runtime-64-bit.description=\u5D4C\u5165\u5F0F JRE \u8FD0\u884C\u65F6\u4E3A 64 \u4F4D, \u7528\u4E8E\u68C0\u6D4B\u4F4D\u4F53\u7CFB\u7ED3\u6784\u4E0D\u5339\u914D\u60C5\u51B5\u3002 + +param.installer-name.name=\u5B89\u88C5\u7A0B\u5E8F\u540D\u79F0 +param.installer-name.description=\u6240\u751F\u6210\u5B89\u88C5\u7A0B\u5E8F\u4E0D\u5E26\u6587\u4EF6\u7C7B\u578B\u6269\u5C55\u540D\u7684\u6587\u4EF6\u540D\u3002\u9ED8\u8BA4\u503C\u4E3A <\u5E94\u7528\u7A0B\u5E8F\u540D\u79F0>-<\u7248\u672C>\u3002 + +param.registry-name.name=\u6CE8\u518C\u8868\u540D\u79F0 +param.registry-name.description=\u7528\u4E8E\u6CE8\u518C\u8868\u5F15\u7528\u7684\u5E94\u7528\u7A0B\u5E8F\u7684\u540D\u79F0\u3002\u9ED8\u8BA4\u503C\u4E3A\u53EA\u5305\u542B\u5B57\u6BCD\u6570\u5B57, \u70B9\u548C\u77ED\u5212\u7EBF (\u65E0\u7A7A\u683C) \u7684\u5E94\u7528\u7A0B\u5E8F\u540D\u79F0\u3002 + +param.installdir-chooser.name=\u5B89\u88C5\u76EE\u5F55\u9009\u62E9\u5668 +param.installdir-chooser.description=\u6DFB\u52A0\u5BF9\u8BDD\u6846\u4EE5\u5141\u8BB8\u7528\u6237\u9009\u62E9\u5C06\u5728\u5176\u4E2D\u5B89\u88C5\u4EA7\u54C1\u7684\u76EE\u5F55\u3002 diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/builders/windows/WindowsAppImageBuilder.properties --- a/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/builders/windows/WindowsAppImageBuilder.properties Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -# -# Copyright (c) 2017, 2018, 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. -# -# - -param.rebrand-executable.name = Rebrand Launcher -param.rebrand-executable.description = Update the launcher with the application icon and update ownership information. - -param.icon-ico.name=.ico Icon -param.icon-ico.description=Icon for the application, in ICO format. - -param.console-hint.name=Console Hint -param.console-hint.description=Indicates if the bundler should use console launcher - -param.config-root.name=Config Root Dir -param.config-root.description=Config Root Dir - -error.cannot-create-output-dir=Output directory {0} cannot be created. -error.cannot-write-to-output-dir=Output directory {0} is not writable. - -message.potential.windows.defender.issue=Warning: Windows Defender may prevent the Java Packager from functioning. If there is an issue, it can be addressed by either disabling realtime monitoring, or adding an exclusion for the directory "{0}". -message.icon-not-ico=The specified icon "{0}" is not an ICO file and will not be used. The default icon will be used in it's place. - -resource.executable-properties-template=Template for creating executable properties file. diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/builders/windows/WindowsAppImageBuilder_ja.properties --- a/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/builders/windows/WindowsAppImageBuilder_ja.properties Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -# -# Copyright (c) 2017, 2018, 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. -# -# - -param.rebrand-executable.name = \u30E9\u30F3\u30C1\u30E3\u306E\u30EA\u30D6\u30E9\u30F3\u30C9 -param.rebrand-executable.description = \u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30A2\u30A4\u30B3\u30F3\u3092\u542B\u3080\u30E9\u30F3\u30C1\u30E3\u304A\u3088\u3073\u6240\u6709\u8005\u60C5\u5831\u3092\u66F4\u65B0\u3057\u307E\u3059\u3002 - -param.icon-ico.name=.ico\u30A2\u30A4\u30B3\u30F3 -param.icon-ico.description=ICO\u5F62\u5F0F\u3067\u306E\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u30A2\u30A4\u30B3\u30F3\u3002 - -param.console-hint.name=Console Hint -param.console-hint.description=Indicates if the bundler should use console launcher - -param.config-root.name=Config Root Dir -param.config-root.description=Config Root Dir - -error.cannot-create-output-dir=\u51FA\u529B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA{0}\u3092\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093\u3002 -error.cannot-write-to-output-dir=\u51FA\u529B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA{0}\u306F\u66F8\u8FBC\u307F\u4E0D\u53EF\u3067\u3059\u3002 - -message.potential.windows.defender.issue=\u8B66\u544A: Windows Defender\u304C\u539F\u56E0\u3067Java\u30D1\u30C3\u30B1\u30FC\u30B8\u30E3\u304C\u6A5F\u80FD\u3057\u306A\u3044\u3053\u3068\u304C\u3042\u308A\u307E\u3059\u3002\u554F\u984C\u304C\u767A\u751F\u3057\u305F\u5834\u5408\u306F\u3001\u30EA\u30A2\u30EB\u30BF\u30A4\u30E0\u30FB\u30E2\u30CB\u30BF\u30EA\u30F3\u30B0\u3092\u7121\u52B9\u306B\u3059\u308B\u304B\u3001\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA"{0}"\u306E\u9664\u5916\u3092\u8FFD\u52A0\u3059\u308B\u3053\u3068\u306B\u3088\u308A\u3001\u554F\u984C\u306B\u5BFE\u51E6\u3067\u304D\u307E\u3059\u3002 -message.icon-not-ico=The specified icon "{0}" is not an ICO file and will not be used. The default icon will be used in it's place. - -resource.executable-properties-template=\u5B9F\u884C\u53EF\u80FD\u306A\u30D7\u30ED\u30D1\u30C6\u30A3\u30FB\u30D5\u30A1\u30A4\u30EB\u4F5C\u6210\u7528\u306E\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u3002 diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/builders/windows/WindowsAppImageBuilder_zh_CN.properties --- a/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/builders/windows/WindowsAppImageBuilder_zh_CN.properties Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -# -# Copyright (c) 2017, 2018, 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. -# -# - -param.rebrand-executable.name = \u66F4\u6539\u542F\u52A8\u7A0B\u5E8F\u54C1\u724C -param.rebrand-executable.description = \u4F7F\u7528\u5E94\u7528\u7A0B\u5E8F\u56FE\u6807\u66F4\u65B0\u542F\u52A8\u7A0B\u5E8F\u5E76\u66F4\u65B0\u6240\u6709\u6743\u4FE1\u606F\u3002 - -param.icon-ico.name=.ico \u56FE\u6807 -param.icon-ico.description=\u5E94\u7528\u7A0B\u5E8F\u7684\u56FE\u6807, \u91C7\u7528 ICO \u683C\u5F0F\u3002 - -param.console-hint.name=Console Hint -param.console-hint.description=Indicates if the bundler should use console launcher - -param.config-root.name=Config Root Dir -param.config-root.description=Config Root Dir - -error.cannot-create-output-dir=\u65E0\u6CD5\u521B\u5EFA\u8F93\u51FA\u76EE\u5F55 {0}\u3002 -error.cannot-write-to-output-dir=\u8F93\u51FA\u76EE\u5F55 {0} \u4E0D\u53EF\u5199\u3002 - -message.potential.windows.defender.issue=\u8B66\u544A: Windows Defender \u53EF\u80FD\u4F1A\u963B\u6B62 Java \u6253\u5305\u7A0B\u5E8F\u6B63\u5E38\u5DE5\u4F5C\u3002\u5982\u679C\u5B58\u5728\u95EE\u9898, \u53EF\u4EE5\u901A\u8FC7\u7981\u7528\u5B9E\u65F6\u76D1\u89C6\u6216\u8005\u4E3A\u76EE\u5F55 "{0}" \u6DFB\u52A0\u6392\u9664\u9879\u8FDB\u884C\u89E3\u51B3\u3002 -message.icon-not-ico=The specified icon "{0}" is not an ICO file and will not be used. The default icon will be used in it's place. - -resource.executable-properties-template=\u7528\u4E8E\u521B\u5EFA\u53EF\u6267\u884C\u5C5E\u6027\u6587\u4EF6\u7684\u6A21\u677F\u3002 diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/icon_inno_setup.bmp Binary file src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/icon_inno_setup.bmp has changed diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/javalogo_white_16.ico Binary file src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/javalogo_white_16.ico has changed diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/javalogo_white_32.ico Binary file src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/javalogo_white_32.ico has changed diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/javalogo_white_48.ico Binary file src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/javalogo_white_48.ico has changed diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/template.iss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/template.iss Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,72 @@ +;This file will be executed next to the application bundle image +;I.e. current directory will contain folder INSTALLER_NAME with application files +[Setup] +AppId={{PRODUCT_APP_IDENTIFIER}} +AppName=INSTALLER_NAME +AppVersion=APPLICATION_VERSION +AppVerName=INSTALLER_NAME APPLICATION_VERSION +AppPublisher=APPLICATION_VENDOR +AppComments=APPLICATION_COMMENTS +AppCopyright=APPLICATION_COPYRIGHT +DefaultDirName=APPLICATION_INSTALL_ROOT\INSTALLER_NAME +DisableStartupPrompt=Yes +DisableDirPage=DISABLE_DIR_PAGE +DisableProgramGroupPage=Yes +DisableReadyPage=Yes +DisableFinishedPage=Yes +DisableWelcomePage=Yes +DefaultGroupName=APPLICATION_GROUP +;Optional License +LicenseFile=APPLICATION_LICENSE_FILE +;WinXP or above +MinVersion=0,5.1 +OutputBaseFilename=INSTALLER_FILE_NAME +Compression=lzma +SolidCompression=yes +PrivilegesRequired=APPLICATION_INSTALL_PRIVILEGE +SetupIconFile=INSTALLER_NAME\LAUNCHER_NAME.ico +UninstallDisplayIcon={app}\LAUNCHER_NAME.ico +UninstallDisplayName=INSTALLER_NAME +WizardImageStretch=No +WizardSmallImageFile=INSTALLER_NAME-setup-icon.bmp +ArchitecturesInstallIn64BitMode=ARCHITECTURE_BIT_MODE +FILE_ASSOCIATIONS + +[Languages] +Name: "english"; MessagesFile: "compiler:Default.isl" + +[Files] +Source: "INSTALLER_NAME\LAUNCHER_NAME.exe"; DestDir: "{app}"; Flags: ignoreversion +Source: "INSTALLER_NAME\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs + +[Icons] +Name: "{group}\INSTALLER_NAME"; Filename: "{app}\LAUNCHER_NAME.exe"; IconFilename: "{app}\LAUNCHER_NAME.ico"; Check: APPLICATION_MENU_SHORTCUT() +Name: "{commondesktop}\INSTALLER_NAME"; Filename: "{app}\LAUNCHER_NAME.exe"; IconFilename: "{app}\LAUNCHER_NAME.ico"; Check: APPLICATION_DESKTOP_SHORTCUT() +SECONDARY_LAUNCHERS + +[Run] +Filename: "{app}\RUN_FILENAME.exe"; Parameters: "-Xappcds:generatecache"; Check: APPLICATION_APP_CDS_INSTALL() +Filename: "{app}\RUN_FILENAME.exe"; Description: "{cm:LaunchProgram,INSTALLER_NAME}"; Flags: nowait postinstall skipifsilent; Check: APPLICATION_NOT_SERVICE() +Filename: "{app}\RUN_FILENAME.exe"; Parameters: "-install -svcName ""INSTALLER_NAME"" -svcDesc ""APPLICATION_DESCRIPTION"" -mainExe ""APPLICATION_LAUNCHER_FILENAME"" START_ON_INSTALL RUN_AT_STARTUP"; Check: APPLICATION_SERVICE() + +[UninstallRun] +Filename: "{app}\RUN_FILENAME.exe "; Parameters: "-uninstall -svcName INSTALLER_NAME STOP_ON_UNINSTALL"; Check: APPLICATION_SERVICE() + +[Code] +function returnTrue(): Boolean; +begin + Result := True; +end; + +function returnFalse(): Boolean; +begin + Result := False; +end; + +function InitializeSetup(): Boolean; +begin +// Possible future improvements: +// if version less or same => just launch app +// if upgrade => check if same app is running and wait for it to exit + Result := True; +end; diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/template.jre.iss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/template.jre.iss Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,55 @@ +;This file will be executed next to the application bundle image +;I.e. current directory will contain folder INSTALLER_NAME with application files +[Setup] +AppId={{PRODUCT_APP_IDENTIFIER}} +AppName=INSTALLER_NAME +AppVersion=APPLICATION_VERSION +AppVerName=INSTALLER_NAME APPLICATION_VERSION +AppPublisher=APPLICATION_VENDOR +AppComments=APPLICATION_COMMENTS +AppCopyright=APPLICATION_COPYRIGHT +DefaultDirName=APPLICATION_INSTALL_ROOT\INSTALLER_NAME +DisableStartupPrompt=Yes +DisableDirPage=DISABLE_DIR_PAGE +DisableProgramGroupPage=Yes +DisableReadyPage=Yes +DisableFinishedPage=Yes +DisableWelcomePage=Yes +DefaultGroupName=APPLICATION_GROUP +;Optional License +LicenseFile=APPLICATION_LICENSE_FILE +;WinXP or above +MinVersion=0,5.1 +OutputBaseFilename=INSTALLER_FILE_NAME +Compression=lzma +SolidCompression=yes +PrivilegesRequired=APPLICATION_INSTALL_PRIVILEGE +SetupIconFile= +UninstallDisplayIcon= +UninstallDisplayName=INSTALLER_NAME +WizardImageStretch=No +WizardSmallImageFile=INSTALLER_NAME-setup-icon.bmp +ArchitecturesInstallIn64BitMode=ARCHITECTURE_BIT_MODE +FILE_ASSOCIATIONS + +[Languages] +Name: "english"; MessagesFile: "compiler:Default.isl" + +[Files] +Source: "INSTALLER_NAME\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs + +[Code] +function returnTrue(): Boolean; +begin + Result := True; +end; + +function returnFalse(): Boolean; +begin + Result := False; +end; + +function InitializeSetup(): Boolean; +begin + Result := True; +end; diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/template.jre.wxs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/template.jre.wxs Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + WIX36_ONLY_START + + WIX36_ONLY_END + + + +UI_BLOCK + + diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/template.wxs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/template.wxs Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + WIX36_ONLY_START + + WIX36_ONLY_END + + + +UI_BLOCK + + +SECONDARY_LAUNCHER_ICONS + + diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/windows.jre.list --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/windows.jre.list Wed Nov 21 17:50:46 2018 -0500 @@ -0,0 +1,3 @@ +; This file contains Windows-specific modules. + +jdk.crypto.mscapi diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/windows/WinAppBundler.properties --- a/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/windows/WinAppBundler.properties Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +0,0 @@ -# -# Copyright (c) 2017, 2018, 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. -# -# - -bundler.name=Windows Application Image -bundler.description=A Directory based image of a windows Application with an optionally co-bundled JRE. Used as a base for the Installer bundlers - -param.config-root.name=Config Root Dir -param.config-root.description=Config Root Dir - -param.raw-executable-url.name=Launcher URL -param.raw-executable-url.description=Override the jpackager default launcher with a custom launcher. - -param.rebrand-executable.name=Rebrand Launcher -param.rebrand-executable.description=Update the launcher with the application icon and update ownership information. - -param.icon-ico.name=.ico Icon -param.icon-ico.description=Icon for the application, in ICO format. - -resource.application-icon=application icon - -error.parameters-null=Parameters map is null. -error.parameters-null.advice=Pass in a non-null parameters map. -error.no-windows-resources=This copy of the JDK does not support Windows. -error.no-windows-resources.advice=Please use the Oracle JDK for Windows. -error.bit-architecture-mismatch=Bit architecture mismatch between FX SDK and JRE runtime. -error.bit-architecture-mismatch.advice=Make sure to use JRE runtime with correct bit architecture. -error.cannot-find-launcher=Cannot find cfg file in predefined app image directory {0}. - -message.result-dir=Result application bundle\: {0} -message.disable-bit-architecture-check=Disabled check for bit architecture mismatch. -message.icon-not-ico=The specified icon "{0}" is not an ICO file and will not be used. The default icon will be used in it's place. -message.multiple-launchers=Multiple launchers found in predefined app-image. {0} will be used as primary launcher. diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/windows/WinAppBundler_ja.properties --- a/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/windows/WinAppBundler_ja.properties Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +0,0 @@ -# -# Copyright (c) 2017, 2018, 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. -# -# - -bundler.name=Windows\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30A4\u30E1\u30FC\u30B8 -bundler.description=\u30AA\u30D7\u30B7\u30E7\u30F3\u3067JRE\u304C\u30D0\u30F3\u30C9\u30EB\u3055\u308C\u3066\u3044\u308BWindows\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u30FB\u30D9\u30FC\u30B9\u306E\u30A4\u30E1\u30FC\u30B8\u3002\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9\u30FB\u30D0\u30F3\u30C9\u30E9\u306E\u30D9\u30FC\u30B9\u3068\u3057\u3066\u4F7F\u7528\u3055\u308C\u307E\u3059 - -param.config-root.name=Config Root Dir -param.config-root.description=Config Root Dir - -param.raw-executable-url.name=\u30E9\u30F3\u30C1\u30E3URL -param.raw-executable-url.description=\u30D1\u30C3\u30B1\u30FC\u30B8\u30E3\u306E\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30E9\u30F3\u30C1\u30E3\u3092\u30AB\u30B9\u30BF\u30E0\u30FB\u30E9\u30F3\u30C1\u30E3\u3067\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3057\u307E\u3059\u3002 - -param.rebrand-executable.name=\u30E9\u30F3\u30C1\u30E3\u306E\u30EA\u30D6\u30E9\u30F3\u30C9 -param.rebrand-executable.description=\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30A2\u30A4\u30B3\u30F3\u3092\u542B\u3080\u30E9\u30F3\u30C1\u30E3\u304A\u3088\u3073\u6240\u6709\u8005\u60C5\u5831\u3092\u66F4\u65B0\u3057\u307E\u3059\u3002 - -param.icon-ico.name=.ico\u30A2\u30A4\u30B3\u30F3 -param.icon-ico.description=ICO\u5F62\u5F0F\u3067\u306E\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u30A2\u30A4\u30B3\u30F3\u3002 - -resource.application-icon=\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30A2\u30A4\u30B3\u30F3 - -error.parameters-null=\u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30DE\u30C3\u30D7\u304Cnull\u3067\u3059\u3002 -error.parameters-null.advice=\u975Enull\u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30DE\u30C3\u30D7\u3067\u6E21\u3057\u3066\u304F\u3060\u3055\u3044\u3002 -error.no-windows-resources=\u3053\u306EJDK\u306E\u30B3\u30D4\u30FC\u3067\u306F\u3001Windows\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002 -error.no-windows-resources.advice=Oracle JDK for Windows\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044\u3002 -error.bit-architecture-mismatch=FX SDK\u3068JRE\u30E9\u30F3\u30BF\u30A4\u30E0\u9593\u306E\u30D3\u30C3\u30C8\u30FB\u30A2\u30FC\u30AD\u30C6\u30AF\u30C1\u30E3\u304C\u4E00\u81F4\u3057\u307E\u305B\u3093\u3002 -error.bit-architecture-mismatch.advice=\u6B63\u3057\u3044\u30D3\u30C3\u30C8\u30FB\u30A2\u30FC\u30AD\u30C6\u30AF\u30C1\u30E3\u3092\u6301\u3064JRE\u30E9\u30F3\u30BF\u30A4\u30E0\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044\u3002 -error.cannot-find-launcher=Cannot find cfg file in predefined app image directory {0}. - -message.result-dir=\u7D50\u679C\u306E\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30D0\u30F3\u30C9\u30EB: {0} -message.disable-bit-architecture-check=\u30D3\u30C3\u30C8\u30FB\u30A2\u30FC\u30AD\u30C6\u30AF\u30C1\u30E3\u306E\u4E0D\u4E00\u81F4\u30C1\u30A7\u30C3\u30AF\u304C\u7121\u52B9\u306B\u306A\u3063\u3066\u3044\u307E\u3059\u3002 -message.icon-not-ico=\u6307\u5B9A\u3057\u305F\u30A2\u30A4\u30B3\u30F3"{0}"\u306FICO\u30D5\u30A1\u30A4\u30EB\u3067\u306F\u306A\u304F\u3001\u4F7F\u7528\u3055\u308C\u307E\u305B\u3093\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30A2\u30A4\u30B3\u30F3\u304C\u305D\u306E\u4F4D\u7F6E\u306B\u4F7F\u7528\u3055\u308C\u307E\u3059\u3002 -message.multiple-launchers=Multiple launchers found in predefined app-image. {0} will be used as primary launcher. diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/windows/WinAppBundler_zh_CN.properties --- a/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/windows/WinAppBundler_zh_CN.properties Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +0,0 @@ -# -# Copyright (c) 2017, 2018, 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. -# -# - -bundler.name=Windows \u5E94\u7528\u7A0B\u5E8F\u6620\u50CF -bundler.description=\u4E00\u4E2A\u57FA\u4E8E\u76EE\u5F55\u7684 Windows \u5E94\u7528\u7A0B\u5E8F\u6620\u50CF, \u53EF\u4EE5\u9009\u62E9\u6027\u5730\u5E26\u6709\u5171\u540C\u6253\u5305\u7684 JRE\u3002\u7528\u4F5C\u5B89\u88C5\u7A0B\u5E8F\u6253\u5305\u7A0B\u5E8F\u7684\u57FA\u7840 - -param.config-root.name=Config Root Dir -param.config-root.description=Config Root Dir - -param.raw-executable-url.name=\u542F\u52A8\u7A0B\u5E8F URL -param.raw-executable-url.description=\u4F7F\u7528\u5B9A\u5236\u542F\u52A8\u7A0B\u5E8F\u8986\u76D6\u6253\u5305\u7A0B\u5E8F\u9ED8\u8BA4\u542F\u52A8\u7A0B\u5E8F\u3002 - -param.rebrand-executable.name=\u66F4\u6539\u542F\u52A8\u7A0B\u5E8F\u54C1\u724C -param.rebrand-executable.description=\u4F7F\u7528\u5E94\u7528\u7A0B\u5E8F\u56FE\u6807\u66F4\u65B0\u542F\u52A8\u7A0B\u5E8F\u5E76\u66F4\u65B0\u6240\u6709\u6743\u4FE1\u606F\u3002 - -param.icon-ico.name=.ico \u56FE\u6807 -param.icon-ico.description=\u5E94\u7528\u7A0B\u5E8F\u7684\u56FE\u6807, \u91C7\u7528 ICO \u683C\u5F0F\u3002 - -resource.application-icon=\u5E94\u7528\u7A0B\u5E8F\u56FE\u6807 - -error.parameters-null=\u53C2\u6570\u6620\u5C04\u4E3A\u7A7A\u503C\u3002 -error.parameters-null.advice=\u8BF7\u4F20\u5165\u975E\u7A7A\u53C2\u6570\u6620\u5C04\u3002 -error.no-windows-resources=\u6B64 JDK \u7684\u526F\u672C\u4E0D\u652F\u6301 Windows\u3002 -error.no-windows-resources.advice=\u8BF7\u4F7F\u7528 Oracle JDK for Windows\u3002 -error.bit-architecture-mismatch=FX SDK \u4E0E JRE \u8FD0\u884C\u65F6\u4E4B\u95F4\u7684\u4F4D\u4F53\u7CFB\u7ED3\u6784\u4E0D\u5339\u914D\u3002 -error.bit-architecture-mismatch.advice=\u8BF7\u786E\u4FDD\u4F7F\u7528\u5E26\u6709\u6B63\u786E\u4F4D\u4F53\u7CFB\u7ED3\u6784\u7684 JRE \u8FD0\u884C\u65F6\u3002 -error.cannot-find-launcher=Cannot find cfg file in predefined app image directory {0}. - -message.result-dir=\u751F\u6210\u7684\u5E94\u7528\u7A0B\u5E8F\u5305: {0} -message.disable-bit-architecture-check=\u5DF2\u7981\u7528\u4F4D\u4F53\u7CFB\u7ED3\u6784\u4E0D\u5339\u914D\u68C0\u67E5\u3002 -message.icon-not-ico=\u6307\u5B9A\u7684\u56FE\u6807 "{0}" \u4E0D\u662F ICO \u6587\u4EF6, \u4E0D\u4F1A\u4F7F\u7528\u3002\u5C06\u4F7F\u7528\u9ED8\u8BA4\u56FE\u6807\u4EE3\u66FF\u3002 -message.multiple-launchers=Multiple launchers found in predefined app-image. {0} will be used as primary launcher. diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/windows/WinExeBundler.properties --- a/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/windows/WinExeBundler.properties Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,103 +0,0 @@ -# -# Copyright (c) 2017, 2018, 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. -# -# - -bundler.name=EXE Installer -bundler.description=Microsoft Windows EXE Installer, via InnoIDE. - -param.system-wide.name=System Wide -param.system-wide.description=Should this application attempt to install itself system wide, or only for each user? Null means use the system default. - -param.app-bundler.name=Exe Installer Bundler -param.app-bundler.description=Exe Installer Bundler - -param.config-root.name=Config Root -param.config-root.description=Config Root - -param.image-dir.name=Image Dir -param.image-dir.description=Image Dir - -param.app-dir.name=App Dir -param.app-dir.description=App Dir - -param.menu-shortcut-hint.name=Menu Hint -param.menu-shortcut-hint.description=If the bundler can add the application to the system menu, should it? - -param.desktop-shortcut-hint.name=Shortcut Hint -param.desktop-shortcut-hint.description=If the bundler can create desktop shortcuts, should it make one? - -param.upgrade-uuid.name=Upgrade UUID -param.upgrade-uuid.description=The UUID associated with upgrades for this package. - -param.product-version.name=Product Version -param.product-version.description=The version of the application as seen by Windows and MSI, of the form "1.2.3" - -param.iscc-path.name=InnoSetup iscc.exe location -param.iscc-path.description=File path to iscc.exe from the InnoSetup tool. - -resource.inno-setup-project-file=Inno Setup project file -resource.setup-icon=setup dialog icon -resource.post-install-script=script to run after application image is populated - -error.parameters-null=Parameters map is null. -error.parameters-null.advice=Pass in a non-null parameters map. - -error.iscc-not-found=Can not find Inno Setup Compiler (iscc.exe). -error.iscc-not-found.advice=Download Inno Setup 5 or later from http\://www.jrsoftware.org and add it to the PATH. - -error.license-missing=Specified license file is missing. -error.license-missing.advice=Make sure that "{0}" references a file in the app resources, and that it is relative file reference. - -error.copyright-is-too-long=The copyright string is too long for InnoSetup. -error.copyright-is-too-long.advice=Provide a copyright string shorter than 100 characters. - -error.too-many-content-types-for-file-association=More than one MIME types was specified for File Association number {0}. -error.too-many-content-types-for-file-association.advice=Specify one and only one MIME type for each file association. - -error.cannot-create-output-dir=Output directory {0} cannot be created. -error.cannot-write-to-output-dir=Output directory {0} is not writable. - -message.tool-wrong-version=Detected [{0}] version {1} but version {2} is required. -message.debug-working-directory=Kept working directory for debug\: {0} -message.outputting-to-location=Generating EXE for installer to\: {0} -message.output-location=Installer (.exe) saved to\: {0} -message.tool-version=\ Detected [{0}] version [{1}] -message.one-shortcut-required=At least one type of shortcut is required. Enabling menu shortcut. -message.running-wsh-script=Running WSH script on application image [{0}] -message.iscc-file-string=\ InnoSetup compiler set to {0} -message.creating-association-with-null-extension=Creating association with null extension. -message.potential.windows.defender.issue=Warning: Windows Defender may prevent the Java Packager from functioning. If there is an issue, it can be addressed by either disabling realtime monitoring, or adding an exclusion for the directory "{0}". - - - -message.tool-version=Detected [{0}] version [{1}] -message.running-wsh-script=Running WSH script on application image [{0}] -message.wrong-tool-version=Detected [{0}] version {1} but version {2} is required. -message.use-wix36-features=WiX 3.6 detected. Enabling advanced cleanup action. -message.version-string-too-many-components=Version sting may have up to 3 components - major.minor.build . -message.debug-working-directory=Kept working directory for debug\: {0} -message.one-shortcut-required=At least one type of shortcut is required. Enabling menu shortcut. -message.creating-association-with-null-extension=Creating association with null extension. -message.truncating.id=Truncating Application ID to 126 chars for Inno Setup. diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/windows/WinExeBundler_ja.properties --- a/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/windows/WinExeBundler_ja.properties Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,90 +0,0 @@ -# -# Copyright (c) 2017, 2018, 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. -# -# - -bundler.name=EXE Installer -bundler.description=Microsoft Windows EXE Installer, via InnoIDE. - -param.system-wide.name=System Wide -param.system-wide.description=Should this application attempt to install itself system wide, or only for each user? Null means use the system default. - -param.app-bundler.name=Exe Installer Bundler -param.app-bundler.description=Exe Installer Bundler - -param.config-root.name=Config Root -param.config-root.description=Config Root - -param.image-dir.name=Image Dir -param.image-dir.description=Image Dir - -param.app-dir.name=App Dir -param.app-dir.description=App Dir - -param.menu-shortcut-hint.name=Menu Hint -param.menu-shortcut-hint.description=If the bundler can add the application to the system menu, should it? - -param.desktop-shortcut-hint.name=Shortcut Hint -param.desktop-shortcut-hint.description=If the bundler can create desktop shortcuts, should it make one? - -param.upgrade-uuid.name=Upgrade UUID -param.upgrade-uuid.description=The UUID associated with upgrades for this package. - -param.product-version.name=Product Version -param.product-version.description=The version of the application as seen by Windows and MSI, of the form "1.2.3" - -param.iscc-path.name=InnoSetup iscc.exe location -param.iscc-path.description=File path to iscc.exe from the InnoSetup tool. - -resource.inno-setup-project-file=Inno Setup project file -resource.setup-icon=setup dialog icon -resource.post-install-script=script to run after application image is populated - -error.parameters-null=Parameters map is null. -error.parameters-null.advice=Pass in a non-null parameters map. - -error.iscc-not-found=Can not find Inno Setup Compiler (iscc.exe). -error.iscc-not-found.advice=Download Inno Setup 5 or later from http\://www.jrsoftware.org and add it to the PATH. - -error.license-missing=Specified license file is missing. -error.license-missing.advice=Make sure that "{0}" references a file in the app resources, and that it is relative file reference. - -error.copyright-is-too-long=The copyright string is too long for InnoSetup. -error.copyright-is-too-long.advice=Provide a copyright string shorter than 100 characters. - -error.too-many-content-types-for-file-association=More than one MIME types was specified for File Association number {0}. -error.too-many-content-types-for-file-association.advice=Specify one and only one MIME type for each file association. - -error.cannot-create-output-dir=Output directory {0} cannot be created. -error.cannot-write-to-output-dir=Output directory {0} is not writable. - -message.tool-version=Detected [{0}] version [{1}] -message.running-wsh-script=Running WSH script on application image [{0}] -message.wrong-tool-version=Detected [{0}] version {1} but version {2} is required. -message.use-wix36-features=WiX 3.6 detected. Enabling advanced cleanup action. -message.version-string-too-many-components=Version sting may have up to 3 components - major.minor.build . -message.debug-working-directory=Kept working directory for debug\: {0} -message.one-shortcut-required=At least one type of shortcut is required. Enabling menu shortcut. -message.creating-association-with-null-extension=Creating association with null extension. -message.truncating.id=Truncating Application ID to 126 chars for Inno Setup. diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/windows/WinExeBundler_zh_CN.properties --- a/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/windows/WinExeBundler_zh_CN.properties Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,91 +0,0 @@ -# -# Copyright (c) 2017, 2018, 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. -# -# - -bundler.name=EXE Installer -bundler.description=Microsoft Windows EXE Installer, via InnoIDE. - -param.system-wide.name=System Wide -param.system-wide.description=Should this application attempt to install itself system wide, or only for each user? Null means use the system default. - -param.app-bundler.name=Exe Installer Bundler -param.app-bundler.description=Exe Installer Bundler - -param.config-root.name=Config Root -param.config-root.description=Config Root - -param.image-dir.name=Image Dir -param.image-dir.description=Image Dir - -param.app-dir.name=App Dir -param.app-dir.description=App Dir - -param.menu-shortcut-hint.name=Menu Hint -param.menu-shortcut-hint.description=If the bundler can add the application to the system menu, should it? - -param.desktop-shortcut-hint.name=Shortcut Hint -param.desktop-shortcut-hint.description=If the bundler can create desktop shortcuts, should it make one? - -param.upgrade-uuid.name=Upgrade UUID -param.upgrade-uuid.description=The UUID associated with upgrades for this package. - -param.product-version.name=Product Version -param.product-version.description=The version of the application as seen by Windows and MSI, of the form "1.2.3" - -param.iscc-path.name=InnoSetup iscc.exe location -param.iscc-path.description=File path to iscc.exe from the InnoSetup tool. - -resource.inno-setup-project-file=Inno Setup project file -resource.setup-icon=setup dialog icon -resource.post-install-script=script to run after application image is populated - -error.parameters-null=Parameters map is null. -error.parameters-null.advice=Pass in a non-null parameters map. - -error.iscc-not-found=Can not find Inno Setup Compiler (iscc.exe). -error.iscc-not-found.advice=Download Inno Setup 5 or later from http\://www.jrsoftware.org and add it to the PATH. - -error.license-missing=Specified license file is missing. -error.license-missing.advice=Make sure that "{0}" references a file in the app resources, and that it is relative file reference. - -error.copyright-is-too-long=The copyright string is too long for InnoSetup. -error.copyright-is-too-long.advice=Provide a copyright string shorter than 100 characters. - -error.too-many-content-types-for-file-association=More than one MIME types was specified for File Association number {0}. -error.too-many-content-types-for-file-association.advice=Specify one and only one MIME type for each file association. - -error.cannot-create-output-dir=Output directory {0} cannot be created. -error.cannot-write-to-output-dir=Output directory {0} is not writable. - -message.tool-wrong-version=Detected [{0}] version {1} but version {2} is required. -message.debug-working-directory=Kept working directory for debug\: {0} -message.outputting-to-location=Generating EXE for installer to\: {0} -message.output-location=Installer (.exe) saved to\: {0} -message.tool-version=\ Detected [{0}] version [{1}] -message.one-shortcut-required=At least one type of shortcut is required. Enabling menu shortcut. -message.running-wsh-script=Running WSH script on application image [{0}] -message.iscc-file-string=\ InnoSetup compiler set to {0} -message.creating-association-with-null-extension=Creating association with null extension. -message.potential.windows.defender.issue=Warning: Windows Defender may prevent the Java Packager from functioning. If there is an issue, it can be addressed by either disabling realtime monitoring, or adding an exclusion for the directory "{0}". diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/windows/WinLauncher.properties --- a/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/windows/WinLauncher.properties Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -# -# Copyright (c) 2017, 2018, 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. -# -# - -Comments=COMMENTS -CompanyName=COMPANY_NAME -FileDescription=FILE_DESCRIPTION -FileVersion=FILE_VERSION -InternalName=INTERNAL_NAME -LegalCopyright=LEGAL_COPYRIGHT -LegalTrademarks=LEGAL_TRADEMARK -OriginalFilename=ORIGINAL_FILENAME -PrivateBuild=PRIVATE_BUILD -ProductName=PRODUCT_NAME -ProductVersion=PRODUCT_VERSION -SpecialBuild=SPECIAL_BUILD diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/windows/WinMsiBundler.properties --- a/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/windows/WinMsiBundler.properties Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,100 +0,0 @@ -# -# Copyright (c) 2017, 2018, 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. -# -# - -bundler.name=MSI Installer -bundler.description=Microsoft Windows MSI Installer, via WiX. - -param.system-wide.name=System Wide -param.system-wide.description=Should this application attempt to install itself system wide, or only for each user? Null means use the system default. - -param.app-bundler.name=MSI App Bundler -param.app-bundler.description=MSI App Bundler - -param.can-use-wix36.name=Can Use Wix -param.can-use-wix36.description=Can Use Wix - -param.config-root.name=Config Root Dir -param.config-root.description=Config Root Dir - -param.image-dir.name=Image Dir -param.image-dir.description=Image Dir - -param.app-dir.name=App Dir -param.app-dir.description=App Dir - -param.menu-shortcut-hint.name=Menu Hint -param.menu-shortcut-hint.description=If the bundler can add the application to the system menu, should it? - -param.desktop-shortcut-hint.name=Shortcut Hint -param.desktop-shortcut-hint.description=If the bundler can create desktop shortcuts, should it make one? - -param.upgrade-uuid.name=Upgrade UUID -param.upgrade-uuid.description=The UUID associated with upgrades for this package. - -param.product-version.name=Product Version -param.product-version.description=The version of the application as seen by Windows and MSI, of the form "1.2.3" - -param.candle-path.name=WiX candle.exe location -param.candle-path.description=File path to candle.exe from the WiX toolset. - -param.light-path.name=WiX light.exe location -param.light-path.description=File path to light.exe from the WiX toolset. - -resource.post-install-script=script to run after application image is populated -resource.wix-config-file=WiX config file - -error.parameters-null=Parameters map is null. -error.parameters-null.advice=Pass in a non-null parameters map. -error.no-wix-tools=Can not find WiX tools (light.exe, candle.exe). -error.no-wix-tools.advice=Download WiX 3.0 or later from http\://wix.sf.net and add it to the PATH. -error.version-string-wrong-format=Version string is not compatible with MSI rules [{0}]. -error.version-string-wrong-format.advice=Set the bundler argument "{0}" according to these rules: http\://msdn.microsoft.com/en-us/library/aa370859%28v\=VS.85%29.aspx -error.version-string-major-out-of-range=Major version must be in the range [0, 255] -error.version-string-build-out-of-range=Build part of version must be in the range [0, 65535] -error.version-string-minor-out-of-range=Minor version must be in the range [0, 255] -error.version-string-part-not-number=Failed to convert version component to int. -error.cannot-walk-directory=Can not walk [{0}] - it is not a valid directory -error.cannot-create-output-dir=Output directory {0} cannot be created. -error.cannot-write-to-output-dir=Output directory {0} is not writable. -error.too-many-content-types-for-file-association=More than one MIME types was specified for File Association number {0}. -error.too-many-content-types-for-file-association.advice=Specify one and only one MIME type for each file association. -error.license-missing=can not find license file {0}. -error.license-missing.advice=include license file {0} in the --files argument. - - -message.tool-version=Detected [{0}] version [{1}] -message.running-wsh-script=Running WSH script on application image [{0}] -message.wrong-tool-version=Detected [{0}] version {1} but version {2} is required. -message.use-wix36-features=WiX 3.6 detected. Enabling advanced cleanup action. -message.version-string-too-many-components=Version sting may have up to 3 components - major.minor.build . -message.debug-working-directory=Kept working directory for debug\: {0} -message.generated-product-guid=Generated product GUID\: {0} -message.preparing-msi-config=Preparing MSI config\: {0} -message.generating-msi=Generating MSI\: {0} -message.one-shortcut-required=At least one type of shortcut is required. Enabling menu shortcut. -message.light-file-string=WiX light tool set to {0} -message.candle-file-string=WiX candle tool set to {0} -message.creating-association-with-null-extension=Creating association with null extension. diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/windows/WinMsiBundler_ja.properties --- a/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/windows/WinMsiBundler_ja.properties Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,91 +0,0 @@ -# -# Copyright (c) 2017, 2018, 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. -# -# - -bundler.name=MSI\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9 -bundler.description=WiX\u3092\u4F7F\u7528\u3057\u305FMicrosoft Windows MSI\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9\u3002 - -param.system-wide.name=\u30B7\u30B9\u30C6\u30E0\u5168\u4F53 -param.system-wide.description=\u3053\u306E\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306F\u3001\u305D\u308C\u81EA\u4F53\u3092\u30B7\u30B9\u30C6\u30E0\u5168\u4F53\u306B\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3057\u307E\u3059\u304B\u3001\u307E\u305F\u306F\u5404\u30E6\u30FC\u30B6\u30FC\u306B\u5BFE\u3057\u3066\u306E\u307F\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3057\u307E\u3059\u304B\u3002Null\u306F\u30B7\u30B9\u30C6\u30E0\u30FB\u30C7\u30D5\u30A9\u30EB\u30C8\u3092\u4F7F\u7528\u3059\u308B\u3053\u3068\u3092\u610F\u5473\u3057\u307E\u3059\u3002 - -param.app-bundler.name=MSI App Bundler -param.app-bundler.description=MSI App Bundler - -param.can-use-wix36.name=Can Use Wix -param.can-use-wix36.description=Can Use Wix - -param.config-root.name=Config Root Dir -param.config-root.description=Config Root Dir - -param.image-dir.name=Image Dir -param.image-dir.description=Image Dir - -param.app-dir.name=App Dir -param.app-dir.description=App Dir - -param.upgrade-uuid.name=\u30A2\u30C3\u30D7\u30B0\u30EC\u30FC\u30C9UUID -param.upgrade-uuid.description=\u3053\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u30A2\u30C3\u30D7\u30B0\u30EC\u30FC\u30C9\u306B\u95A2\u9023\u4ED8\u3051\u3089\u308C\u3066\u3044\u308BUUID\u3002 - -param.product-version.name=\u88FD\u54C1\u30D0\u30FC\u30B8\u30E7\u30F3 -param.product-version.description=Windows\u304A\u3088\u3073MSI\u306B\u8868\u793A\u3055\u308C\u308B\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u30D0\u30FC\u30B8\u30E7\u30F3(\u5F62\u5F0F\u306F"1.2.3") - -param.candle-path.name=WiX candle.exe\u306E\u5834\u6240 -param.candle-path.description=WiX\u30C4\u30FC\u30EB\u30BB\u30C3\u30C8\u304B\u3089\u306Ecandle.exe\u3078\u306E\u30D5\u30A1\u30A4\u30EB\u30FB\u30D1\u30B9\u3002 - -param.light-path.name=WiX light.exe\u306E\u5834\u6240 -param.light-path.description=WiX\u30C4\u30FC\u30EB\u30BB\u30C3\u30C8\u304B\u3089\u306Elight.exe\u3078\u306E\u30D5\u30A1\u30A4\u30EB\u30FB\u30D1\u30B9\u3002 - -resource.post-install-script=\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30A4\u30E1\u30FC\u30B8\u3092\u79FB\u5165\u3057\u305F\u5F8C\u306B\u5B9F\u884C\u3059\u308B\u30B9\u30AF\u30EA\u30D7\u30C8 -resource.wix-config-file=WiX\u69CB\u6210\u30D5\u30A1\u30A4\u30EB - -error.parameters-null=\u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30DE\u30C3\u30D7\u304Cnull\u3067\u3059\u3002 -error.parameters-null.advice=\u975Enull\u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30DE\u30C3\u30D7\u3067\u6E21\u3057\u3066\u304F\u3060\u3055\u3044\u3002 -error.no-wix-tools=WiX\u30C4\u30FC\u30EB(light.exe\u3001candle.exe)\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002 -error.no-wix-tools.advice=WiX 3.0\u4EE5\u964D\u3092http://wix.sf.net\u304B\u3089\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u3057\u3001PATH\u306B\u8FFD\u52A0\u3057\u307E\u3059\u3002 -error.version-string-wrong-format=\u30D0\u30FC\u30B8\u30E7\u30F3\u6587\u5B57\u5217\u306FMSI\u898F\u5247[{0}]\u3068\u4E92\u63DB\u6027\u304C\u3042\u308A\u307E\u305B\u3093\u3002 -error.version-string-wrong-format.advice=\u30D0\u30F3\u30C9\u30E9\u5F15\u6570"{0}"\u3092\u6B21\u306E\u898F\u5247\u306B\u5F93\u3063\u3066\u8A2D\u5B9A\u3057\u307E\u3059: http://msdn.microsoft.com/en-us/library/aa370859%28v=VS.85%29.aspx -error.version-string-major-out-of-range=\u30E1\u30B8\u30E3\u30FC\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3\u306F\u7BC4\u56F2[0, 255]\u5185\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059 -error.version-string-build-out-of-range=\u30D0\u30FC\u30B8\u30E7\u30F3\u306E\u30D3\u30EB\u30C9\u90E8\u5206\u306F\u7BC4\u56F2[0, 65535]\u5185\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059 -error.version-string-minor-out-of-range=\u30DE\u30A4\u30CA\u30FC\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3\u306F\u7BC4\u56F2[0, 255]\u5185\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059 -error.version-string-part-not-number=\u30D0\u30FC\u30B8\u30E7\u30F3\u30FB\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306Eint\u3078\u306E\u5909\u63DB\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002 -error.cannot-walk-directory=[{0}]\u3067\u79FB\u52D5\u3067\u304D\u307E\u305B\u3093 - \u6709\u52B9\u306A\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3067\u306F\u3042\u308A\u307E\u305B\u3093 -error.cannot-create-output-dir=\u51FA\u529B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA{0}\u3092\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093\u3002 -error.cannot-write-to-output-dir=\u51FA\u529B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA{0}\u306F\u66F8\u8FBC\u307F\u4E0D\u53EF\u3067\u3059\u3002 -error.too-many-content-types-for-file-association=\u30D5\u30A1\u30A4\u30EB\u30FB\u30A2\u30BD\u30B7\u30A8\u30FC\u30B7\u30E7\u30F3\u756A\u53F7{0}\u306B\u8907\u6570\u306EMIME\u30BF\u30A4\u30D7\u304C\u6307\u5B9A\u3055\u308C\u307E\u3057\u305F\u3002 -error.too-many-content-types-for-file-association.advice=Linux\u30D0\u30F3\u30C9\u30EB\u306E\u5834\u5408\u3001\u5404\u30D5\u30A1\u30A4\u30EB\u30FB\u30A2\u30BD\u30B7\u30A8\u30FC\u30B7\u30E7\u30F3\u306BMIME\u30BF\u30A4\u30D7\u30921\u3064\u3060\u3051\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002 - -message.tool-version=[{0}]\u30D0\u30FC\u30B8\u30E7\u30F3[{1}]\u304C\u691C\u51FA\u3055\u308C\u307E\u3057\u305F -message.running-wsh-script=\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30A4\u30E1\u30FC\u30B8[{0}]\u3067WSH\u30B9\u30AF\u30EA\u30D7\u30C8\u3092\u5B9F\u884C\u3057\u3066\u3044\u307E\u3059 -message.wrong-tool-version=[{0}]\u30D0\u30FC\u30B8\u30E7\u30F3{1}\u304C\u691C\u51FA\u3055\u308C\u307E\u3057\u305F\u304C\u3001\u30D0\u30FC\u30B8\u30E7\u30F3{2}\u304C\u5FC5\u8981\u3067\u3059\u3002 -message.use-wix36-features=WiX 3.6\u304C\u691C\u51FA\u3055\u308C\u307E\u3057\u305F\u3002\u62E1\u5F35\u30AF\u30EA\u30FC\u30F3\u30A2\u30C3\u30D7\u30FB\u30A2\u30AF\u30B7\u30E7\u30F3\u3092\u6709\u52B9\u5316\u3057\u3066\u3044\u307E\u3059\u3002 -message.version-string-too-many-components=\u30D0\u30FC\u30B8\u30E7\u30F3\u6587\u5B57\u5217\u306B\u306F\u3001\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u30923\u3064(\u30E1\u30B8\u30E3\u30FC.\u30DE\u30A4\u30CA\u30FC.\u30D3\u30EB\u30C9)\u307E\u3067\u542B\u3081\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002 -message.debug-working-directory=\u30C7\u30D0\u30C3\u30B0\u306E\u4F5C\u696D\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304C\u4FDD\u6301\u3055\u308C\u307E\u3057\u305F: {0} -message.generated-product-guid=\u88FD\u54C1GUID\u3092\u751F\u6210\u3057\u307E\u3057\u305F: {0} -message.preparing-msi-config=MSI\u69CB\u6210\u3092\u6E96\u5099\u3057\u3066\u3044\u307E\u3059: {0} -message.generating-msi=MSI\u3092\u751F\u6210\u3057\u3066\u3044\u307E\u3059: {0} -message.one-shortcut-required=\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u30B7\u30E7\u30FC\u30C8\u30AB\u30C3\u30C8\u30FB\u30BF\u30A4\u30D7\u304C\u5FC5\u8981\u3067\u3059\u3002\u30E1\u30CB\u30E5\u30FC\u30FB\u30B7\u30E7\u30FC\u30C8\u30AB\u30C3\u30C8\u3092\u6709\u52B9\u5316\u3057\u3066\u3044\u307E\u3059\u3002 -message.light-file-string=WiX light\u30C4\u30FC\u30EB\u304C{0}\u306B\u8A2D\u5B9A\u3055\u308C\u307E\u3057\u305F -message.candle-file-string=WiX candle\u30C4\u30FC\u30EB\u304C{0}\u306B\u8A2D\u5B9A\u3055\u308C\u307E\u3057\u305F -message.creating-association-with-null-extension=null\u62E1\u5F35\u5B50\u3068\u306E\u95A2\u9023\u4ED8\u3051\u3092\u4F5C\u6210\u3057\u3066\u3044\u307E\u3059\u3002 diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/windows/WinMsiBundler_zh_CN.properties --- a/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/windows/WinMsiBundler_zh_CN.properties Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,91 +0,0 @@ -# -# Copyright (c) 2017, 2018, 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. -# -# - -bundler.name=MSI \u5B89\u88C5\u7A0B\u5E8F -bundler.description=Microsoft Windows MSI \u5B89\u88C5\u7A0B\u5E8F, \u901A\u8FC7 WiX\u3002 - -param.system-wide.name=\u7CFB\u7EDF\u8303\u56F4 -param.system-wide.description=\u6B64\u5E94\u7528\u7A0B\u5E8F\u662F\u5E94\u5C1D\u8BD5\u5728\u7CFB\u7EDF\u8303\u56F4\u5185\u5B89\u88C5, \u8FD8\u662F\u4EC5\u4E3A\u6BCF\u4E2A\u7528\u6237\u5B89\u88C5? \u7A7A\u503C\u8868\u793A\u4F7F\u7528\u7CFB\u7EDF\u9ED8\u8BA4\u503C\u3002 - -param.app-bundler.name=MSI App Bundler -param.app-bundler.description=MSI App Bundler - -param.can-use-wix36.name=Can Use Wix -param.can-use-wix36.description=Can Use Wix - -param.config-root.name=Config Root Dir -param.config-root.description=Config Root Dir - -param.image-dir.name=Image Dir -param.image-dir.description=Image Dir - -param.app-dir.name=App Dir -param.app-dir.description=App Dir - -param.upgrade-uuid.name=\u5347\u7EA7 UUID -param.upgrade-uuid.description=\u4E0E\u6B64\u7A0B\u5E8F\u5305\u7684\u5347\u7EA7\u5173\u8054\u7684 UUID\u3002 - -param.product-version.name=\u4EA7\u54C1\u7248\u672C -param.product-version.description=\u5411 Windows \u548C MSI \u663E\u793A\u7684\u5E94\u7528\u7A0B\u5E8F\u7684\u7248\u672C, \u5F62\u5F0F\u4E3A "1.2.3" - -param.candle-path.name=WiX candle.exe \u4F4D\u7F6E -param.candle-path.description=WiX \u5DE5\u5177\u96C6\u4E2D candle.exe \u7684\u6587\u4EF6\u8DEF\u5F84\u3002 - -param.light-path.name=WiX light.exe \u4F4D\u7F6E -param.light-path.description=WiX \u5DE5\u5177\u96C6\u4E2D light.exe \u7684\u6587\u4EF6\u8DEF\u5F84\u3002 - -resource.post-install-script=\u8981\u5728\u586B\u5145\u5E94\u7528\u7A0B\u5E8F\u6620\u50CF\u4E4B\u540E\u8FD0\u884C\u7684\u811A\u672C -resource.wix-config-file=WiX \u914D\u7F6E\u6587\u4EF6 - -error.parameters-null=\u53C2\u6570\u6620\u5C04\u4E3A\u7A7A\u503C\u3002 -error.parameters-null.advice=\u8BF7\u4F20\u5165\u975E\u7A7A\u53C2\u6570\u6620\u5C04\u3002 -error.no-wix-tools=\u627E\u4E0D\u5230 WiX \u5DE5\u5177 (light.exe, candle.exe)\u3002 -error.no-wix-tools.advice=\u4ECE http://wix.sf.net \u4E0B\u8F7D WiX 3.0 \u6216\u66F4\u9AD8\u7248\u672C, \u7136\u540E\u5C06\u5176\u6DFB\u52A0\u5230 PATH\u3002 -error.version-string-wrong-format=\u7248\u672C\u5B57\u7B26\u4E32\u4E0D\u7B26\u5408 MSI \u89C4\u5219 [{0}]\u3002 -error.version-string-wrong-format.advice=\u6839\u636E\u4EE5\u4E0B\u89C4\u5219\u8BBE\u7F6E\u6253\u5305\u7A0B\u5E8F\u53C2\u6570 "{0}": http://msdn.microsoft.com/en-us/library/aa370859%28v=VS.85%29.aspx -error.version-string-major-out-of-range=\u4E3B\u7248\u672C\u5FC5\u987B\u4F4D\u4E8E [0, 255] \u8303\u56F4\u4E2D -error.version-string-build-out-of-range=\u7248\u672C\u7684\u5DE5\u4F5C\u7248\u672C\u90E8\u5206\u5FC5\u987B\u4F4D\u4E8E [0, 65535] \u8303\u56F4\u4E2D -error.version-string-minor-out-of-range=\u6B21\u7248\u672C\u5FC5\u987B\u4F4D\u4E8E [0, 255] \u8303\u56F4\u4E2D -error.version-string-part-not-number=\u65E0\u6CD5\u5C06\u7248\u672C\u7EC4\u6210\u90E8\u5206\u8F6C\u6362\u4E3A\u6574\u6570\u3002 -error.cannot-walk-directory=\u65E0\u6CD5\u904D\u5386 [{0}] - \u5B83\u4E0D\u662F\u6709\u6548\u7684\u76EE\u5F55 -error.cannot-create-output-dir=\u65E0\u6CD5\u521B\u5EFA\u8F93\u51FA\u76EE\u5F55 {0}\u3002 -error.cannot-write-to-output-dir=\u8F93\u51FA\u76EE\u5F55 {0} \u4E0D\u53EF\u5199\u3002 -error.too-many-content-types-for-file-association=\u4E3A\u6587\u4EF6\u5173\u8054\u53F7{0}\u6307\u5B9A\u4E86\u591A\u4E2A MIME \u7C7B\u578B\u3002 -error.too-many-content-types-for-file-association.advice=\u5BF9\u4E8E Linux \u6253\u5305, \u8BF7\u4E3A\u6BCF\u4E2A\u6587\u4EF6\u5173\u8054\u6307\u5B9A\u4E00\u4E2A\u4E14\u4EC5\u6307\u5B9A\u4E00\u4E2A MIME \u7C7B\u578B\u3002 - -message.tool-version=\u68C0\u6D4B\u5230 [{0}] \u7248\u672C [{1}] -message.running-wsh-script=\u5728\u5E94\u7528\u7A0B\u5E8F\u6620\u50CF [{0}] \u4E0A\u8FD0\u884C WSH \u811A\u672C -message.wrong-tool-version=\u68C0\u6D4B\u5230 [{0}] \u7248\u672C {1}, \u4F46\u9700\u8981\u7248\u672C {2}\u3002 -message.use-wix36-features=\u68C0\u6D4B\u5230 WiX 3.6\u3002\u6B63\u5728\u542F\u7528\u9AD8\u7EA7\u6E05\u9664\u64CD\u4F5C\u3002 -message.version-string-too-many-components=\u7248\u672C\u5B57\u7B26\u4E32\u6700\u591A\u53EF\u4EE5\u5177\u6709 3 \u4E2A\u7EC4\u6210\u90E8\u5206 - major.minor.build\u3002 -message.debug-working-directory=\u7528\u4E8E\u8C03\u8BD5\u7684\u5DF2\u4FDD\u7559\u5DE5\u4F5C\u76EE\u5F55: {0} -message.generated-product-guid=\u5DF2\u751F\u6210\u4EA7\u54C1 GUID: {0} -message.preparing-msi-config=\u6B63\u5728\u51C6\u5907 MSI \u914D\u7F6E: {0} -message.generating-msi=\u6B63\u5728\u751F\u6210 MSI: {0} -message.one-shortcut-required=\u81F3\u5C11\u9700\u8981\u4E00\u79CD\u7C7B\u578B\u7684\u5FEB\u6377\u65B9\u5F0F\u3002\u6B63\u5728\u542F\u7528\u83DC\u5355\u5FEB\u6377\u65B9\u5F0F\u3002 -message.light-file-string=WiX light \u5DE5\u5177\u8BBE\u7F6E\u4E3A{0} -message.candle-file-string=WiX candle \u5DE5\u5177\u8BBE\u7F6E\u4E3A{0} -message.creating-association-with-null-extension=\u6B63\u5728\u4F7F\u7528\u7A7A\u6269\u5C55\u540D\u521B\u5EFA\u5173\u8054\u3002 diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/windows/WinResources.java --- a/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/windows/WinResources.java Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2011, 2018, 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.jpackager.internal.resources.windows; - -public class WinResources { - -} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/windows/WindowsBundlerParam.properties --- a/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/windows/WindowsBundlerParam.properties Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -# -# Copyright (c) 2017, 2018, 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. -# -# - -param.menu-group.name=Menu Group -param.menu-group.description=The Start Menu group this application should be placed in -param.menu-group.default=Unknown - -param.64-bit.name=64-bit -param.64-bit.description=Prepare the bundles for 64 bit windows. - -param.runtime-64-bit.name=runtime 64-bit -param.runtime-64-bit.description=Embedded JRE runtime is 64-bit, used to detect bit architecture mismatches. - -param.installer-name.name=Installer Name -param.installer-name.description=The filename of the generated installer without the file type extension. Default is -. - -param.registry-name.name=Registry Name -param.registry-name.description=The name of the application for registry references. Default is the Application Name with only alphanumerics, dots, and dashes (no whitespace). - -param.installdir-chooser.name=Install Directory Chooser -param.installdir-chooser.description=Adds a dialog to let the user choose a directory where the product will be installed. diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/windows/WindowsBundlerParam_ja.properties --- a/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/windows/WindowsBundlerParam_ja.properties Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -# -# Copyright (c) 2017, 2018, 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. -# -# - -param.menu-group.name=\u30E1\u30CB\u30E5\u30FC\u30FB\u30B0\u30EB\u30FC\u30D7 -param.menu-group.description=\u3053\u306E\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u3092\u914D\u7F6E\u3059\u308B\u5FC5\u8981\u304C\u3042\u308B\u8D77\u52D5\u30E1\u30CB\u30E5\u30FC\u30FB\u30B0\u30EB\u30FC\u30D7 -param.menu-group.default=\u4E0D\u660E - -param.64-bit.name=64\u30D3\u30C3\u30C8 -param.64-bit.description=64\u30D3\u30C3\u30C8\u306EWindows\u7528\u306E\u30D0\u30F3\u30C9\u30EB\u3092\u6E96\u5099\u3057\u307E\u3059\u3002 - -param.runtime-64-bit.name=\u30E9\u30F3\u30BF\u30A4\u30E064\u30D3\u30C3\u30C8 -param.runtime-64-bit.description=\u57CB\u8FBC\u307FJRE\u30E9\u30F3\u30BF\u30A4\u30E0\u306F64\u30D3\u30C3\u30C8\u3067\u3001\u30D3\u30C3\u30C8\u30FB\u30A2\u30FC\u30AD\u30C6\u30AF\u30C1\u30E3\u306E\u4E0D\u4E00\u81F4\u306E\u691C\u51FA\u306B\u4F7F\u7528\u3055\u308C\u307E\u3059\u3002 - -param.installer-name.name=\u30A4\u30F3\u30B9\u30C8\u30FC\u30E9\u540D -param.installer-name.description=\u30D5\u30A1\u30A4\u30EB\u30FB\u30BF\u30A4\u30D7\u62E1\u5F35\u5B50\u306A\u3057\u306E\u751F\u6210\u3055\u308C\u305F\u30A4\u30F3\u30B9\u30C8\uFF0D\u30E9\u306E\u30D5\u30A1\u30A4\u30EB\u540D\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u306F-\u3067\u3059\u3002 - -param.registry-name.name=\u30EC\u30B8\u30B9\u30C8\u30EA\u540D -param.registry-name.description=\u30EC\u30B8\u30B9\u30C8\u30EA\u53C2\u7167\u7528\u306E\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u540D\u524D\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u306F\u3001\u82F1\u6570\u5B57\u3001\u30C9\u30C3\u30C8\u304A\u3088\u3073\u30C0\u30C3\u30B7\u30E5(\u7A7A\u767D\u306A\u3057)\u306E\u307F\u3092\u4F7F\u7528\u3057\u305F\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u540D\u3067\u3059\u3002 - -param.installdir-chooser.name=\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u30FB\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u9078\u629E -param.installdir-chooser.description=\u30E6\u30FC\u30B6\u30FC\u304C\u88FD\u54C1\u3092\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3059\u308B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u9078\u629E\u3059\u308B\u305F\u3081\u306E\u30C0\u30A4\u30A2\u30ED\u30B0\u3092\u8FFD\u52A0\u3057\u307E\u3059\u3002 diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/windows/WindowsBundlerParam_zh_CN.properties --- a/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/windows/WindowsBundlerParam_zh_CN.properties Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -# -# Copyright (c) 2017, 2018, 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. -# -# - -param.menu-group.name=\u83DC\u5355\u7EC4 -param.menu-group.description=\u5E94\u5C06\u6B64\u5E94\u7528\u7A0B\u5E8F\u653E\u7F6E\u5230\u7684\u5F00\u59CB\u83DC\u5355\u7EC4 -param.menu-group.default=\u672A\u77E5 - -param.64-bit.name=64 \u4F4D -param.64-bit.description=\u51C6\u5907\u9002\u7528\u4E8E 64 \u4F4D Windows \u7684\u5305\u3002 - -param.runtime-64-bit.name=\u8FD0\u884C\u65F6 64 \u4F4D -param.runtime-64-bit.description=\u5D4C\u5165\u5F0F JRE \u8FD0\u884C\u65F6\u4E3A 64 \u4F4D, \u7528\u4E8E\u68C0\u6D4B\u4F4D\u4F53\u7CFB\u7ED3\u6784\u4E0D\u5339\u914D\u60C5\u51B5\u3002 - -param.installer-name.name=\u5B89\u88C5\u7A0B\u5E8F\u540D\u79F0 -param.installer-name.description=\u6240\u751F\u6210\u5B89\u88C5\u7A0B\u5E8F\u4E0D\u5E26\u6587\u4EF6\u7C7B\u578B\u6269\u5C55\u540D\u7684\u6587\u4EF6\u540D\u3002\u9ED8\u8BA4\u503C\u4E3A <\u5E94\u7528\u7A0B\u5E8F\u540D\u79F0>-<\u7248\u672C>\u3002 - -param.registry-name.name=\u6CE8\u518C\u8868\u540D\u79F0 -param.registry-name.description=\u7528\u4E8E\u6CE8\u518C\u8868\u5F15\u7528\u7684\u5E94\u7528\u7A0B\u5E8F\u7684\u540D\u79F0\u3002\u9ED8\u8BA4\u503C\u4E3A\u53EA\u5305\u542B\u5B57\u6BCD\u6570\u5B57, \u70B9\u548C\u77ED\u5212\u7EBF (\u65E0\u7A7A\u683C) \u7684\u5E94\u7528\u7A0B\u5E8F\u540D\u79F0\u3002 - -param.installdir-chooser.name=\u5B89\u88C5\u76EE\u5F55\u9009\u62E9\u5668 -param.installdir-chooser.description=\u6DFB\u52A0\u5BF9\u8BDD\u6846\u4EE5\u5141\u8BB8\u7528\u6237\u9009\u62E9\u5C06\u5728\u5176\u4E2D\u5B89\u88C5\u4EA7\u54C1\u7684\u76EE\u5F55\u3002 diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/windows/icon_inno_setup.bmp Binary file src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/windows/icon_inno_setup.bmp has changed diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/windows/javalogo_white_16.ico Binary file src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/windows/javalogo_white_16.ico has changed diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/windows/javalogo_white_32.ico Binary file src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/windows/javalogo_white_32.ico has changed diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/windows/javalogo_white_48.ico Binary file src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/windows/javalogo_white_48.ico has changed diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/windows/template.iss --- a/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/windows/template.iss Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ -;This file will be executed next to the application bundle image -;I.e. current directory will contain folder INSTALLER_NAME with application files -[Setup] -AppId={{PRODUCT_APP_IDENTIFIER}} -AppName=INSTALLER_NAME -AppVersion=APPLICATION_VERSION -AppVerName=INSTALLER_NAME APPLICATION_VERSION -AppPublisher=APPLICATION_VENDOR -AppComments=APPLICATION_COMMENTS -AppCopyright=APPLICATION_COPYRIGHT -DefaultDirName=APPLICATION_INSTALL_ROOT\INSTALLER_NAME -DisableStartupPrompt=Yes -DisableDirPage=DISABLE_DIR_PAGE -DisableProgramGroupPage=Yes -DisableReadyPage=Yes -DisableFinishedPage=Yes -DisableWelcomePage=Yes -DefaultGroupName=APPLICATION_GROUP -;Optional License -LicenseFile=APPLICATION_LICENSE_FILE -;WinXP or above -MinVersion=0,5.1 -OutputBaseFilename=INSTALLER_FILE_NAME -Compression=lzma -SolidCompression=yes -PrivilegesRequired=APPLICATION_INSTALL_PRIVILEGE -SetupIconFile=INSTALLER_NAME\LAUNCHER_NAME.ico -UninstallDisplayIcon={app}\LAUNCHER_NAME.ico -UninstallDisplayName=INSTALLER_NAME -WizardImageStretch=No -WizardSmallImageFile=INSTALLER_NAME-setup-icon.bmp -ArchitecturesInstallIn64BitMode=ARCHITECTURE_BIT_MODE -FILE_ASSOCIATIONS - -[Languages] -Name: "english"; MessagesFile: "compiler:Default.isl" - -[Files] -Source: "INSTALLER_NAME\LAUNCHER_NAME.exe"; DestDir: "{app}"; Flags: ignoreversion -Source: "INSTALLER_NAME\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs - -[Icons] -Name: "{group}\INSTALLER_NAME"; Filename: "{app}\LAUNCHER_NAME.exe"; IconFilename: "{app}\LAUNCHER_NAME.ico"; Check: APPLICATION_MENU_SHORTCUT() -Name: "{commondesktop}\INSTALLER_NAME"; Filename: "{app}\LAUNCHER_NAME.exe"; IconFilename: "{app}\LAUNCHER_NAME.ico"; Check: APPLICATION_DESKTOP_SHORTCUT() -SECONDARY_LAUNCHERS - -[Run] -Filename: "{app}\RUN_FILENAME.exe"; Parameters: "-Xappcds:generatecache"; Check: APPLICATION_APP_CDS_INSTALL() -Filename: "{app}\RUN_FILENAME.exe"; Description: "{cm:LaunchProgram,INSTALLER_NAME}"; Flags: nowait postinstall skipifsilent; Check: APPLICATION_NOT_SERVICE() -Filename: "{app}\RUN_FILENAME.exe"; Parameters: "-install -svcName ""INSTALLER_NAME"" -svcDesc ""APPLICATION_DESCRIPTION"" -mainExe ""APPLICATION_LAUNCHER_FILENAME"" START_ON_INSTALL RUN_AT_STARTUP"; Check: APPLICATION_SERVICE() - -[UninstallRun] -Filename: "{app}\RUN_FILENAME.exe "; Parameters: "-uninstall -svcName INSTALLER_NAME STOP_ON_UNINSTALL"; Check: APPLICATION_SERVICE() - -[Code] -function returnTrue(): Boolean; -begin - Result := True; -end; - -function returnFalse(): Boolean; -begin - Result := False; -end; - -function InitializeSetup(): Boolean; -begin -// Possible future improvements: -// if version less or same => just launch app -// if upgrade => check if same app is running and wait for it to exit - Result := True; -end; diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/windows/template.jre.iss --- a/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/windows/template.jre.iss Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +0,0 @@ -;This file will be executed next to the application bundle image -;I.e. current directory will contain folder INSTALLER_NAME with application files -[Setup] -AppId={{PRODUCT_APP_IDENTIFIER}} -AppName=INSTALLER_NAME -AppVersion=APPLICATION_VERSION -AppVerName=INSTALLER_NAME APPLICATION_VERSION -AppPublisher=APPLICATION_VENDOR -AppComments=APPLICATION_COMMENTS -AppCopyright=APPLICATION_COPYRIGHT -DefaultDirName=APPLICATION_INSTALL_ROOT\INSTALLER_NAME -DisableStartupPrompt=Yes -DisableDirPage=DISABLE_DIR_PAGE -DisableProgramGroupPage=Yes -DisableReadyPage=Yes -DisableFinishedPage=Yes -DisableWelcomePage=Yes -DefaultGroupName=APPLICATION_GROUP -;Optional License -LicenseFile=APPLICATION_LICENSE_FILE -;WinXP or above -MinVersion=0,5.1 -OutputBaseFilename=INSTALLER_FILE_NAME -Compression=lzma -SolidCompression=yes -PrivilegesRequired=APPLICATION_INSTALL_PRIVILEGE -SetupIconFile= -UninstallDisplayIcon= -UninstallDisplayName=INSTALLER_NAME -WizardImageStretch=No -WizardSmallImageFile=INSTALLER_NAME-setup-icon.bmp -ArchitecturesInstallIn64BitMode=ARCHITECTURE_BIT_MODE -FILE_ASSOCIATIONS - -[Languages] -Name: "english"; MessagesFile: "compiler:Default.isl" - -[Files] -Source: "INSTALLER_NAME\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs - -[Code] -function returnTrue(): Boolean; -begin - Result := True; -end; - -function returnFalse(): Boolean; -begin - Result := False; -end; - -function InitializeSetup(): Boolean; -begin - Result := True; -end; diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/windows/template.jre.wxs --- a/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/windows/template.jre.wxs Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - WIX36_ONLY_START - - WIX36_ONLY_END - - - -UI_BLOCK - - diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/windows/template.wxs --- a/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/windows/template.wxs Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - WIX36_ONLY_START - - WIX36_ONLY_END - - - -UI_BLOCK - - -SECONDARY_LAUNCHER_ICONS - - diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/windows/windows.jre.list --- a/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/resources/windows/windows.jre.list Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -; This file contains Windows-specific modules. - -jdk.crypto.mscapi diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/windows/WinAppBundler.java --- a/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/windows/WinAppBundler.java Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,342 +0,0 @@ -/* - * Copyright (c) 2012, 2018, 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.jpackager.internal.windows; - -import jdk.jpackager.internal.AbstractImageBundler; -import jdk.jpackager.internal.BundlerParamInfo; -import jdk.jpackager.internal.ConfigException; -import jdk.jpackager.internal.IOUtils; -import jdk.jpackager.internal.Log; -import jdk.jpackager.internal.Platform; -import jdk.jpackager.internal.StandardBundlerParam; -import jdk.jpackager.internal.UnsupportedPlatformException; -import jdk.jpackager.internal.builders.windows.WindowsAppImageBuilder; -import jdk.jpackager.internal.resources.windows.WinResources; -import jdk.jpackager.internal.JLinkBundlerHelper; -import jdk.jpackager.internal.Arguments; -import jdk.jpackager.internal.builders.AbstractAppImageBuilder; - -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.IOException; -import java.io.PrintStream; -import java.text.MessageFormat; -import java.util.Arrays; -import java.util.Collection; -import java.util.Map; -import java.util.ResourceBundle; - -import static jdk.jpackager.internal.windows.WindowsBundlerParam.*; -import static jdk.jpackager.internal.windows.WinMsiBundler.WIN_APP_IMAGE; - -public class WinAppBundler extends AbstractImageBundler { - - private static final ResourceBundle I18N = - ResourceBundle.getBundle( - "jdk.jpackager.internal.resources.windows.WinAppBundler"); - - public static final BundlerParamInfo ICON_ICO = - new StandardBundlerParam<>( - I18N.getString("param.icon-ico.name"), - I18N.getString("param.icon-ico.description"), - "icon.ico", - File.class, - params -> { - File f = ICON.fetchFrom(params); - if (f != null && !f.getName().toLowerCase().endsWith(".ico")) { - Log.error(MessageFormat.format( - I18N.getString("message.icon-not-ico"), f)); - return null; - } - return f; - }, - (s, p) -> new File(s)); - - public WinAppBundler() { - super(); - baseResourceLoader = WinResources.class; - } - - public final static String WIN_BUNDLER_PREFIX = - BUNDLER_PREFIX + "windows/"; - - @Override - public boolean validate(Map params) - throws UnsupportedPlatformException, ConfigException { - try { - if (params == null) throw new ConfigException( - I18N.getString("error.parameters-null"), - I18N.getString("error.parameters-null.advice")); - - return doValidate(params); - } catch (RuntimeException re) { - if (re.getCause() instanceof ConfigException) { - throw (ConfigException) re.getCause(); - } else { - throw new ConfigException(re); - } - } - } - - // to be used by chained bundlers, e.g. by EXE bundler to avoid - // skipping validation if p.type does not include "image" - boolean doValidate(Map p) - throws UnsupportedPlatformException, ConfigException { - if (Platform.getPlatform() != Platform.WINDOWS) { - throw new UnsupportedPlatformException(); - } - - imageBundleValidation(p); - - if (StandardBundlerParam.getPredefinedAppImage(p) != null) { - return true; - } - - // Make sure that jpackager.exe exists. - File tool = new File( - System.getProperty("java.home") + "\\bin\\jpackager.exe"); - - if (!tool.exists()) { - throw new ConfigException( - I18N.getString("error.no-windows-resources"), - I18N.getString("error.no-windows-resources.advice")); - } - - // validate runtime bit-architectire - testRuntimeBitArchitecture(p); - - return true; - } - - private static void testRuntimeBitArchitecture( - Map params) throws ConfigException { - if ("true".equalsIgnoreCase(System.getProperty( - "fxpackager.disableBitArchitectureMismatchCheck"))) { - Log.debug(I18N.getString("message.disable-bit-architecture-check")); - return; - } - - if ((BIT_ARCH_64.fetchFrom(params) != - BIT_ARCH_64_RUNTIME.fetchFrom(params))) { - throw new ConfigException( - I18N.getString("error.bit-architecture-mismatch"), - I18N.getString("error.bit-architecture-mismatch.advice")); - } - } - - private static boolean usePredefineAppName(Map p) { - return (PREDEFINED_APP_IMAGE.fetchFrom(p) != null); - } - - private static String appName; - synchronized static String getAppName( - Map p) { - // If we building from predefined app image, then we should use names - // from image and not from CLI. - if (usePredefineAppName(p)) { - if (appName == null) { - // Use WIN_APP_IMAGE here, since we already copy pre-defined - // image to WIN_APP_IMAGE - File appImageDir = new File( - WIN_APP_IMAGE.fetchFrom(p).toString() + "\\app"); - File [] files = appImageDir.listFiles( - (File dir, String name) -> name.endsWith(".cfg")); - if (files == null || files.length == 0) { - throw new RuntimeException(MessageFormat.format( - I18N.getString("error.cannot-find-launcher"), - appImageDir)); - } else { - appName = files[0].getName(); - int index = appName.indexOf("."); - if (index != -1) { - appName = appName.substring(0, index); - } - if (files.length > 1) { - Log.error(MessageFormat.format(I18N.getString( - "message.multiple-launchers"), appName)); - } - } - return appName; - } else { - return appName; - } - } - - return APP_NAME.fetchFrom(p); - } - - public static String getLauncherName(Map p) { - return getAppName(p) + ".exe"; - } - - public static String getLauncherCfgName(Map p) { - return "app\\" + getAppName(p) +".cfg"; - } - - public boolean bundle(Map p, File outputDirectory) { - return doBundle(p, outputDirectory, false) != null; - } - - File doBundle(Map p, - File outputDirectory, boolean dependentTask) { - if (Arguments.CREATE_JRE_INSTALLER.fetchFrom(p)) { - return doJreBundle(p, outputDirectory, dependentTask); - } else { - return doAppBundle(p, outputDirectory, dependentTask); - } - } - - File doJreBundle(Map p, - File outputDirectory, boolean dependentTask) { - try { - File rootDirectory = createRoot(p, outputDirectory, dependentTask, - APP_NAME.fetchFrom(p), "windowsapp-image-builder"); - AbstractAppImageBuilder appBuilder = new WindowsAppImageBuilder( - APP_NAME.fetchFrom(p), - outputDirectory.toPath()); - File predefined = PREDEFINED_RUNTIME_IMAGE.fetchFrom(p); - if (predefined == null ) { - JLinkBundlerHelper.generateServerJre(p, appBuilder); - } else { - return predefined; - } - return rootDirectory; - } catch (Exception ex) { - Log.error("Exception: "+ex); - Log.verbose(ex); - return null; - } - } - - File doAppBundle(Map p, - File outputDirectory, boolean dependentTask) { - try { - File rootDirectory = createRoot(p, outputDirectory, dependentTask, - APP_NAME.fetchFrom(p), "windowsapp-image-builder"); - AbstractAppImageBuilder appBuilder = - new WindowsAppImageBuilder(p, outputDirectory.toPath()); - if (PREDEFINED_RUNTIME_IMAGE.fetchFrom(p) == null ) { - JLinkBundlerHelper.execute(p, appBuilder); - } else { - StandardBundlerParam.copyPredefinedRuntimeImage(p, appBuilder); - } - if (!dependentTask) { - Log.verbose(MessageFormat.format( - I18N.getString("message.result-dir"), - outputDirectory.getAbsolutePath())); - } - return rootDirectory; - } catch (Exception ex) { - Log.error("Exception: "+ex); - Log.verbose(ex); - return null; - } - } - - private static final String RUNTIME_AUTO_DETECT = ".runtime.autodetect"; - - public static void extractFlagsFromRuntime( - Map params) { - if (params.containsKey(".runtime.autodetect")) return; - - params.put(RUNTIME_AUTO_DETECT, "attempted"); - - String commandline; - File runtimePath = JLinkBundlerHelper.getJDKHome(params).toFile(); - File launcherPath = new File(runtimePath, "bin\\java.exe"); - - ProcessBuilder pb = - new ProcessBuilder(launcherPath.getAbsolutePath(), "-version"); - try (ByteArrayOutputStream baos = new ByteArrayOutputStream()) { - try (PrintStream pout = new PrintStream(baos)) { - IOUtils.exec(pb, Log.isDebug(), true, pout); - } - - commandline = baos.toString(); - } catch (IOException e) { - e.printStackTrace(); - params.put(RUNTIME_AUTO_DETECT, "failed"); - return; - } - - AbstractImageBundler.extractFlagsFromVersion(params, commandline); - params.put(RUNTIME_AUTO_DETECT, "succeeded"); - } - - @Override - public String getName() { - return I18N.getString("bundler.name"); - } - - @Override - public String getDescription() { - return I18N.getString("bundler.description"); - } - - @Override - public String getID() { - return "windows.app"; - } - - @Override - public String getBundleType() { - return "IMAGE"; - } - - @Override - public Collection> getBundleParameters() { - return getAppBundleParameters(); - } - - public static Collection> getAppBundleParameters() { - return Arrays.asList( - APP_NAME, - APP_RESOURCES, - ARGUMENTS, - CLASSPATH, - ICON_ICO, - JVM_OPTIONS, - JVM_PROPERTIES, - MAIN_CLASS, - MAIN_JAR, - PREFERENCES_ID, - VERSION, - VERBOSE - ); - } - - @Override - public File execute( - Map params, File outputParentDir) { - return doBundle(params, outputParentDir, false); - } - - @Override - public boolean supported() { - return (Platform.getPlatform() == Platform.WINDOWS); - } - -} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/windows/WinExeBundler.java --- a/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/windows/WinExeBundler.java Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,969 +0,0 @@ -/* - * Copyright (c) 2017, 2018, 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.jpackager.internal.windows; - -import jdk.jpackager.internal.*; -import jdk.jpackager.internal.ConfigException; -import jdk.jpackager.internal.Arguments; -import jdk.jpackager.internal.UnsupportedPlatformException; -import jdk.jpackager.internal.resources.windows.WinResources; - -import java.io.*; -import java.nio.charset.Charset; -import java.nio.file.Files; -import java.text.MessageFormat; -import java.util.*; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import static jdk.jpackager.internal.windows.WindowsBundlerParam.*; - -public class WinExeBundler extends AbstractBundler { - - private static final ResourceBundle I18N = ResourceBundle.getBundle( - "jdk.jpackager.internal.resources.windows.WinExeBundler"); - - public static final BundlerParamInfo APP_BUNDLER = - new WindowsBundlerParam<>( - getString("param.app-bundler.name"), - getString("param.app-bundler.description"), - "win.app.bundler", - WinAppBundler.class, - params -> new WinAppBundler(), - null); - - public static final BundlerParamInfo CONFIG_ROOT = - new WindowsBundlerParam<>( - getString("param.config-root.name"), - getString("param.config-root.description"), - "configRoot", - File.class, - params -> { - File imagesRoot = - new File(BUILD_ROOT.fetchFrom(params), "windows"); - imagesRoot.mkdirs(); - return imagesRoot; - }, - (s, p) -> null); - - public static final BundlerParamInfo EXE_IMAGE_DIR = - new WindowsBundlerParam<>( - getString("param.image-dir.name"), - getString("param.image-dir.description"), - "win.exe.imageDir", - File.class, - params -> { - File imagesRoot = IMAGES_ROOT.fetchFrom(params); - if (!imagesRoot.exists()) imagesRoot.mkdirs(); - return new File(imagesRoot, "win-exe.image"); - }, - (s, p) -> null); - - public static final BundlerParamInfo WIN_APP_IMAGE = - new WindowsBundlerParam<>( - getString("param.app-dir.name"), - getString("param.app-dir.description"), - "win.app.image", - File.class, - null, - (s, p) -> null); - - - public static final StandardBundlerParam EXE_SYSTEM_WIDE = - new StandardBundlerParam<>( - getString("param.system-wide.name"), - getString("param.system-wide.description"), - Arguments.CLIOptions.WIN_PER_USER_INSTALLATION.getId(), - Boolean.class, - params -> true, // default to system wide - (s, p) -> (s == null || "null".equalsIgnoreCase(s))? null - : Boolean.valueOf(s) - ); - public static final StandardBundlerParam PRODUCT_VERSION = - new StandardBundlerParam<>( - getString("param.product-version.name"), - getString("param.product-version.description"), - "win.msi.productVersion", - String.class, - VERSION::fetchFrom, - (s, p) -> s - ); - - public static final StandardBundlerParam MENU_HINT = - new WindowsBundlerParam<>( - getString("param.menu-shortcut-hint.name"), - getString("param.menu-shortcut-hint.description"), - Arguments.CLIOptions.WIN_MENU_HINT.getId(), - Boolean.class, - params -> false, - (s, p) -> (s == null || - "null".equalsIgnoreCase(s))? true : Boolean.valueOf(s) - ); - - public static final StandardBundlerParam SHORTCUT_HINT = - new WindowsBundlerParam<>( - getString("param.desktop-shortcut-hint.name"), - getString("param.desktop-shortcut-hint.description"), - Arguments.CLIOptions.WIN_SHORTCUT_HINT.getId(), - Boolean.class, - params -> false, - (s, p) -> (s == null || - "null".equalsIgnoreCase(s))? false : Boolean.valueOf(s) - ); - - - - private final static String DEFAULT_EXE_PROJECT_TEMPLATE = "template.iss"; - private final static String DEFAULT_JRE_EXE_TEMPLATE = "template.jre.iss"; - private static final String TOOL_INNO_SETUP_COMPILER = "iscc.exe"; - - public static final BundlerParamInfo - TOOL_INNO_SETUP_COMPILER_EXECUTABLE = new WindowsBundlerParam<>( - getString("param.iscc-path.name"), - getString("param.iscc-path.description"), - "win.exe.iscc.exe", - String.class, - params -> { - for (String dirString : (System.getenv("PATH") - + ";C:\\Program Files (x86)\\Inno Setup 5;" - + "C:\\Program Files\\Inno Setup 5").split(";")) { - File f = new File(dirString.replace("\"", ""), - TOOL_INNO_SETUP_COMPILER); - if (f.isFile()) { - return f.toString(); - } - } - return null; - }, - null); - - public WinExeBundler() { - super(); - baseResourceLoader = WinResources.class; - } - - @Override - public String getName() { - return getString("bundler.name"); - } - - @Override - public String getDescription() { - return getString("bundler.description"); - } - - @Override - public String getID() { - return "exe"; - } - - @Override - public String getBundleType() { - return "INSTALLER"; - } - - @Override - public Collection> getBundleParameters() { - Collection> results = new LinkedHashSet<>(); - results.addAll(WinAppBundler.getAppBundleParameters()); - results.addAll(getExeBundleParameters()); - return results; - } - - public static Collection> getExeBundleParameters() { - return Arrays.asList( - DESCRIPTION, - COPYRIGHT, - LICENSE_FILE, - MENU_GROUP, - MENU_HINT, - SHORTCUT_HINT, - EXE_SYSTEM_WIDE, - TITLE, - VENDOR, - INSTALLDIR_CHOOSER - ); - } - - @Override - public File execute( - Map p, File outputParentDir) { - return bundle(p, outputParentDir); - } - - @Override - public boolean supported() { - return (Platform.getPlatform() == Platform.WINDOWS); - } - - static class VersionExtractor extends PrintStream { - double version = 0f; - - public VersionExtractor() { - super(new ByteArrayOutputStream()); - } - - double getVersion() { - if (version == 0f) { - String content = - new String(((ByteArrayOutputStream) out).toByteArray()); - Pattern pattern = Pattern.compile("Inno Setup (\\d+.?\\d*)"); - Matcher matcher = pattern.matcher(content); - if (matcher.find()) { - String v = matcher.group(1); - version = Double.parseDouble(v); - } - } - return version; - } - } - - private static double findToolVersion(String toolName) { - try { - if (toolName == null || "".equals(toolName)) return 0f; - - ProcessBuilder pb = new ProcessBuilder( - toolName, - "/?"); - VersionExtractor ve = new VersionExtractor(); - IOUtils.exec(pb, Log.isDebug(), true, ve); - // not interested in the output - double version = ve.getVersion(); - Log.verbose(MessageFormat.format( - getString("message.tool-version"), toolName, version)); - return version; - } catch (Exception e) { - if (Log.isDebug()) { - Log.verbose(e); - } - return 0f; - } - } - - @Override - public boolean validate(Map p) - throws UnsupportedPlatformException, ConfigException { - try { - if (p == 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); - - // make sure some key values don't have newlines - for (BundlerParamInfo pi : Arrays.asList( - APP_NAME, - COPYRIGHT, - DESCRIPTION, - MENU_GROUP, - TITLE, - VENDOR, - VERSION) - ) { - String v = pi.fetchFrom(p); - if (v.contains("\n") | v.contains("\r")) { - throw new ConfigException("Parmeter '" + pi.getID() + - "' cannot contain a newline.", - " Change the value of '" + pi.getID() + - " so that it does not contain any newlines"); - } - } - - // exe bundlers trim the copyright to 100 characters, - // tell them this will happen - if (COPYRIGHT.fetchFrom(p).length() > 100) { - throw new ConfigException( - getString("error.copyright-is-too-long"), - getString("error.copyright-is-too-long.advice")); - } - - double innoVersion = findToolVersion( - TOOL_INNO_SETUP_COMPILER_EXECUTABLE.fetchFrom(p)); - - //Inno Setup 5+ is required - double minVersion = 5.0f; - - if (innoVersion < minVersion) { - Log.error(MessageFormat.format( - getString("message.tool-wrong-version"), - TOOL_INNO_SETUP_COMPILER, innoVersion, minVersion)); - throw new ConfigException( - getString("error.iscc-not-found"), - getString("error.iscc-not-found.advice")); - } - - /********* validate bundle parameters *************/ - - // only one mime type per association, at least one file extension - List> associations = - FILE_ASSOCIATIONS.fetchFrom(p); - if (associations != null) { - for (int i = 0; i < associations.size(); i++) { - Map assoc = associations.get(i); - List mimes = FA_CONTENT_TYPE.fetchFrom(assoc); - if (mimes.size() > 1) { - throw new ConfigException(MessageFormat.format( - getString("error.too-many-content-" - + "types-for-file-association"), i), - getString("error.too-many-content-" - + "types-for-file-association.advice")); - } - } - } - - // validate license file, if used, exists in the proper place - if (p.containsKey(LICENSE_FILE.getID())) { - List appResourcesList = - APP_RESOURCES_LIST.fetchFrom(p); - for (String license : LICENSE_FILE.fetchFrom(p)) { - boolean found = false; - for (RelativeFileSet appResources : appResourcesList) { - found = found || appResources.contains(license); - } - if (!found) { - throw new ConfigException( - MessageFormat.format(getString( - "error.license-missing"), license), - MessageFormat.format(getString( - "error.license-missing.advice"), license)); - } - } - } - - return true; - } catch (RuntimeException re) { - if (re.getCause() instanceof ConfigException) { - throw (ConfigException) re.getCause(); - } else { - throw new ConfigException(re); - } - } - } - - private boolean prepareProto(Map p) - throws IOException { - File appImage = StandardBundlerParam.getPredefinedAppImage(p); - 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)); - // 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); - } - - if (appDir == null) { - return false; - } - - p.put(WIN_APP_IMAGE.getID(), appDir); - - List licenseFiles = LICENSE_FILE.fetchFrom(p); - if (licenseFiles != null) { - // need to copy license file to the root of win.app.image - outerLoop: - for (RelativeFileSet rfs : APP_RESOURCES_LIST.fetchFrom(p)) { - for (String s : licenseFiles) { - if (rfs.contains(s)) { - File lfile = new File(rfs.getBaseDirectory(), s); - File destFile = - new File(appDir.getParentFile(), lfile.getName()); - IOUtils.copyFile(lfile, destFile); - ensureByMutationFileIsRTF(destFile); - break outerLoop; - } - } - } - } - - // copy file association icons - List> fileAssociations = - FILE_ASSOCIATIONS.fetchFrom(p); - - for (Map fa : fileAssociations) { - File icon = FA_ICON.fetchFrom(fa); // TODO FA_ICON_ICO - if (icon == null) { - continue; - } - - File faIconFile = new File(appDir, icon.getName()); - - if (icon.exists()) { - try { - IOUtils.copyFile(icon, faIconFile); - } catch (IOException e) { - e.printStackTrace(); - } - } - } - - return true; - } - - public File bundle(Map p, File outdir) { - if (!outdir.isDirectory() && !outdir.mkdirs()) { - throw new RuntimeException(MessageFormat.format( - getString("error.cannot-create-output-dir"), - outdir.getAbsolutePath())); - } - if (!outdir.canWrite()) { - throw new RuntimeException(MessageFormat.format( - getString("error.cannot-write-to-output-dir"), - outdir.getAbsolutePath())); - } - - if (WindowsDefender.isThereAPotentialWindowsDefenderIssue()) { - Log.error(MessageFormat.format( - getString("message.potential.windows.defender.issue"), - WindowsDefender.getUserTempDirectory())); - } - - // validate we have valid tools before continuing - String iscc = TOOL_INNO_SETUP_COMPILER_EXECUTABLE.fetchFrom(p); - if (iscc == null || !new File(iscc).isFile()) { - Log.error(getString("error.iscc-not-found")); - Log.error(MessageFormat.format( - getString("message.iscc-file-string"), iscc)); - return null; - } - - File imageDir = EXE_IMAGE_DIR.fetchFrom(p); - try { - imageDir.mkdirs(); - - boolean menuShortcut = MENU_HINT.fetchFrom(p); - boolean desktopShortcut = SHORTCUT_HINT.fetchFrom(p); - 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); - } - - if (prepareProto(p) && prepareProjectConfig(p)) { - File configScript = getConfig_Script(p); - if (configScript.exists()) { - Log.verbose(MessageFormat.format( - getString("message.running-wsh-script"), - configScript.getAbsolutePath())); - IOUtils.run("wscript", configScript, VERBOSE.fetchFrom(p)); - } - return buildEXE(p, outdir); - } - return null; - } catch (IOException ex) { - ex.printStackTrace(); - return null; - } finally { - try { - if (imageDir != null && - PREDEFINED_APP_IMAGE.fetchFrom(p) == null && - (PREDEFINED_RUNTIME_IMAGE.fetchFrom(p) == null || - !Arguments.CREATE_JRE_INSTALLER.fetchFrom(p)) && - !Log.isDebug() && - !Log.isVerbose()) { - IOUtils.deleteRecursive(imageDir); - } else if (imageDir != null) { - Log.verbose(MessageFormat.format( - I18N.getString("message.debug-working-directory"), - imageDir.getAbsolutePath())); - } - } catch (IOException ex) { - // noinspection ReturnInsideFinallyBlock - Log.debug(ex.getMessage()); - return null; - } - } - } - - // name of post-image script - private File getConfig_Script(Map p) { - return new File(EXE_IMAGE_DIR.fetchFrom(p), - APP_NAME.fetchFrom(p) + "-post-image.wsf"); - } - - private String getAppIdentifier(Map p) { - String nm = IDENTIFIER.fetchFrom(p); - - if (nm == null) { - nm = APP_NAME.fetchFrom(p); - } - - // limitation of innosetup - if (nm.length() > 126) { - Log.error(getString("message-truncating-id")); - nm = nm.substring(0, 126); - } - - return nm; - } - - - private String getLicenseFile(Map p) { - List licenseFiles = LICENSE_FILE.fetchFrom(p); - if (licenseFiles == null || licenseFiles.isEmpty()) { - return ""; - } else { - return licenseFiles.get(0); - } - } - - void validateValueAndPut(Map data, String key, - BundlerParamInfo param, - Map p) throws IOException { - String value = param.fetchFrom(p); - if (value.contains("\r") || value.contains("\n")) { - throw new IOException("Configuration Parameter " + - param.getID() + " cannot contain multiple lines of text"); - } - data.put(key, innosetupEscape(value)); - } - - private String innosetupEscape(String value) { - if (value.contains("\"") || !value.trim().equals(value)) { - value = "\"" + value.replace("\"", "\"\"") + "\""; - } - return value; - } - - boolean prepareMainProjectFile(Map p) - throws IOException { - Map data = new HashMap<>(); - data.put("PRODUCT_APP_IDENTIFIER", - innosetupEscape(getAppIdentifier(p))); - - - validateValueAndPut(data, "INSTALLER_NAME", APP_NAME, p); - validateValueAndPut(data, "APPLICATION_VENDOR", VENDOR, p); - validateValueAndPut(data, "APPLICATION_VERSION", VERSION, p); - validateValueAndPut(data, "INSTALLER_FILE_NAME", - INSTALLER_FILE_NAME, p); - - data.put("LAUNCHER_NAME", - innosetupEscape(WinAppBundler.getAppName(p))); - - data.put("APPLICATION_LAUNCHER_FILENAME", - innosetupEscape(WinAppBundler.getLauncherName(p))); - - data.put("APPLICATION_DESKTOP_SHORTCUT", - SHORTCUT_HINT.fetchFrom(p) ? "returnTrue" : "returnFalse"); - data.put("APPLICATION_MENU_SHORTCUT", - MENU_HINT.fetchFrom(p) ? "returnTrue" : "returnFalse"); - validateValueAndPut(data, "APPLICATION_GROUP", MENU_GROUP, p); - validateValueAndPut(data, "APPLICATION_COMMENTS", TITLE, p); - validateValueAndPut(data, "APPLICATION_COPYRIGHT", COPYRIGHT, p); - - data.put("APPLICATION_LICENSE_FILE", - innosetupEscape(getLicenseFile(p))); - data.put("DISABLE_DIR_PAGE", - INSTALLDIR_CHOOSER.fetchFrom(p) ? "No" : "Yes"); - - Boolean isSystemWide = EXE_SYSTEM_WIDE.fetchFrom(p); - - if (isSystemWide) { - data.put("APPLICATION_INSTALL_ROOT", "{pf}"); - data.put("APPLICATION_INSTALL_PRIVILEGE", "admin"); - } else { - data.put("APPLICATION_INSTALL_ROOT", "{localappdata}"); - data.put("APPLICATION_INSTALL_PRIVILEGE", "lowest"); - } - - if (BIT_ARCH_64.fetchFrom(p)) { - data.put("ARCHITECTURE_BIT_MODE", "x64"); - } else { - data.put("ARCHITECTURE_BIT_MODE", ""); - } - validateValueAndPut(data, "RUN_FILENAME", APP_NAME, p); - - validateValueAndPut(data, "APPLICATION_DESCRIPTION", - DESCRIPTION, p); - - data.put("APPLICATION_SERVICE", "returnFalse"); - data.put("APPLICATION_NOT_SERVICE", "returnFalse"); - data.put("APPLICATION_APP_CDS_INSTALL", "returnFalse"); - data.put("START_ON_INSTALL", ""); - data.put("STOP_ON_UNINSTALL", ""); - data.put("RUN_AT_STARTUP", ""); - - StringBuilder secondaryLaunchersCfg = new StringBuilder(); - for (Map - launcher : SECONDARY_LAUNCHERS.fetchFrom(p)) { - String application_name = APP_NAME.fetchFrom(launcher); - if (MENU_HINT.fetchFrom(launcher)) { - // Name: "{group}\APPLICATION_NAME"; - // Filename: "{app}\APPLICATION_NAME.exe"; - // IconFilename: "{app}\APPLICATION_NAME.ico" - secondaryLaunchersCfg.append("Name: \"{group}\\"); - secondaryLaunchersCfg.append(application_name); - secondaryLaunchersCfg.append("\"; Filename: \"{app}\\"); - secondaryLaunchersCfg.append(application_name); - secondaryLaunchersCfg.append(".exe\"; IconFilename: \"{app}\\"); - secondaryLaunchersCfg.append(application_name); - secondaryLaunchersCfg.append(".ico\"\r\n"); - } - if (SHORTCUT_HINT.fetchFrom(launcher)) { - // Name: "{commondesktop}\APPLICATION_NAME"; - // Filename: "{app}\APPLICATION_NAME.exe"; - // IconFilename: "{app}\APPLICATION_NAME.ico" - secondaryLaunchersCfg.append("Name: \"{commondesktop}\\"); - secondaryLaunchersCfg.append(application_name); - secondaryLaunchersCfg.append("\"; Filename: \"{app}\\"); - secondaryLaunchersCfg.append(application_name); - secondaryLaunchersCfg.append(".exe\"; IconFilename: \"{app}\\"); - secondaryLaunchersCfg.append(application_name); - secondaryLaunchersCfg.append(".ico\"\r\n"); - } - } - data.put("SECONDARY_LAUNCHERS", secondaryLaunchersCfg.toString()); - - StringBuilder registryEntries = new StringBuilder(); - String regName = APP_REGISTRY_NAME.fetchFrom(p); - List> fetchFrom = - FILE_ASSOCIATIONS.fetchFrom(p); - for (int i = 0; i < fetchFrom.size(); i++) { - Map fileAssociation = fetchFrom.get(i); - String description = FA_DESCRIPTION.fetchFrom(fileAssociation); - File icon = FA_ICON.fetchFrom(fileAssociation); //TODO FA_ICON_ICO - - List extensions = FA_EXTENSIONS.fetchFrom(fileAssociation); - String entryName = regName + "File"; - if (i > 0) { - entryName += "." + i; - } - - if (extensions == null) { - Log.verbose(getString( - "message.creating-association-with-null-extension")); - } else { - for (String ext : extensions) { - if (isSystemWide) { - // "Root: HKCR; Subkey: \".myp\"; - // ValueType: string; ValueName: \"\"; - // ValueData: \"MyProgramFile\"; - // Flags: uninsdeletevalue" - registryEntries.append("Root: HKCR; Subkey: \".") - .append(ext) - .append("\"; ValueType: string;" - + " ValueName: \"\"; ValueData: \"") - .append(entryName) - .append("\"; Flags: uninsdeletevalue\r\n"); - } else { - registryEntries.append( - "Root: HKCU; Subkey: \"Software\\Classes\\.") - .append(ext) - .append("\"; ValueType: string;" - + " ValueName: \"\"; ValueData: \"") - .append(entryName) - .append("\"; Flags: uninsdeletevalue\r\n"); - } - } - } - - if (extensions != null && !extensions.isEmpty()) { - String ext = extensions.get(0); - List mimeTypes = - FA_CONTENT_TYPE.fetchFrom(fileAssociation); - for (String mime : mimeTypes) { - if (isSystemWide) { - // "Root: HKCR; - // Subkey: HKCR\\Mime\\Database\\ - // Content Type\\application/chaos; - // ValueType: string; - // ValueName: Extension; - // ValueData: .chaos; - // Flags: uninsdeletevalue" - registryEntries.append("Root: HKCR; Subkey: " + - "\"Mime\\Database\\Content Type\\") - .append(mime) - .append("\"; ValueType: string; ValueName: " + - "\"Extension\"; ValueData: \".") - .append(ext) - .append("\"; Flags: uninsdeletevalue\r\n"); - } else { - registryEntries.append( - "Root: HKCU; Subkey: \"Software\\" + - "Classes\\Mime\\Database\\Content Type\\") - .append(mime) - .append("\"; ValueType: string; " + - "ValueName: \"Extension\"; ValueData: \".") - .append(ext) - .append("\"; Flags: uninsdeletevalue\r\n"); - } - } - } - - if (isSystemWide) { - // "Root: HKCR; - // Subkey: \"MyProgramFile\"; - // ValueType: string; - // ValueName: \"\"; - // ValueData: \"My Program File\"; - // Flags: uninsdeletekey" - registryEntries.append("Root: HKCR; Subkey: \"") - .append(entryName) - .append( - "\"; ValueType: string; ValueName: \"\"; ValueData: \"") - .append(removeQuotes(description)) - .append("\"; Flags: uninsdeletekey\r\n"); - } else { - registryEntries.append( - "Root: HKCU; Subkey: \"Software\\Classes\\") - .append(entryName) - .append( - "\"; ValueType: string; ValueName: \"\"; ValueData: \"") - .append(removeQuotes(description)) - .append("\"; Flags: uninsdeletekey\r\n"); - } - - if (icon != null && icon.exists()) { - if (isSystemWide) { - // "Root: HKCR; - // Subkey: \"MyProgramFile\\DefaultIcon\"; - // ValueType: string; - // ValueName: \"\"; - // ValueData: \"{app}\\MYPROG.EXE,0\"\n" + - registryEntries.append("Root: HKCR; Subkey: \"") - .append(entryName) - .append("\\DefaultIcon\"; ValueType: string; " + - "ValueName: \"\"; ValueData: \"{app}\\") - .append(icon.getName()) - .append("\"\r\n"); - } else { - registryEntries.append( - "Root: HKCU; Subkey: \"Software\\Classes\\") - .append(entryName) - .append("\\DefaultIcon\"; ValueType: string; " + - "ValueName: \"\"; ValueData: \"{app}\\") - .append(icon.getName()) - .append("\"\r\n"); - } - } - - if (isSystemWide) { - // "Root: HKCR; - // Subkey: \"MyProgramFile\\shell\\open\\command\"; - // ValueType: string; - // ValueName: \"\"; - // ValueData: \"\"\"{app}\\MYPROG.EXE\"\" \"\"%1\"\"\"\n" - registryEntries.append("Root: HKCR; Subkey: \"") - .append(entryName) - .append("\\shell\\open\\command\"; ValueType: " + - "string; ValueName: \"\"; ValueData: \"\"\"{app}\\") - .append(APP_NAME.fetchFrom(p)) - .append("\"\" \"\"%1\"\"\"\r\n"); - } else { - registryEntries.append( - "Root: HKCU; Subkey: \"Software\\Classes\\") - .append(entryName) - .append("\\shell\\open\\command\"; ValueType: " + - "string; ValueName: \"\"; ValueData: \"\"\"{app}\\") - .append(APP_NAME.fetchFrom(p)) - .append("\"\" \"\"%1\"\"\"\r\n"); - } - } - if (registryEntries.length() > 0) { - data.put("FILE_ASSOCIATIONS", - "ChangesAssociations=yes\r\n\r\n[Registry]\r\n" + - registryEntries.toString()); - } else { - data.put("FILE_ASSOCIATIONS", ""); - } - - // TODO - alternate template for JRE installer - String iss = Arguments.CREATE_JRE_INSTALLER.fetchFrom(p) ? - DEFAULT_JRE_EXE_TEMPLATE : DEFAULT_EXE_PROJECT_TEMPLATE; - - Writer w = new BufferedWriter(new FileWriter( - getConfig_ExeProjectFile(p))); - - String content = preprocessTextResource( - WinAppBundler.WIN_BUNDLER_PREFIX + - getConfig_ExeProjectFile(p).getName(), - getString("resource.inno-setup-project-file"), - iss, data, VERBOSE.fetchFrom(p), - DROP_IN_RESOURCES_ROOT.fetchFrom(p)); - w.write(content); - w.close(); - return true; - } - - private final static String removeQuotes(String s) { - if (s.length() > 2 && s.startsWith("\"") && s.endsWith("\"")) { - // special case for '"XXX"' return 'XXX' not '-XXX-' - // note '"' and '""' are excluded from this special case - s = s.substring(1, s.length() - 1); - } - // if there interior double quotes replace them with '-' - return s.replaceAll("\"", "-"); - } - - private final static String DEFAULT_INNO_SETUP_ICON = - "icon_inno_setup.bmp"; - - private boolean prepareProjectConfig(Map p) - throws IOException { - prepareMainProjectFile(p); - - // prepare installer icon - File iconTarget = getConfig_SmallInnoSetupIcon(p); - fetchResource(WinAppBundler.WIN_BUNDLER_PREFIX + iconTarget.getName(), - getString("resource.setup-icon"), - DEFAULT_INNO_SETUP_ICON, - iconTarget, - VERBOSE.fetchFrom(p), - DROP_IN_RESOURCES_ROOT.fetchFrom(p)); - - fetchResource(WinAppBundler.WIN_BUNDLER_PREFIX + - getConfig_Script(p).getName(), - getString("resource.post-install-script"), - (String) null, - getConfig_Script(p), - VERBOSE.fetchFrom(p), - DROP_IN_RESOURCES_ROOT.fetchFrom(p)); - return true; - } - - private File getConfig_SmallInnoSetupIcon( - Map p) { - return new File(EXE_IMAGE_DIR.fetchFrom(p), - APP_NAME.fetchFrom(p) + "-setup-icon.bmp"); - } - - private File getConfig_ExeProjectFile(Map p) { - return new File(EXE_IMAGE_DIR.fetchFrom(p), - APP_NAME.fetchFrom(p) + ".iss"); - } - - - private File buildEXE(Map p, File outdir) - throws IOException { - Log.verbose(MessageFormat.format( - getString("message.outputting-to-location"), - outdir.getAbsolutePath())); - - outdir.mkdirs(); - - // run Inno Setup - ProcessBuilder pb = new ProcessBuilder( - TOOL_INNO_SETUP_COMPILER_EXECUTABLE.fetchFrom(p), - "/q", // turn off inno setup output - "/o"+outdir.getAbsolutePath(), - getConfig_ExeProjectFile(p).getAbsolutePath()); - pb = pb.directory(EXE_IMAGE_DIR.fetchFrom(p)); - IOUtils.exec(pb, VERBOSE.fetchFrom(p)); - - Log.verbose(MessageFormat.format( - getString("message.output-location"), - outdir.getAbsolutePath())); - - // presume the result is the ".exe" file with the newest modified time - // not the best solution, but it is the most reliable - File result = null; - long lastModified = 0; - File[] list = outdir.listFiles(); - if (list != null) { - for (File f : list) { - if (f.getName().endsWith(".exe") && - f.lastModified() > lastModified) { - result = f; - lastModified = f.lastModified(); - } - } - } - - return result; - } - - public static void ensureByMutationFileIsRTF(File f) { - if (f == null || !f.isFile()) return; - - try { - boolean existingLicenseIsRTF = false; - - try (FileInputStream fin = new FileInputStream(f)) { - byte[] firstBits = new byte[7]; - - if (fin.read(firstBits) == firstBits.length) { - String header = new String(firstBits); - existingLicenseIsRTF = "{\\rtf1\\".equals(header); - } - } - - if (!existingLicenseIsRTF) { - List oldLicense = Files.readAllLines(f.toPath()); - try (Writer w = Files.newBufferedWriter( - f.toPath(), Charset.forName("Windows-1252"))) { - w.write("{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033" - + "{\\fonttbl{\\f0\\fnil\\fcharset0 Arial;}}\n" - + "\\viewkind4\\uc1\\pard\\sa200\\sl276" - + "\\slmult1\\lang9\\fs20 "); - oldLicense.forEach(l -> { - try { - for (char c : l.toCharArray()) { - if (c < 0x10) { - w.write("\\'0"); - w.write(Integer.toHexString(c)); - } else if (c > 0xff) { - w.write("\\ud"); - w.write(Integer.toString(c)); - w.write("?"); - } else if ((c < 0x20) || (c >= 0x80) || - (c == 0x5C) || (c == 0x7B) || - (c == 0x7D)) { - w.write("\\'"); - w.write(Integer.toHexString(c)); - } else { - w.write(c); - } - } - if (l.length() < 1) { - w.write("\\par"); - } else { - w.write(" "); - } - w.write("\r\n"); - } catch (IOException e) { - Log.verbose(e); - } - }); - w.write("}\r\n"); - } - } - } catch (IOException e) { - Log.verbose(e); - } - } - - private static String getString(String key) - throws MissingResourceException { - return I18N.getString(key); - } -} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/windows/WinMsiBundler.java --- a/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/windows/WinMsiBundler.java Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1270 +0,0 @@ -/* - * Copyright (c) 2012, 2018, 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.jpackager.internal.windows; - -import jdk.jpackager.internal.*; -import jdk.jpackager.internal.ConfigException; -import jdk.jpackager.internal.Arguments; -import jdk.jpackager.internal.UnsupportedPlatformException; -import jdk.jpackager.internal.resources.windows.WinResources; - -import java.io.*; -import java.nio.charset.Charset; -import java.nio.file.Files; -import java.text.MessageFormat; -import java.util.*; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import static jdk.jpackager.internal.windows.WindowsBundlerParam.*; - -public class WinMsiBundler extends AbstractBundler { - - private static final ResourceBundle I18N = - ResourceBundle.getBundle( - "jdk.jpackager.internal.resources.windows.WinMsiBundler"); - - public static final BundlerParamInfo APP_BUNDLER = - new WindowsBundlerParam<>( - I18N.getString("param.app-bundler.name"), - I18N.getString("param.app-bundler.description"), - "win.app.bundler", - WinAppBundler.class, - params -> new WinAppBundler(), - null); - - public static final BundlerParamInfo 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 CONFIG_ROOT = - new WindowsBundlerParam<>( - I18N.getString("param.config-root.name"), - I18N.getString("param.config-root.description"), - "configRoot", - File.class, - params -> { - File imagesRoot = - new File(BUILD_ROOT.fetchFrom(params), "windows"); - imagesRoot.mkdirs(); - return imagesRoot; - }, - (s, p) -> null); - - public static final BundlerParamInfo 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(); - return new File(imagesRoot, "win-msi.image"); - }, - (s, p) -> null); - - public static final BundlerParamInfo 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 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 - (s, p) -> (s == null || "null".equalsIgnoreCase(s))? null - : Boolean.valueOf(s) - ); - - - public static final StandardBundlerParam 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 UPGRADE_UUID = - new WindowsBundlerParam<>( - I18N.getString("param.upgrade-uuid.name"), - I18N.getString("param.upgrade-uuid.description"), - Arguments.CLIOptions.WIN_MSI_UPGRADE_UUID.getId(), - UUID.class, - params -> UUID.randomUUID(), // TODO check to see - // if identifier is a valid UUID during default - (s, p) -> UUID.fromString(s)); - - private static final String TOOL_CANDLE = "candle.exe"; - private static final String TOOL_LIGHT = "light.exe"; - // autodetect just v3.7, v3.8, 3.9, 3.10 and 3.11 - private static final String AUTODETECT_DIRS = - ";C:\\Program Files (x86)\\WiX Toolset v3.11\\bin;" - + "C:\\Program Files\\WiX Toolset v3.11\\bin;" - + "C:\\Program Files (x86)\\WiX Toolset v3.10\\bin;" - + "C:\\Program Files\\WiX Toolset v3.10\\bin;" - + "C:\\Program Files (x86)\\WiX Toolset v3.9\\bin;" - + "C:\\Program Files\\WiX Toolset v3.9\\bin;" - + "C:\\Program Files (x86)\\WiX Toolset v3.8\\bin;" - + "C:\\Program Files\\WiX Toolset v3.8\\bin;" - + "C:\\Program Files (x86)\\WiX Toolset v3.7\\bin;" - + "C:\\Program Files\\WiX Toolset v3.7\\bin"; - - public static final BundlerParamInfo 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(";")) { - File f = new File(dirString.replace("\"", ""), TOOL_CANDLE); - if (f.isFile()) { - return f.toString(); - } - } - return null; - }, - null); - - public static final BundlerParamInfo 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(";")) { - File f = new File(dirString.replace("\"", ""), TOOL_LIGHT); - if (f.isFile()) { - return f.toString(); - } - } - return null; - }, - null); - - public static final StandardBundlerParam 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 - (s, p) -> (s == null || - "null".equalsIgnoreCase(s))? true : Boolean.valueOf(s) - ); - - public static final StandardBundlerParam 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 - (s, p) -> (s == null || - "null".equalsIgnoreCase(s))? false : Boolean.valueOf(s) - ); - - public WinMsiBundler() { - super(); - baseResourceLoader = WinResources.class; - } - - - @Override - public String getName() { - return I18N.getString("bundler.name"); - } - - @Override - public String getDescription() { - return I18N.getString("bundler.description"); - } - - @Override - public String getID() { - return "msi"; - } - - @Override - public String getBundleType() { - return "INSTALLER"; - } - - @Override - public Collection> getBundleParameters() { - Collection> results = new LinkedHashSet<>(); - results.addAll(WinAppBundler.getAppBundleParameters()); - results.addAll(getMsiBundleParameters()); - return results; - } - - public static Collection> getMsiBundleParameters() { - return Arrays.asList( - DESCRIPTION, - MENU_GROUP, - MENU_HINT, - PRODUCT_VERSION, - SHORTCUT_HINT, - MSI_SYSTEM_WIDE, - VENDOR, - LICENSE_FILE, - INSTALLDIR_CHOOSER - ); - } - - @Override - public File execute( - Map params, File outputParentDir) { - return bundle(params, outputParentDir); - } - - @Override - public boolean supported() { - return (Platform.getPlatform() == Platform.WINDOWS); - } - - static class VersionExtractor extends PrintStream { - double version = 0f; - - public VersionExtractor() { - super(new ByteArrayOutputStream()); - } - - double getVersion() { - if (version == 0f) { - String content = - new String(((ByteArrayOutputStream) out).toByteArray()); - Pattern pattern = Pattern.compile("version (\\d+.\\d+)"); - Matcher matcher = pattern.matcher(content); - if (matcher.find()) { - String v = matcher.group(1); - version = Double.parseDouble(v); - } - } - return version; - } - } - - private static double findToolVersion(String toolName) { - try { - if (toolName == null || "".equals(toolName)) return 0f; - - ProcessBuilder pb = new ProcessBuilder( - toolName, - "/?"); - VersionExtractor ve = new VersionExtractor(); - // not interested in the output - IOUtils.exec(pb, Log.isDebug(), true, ve); - double version = ve.getVersion(); - Log.verbose(MessageFormat.format( - I18N.getString("message.tool-version"), - toolName, version)); - return version; - } catch (Exception e) { - if (Log.isDebug()) { - Log.verbose(e); - } - return 0f; - } - } - - @Override - public boolean validate(Map p) - throws UnsupportedPlatformException, ConfigException { - try { - if (p == 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).doValidate(p); - - double candleVersion = - findToolVersion(TOOL_CANDLE_EXECUTABLE.fetchFrom(p)); - double lightVersion = - findToolVersion(TOOL_LIGHT_EXECUTABLE.fetchFrom(p)); - - // WiX 3.0+ is required - double minVersion = 3.0f; - boolean bad = false; - - if (candleVersion < minVersion) { - Log.verbose(MessageFormat.format( - I18N.getString("message.wrong-tool-version"), - TOOL_CANDLE, candleVersion, minVersion)); - bad = true; - } - if (lightVersion < minVersion) { - Log.verbose(MessageFormat.format( - I18N.getString("message.wrong-tool-version"), - TOOL_LIGHT, lightVersion, minVersion)); - bad = true; - } - - if (bad){ - throw new ConfigException( - I18N.getString("error.no-wix-tools"), - I18N.getString("error.no-wix-tools.advice")); - } - - if (lightVersion >= 3.6f) { - Log.verbose(I18N.getString("message.use-wix36-features")); - p.put(CAN_USE_WIX36.getID(), Boolean.TRUE); - } - - /********* validate bundle parameters *************/ - - String version = PRODUCT_VERSION.fetchFrom(p); - if (!isVersionStringValid(version)) { - throw new ConfigException( - MessageFormat.format(I18N.getString( - "error.version-string-wrong-format"), version), - MessageFormat.format(I18N.getString( - "error.version-string-wrong-format.advice"), - PRODUCT_VERSION.getID())); - } - - // only one mime type per association, at least one file extension - List> associations = - FILE_ASSOCIATIONS.fetchFrom(p); - if (associations != null) { - for (int i = 0; i < associations.size(); i++) { - Map assoc = associations.get(i); - List mimes = FA_CONTENT_TYPE.fetchFrom(assoc); - if (mimes.size() > 1) { - throw new ConfigException(MessageFormat.format( - I18N.getString("error.too-many-content-" - + "types-for-file-association"), i), - I18N.getString("error.too-many-content-" - + "types-for-file-association.advice")); - } - } - } - - // validate license file, if used, exists in the proper place - if (p.containsKey(LICENSE_FILE.getID())) { - List appResourcesList = - APP_RESOURCES_LIST.fetchFrom(p); - for (String license : LICENSE_FILE.fetchFrom(p)) { - boolean found = false; - for (RelativeFileSet appResources : appResourcesList) { - found = found || appResources.contains(license); - } - if (!found) { - throw new ConfigException( - MessageFormat.format(I18N.getString( - "error.license-missing"), license), - MessageFormat.format(I18N.getString( - "error.license-missing.advice"), license)); - } - } - } - - return true; - } catch (RuntimeException re) { - if (re.getCause() instanceof ConfigException) { - throw (ConfigException) re.getCause(); - } else { - throw new ConfigException(re); - } - } - } - - // http://msdn.microsoft.com/en-us/library/aa370859%28v=VS.85%29.aspx - // The format of the string is as follows: - // major.minor.build - // The first field is the major version and has a maximum value of 255. - // The second field is the minor version and has a maximum value of 255. - // The third field is called the build version or the update version and - // has a maximum value of 65,535. - static boolean isVersionStringValid(String v) { - if (v == null) { - return true; - } - - String p[] = v.split("\\."); - if (p.length > 3) { - Log.verbose(I18N.getString( - "message.version-string-too-many-components")); - return false; - } - - try { - int val = Integer.parseInt(p[0]); - if (val < 0 || val > 255) { - Log.verbose(I18N.getString( - "error.version-string-major-out-of-range")); - return false; - } - if (p.length > 1) { - val = Integer.parseInt(p[1]); - if (val < 0 || val > 255) { - Log.verbose(I18N.getString( - "error.version-string-minor-out-of-range")); - return false; - } - } - if (p.length > 2) { - val = Integer.parseInt(p[2]); - if (val < 0 || val > 65535) { - Log.verbose(I18N.getString( - "error.version-string-build-out-of-range")); - return false; - } - } - } catch (NumberFormatException ne) { - Log.verbose(I18N.getString("error.version-string-part-not-number")); - Log.verbose(ne); - return false; - } - - return true; - } - - private boolean prepareProto(Map p) - throws IOException { - File appImage = StandardBundlerParam.getPredefinedAppImage(p); - 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)); - // 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); - } - - p.put(WIN_APP_IMAGE.getID(), appDir); - - List licenseFiles = LICENSE_FILE.fetchFrom(p); - if (licenseFiles != null) { - // need to copy license file to the root of win.app.image - outerLoop: - for (RelativeFileSet rfs : APP_RESOURCES_LIST.fetchFrom(p)) { - for (String s : licenseFiles) { - if (rfs.contains(s)) { - File lfile = new File(rfs.getBaseDirectory(), s); - File destFile = new File(appDir, lfile.getName()); - IOUtils.copyFile(lfile, destFile); - ensureByMutationFileIsRTF(destFile); - break outerLoop; - } - } - } - } - - // copy file association icons - List> fileAssociations = - FILE_ASSOCIATIONS.fetchFrom(p); - for (Map fa : fileAssociations) { - File icon = FA_ICON.fetchFrom(fa); // TODO FA_ICON_ICO - if (icon == null) { - continue; - } - - File faIconFile = new File(appDir, icon.getName()); - - if (icon.exists()) { - try { - IOUtils.copyFile(icon, faIconFile); - } catch (IOException e) { - e.printStackTrace(); - } - } - } - - return appDir != null; - } - - public File bundle(Map p, File outdir) { - if (!outdir.isDirectory() && !outdir.mkdirs()) { - throw new RuntimeException(MessageFormat.format( - I18N.getString("error.cannot-create-output-dir"), - outdir.getAbsolutePath())); - } - if (!outdir.canWrite()) { - throw new RuntimeException(MessageFormat.format( - I18N.getString("error.cannot-write-to-output-dir"), - outdir.getAbsolutePath())); - } - - // validate we have valid tools before continuing - String light = TOOL_LIGHT_EXECUTABLE.fetchFrom(p); - String candle = TOOL_CANDLE_EXECUTABLE.fetchFrom(p); - if (light == null || !new File(light).isFile() || - candle == null || !new File(candle).isFile()) { - Log.error(I18N.getString("error.no-wix-tools")); - Log.verbose(MessageFormat.format( - I18N.getString("message.light-file-string"), light)); - Log.verbose(MessageFormat.format( - I18N.getString("message.candle-file-string"), candle)); - return null; - } - - File imageDir = MSI_IMAGE_DIR.fetchFrom(p); - try { - imageDir.mkdirs(); - - boolean menuShortcut = MENU_HINT.fetchFrom(p); - boolean desktopShortcut = SHORTCUT_HINT.fetchFrom(p); - 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); - } - - if (prepareProto(p) && prepareWiXConfig(p) - && prepareBasicProjectConfig(p)) { - File configScriptSrc = getConfig_Script(p); - if (configScriptSrc.exists()) { - // we need to be running post script in the image folder - - // NOTE: Would it be better to generate it to the image - // folder and save only if "verbose" is requested? - - // for now we replicate it - File configScript = - new File(imageDir, configScriptSrc.getName()); - IOUtils.copyFile(configScriptSrc, configScript); - Log.verbose(MessageFormat.format( - I18N.getString("message.running-wsh-script"), - configScript.getAbsolutePath())); - IOUtils.run("wscript", - configScript, false); - } - return buildMSI(p, outdir); - } - return null; - } catch (IOException ex) { - Log.verbose(ex); - return null; - } finally { - try { - if (imageDir != null && - PREDEFINED_APP_IMAGE.fetchFrom(p) == null && - (PREDEFINED_RUNTIME_IMAGE.fetchFrom(p) == null || - !Arguments.CREATE_JRE_INSTALLER.fetchFrom(p)) && - !Log.isDebug() && - !Log.isVerbose()) { - IOUtils.deleteRecursive(imageDir); - } else if (imageDir != null) { - Log.verbose(MessageFormat.format( - I18N.getString("message.debug-working-directory"), - imageDir.getAbsolutePath())); - } - - cleanupConfigFiles(p); - } catch (IOException ex) { - // noinspection ReturnInsideFinallyBlock - Log.debug(ex.getMessage()); - return null; - } - } - } - - protected void cleanupConfigFiles(Map params) { - if (Log.isDebug() || Log.isVerbose()) { - return; - } - - if (getConfig_ProjectFile(params) != null) { - getConfig_ProjectFile(params).delete(); - } - if (getConfig_Script(params) != null) { - getConfig_Script(params).delete(); - } - } - - // name of post-image script - private File getConfig_Script(Map params) { - return new File(CONFIG_ROOT.fetchFrom(params), - APP_FS_NAME.fetchFrom(params) + "-post-image.wsf"); - } - - private boolean prepareBasicProjectConfig( - Map params) throws IOException { - fetchResource(WinAppBundler.WIN_BUNDLER_PREFIX + - getConfig_Script(params).getName(), - I18N.getString("resource.post-install-script"), - (String) null, - getConfig_Script(params), - VERBOSE.fetchFrom(params), - DROP_IN_RESOURCES_ROOT.fetchFrom(params)); - return true; - } - - private String relativePath(File basedir, File file) { - return file.getAbsolutePath().substring( - basedir.getAbsolutePath().length() + 1); - } - - boolean prepareMainProjectFile( - Map params) throws IOException { - Map data = new HashMap<>(); - - UUID productGUID = UUID.randomUUID(); - - Log.verbose(MessageFormat.format( - I18N.getString("message.generated-product-guid"), - productGUID.toString())); - - // we use random GUID for product itself but - // user provided for upgrade guid - // Upgrade guid is important to decide whether it is an upgrade of - // installed app. I.e. we need it to be the same for - // 2 different versions of app if possible - data.put("PRODUCT_GUID", productGUID.toString()); - data.put("PRODUCT_UPGRADE_GUID", - UPGRADE_UUID.fetchFrom(params).toString()); - - data.put("APPLICATION_NAME", APP_NAME.fetchFrom(params)); - data.put("APPLICATION_DESCRIPTION", DESCRIPTION.fetchFrom(params)); - data.put("APPLICATION_VENDOR", VENDOR.fetchFrom(params)); - data.put("APPLICATION_VERSION", PRODUCT_VERSION.fetchFrom(params)); - - // WinAppBundler will add application folder again => step out - File imageRootDir = WIN_APP_IMAGE.fetchFrom(params); - File launcher = new File(imageRootDir, - WinAppBundler.getLauncherName(params)); - - String launcherPath = relativePath(imageRootDir, launcher); - data.put("APPLICATION_LAUNCHER", launcherPath); - - String iconPath = launcherPath.replace(".exe", ".ico"); - - data.put("APPLICATION_ICON", iconPath); - - data.put("REGISTRY_ROOT", getRegistryRoot(params)); - - boolean canUseWix36Features = CAN_USE_WIX36.fetchFrom(params); - data.put("WIX36_ONLY_START", - canUseWix36Features ? "" : ""); - - if (MSI_SYSTEM_WIDE.fetchFrom(params)) { - data.put("INSTALL_SCOPE", "perMachine"); - } else { - data.put("INSTALL_SCOPE", "perUser"); - } - - if (BIT_ARCH_64.fetchFrom(params)) { - data.put("PLATFORM", "x64"); - data.put("WIN64", "yes"); - } else { - data.put("PLATFORM", "x86"); - data.put("WIN64", "no"); - } - - data.put("UI_BLOCK", getUIBlock(params)); - - List> secondaryLaunchers = - SECONDARY_LAUNCHERS.fetchFrom(params); - - StringBuilder secondaryLauncherIcons = new StringBuilder(); - for (int i = 0; i < secondaryLaunchers.size(); i++) { - Map sl = secondaryLaunchers.get(i); - // - 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(" \r\n"); - } - } - data.put("SECONDARY_LAUNCHER_ICONS", secondaryLauncherIcons.toString()); - - String wxs = Arguments.CREATE_JRE_INSTALLER.fetchFrom(params) ? - MSI_PROJECT_TEMPLATE_SERVER_JRE : MSI_PROJECT_TEMPLATE; - - Writer w = new BufferedWriter( - new FileWriter(getConfig_ProjectFile(params))); - - String content = preprocessTextResource( - WinAppBundler.WIN_BUNDLER_PREFIX + - getConfig_ProjectFile(params).getName(), - I18N.getString("resource.wix-config-file"), - wxs, data, VERBOSE.fetchFrom(params), - DROP_IN_RESOURCES_ROOT.fetchFrom(params)); - w.write(content); - w.close(); - return true; - } - private int id; - private int compId; - private final static String LAUNCHER_ID = "LauncherId"; - private final static String LAUNCHER_SVC_ID = "LauncherSvcId"; - - /** - * Overrides the dialog sequence in built-in dialog set "WixUI_InstallDir" - * to exclude license dialog - */ - private static final String TWEAK_FOR_EXCLUDING_LICENSE = - " 1" - + " \n" - + " 1" - + " \n"; - - /** - * Creates UI element using WiX built-in dialog sets - * - WixUI_InstallDir/WixUI_Minimal. - * The dialog sets are the closest to what we want to implement. - * - * WixUI_Minimal for license dialog only - * WixUI_InstallDir for installdir dialog only or for both - * installdir/license dialogs - */ - private String getUIBlock(Map params) { - String uiBlock = " \n"; // UI-less element - - if (INSTALLDIR_CHOOSER.fetchFrom(params)) { - boolean enableTweakForExcludingLicense = - (getLicenseFile(params) == null); - uiBlock = " \n" - + " \n" - + " \n" - + (enableTweakForExcludingLicense ? - TWEAK_FOR_EXCLUDING_LICENSE : "") - +" \n"; - } else if (getLicenseFile(params) != null) { - uiBlock = " \n" - + " \n" - + " \n"; - } - - return uiBlock; - } - - private void walkFileTree(Map params, - File root, PrintStream out, String prefix) { - List dirs = new ArrayList<>(); - List files = new ArrayList<>(); - - if (!root.isDirectory()) { - throw new RuntimeException( - MessageFormat.format( - I18N.getString("error.cannot-walk-directory"), - root.getAbsolutePath())); - } - - // sort to files and dirs - File[] children = root.listFiles(); - if (children != null) { - for (File f : children) { - if (f.isDirectory()) { - dirs.add(f); - } else { - files.add(f); - } - } - } - - // have files => need to output component - out.println(prefix + " "); - out.println(prefix + " "); - out.println(prefix + " "); - - boolean needRegistryKey = !MSI_SYSTEM_WIDE.fetchFrom(params); - File imageRootDir = WIN_APP_IMAGE.fetchFrom(params); - File launcherFile = - new File(imageRootDir, WinAppBundler.getLauncherName(params)); - - // Find out if we need to use registry. We need it if - // - we doing user level install as file can not serve as KeyPath - // - if we adding shortcut in this component - - for (File f: files) { - boolean isLauncher = f.equals(launcherFile); - if (isLauncher) { - needRegistryKey = true; - } - } - - if (needRegistryKey) { - // has to be under HKCU to make WiX happy - out.println(prefix + " " : " Action=\"createAndRemoveOnUninstall\">")); - out.println(prefix - + " "); - out.println(prefix + " "); - } - - boolean menuShortcut = MENU_HINT.fetchFrom(params); - boolean desktopShortcut = SHORTCUT_HINT.fetchFrom(params); - - Map idToFileMap = new TreeMap<>(); - boolean launcherSet = false; - - for (File f : files) { - boolean isLauncher = f.equals(launcherFile); - - launcherSet = launcherSet || isLauncher; - - boolean doShortcuts = - isLauncher && (menuShortcut || desktopShortcut); - - String thisFileId = isLauncher ? LAUNCHER_ID : ("FileId" + (id++)); - idToFileMap.put(f.getName(), thisFileId); - - out.println(prefix + " "); - if (doShortcuts && desktopShortcut) { - out.println(prefix - + " "); - } - if (doShortcuts && menuShortcut) { - out.println(prefix - + " "); - } - - List> secondaryLaunchers = - SECONDARY_LAUNCHERS.fetchFrom(params); - for (int i = 0; i < secondaryLaunchers.size(); i++) { - Map sl = secondaryLaunchers.get(i); - File secondaryLauncherFile = new File(imageRootDir, - WinAppBundler.getLauncherName(sl)); - if (f.equals(secondaryLauncherFile)) { - if (SHORTCUT_HINT.fetchFrom(sl)) { - out.println(prefix - + " "); - } - if (MENU_HINT.fetchFrom(sl)) { - out.println(prefix - + " "); - // Should we allow different menu groups? Not for now. - } - } - } - out.println(prefix + " "); - } - - if (launcherSet) { - List> fileAssociations = - FILE_ASSOCIATIONS.fetchFrom(params); - String regName = APP_REGISTRY_NAME.fetchFrom(params); - Set defaultedMimes = new TreeSet<>(); - int count = 0; - for (Map fa : fileAssociations) { - String description = FA_DESCRIPTION.fetchFrom(fa); - List extensions = FA_EXTENSIONS.fetchFrom(fa); - List mimeTypes = FA_CONTENT_TYPE.fetchFrom(fa); - File icon = FA_ICON.fetchFrom(fa); // TODO FA_ICON_ICO - - String mime = (mimeTypes == null || - mimeTypes.isEmpty()) ? null : mimeTypes.get(0); - - if (extensions == null) { - Log.verbose(I18N.getString( - "message.creating-association-with-null-extension")); - - String entryName = regName + "File"; - if (count > 0) { - entryName += "." + count; - } - count++; - out.print(prefix + " "); - } else { - for (String ext : extensions) { - String entryName = regName + "File"; - if (count > 0) { - entryName += "." + count; - } - count++; - - out.print(prefix + " "); - - if (extensions == null) { - Log.verbose(I18N.getString( - "message.creating-association-with-null-extension")); - } else { - out.print(prefix + " "); - } else { - out.println(" ContentType='" + mime + "'>"); - if (!defaultedMimes.contains(mime)) { - out.println(prefix - + " "); - defaultedMimes.add(mime); - } - } - out.println(prefix - + " "); - out.println(prefix + " "); - } - out.println(prefix + " "); - } - } - } - } - - out.println(prefix + " "); - - for (File d : dirs) { - out.println(prefix + " "); - walkFileTree(params, d, out, prefix + " "); - out.println(prefix + " "); - } - } - - String getRegistryRoot(Map params) { - if (MSI_SYSTEM_WIDE.fetchFrom(params)) { - return "HKLM"; - } else { - return "HKCU"; - } - } - - boolean prepareContentList(Map params) - throws FileNotFoundException { - File f = new File( - CONFIG_ROOT.fetchFrom(params), MSI_PROJECT_CONTENT_FILE); - PrintStream out = new PrintStream(f); - - // opening - out.println(""); - out.println(""); - - out.println(" "); - if (MSI_SYSTEM_WIDE.fetchFrom(params)) { - // install to programfiles - if (BIT_ARCH_64.fetchFrom(params)) { - out.println(" "); - } else { - out.println(" "); - } - } else { - // install to user folder - out.println( - " "); - } - out.println(" "); - - // dynamic part - id = 0; - compId = 0; // reset counters - walkFileTree(params, WIN_APP_IMAGE.fetchFrom(params), out, " "); - - // closing - out.println(" "); - out.println(" "); - - // for shortcuts - if (SHORTCUT_HINT.fetchFrom(params)) { - out.println(" "); - } - if (MENU_HINT.fetchFrom(params)) { - out.println(" "); - out.println(" "); - out.println(" "); - out.println(" "); - // This has to be under HKCU to make WiX happy. - // There are numberous discussions on this amoung WiX users - // (if user A installs and user B uninstalls key is left behind) - // there are suggested workarounds but none of them are appealing. - // Leave it for now - out.println( - " "); - out.println(" "); - out.println(" "); - out.println(" "); - } - - out.println(" "); - - out.println(" "); - for (int j = 0; j < compId; j++) { - out.println(" "); - } - // component is defined in the template.wsx - out.println(" "); - out.println(" "); - out.println(""); - - out.close(); - return true; - } - - private File getConfig_ProjectFile(Map params) { - return new File(CONFIG_ROOT.fetchFrom(params), - APP_NAME.fetchFrom(params) + ".wxs"); - } - - private String getLicenseFile(Map params) { - List licenseFiles = LICENSE_FILE.fetchFrom(params); - if (licenseFiles == null || licenseFiles.isEmpty()) { - return null; - } else { - return licenseFiles.get(0); - } - } - - private boolean prepareWiXConfig( - Map params) throws IOException { - return prepareMainProjectFile(params) && prepareContentList(params); - - } - private final static String MSI_PROJECT_TEMPLATE = "template.wxs"; - private final static String MSI_PROJECT_TEMPLATE_SERVER_JRE = - "template.jre.wxs"; - private final static String MSI_PROJECT_CONTENT_FILE = "bundle.wxi"; - - private File buildMSI(Map 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"); - - Log.verbose(MessageFormat.format(I18N.getString( - "message.preparing-msi-config"), msiOut.getAbsolutePath())); - - msiOut.getParentFile().mkdirs(); - - // run candle - ProcessBuilder pb = new ProcessBuilder( - TOOL_CANDLE_EXECUTABLE.fetchFrom(params), - "-nologo", - getConfig_ProjectFile(params).getAbsolutePath(), - "-ext", "WixUtilExtension", - "-out", candleOut.getAbsolutePath()); - pb = pb.directory(WIN_APP_IMAGE.fetchFrom(params)); - IOUtils.exec(pb, false); - - Log.verbose(MessageFormat.format(I18N.getString( - "message.generating-msi"), msiOut.getAbsolutePath())); - - boolean enableLicenseUI = (getLicenseFile(params) != null); - boolean enableInstalldirUI = INSTALLDIR_CHOOSER.fetchFrom(params); - - List commandLine = new ArrayList<>(); - - commandLine.add(TOOL_LIGHT_EXECUTABLE.fetchFrom(params)); - if (enableLicenseUI) { - commandLine.add("-dWixUILicenseRtf="+getLicenseFile(params)); - } - commandLine.add("-nologo"); - commandLine.add("-spdb"); - commandLine.add("-sice:60"); - // ignore warnings due to "missing launcguage info" (ICE60) - commandLine.add(candleOut.getAbsolutePath()); - commandLine.add("-ext"); - commandLine.add("WixUtilExtension"); - if (enableLicenseUI || enableInstalldirUI) { - commandLine.add("-ext"); - commandLine.add("WixUIExtension.dll"); - } - commandLine.add("-out"); - commandLine.add(msiOut.getAbsolutePath()); - - // create .msi - pb = new ProcessBuilder(commandLine); - - pb = pb.directory(WIN_APP_IMAGE.fetchFrom(params)); - IOUtils.exec(pb, false); - - candleOut.delete(); - IOUtils.deleteRecursive(tmpDir); - - return msiOut; - } - - public static void ensureByMutationFileIsRTF(File f) { - if (f == null || !f.isFile()) return; - - try { - boolean existingLicenseIsRTF = false; - - try (FileInputStream fin = new FileInputStream(f)) { - byte[] firstBits = new byte[7]; - - if (fin.read(firstBits) == firstBits.length) { - String header = new String(firstBits); - existingLicenseIsRTF = "{\\rtf1\\".equals(header); - } - } - - if (!existingLicenseIsRTF) { - List oldLicense = Files.readAllLines(f.toPath()); - try (Writer w = Files.newBufferedWriter( - f.toPath(), Charset.forName("Windows-1252"))) { - w.write("{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033" - + "{\\fonttbl{\\f0\\fnil\\fcharset0 Arial;}}\n" - + "\\viewkind4\\uc1\\pard\\sa200\\sl276" - + "\\slmult1\\lang9\\fs20 "); - oldLicense.forEach(l -> { - try { - for (char c : l.toCharArray()) { - // 0x00 <= ch < 0x20 Escaped (\'hh) - // 0x20 <= ch < 0x80 Raw(non - escaped) char - // 0x80 <= ch <= 0xFF Escaped(\ 'hh) - // 0x5C, 0x7B, 0x7D (special RTF characters - // \,{,})Escaped(\'hh) - // ch > 0xff Escaped (\\ud###?) - if (c < 0x10) { - w.write("\\'0"); - w.write(Integer.toHexString(c)); - } else if (c > 0xff) { - w.write("\\ud"); - w.write(Integer.toString(c)); - // \\uc1 is in the header and in effect - // so we trail with a replacement char if - // the font lacks that character - '?' - w.write("?"); - } else if ((c < 0x20) || (c >= 0x80) || - (c == 0x5C) || (c == 0x7B) || - (c == 0x7D)) { - w.write("\\'"); - w.write(Integer.toHexString(c)); - } else { - w.write(c); - } - } - // blank lines are interpreted as paragraph breaks - if (l.length() < 1) { - w.write("\\par"); - } else { - w.write(" "); - } - w.write("\r\n"); - } catch (IOException e) { - Log.verbose(e); - } - }); - w.write("}\r\n"); - } - } - } catch (IOException e) { - Log.verbose(e); - } - - } -} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/windows/WindowsBundlerParam.java --- a/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/windows/WindowsBundlerParam.java Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,132 +0,0 @@ -/* - * Copyright (c) 2014, 2018, 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.jpackager.internal.windows; - -import jdk.jpackager.internal.BundlerParamInfo; -import jdk.jpackager.internal.StandardBundlerParam; -import jdk.jpackager.internal.Arguments; -import jdk.jpackager.internal.RelativeFileSet; -import jdk.jpackager.internal.bundlers.BundleParams; - -import java.util.Map; -import java.util.ResourceBundle; -import java.util.function.BiFunction; -import java.util.function.Function; - -public class WindowsBundlerParam extends StandardBundlerParam { - - private static final ResourceBundle I18N = ResourceBundle.getBundle( - "jdk.jpackager.internal.resources.windows.WindowsBundlerParam"); - - public WindowsBundlerParam(String name, String description, String id, - Class valueType, - Function, T> defaultValueFunction, - BiFunction, T> stringConverter) { - super(name, description, id, valueType, - defaultValueFunction, stringConverter); - } - - public static final BundlerParamInfo INSTALLER_FILE_NAME = - new StandardBundlerParam<> ( - I18N.getString("param.installer-name.name"), - I18N.getString("param.installer-name.description"), - "win.installerName", - String.class, - params -> { - String nm = APP_NAME.fetchFrom(params); - if (nm == null) return null; - - String version = VERSION.fetchFrom(params); - if (version == null) { - return nm; - } else { - return nm + "-" + version; - } - }, - (s, p) -> s); - - public static final BundlerParamInfo APP_REGISTRY_NAME = - new StandardBundlerParam<> ( - I18N.getString("param.registry-name.name"), - I18N.getString("param.registry-name.description"), - Arguments.CLIOptions.WIN_REGISTRY_NAME.getId(), - String.class, - params -> { - String nm = APP_NAME.fetchFrom(params); - if (nm == null) return null; - - return nm.replaceAll("[^-a-zA-Z\\.0-9]", ""); - }, - (s, p) -> s); - - public static final StandardBundlerParam MENU_GROUP = - new StandardBundlerParam<>( - I18N.getString("param.menu-group.name"), - I18N.getString("param.menu-group.description"), - Arguments.CLIOptions.WIN_MENU_GROUP.getId(), - String.class, - params -> params.containsKey(VENDOR.getID()) - ? VENDOR.fetchFrom(params) - : params.containsKey(CATEGORY.getID()) - ? CATEGORY.fetchFrom(params) - : I18N.getString("param.menu-group.default"), - (s, p) -> s - ); - - public static final StandardBundlerParam BIT_ARCH_64 = - new StandardBundlerParam<>( - I18N.getString("param.64-bit.name"), - I18N.getString("param.64-bit.description"), - "win.64Bit", - Boolean.class, - params -> System.getProperty("os.arch").contains("64"), - (s, p) -> Boolean.valueOf(s) - ); - - public static final StandardBundlerParam BIT_ARCH_64_RUNTIME = - new StandardBundlerParam<>( - I18N.getString("param.runtime-64-bit.name"), - I18N.getString("param.runtime-64-bit.description"), - "win.64BitJreRuntime", - Boolean.class, - params -> { - WinAppBundler.extractFlagsFromRuntime(params); - return "64".equals(params.get(".runtime.bit-arch")); - }, - (s, p) -> Boolean.valueOf(s) - ); - - public static final BundlerParamInfo INSTALLDIR_CHOOSER = - new StandardBundlerParam<> ( - I18N.getString("param.installdir-chooser.name"), - I18N.getString("param.installdir-chooser.description"), - Arguments.CLIOptions.WIN_DIR_CHOOSER.getId(), - Boolean.class, - params -> Boolean.FALSE, - (s, p) -> Boolean.valueOf(s) - ); -} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/windows/WindowsDefender.java --- a/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/windows/WindowsDefender.java Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2012, 2018, 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.jpackager.internal.windows; - -import jdk.jpackager.internal.Platform; -import java.util.List; - -public final class WindowsDefender { - - private WindowsDefender() {} - - public static final boolean isThereAPotentialWindowsDefenderIssue() { - boolean result = false; - - if (Platform.getPlatform() == Platform.WINDOWS && - Platform.getMajorVersion() == 10) { - - // If DisableRealtimeMonitoring is not enabled then there - // may be a problem. - if (!WindowsRegistry.readDisableRealtimeMonitoring() && - !isTempDirectoryInExclusionPath()) { - result = true; - } - } - - return result; - } - - private static boolean isTempDirectoryInExclusionPath() { - boolean result = false; - // If the user temp directory is not found in the exclusion - // list then there may be a problem. - List paths = WindowsRegistry.readExclusionsPaths(); - String tempDirectory = getUserTempDirectory(); - - for (String s : paths) { - if (s.equals(tempDirectory)) { - result = true; - break; - } - } - - return result; - } - - public static final String getUserTempDirectory() { - String tempDirectory = System.getProperty("java.io.tmpdir"); - return tempDirectory; - } -} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/jdk/jpackager/internal/windows/WindowsRegistry.java --- a/src/jdk.jpackager/windows/classes/jdk/jpackager/internal/windows/WindowsRegistry.java Wed Nov 21 13:53:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,150 +0,0 @@ -/* - * Copyright (c) 2012, 2018, 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.jpackager.internal.windows; - -import java.io.BufferedReader; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.PrintStream; -import java.util.ArrayList; -import java.util.List; - -import static jdk.jpackager.internal.IOUtils.exec; - -public final class WindowsRegistry { - - private WindowsRegistry() {} - - /** - * Reads the registry value for DisableRealtimeMonitoring. - * @return true if DisableRealtimeMonitoring is set to 0x1, - * false otherwise. - */ - public static final boolean readDisableRealtimeMonitoring() { - boolean result = false; - final String key = "HKEY_LOCAL_MACHINE\\Software\\Microsoft\\" - + "Windows Defender\\Real-Time Protection"; - final String subkey = "DisableRealtimeMonitoring"; - String value = readRegistry(key, subkey); - - if (!value.isEmpty()) { - // This code could be written better but this works. It validates - // that the result of readRegistry returned what we expect and then - // checks for a 0x0 or 0x1. 0x0 means real time monitoring is - // on, 0x1 means it is off. So this function returns true if - // real-time-monitoring is disabled. - int index = value.indexOf(subkey); - value = value.substring(index + subkey.length()); - String reg = "REG_DWORD"; - index = value.indexOf(reg); - value = value.substring(index + reg.length()); - String hex = "0x"; - index = value.indexOf(hex); - value = value.substring(index + hex.length()); - - if (value.equals("1")) { - result = true; - } - } - - return result; - } - - public static final List readExclusionsPaths() { - List result = new ArrayList(); - final String key = "HKEY_LOCAL_MACHINE\\Software\\Microsoft\\" - + "Windows Defender\\Exclusions\\Paths"; - String value = readRegistry(key, ""); - - if (!value.isEmpty()) { - final String reg = "REG_DWORD"; - final String hex = "0x0"; - - int index = value.indexOf(key); - if (index == 0) { - value = value.substring(index + key.length()); - - while (value.length() > 0) { - index = value.indexOf(reg); - String name = value.substring(0, index); - value = value.substring(index + reg.length()); - index = value.indexOf(hex); - value = value.substring(index + hex.length()); - - if (index > 0) { - name = name.trim(); - result.add(name); - } - } - } - } - - return result; - } - - /** - * @param key in the registry - * @param subkey in the registry key - * @return registry value or null if not found - */ - public static final String readRegistry(String key, String subkey){ - String result = ""; - - try { - List buildOptions = new ArrayList<>(); - buildOptions.add("reg"); - buildOptions.add("query"); - buildOptions.add("\"" + key + "\""); - - if (!subkey.isEmpty()) { - buildOptions.add("/v"); - buildOptions.add(subkey); - } - - try (ByteArrayOutputStream baos = new ByteArrayOutputStream(); - PrintStream ps = new PrintStream(baos)) { - ProcessBuilder security = new ProcessBuilder(buildOptions); - exec(security, false, false, ps); - BufferedReader bfReader = new BufferedReader( - new InputStreamReader( - new ByteArrayInputStream(baos.toByteArray()))); - String line = null; - - while((line = bfReader.readLine()) != null){ - result += line; - } - } - catch (IOException e) { - } - } - catch (Exception e) { - } - - return result; - } -} diff -r a42d0a8e0916 -r b0f09e7c4680 src/jdk.jpackager/windows/classes/module-info.java.extra --- a/src/jdk.jpackager/windows/classes/module-info.java.extra Wed Nov 21 13:53:17 2018 -0500 +++ b/src/jdk.jpackager/windows/classes/module-info.java.extra Wed Nov 21 17:50:46 2018 -0500 @@ -23,9 +23,8 @@ * questions. */ +provides jdk.jpackager.internal.Bundler with + jdk.jpackager.internal.WinAppBundler, + jdk.jpackager.internal.WinExeBundler, + jdk.jpackager.internal.WinMsiBundler; -provides jdk.jpackager.internal.Bundler with - jdk.jpackager.internal.windows.WinAppBundler, - jdk.jpackager.internal.windows.WinExeBundler, - jdk.jpackager.internal.windows.WinMsiBundler; -