8217331: Problems when space in application name JDK-8200758-branch
authorherrick
Tue, 29 Jan 2019 09:40:14 -0500
branchJDK-8200758-branch
changeset 57119 b3dda8d77d8a
parent 57118 cf2b4754174d
child 57125 846d4865b362
8217331: Problems when space in application name Reviewed-by: almatvee, kbr
src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxAppBundler.java
src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxAppImageBuilder.java
src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxDebBundler.java
src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxRpmBundler.java
src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacPkgBundler.java
src/jdk.jpackage/share/classes/jdk/jpackage/internal/Arguments.java
src/jdk.jpackage/share/classes/jdk/jpackage/internal/DeployParams.java
src/jdk.jpackage/share/classes/jdk/jpackage/internal/StandardBundlerParam.java
src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/MainResources.properties
src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/MainResources_ja.properties
src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/MainResources_zh_CN.properties
src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WinMsiBundler.java
src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WindowsAppImageBuilder.java
test/jdk/tools/jpackage/jdk/jpackage/internal/DeployParamsTest.java
--- a/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxAppBundler.java	Tue Jan 29 09:38:31 2019 -0500
+++ b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxAppBundler.java	Tue Jan 29 09:40:14 2019 -0500
@@ -122,11 +122,11 @@
     // 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<String, ? super Object> p) {
-        return new File(outDir, APP_FS_NAME.fetchFrom(p));
+        return new File(outDir, APP_NAME.fetchFrom(p));
     }
 
     public static String getLauncherCfgName(Map<String, ? super Object> p) {
-        return "app/" + APP_FS_NAME.fetchFrom(p) +".cfg";
+        return "app/" + APP_NAME.fetchFrom(p) +".cfg";
     }
 
     File doBundle(Map<String, ? super Object> p, File outputDirectory,
@@ -142,7 +142,7 @@
             File outputDirectory, boolean dependentTask) {
         try {
             File rootDirectory = createRoot(p, outputDirectory, dependentTask,
-                    APP_FS_NAME.fetchFrom(p), "linuxapp-image-builder");
+                    APP_NAME.fetchFrom(p), "linuxapp-image-builder");
             AbstractAppImageBuilder appBuilder = new LinuxAppImageBuilder(
                     APP_NAME.fetchFrom(p), outputDirectory.toPath());
             File predefined = PREDEFINED_RUNTIME_IMAGE.fetchFrom(p);
@@ -163,7 +163,7 @@
             File outputDirectory, boolean dependentTask) {
         try {
             File rootDirectory = createRoot(p, outputDirectory, dependentTask,
-                    APP_FS_NAME.fetchFrom(p), "linuxapp-image-builder");
+                    APP_NAME.fetchFrom(p), "linuxapp-image-builder");
             AbstractAppImageBuilder appBuilder = new LinuxAppImageBuilder(p,
                     outputDirectory.toPath());
             if (PREDEFINED_RUNTIME_IMAGE.fetchFrom(p) == null ) {
--- a/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxAppImageBuilder.java	Tue Jan 29 09:38:31 2019 -0500
+++ b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxAppImageBuilder.java	Tue Jan 29 09:40:14 2019 -0500
@@ -158,15 +158,15 @@
     // 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<String, ? super Object> p) {
-        return new File(outDir, APP_FS_NAME.fetchFrom(p));
+        return new File(outDir, APP_NAME.fetchFrom(p));
     }
 
     public static String getLauncherName(Map<String, ? super Object> p) {
-        return APP_FS_NAME.fetchFrom(p);
+        return APP_NAME.fetchFrom(p);
     }
 
     public static String getLauncherCfgName(Map<String, ? super Object> p) {
-        return "app/" + APP_FS_NAME.fetchFrom(p) + ".cfg";
+        return "app/" + APP_NAME.fetchFrom(p) + ".cfg";
     }
 
     @Override
@@ -197,9 +197,6 @@
         for (Map<String, ? super Object> entryPoint : entryPoints) {
             Map<String, ? super Object> 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);
         }
 
