< prev index next >

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

Print this page




 237                     I18N.getString("error.cannot-write-to-output-dir"),
 238                     rootFile.getAbsolutePath()));
 239         }
 240         // create the .exe launchers
 241         createLauncherForEntryPoint(params);
 242 
 243         // copy the jars
 244         copyApplication(params);
 245 
 246         // copy in the needed libraries
 247         try (InputStream is_lib = getResourceAsStream(LIBRARY_NAME)) {
 248             Files.copy(is_lib, root.resolve(LIBRARY_NAME));
 249         }
 250 
 251         copyMSVCDLLs();
 252 
 253         // create the additional launcher(s), if any
 254         List<Map<String, ? super Object>> entryPoints =
 255                 StandardBundlerParam.ADD_LAUNCHERS.fetchFrom(params);
 256         for (Map<String, ? super Object> entryPoint : entryPoints) {
 257             Map<String, ? super Object> tmp = new HashMap<>(originalParams);
 258             tmp.putAll(entryPoint);
 259             createLauncherForEntryPoint(tmp);
 260         }
 261     }
 262 
 263     @Override
 264     public void prepareJreFiles() throws IOException {}
 265 
 266     private void copyMSVCDLLs() throws IOException {
 267         AtomicReference<IOException> ioe = new AtomicReference<>();
 268         try (Stream<Path> files = Files.list(runtimeDir.resolve("bin"))) {
 269             files.filter(p -> Pattern.matches(
 270                     "^(vcruntime|msvcp|msvcr|ucrtbase|api-ms-win-).*\\.dll$",
 271                     p.toFile().getName().toLowerCase()))
 272                  .forEach(p -> {
 273                     try {
 274                         Files.copy(p, root.resolve((p.toFile().getName())));
 275                     } catch (IOException e) {
 276                         ioe.set(e);
 277                     }
 278                 });
 279         }




 237                     I18N.getString("error.cannot-write-to-output-dir"),
 238                     rootFile.getAbsolutePath()));
 239         }
 240         // create the .exe launchers
 241         createLauncherForEntryPoint(params);
 242 
 243         // copy the jars
 244         copyApplication(params);
 245 
 246         // copy in the needed libraries
 247         try (InputStream is_lib = getResourceAsStream(LIBRARY_NAME)) {
 248             Files.copy(is_lib, root.resolve(LIBRARY_NAME));
 249         }
 250 
 251         copyMSVCDLLs();
 252 
 253         // create the additional launcher(s), if any
 254         List<Map<String, ? super Object>> entryPoints =
 255                 StandardBundlerParam.ADD_LAUNCHERS.fetchFrom(params);
 256         for (Map<String, ? super Object> entryPoint : entryPoints) {
 257             createLauncherForEntryPoint(
 258                     AddLauncherArguments.merge(originalParams, entryPoint));

 259         }
 260     }
 261 
 262     @Override
 263     public void prepareJreFiles() throws IOException {}
 264 
 265     private void copyMSVCDLLs() throws IOException {
 266         AtomicReference<IOException> ioe = new AtomicReference<>();
 267         try (Stream<Path> files = Files.list(runtimeDir.resolve("bin"))) {
 268             files.filter(p -> Pattern.matches(
 269                     "^(vcruntime|msvcp|msvcr|ucrtbase|api-ms-win-).*\\.dll$",
 270                     p.toFile().getName().toLowerCase()))
 271                  .forEach(p -> {
 272                     try {
 273                         Files.copy(p, root.resolve((p.toFile().getName())));
 274                     } catch (IOException e) {
 275                         ioe.set(e);
 276                     }
 277                 });
 278         }


< prev index next >