src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WindowsAppImageBuilder.java
branchJDK-8200758-branch
changeset 57256 d7c27451f759
parent 57215 62db1c695d13
child 57259 a84c657c713d
equal deleted inserted replaced
57255:f686bda3b831 57256:d7c27451f759
    78 
    78 
    79     private final Map<String, ? super Object> params;
    79     private final Map<String, ? super Object> params;
    80 
    80 
    81     public static final BundlerParamInfo<Boolean> REBRAND_EXECUTABLE =
    81     public static final BundlerParamInfo<Boolean> REBRAND_EXECUTABLE =
    82             new WindowsBundlerParam<>(
    82             new WindowsBundlerParam<>(
    83             I18N.getString("param.rebrand-executable.name"),
       
    84             I18N.getString("param.rebrand-executable.description"),
       
    85             "win.launcher.rebrand",
    83             "win.launcher.rebrand",
    86             Boolean.class,
    84             Boolean.class,
    87             params -> Boolean.TRUE,
    85             params -> Boolean.TRUE,
    88             (s, p) -> Boolean.valueOf(s));
    86             (s, p) -> Boolean.valueOf(s));
    89 
    87 
    90     public static final BundlerParamInfo<File> ICON_ICO =
    88     public static final BundlerParamInfo<File> ICON_ICO =
    91             new StandardBundlerParam<>(
    89             new StandardBundlerParam<>(
    92             I18N.getString("param.icon-ico.name"),
       
    93             I18N.getString("param.icon-ico.description"),
       
    94             "icon.ico",
    90             "icon.ico",
    95             File.class,
    91             File.class,
    96             params -> {
    92             params -> {
    97                 File f = ICON.fetchFrom(params);
    93                 File f = ICON.fetchFrom(params);
    98                 if (f != null && !f.getName().toLowerCase().endsWith(".ico")) {
    94                 if (f != null && !f.getName().toLowerCase().endsWith(".ico")) {
   104             },
   100             },
   105             (s, p) -> new File(s));
   101             (s, p) -> new File(s));
   106 
   102 
   107     public static final StandardBundlerParam<Boolean> CONSOLE_HINT =
   103     public static final StandardBundlerParam<Boolean> CONSOLE_HINT =
   108             new WindowsBundlerParam<>(
   104             new WindowsBundlerParam<>(
   109             I18N.getString("param.console-hint.name"),
       
   110             I18N.getString("param.console-hint.description"),
       
   111             Arguments.CLIOptions.WIN_CONSOLE_HINT.getId(),
   105             Arguments.CLIOptions.WIN_CONSOLE_HINT.getId(),
   112             Boolean.class,
   106             Boolean.class,
   113             params -> false,
   107             params -> false,
   114             // valueOf(null) is false,
   108             // valueOf(null) is false,
   115             // and we actually do want null in some cases
   109             // and we actually do want null in some cases
   254             Files.copy(is_lib, root.resolve(LIBRARY_NAME));
   248             Files.copy(is_lib, root.resolve(LIBRARY_NAME));
   255         }
   249         }
   256 
   250 
   257         copyMSVCDLLs();
   251         copyMSVCDLLs();
   258 
   252 
   259         // create the secondary launchers, if any
   253         // create the additional launcher(s), if any
   260         List<Map<String, ? super Object>> entryPoints =
   254         List<Map<String, ? super Object>> entryPoints =
   261                 StandardBundlerParam.SECONDARY_LAUNCHERS.fetchFrom(params);
   255                 StandardBundlerParam.ADD_LAUNCHERS.fetchFrom(params);
   262         for (Map<String, ? super Object> entryPoint : entryPoints) {
   256         for (Map<String, ? super Object> entryPoint : entryPoints) {
   263             Map<String, ? super Object> tmp = new HashMap<>(originalParams);
   257             Map<String, ? super Object> tmp = new HashMap<>(originalParams);
   264             tmp.putAll(entryPoint);
   258             tmp.putAll(entryPoint);
   265             createLauncherForEntryPoint(tmp);
   259             createLauncherForEntryPoint(tmp);
   266         }
   260         }
   387         // Update branding of EXE file
   381         // Update branding of EXE file
   388         if (REBRAND_EXECUTABLE.fetchFrom(p)) {
   382         if (REBRAND_EXECUTABLE.fetchFrom(p)) {
   389             try {
   383             try {
   390                 String tempDirectory = WindowsDefender.getUserTempDirectory();
   384                 String tempDirectory = WindowsDefender.getUserTempDirectory();
   391                 if (Arguments.CLIOptions.context().userProvidedBuildRoot) {
   385                 if (Arguments.CLIOptions.context().userProvidedBuildRoot) {
   392                     tempDirectory = BUILD_ROOT.fetchFrom(p).getAbsolutePath();
   386                     tempDirectory = TEMP_ROOT.fetchFrom(p).getAbsolutePath();
   393                 }
   387                 }
   394                 if (WindowsDefender.isThereAPotentialWindowsDefenderIssue(
   388                 if (WindowsDefender.isThereAPotentialWindowsDefenderIssue(
   395                         tempDirectory)) {
   389                         tempDirectory)) {
   396                     Log.error(MessageFormat.format(I18N.getString(
   390                     Log.error(MessageFormat.format(I18N.getString(
   397                             "message.potential.windows.defender.issue"),
   391                             "message.potential.windows.defender.issue"),