@@ -233,7 +230,7 @@
         File icon = ICON_PNG.fetchFrom(params);
         if (icon != null) {
             File iconTarget = new File(resourcesDir.toFile(),
-                    APP_FS_NAME.fetchFrom(params) + ".png");
+                    APP_NAME.fetchFrom(params) + ".png");
             IOUtils.copyFile(icon, iconTarget);
         }
     }
--- a/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxDebBundler.java	Tue Jan 29 09:38:31 2019 -0500
+++ b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxDebBundler.java	Tue Jan 29 09:40:14 2019 -0500
@@ -193,7 +193,7 @@
                     } else {
                         vendor = "jpackage";
                     }
-                    String appName = APP_FS_NAME.fetchFrom(params);
+                    String appName = APP_NAME.fetchFrom(params);
 
                     return (appName + "-" + vendor).replaceAll("\\s", "");
                 } catch (Exception e) {
@@ -592,7 +592,7 @@
 
                     if (size > 0) {
                         File target = new File(rootDir,
-                                APP_FS_NAME.fetchFrom(params)
+                                APP_NAME.fetchFrom(params)
                                 + "_fa_" + faIcon.getName());
                         IOUtils.copyFile(faIcon, target);
 
@@ -742,13 +742,12 @@
         Map<String, String> data = new HashMap<>();
 
         data.put("APPLICATION_NAME", APP_NAME.fetchFrom(params));
-        data.put("APPLICATION_FS_NAME", APP_FS_NAME.fetchFrom(params));
+        data.put("APPLICATION_FS_NAME", APP_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("APPLICATION_LAUNCHER_FILENAME", APP_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));
@@ -770,14 +769,12 @@
 
     private File getConfig_DesktopShortcutFile(File rootDir,
             Map<String, ? super Object> params) {
-        return new File(rootDir,
-                APP_FS_NAME.fetchFrom(params) + ".desktop");
+        return new File(rootDir, APP_NAME.fetchFrom(params) + ".desktop");
     }
 
     private File getConfig_IconFile(File rootDir,
             Map<String, ? super Object> params) {
-        return new File(rootDir,
-                APP_FS_NAME.fetchFrom(params) + ".png");
+        return new File(rootDir, APP_NAME.fetchFrom(params) + ".png");
     }
 
     private File getConfig_InitScriptFile(Map<String, ? super Object> params) {
--- a/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxRpmBundler.java	Tue Jan 29 09:38:31 2019 -0500
+++ b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxRpmBundler.java	Tue Jan 29 09:40:14 2019 -0500
@@ -132,7 +132,7 @@
                     } else {
                         vendor = "jpackage";
                     }
-                    String appName = APP_FS_NAME.fetchFrom(params);
+                    String appName = APP_NAME.fetchFrom(params);
 
                     return (vendor + "-" + appName).replaceAll("\\s", "");
                 } catch (Exception e) {
@@ -298,7 +298,7 @@
             sb.append("%license ");
             sb.append(LINUX_INSTALL_DIR.fetchFrom(params));
             sb.append("/");
-            sb.append(APP_FS_NAME.fetchFrom(params));
+            sb.append(APP_NAME.fetchFrom(params));
             sb.append("/app/");
             sb.append(licenseFile.getName());
         }
@@ -490,8 +490,8 @@
 
                     if (size > 0) {
                         File target = new File(rootDir,
-                                APP_FS_NAME.fetchFrom(params)
-                                        + "_fa_" + faIcon.getName());
+                                APP_NAME.fetchFrom(params)
+                                + "_fa_" + faIcon.getName());
                         IOUtils.copyFile(faIcon, target);
 
                         // xdg-icon-resource install --context mimetypes
@@ -577,12 +577,11 @@
         Map<String, String> data = new HashMap<>();
 
         data.put("APPLICATION_NAME", APP_NAME.fetchFrom(params));
-        data.put("APPLICATION_FS_NAME", APP_FS_NAME.fetchFrom(params));
+        data.put("APPLICATION_FS_NAME", APP_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("APPLICATION_LAUNCHER_FILENAME", APP_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));
@@ -601,19 +600,17 @@
 
     private File getConfig_DesktopShortcutFile(File rootDir,
             Map<String, ? super Object> params) {
-        return new File(rootDir,
-                APP_FS_NAME.fetchFrom(params) + ".desktop");
+        return new File(rootDir, APP_NAME.fetchFrom(params) + ".desktop");
     }
 
     private File getConfig_IconFile(File rootDir,
             Map<String, ? super Object> params) {
-        return new File(rootDir,
-                APP_FS_NAME.fetchFrom(params) + ".png");
+        return new File(rootDir, APP_NAME.fetchFrom(params) + ".png");
     }
 
     private File getConfig_SpecFile(Map<String, ? super Object> params) {
         return new File(RPM_IMAGE_DIR.fetchFrom(params),
-                APP_FS_NAME.fetchFrom(params) + ".spec");
+                APP_NAME.fetchFrom(params) + ".spec");
     }
 
     private File buildRPM(Map<String, ? super Object> params,
--- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacPkgBundler.java	Tue Jan 29 09:38:31 2019 -0500
+++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacPkgBundler.java	Tue Jan 29 09:40:14 2019 -0500
@@ -178,12 +178,12 @@
 
     private File getPackages_AppPackage(Map<String, ? super Object> params) {
         return new File(PACKAGES_ROOT.fetchFrom(params),
-                APP_FS_NAME.fetchFrom(params) + "-app.pkg");
+                APP_NAME.fetchFrom(params) + "-app.pkg");
     }
 
     private File getPackages_DaemonPackage(Map<String, ? super Object> params) {
         return new File(PACKAGES_ROOT.fetchFrom(params),
-                APP_FS_NAME.fetchFrom(params) + "-daemon.pkg");
+                APP_NAME.fetchFrom(params) + "-daemon.pkg");
     }
 
     private File getConfig_DistributionXMLFile(
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Arguments.java	Tue Jan 29 09:38:31 2019 -0500
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Arguments.java	Tue Jan 29 09:40:14 2019 -0500
@@ -656,11 +656,12 @@
                         (String) slMap.get(Arguments.CLIOptions.NAME.getId());
                 if (slName == null) {
                     throw new PackagerException("ERR_NoSecondaryLauncherName");
-                } else {
-                    for (String usedName : usedNames) {
-                        if (slName.equals(usedName)) {
-                            throw new PackagerException("ERR_NoUniqueName");
-                        }
+                }
+                // same rules apply to secondary launcher names as app name
+                DeployParams.validateName(slName, false);
+                for (String usedName : usedNames) {
+                    if (slName.equals(usedName)) {
+                        throw new PackagerException("ERR_NoUniqueName");
                     }
                 }
                 usedNames.add(slName);
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/DeployParams.java	Tue Jan 29 09:38:31 2019 -0500
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/DeployParams.java	Tue Jan 29 09:40:14 2019 -0500
@@ -27,6 +27,8 @@
 
 import java.io.File;
 import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.InvalidPathException;
 import java.text.MessageFormat;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -291,40 +293,47 @@
                         null : baseDir.getAbsolutePath(), path);
     }
 
