< prev index next >

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

Print this page




 377                     e.printStackTrace();
 378                 }
 379             }
 380         }
 381 
 382         return true;
 383     }
 384 
 385     public File bundle(Map<String, ? super Object> p, File outdir) {
 386         if (!outdir.isDirectory() && !outdir.mkdirs()) {
 387             throw new RuntimeException(MessageFormat.format(
 388                     getString("error.cannot-create-output-dir"),
 389                     outdir.getAbsolutePath()));
 390         }
 391         if (!outdir.canWrite()) {
 392             throw new RuntimeException(MessageFormat.format(
 393                     getString("error.cannot-write-to-output-dir"),
 394                     outdir.getAbsolutePath()));
 395         }
 396 
 397         if (WindowsDefender.isThereAPotentialWindowsDefenderIssue()) {





 398             Log.error(MessageFormat.format(
 399                     getString("message.potential.windows.defender.issue"),
 400                     WindowsDefender.getUserTempDirectory()));
 401         }
 402 
 403         // validate we have valid tools before continuing
 404         String iscc = TOOL_INNO_SETUP_COMPILER_EXECUTABLE.fetchFrom(p);
 405         if (iscc == null || !new File(iscc).isFile()) {
 406             Log.error(getString("error.iscc-not-found"));
 407             Log.error(MessageFormat.format(
 408                     getString("message.iscc-file-string"), iscc));
 409             return null;
 410         }
 411 
 412         File imageDir = EXE_IMAGE_DIR.fetchFrom(p);
 413         try {
 414             imageDir.mkdirs();
 415 
 416             boolean menuShortcut = MENU_HINT.fetchFrom(p);
 417             boolean desktopShortcut = SHORTCUT_HINT.fetchFrom(p);
 418             if (!menuShortcut && !desktopShortcut) {
 419                 // both can not be false - user will not find the app
 420                 Log.verbose(getString("message.one-shortcut-required"));




 377                     e.printStackTrace();
 378                 }
 379             }
 380         }
 381 
 382         return true;
 383     }
 384 
 385     public File bundle(Map<String, ? super Object> p, File outdir) {
 386         if (!outdir.isDirectory() && !outdir.mkdirs()) {
 387             throw new RuntimeException(MessageFormat.format(
 388                     getString("error.cannot-create-output-dir"),
 389                     outdir.getAbsolutePath()));
 390         }
 391         if (!outdir.canWrite()) {
 392             throw new RuntimeException(MessageFormat.format(
 393                     getString("error.cannot-write-to-output-dir"),
 394                     outdir.getAbsolutePath()));
 395         }
 396 
 397         String tempDirectory = WindowsDefender.getUserTempDirectory();
 398         if (Arguments.CLIOptions.context().userProvidedBuildRoot) {
 399             tempDirectory = BUILD_ROOT.fetchFrom(p).getAbsolutePath();
 400         }
 401         if (WindowsDefender.isThereAPotentialWindowsDefenderIssue(
 402                 tempDirectory)) {
 403             Log.error(MessageFormat.format(
 404                     getString("message.potential.windows.defender.issue"),
 405                     tempDirectory));
 406         }
 407 
 408         // validate we have valid tools before continuing
 409         String iscc = TOOL_INNO_SETUP_COMPILER_EXECUTABLE.fetchFrom(p);
 410         if (iscc == null || !new File(iscc).isFile()) {
 411             Log.error(getString("error.iscc-not-found"));
 412             Log.error(MessageFormat.format(
 413                     getString("message.iscc-file-string"), iscc));
 414             return null;
 415         }
 416 
 417         File imageDir = EXE_IMAGE_DIR.fetchFrom(p);
 418         try {
 419             imageDir.mkdirs();
 420 
 421             boolean menuShortcut = MENU_HINT.fetchFrom(p);
 422             boolean desktopShortcut = SHORTCUT_HINT.fetchFrom(p);
 423             if (!menuShortcut && !desktopShortcut) {
 424                 // both can not be false - user will not find the app
 425                 Log.verbose(getString("message.one-shortcut-required"));


< prev index next >