419 |
419 |
420 params.put(WIN_APP_IMAGE.getID(), appDir); |
420 params.put(WIN_APP_IMAGE.getID(), appDir); |
421 |
421 |
422 String licenseFile = LICENSE_FILE.fetchFrom(params); |
422 String licenseFile = LICENSE_FILE.fetchFrom(params); |
423 if (licenseFile != null) { |
423 if (licenseFile != null) { |
424 // need to copy license file to the working directory and convert to rtf if needed |
424 // need to copy license file to the working directory |
|
425 // and convert to rtf if needed |
425 File lfile = new File(licenseFile); |
426 File lfile = new File(licenseFile); |
426 File destFile = new File(CONFIG_ROOT.fetchFrom(params), |
427 File destFile = new File(CONFIG_ROOT.fetchFrom(params), |
427 lfile.getName()); |
428 lfile.getName()); |
428 |
429 |
429 IOUtils.copyFile(lfile, destFile); |
430 IOUtils.copyFile(lfile, destFile); |
552 xml.writeStartElement("Include"); |
553 xml.writeStartElement("Include"); |
553 |
554 |
554 File launcher = new File(imageRootDir, |
555 File launcher = new File(imageRootDir, |
555 WinAppBundler.getLauncherRelativePath(params)); |
556 WinAppBundler.getLauncherRelativePath(params)); |
556 if (launcher.exists()) { |
557 if (launcher.exists()) { |
557 String iconPath = launcher.getAbsolutePath().replace(".exe", ".ico"); |
558 String iconPath = launcher.getAbsolutePath().replace( |
|
559 ".exe", ".ico"); |
558 if (MENU_HINT.fetchFrom(params)) { |
560 if (MENU_HINT.fetchFrom(params)) { |
559 xml.writeStartElement("Icon"); |
561 xml.writeStartElement("Icon"); |
560 xml.writeAttribute("Id", "StartMenuIcon.exe"); |
562 xml.writeAttribute("Id", "StartMenuIcon.exe"); |
561 xml.writeAttribute("SourceFile", iconPath); |
563 xml.writeAttribute("SourceFile", iconPath); |
562 xml.writeEndElement(); |
564 xml.writeEndElement(); |
626 data.put("JpAppName", APP_NAME.fetchFrom(params)); |
628 data.put("JpAppName", APP_NAME.fetchFrom(params)); |
627 data.put("JpAppDescription", DESCRIPTION.fetchFrom(params)); |
629 data.put("JpAppDescription", DESCRIPTION.fetchFrom(params)); |
628 data.put("JpAppVendor", VENDOR.fetchFrom(params)); |
630 data.put("JpAppVendor", VENDOR.fetchFrom(params)); |
629 data.put("JpAppVersion", PRODUCT_VERSION.fetchFrom(params)); |
631 data.put("JpAppVersion", PRODUCT_VERSION.fetchFrom(params)); |
630 |
632 |
631 data.put("JpConfigDir", CONFIG_ROOT.fetchFrom(params).getAbsolutePath()); |
633 data.put("JpConfigDir", |
|
634 CONFIG_ROOT.fetchFrom(params).getAbsolutePath()); |
632 |
635 |
633 File imageRootDir = WIN_APP_IMAGE.fetchFrom(params); |
636 File imageRootDir = WIN_APP_IMAGE.fetchFrom(params); |
634 |
637 |
635 if (MSI_SYSTEM_WIDE.fetchFrom(params)) { |
638 if (MSI_SYSTEM_WIDE.fetchFrom(params)) { |
636 data.put("JpIsSystemWide", "yes"); |
639 data.put("JpIsSystemWide", "yes"); |
647 if (INSTALLDIR_CHOOSER.fetchFrom(params)) { |
650 if (INSTALLDIR_CHOOSER.fetchFrom(params)) { |
648 data.put("JpInstallDirChooser", "yes"); |
651 data.put("JpInstallDirChooser", "yes"); |
649 String fname = "wixhelper.dll"; |
652 String fname = "wixhelper.dll"; |
650 try (InputStream is = getResourceAsStream(fname)) { |
653 try (InputStream is = getResourceAsStream(fname)) { |
651 Files.copy(is, Paths.get( |
654 Files.copy(is, Paths.get( |
652 CONFIG_ROOT.fetchFrom(params).getAbsolutePath(), fname)); |
655 CONFIG_ROOT.fetchFrom(params).getAbsolutePath(), |
|
656 fname)); |
653 } |
657 } |
654 } |
658 } |
655 |
659 |
656 // Copy l10n files. |
660 // Copy l10n files. |
657 for (String loc : Arrays.asList("en", "ja", "zh_CN")) { |
661 for (String loc : Arrays.asList("en", "ja", "zh_CN")) { |
658 String fname = "MsiInstallerStrings_" + loc + ".wxl"; |
662 String fname = "MsiInstallerStrings_" + loc + ".wxl"; |
659 try (InputStream is = getResourceAsStream(fname)) { |
663 try (InputStream is = getResourceAsStream(fname)) { |
660 Files.copy(is, Paths.get( |
664 Files.copy(is, Paths.get( |
661 CONFIG_ROOT.fetchFrom(params).getAbsolutePath(), fname)); |
665 CONFIG_ROOT.fetchFrom(params).getAbsolutePath(), |
|
666 fname)); |
662 } |
667 } |
663 } |
668 } |
664 |
669 |
665 try (InputStream is = getResourceAsStream("main.wxs")) { |
670 try (InputStream is = getResourceAsStream("main.wxs")) { |
666 Files.copy(is, Paths.get( |
671 Files.copy(is, Paths.get( |