-    static void validateAppName(String s) throws PackagerException {
-        if (s == null || s.length() == 0) {
-            // empty or null string - there is no unsupported char
-            return;
+    static void validateName(String s, boolean forApp)
+            throws PackagerException {
+        
+        String exceptionKey = forApp ?
+            "ERR_InvalidAppName" : "ERR_InvalidSLName";
+        
+        if (s == null) {
+            if (forApp) {
+                return;
+            } else {
+                throw new PackagerException(exceptionKey, s);
+            }
         }
-
-        int last = s.length() - 1;
-
-        char fc = s.charAt(0);
-        char lc = s.charAt(last);
-
-        // illegal to end in backslash escape char
-        if (lc == '\\') {
-            throw new PackagerException("ERR_InvalidCharacterInArgument", "--name");
+        if (s.length() == 0 || s.charAt(s.length() - 1) == '\\') {
+            throw new PackagerException(exceptionKey, s);
+        }
+        try {
+            // name must be valid path element for this file system
+            Path p = (new File(s)).toPath();
+            // and it must be a single name element in a path
+            if (p.getNameCount() != 1) {
+                throw new PackagerException(exceptionKey, s);
+            }
+        } catch (InvalidPathException ipe) {
+            throw new PackagerException(ipe, exceptionKey, s);
         }
 
         for (int i = 0; i < s.length(); i++) {
             char a = s.charAt(i);
             // We check for ASCII codes first which we accept. If check fails,
             // check if it is acceptable extended ASCII or unicode character.
-            if (a < ' ' || a > '~' || a == '%') {
-                // Reject '%', whitespaces and ISO Control.
+            if (a < ' ' || a > '~') {
                 // Accept anything else including special chars like copyright
                 // symbols. Note: space will be included by ASCII check above,
-                // but other whitespace like tabs or new line will be ignored.
-                if (Character.isISOControl(a) ||
-                        Character.isWhitespace(a) || a == '%') {
-                    throw new PackagerException(
-                            "ERR_InvalidCharacterInArgument", "--name");
+                // but other whitespace like tabs or new line will be rejected.
+                if (Character.isISOControl(a)  ||
+                        Character.isWhitespace(a)) {
+                    throw new PackagerException(exceptionKey, s);
                 }
-            }
-            if (a == '"') {
-                throw new PackagerException(
-                        "ERR_InvalidCharacterInArgument", "--name");
+            } else if (a == '"' || a == '%') {
+                throw new PackagerException(exceptionKey, s);
             }
         }
     }
@@ -397,7 +406,7 @@
 
         String name = (String)bundlerArguments.get(
                 Arguments.CLIOptions.NAME.getId());
-        validateAppName(name);
+        validateName(name, true);
 
         // Validate app image if set
         String appImage = (String)bundlerArguments.get(
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/StandardBundlerParam.java	Tue Jan 29 09:38:31 2019 -0500
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/StandardBundlerParam.java	Tue Jan 29 09:40:14 2019 -0500
@@ -201,20 +201,6 @@
                     (s, p) -> s
             );
 
-    private static Pattern TO_FS_NAME = Pattern.compile("\\s|[\\\\/?:*<>|]");
-            // keep out invalid/undesireable filename characters
-
-    static final StandardBundlerParam<String> APP_FS_NAME =
-            new StandardBundlerParam<>(
-                    I18N.getString("param.app-fs-name.name"),
-                    I18N.getString("param.app-fs-name.description"),
-                    "name.fs",
-                    String.class,
-                    params -> TO_FS_NAME.matcher(
-                            APP_NAME.fetchFrom(params)).replaceAll(""),
-                    (s, p) -> s
-            );
-
     static final StandardBundlerParam<File> ICON =
             new StandardBundlerParam<>(
                     I18N.getString("param.icon-file.name"),
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/MainResources.properties	Tue Jan 29 09:38:31 2019 -0500
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/MainResources.properties	Tue Jan 29 09:40:14 2019 -0500
@@ -38,8 +38,6 @@
 param.jlink-builder.description=Name of the JLink Builder to build the applicaiton image with.
 param.app-name.name=App Name
 param.app-name.description=The name of the application.
-param.app-fs-name.name=App File System Name
-param.app-fs-name.description=The name of the application suitable for file system use.  Typically this is just letters, numbers, dots, and dashes.
 param.app-resource.description=All of the files to place in the resources directory.  Including all needed jars as assets.
 param.app-resources.name=Resources
 param.app-resource-list.description=A List of RelativeFileSet objects containing all of the files to place in the resources directory.  Including all needed jars as assets.
@@ -168,9 +166,10 @@
 ERR_MissingAppResources=Error: No application jars found
 ERR_AppImageNotExist=Error: App image directory "{0}" does not exist
 ERR_AppImageInvalid=Error: App image directory "{0}" is invalid and does not contain "app" and/or "runtime" sub-directories
-ERR_NoSecondaryLauncherName=Secondary Launchers require a name parameter.
-ERR_NoUniqueName=Secondary Launchers require a unique name parameter.
-ERR_NoJreInstallerName=Jre Installers require a name parameter.
-ERR_InvalidCharacterInArgument=Error: Invalid character found in {0} argument
+ERR_NoSecondaryLauncherName=Error: Secondary Launchers require a name parameter.
+ERR_NoUniqueName=Error: Secondary Launchers require a unique name parameter.
+ERR_NoJreInstallerName=Error: Jre Installers require a name parameter.
+ERR_InvalidAppName=Error: Invalid Application name: {0}.
+ERR_InvalidSLName=Error: Invalid Secondary Launcher name: {0}.
 ERR_LicenseFileNotExit=Error: Specified license file does not exist.
 ERR_BuildRootInvalid=Error: build-root ({0}) must be empty directory.
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/MainResources_ja.properties	Tue Jan 29 09:38:31 2019 -0500
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/MainResources_ja.properties	Tue Jan 29 09:40:14 2019 -0500
@@ -38,8 +38,6 @@
 param.jlink-builder.description=Name of the JLink Builder to build the applicaiton image with.
 param.app-name.name=App Name
 param.app-name.description=The name of the application.
-param.app-fs-name.name=App File System Name
-param.app-fs-name.description=The name of the application suitable for file system use.  Typically this is just letters, numbers, dots, and dashes.
 param.app-resource.description=All of the files to place in the resources directory.  Including all needed jars as assets.
 param.app-resources.name=Resources
 param.app-resource-list.description=A List of RelativeFileSet objects containing all of the files to place in the resources directory.  Including all needed jars as assets.
@@ -168,9 +166,10 @@
 ERR_MissingAppResources=Error: No application jars found
 ERR_AppImageNotExist=Error: App image directory "{0}" does not exist
 ERR_AppImageInvalid=Error: App image directory "{0}" is invalid and does not contain "app" and/or "runtime" sub-directories
-ERR_NoSecondaryLauncherName=Secondary Launchers require a name parameter.
-ERR_NoUniqueName=Secondary Launchers require a unique name parameter.
-ERR_NoJreInstallerName=Jre Installers require a name parameter.
-ERR_InvalidCharacterInArgument=Error: Invalid character found in {0} argument
+ERR_NoSecondaryLauncherName=Error: Secondary Launchers require a name parameter.
+ERR_NoUniqueName=Error: Secondary Launchers require a unique name parameter.
+ERR_NoJreInstallerName=Error: Jre Installers require a name parameter.
+ERR_InvalidAppName=Error: Invalid Application name: {0}.
+ERR_InvalidSLName=Error: Invalid Secondary Launcher name: {0}.
 ERR_LicenseFileNotExit=Error: Specified license file does not exist.
 ERR_BuildRootInvalid=Error: build-root ({0}) must be empty directory.
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/MainResources_zh_CN.properties	Tue Jan 29 09:38:31 2019 -0500
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/MainResources_zh_CN.properties	Tue Jan 29 09:40:14 2019 -0500
@@ -38,8 +38,6 @@
 param.jlink-builder.description=Name of the JLink Builder to build the applicaiton image with.
 param.app-name.name=App Name
 param.app-name.description=The name of the application.
-param.app-fs-name.name=App File System Name
-param.app-fs-name.description=The name of the application suitable for file system use.  Typically this is just letters, numbers, dots, and dashes.
 param.app-resource.description=All of the files to place in the resources directory.  Including all needed jars as assets.
 param.app-resources.name=Resources
 param.app-resource-list.description=A List of RelativeFileSet objects containing all of the files to place in the resources directory.  Including all needed jars as assets.
@@ -168,9 +166,10 @@
 ERR_MissingAppResources=Error: No application jars found
 ERR_AppImageNotExist=Error: App image directory "{0}" does not exist
 ERR_AppImageInvalid=Error: App image directory "{0}" is invalid and does not contain "app" and/or "runtime" sub-directories
-ERR_NoSecondaryLauncherName=Secondary Launchers require a name parameter.
-ERR_NoUniqueName=Secondary Launchers require a unique name parameter.
-ERR_NoJreInstallerName=Jre Installers require a name parameter.
-ERR_InvalidCharacterInArgument=Error: Invalid character found in {0} argument
+ERR_NoSecondaryLauncherName=Error: Secondary Launchers require a name parameter.
+ERR_NoUniqueName=Error: Secondary Launchers require a unique name parameter.
+ERR_NoJreInstallerName=Error: Jre Installers require a name parameter.
+ERR_InvalidAppName=Error: Invalid Application name: {0}.
+ERR_InvalidSLName=Error: Invalid Secondary Launcher name: {0}.
 ERR_LicenseFileNotExit=Error: Specified license file does not exist.
 ERR_BuildRootInvalid=Error: build-root ({0}) must be empty directory.
--- a/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WinMsiBundler.java	Tue Jan 29 09:38:31 2019 -0500
+++ b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WinMsiBundler.java	Tue Jan 29 09:40:14 2019 -0500
@@ -541,7 +541,7 @@
     // name of post-image script
     private File getConfig_Script(Map<String, ? super Object> params) {
         return new File(CONFIG_ROOT.fetchFrom(params),
-                APP_FS_NAME.fetchFrom(params) + "-post-image.wsf");
+                APP_NAME.fetchFrom(params) + "-post-image.wsf");
     }
 
     private boolean prepareBasicProjectConfig(
--- a/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WindowsAppImageBuilder.java	Tue Jan 29 09:38:31 2019 -0500
+++ b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WindowsAppImageBuilder.java	Tue Jan 29 09:40:14 2019 -0500
@@ -186,7 +186,7 @@
     }
 
     public static String getLauncherName(Map<String, ? super Object> p) {
-        return APP_FS_NAME.fetchFrom(p) + ".exe";
+        return APP_NAME.fetchFrom(p) + ".exe";
     }
 
     // Returns launcher resource name for launcher we need to use.
@@ -200,18 +200,18 @@
     }
 
     public static String getLauncherCfgName(Map<String, ? super Object> p) {
-        return "app/" + APP_FS_NAME.fetchFrom(p) +".cfg";
+        return "app/" + APP_NAME.fetchFrom(p) +".cfg";
     }
 
     private File getConfig_AppIcon(Map<String, ? super Object> params) {
         return new File(getConfigRoot(params),
-                APP_FS_NAME.fetchFrom(params) + ".ico");
+                APP_NAME.fetchFrom(params) + ".ico");
     }
 
     private File getConfig_ExecutableProperties(
            Map<String, ? super Object> params) {
         return new File(getConfigRoot(params),
-                APP_FS_NAME.fetchFrom(params) + ".properties");
+                APP_NAME.fetchFrom(params) + ".properties");
     }
 
     File getConfigRoot(Map<String, ? super Object> params) {
--- a/test/jdk/tools/jpackage/jdk/jpackage/internal/DeployParamsTest.java	Tue Jan 29 09:38:31 2019 -0500
+++ b/test/jdk/tools/jpackage/jdk/jpackage/internal/DeployParamsTest.java	Tue Jan 29 09:40:14 2019 -0500
@@ -83,7 +83,7 @@
         try {
             params.validate();
         } catch (PackagerException pe) {
-            if (!pe.getMessage().equals("Error: Invalid character found in --name argument")) {
+            if (!pe.getMessage().startsWith("Error: Invalid Application name")) {
                 throw new Exception("Unexpected PackagerException received: " + pe);
             }