src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxDebBundler.java
branchJDK-8200758-branch
changeset 57150 fa68c2ab636d
parent 57140 3dcb33ce7ced
child 57255 f686bda3b831
equal deleted inserted replaced
57141:e7ba8c89abe7 57150:fa68c2ab636d
   408         File rootDir = LinuxAppBundler.getRootDir(APP_IMAGE_ROOT.fetchFrom(
   408         File rootDir = LinuxAppBundler.getRootDir(APP_IMAGE_ROOT.fetchFrom(
   409                 params), params);
   409                 params), params);
   410 
   410 
   411         File iconTarget = getConfig_IconFile(rootDir, params);
   411         File iconTarget = getConfig_IconFile(rootDir, params);
   412         File icon = ICON_PNG.fetchFrom(params);
   412         File icon = ICON_PNG.fetchFrom(params);
   413         if (!Arguments.CREATE_JRE_INSTALLER.fetchFrom(params)) {
   413         if (!RUNTIME_INSTALLER.fetchFrom(params)) {
   414             // prepare installer icon
   414             // prepare installer icon
   415             if (icon == null || !icon.exists()) {
   415             if (icon == null || !icon.exists()) {
   416                 fetchResource(iconTarget.getName(),
   416                 fetchResource(iconTarget.getName(),
   417                         I18N.getString("resource.menu-icon"),
   417                         I18N.getString("resource.menu-icon"),
   418                         DEFAULT_ICON,
   418                         DEFAULT_ICON,
   437                     createReplacementData(secondaryLauncher);
   437                     createReplacementData(secondaryLauncher);
   438             secondaryLauncherData.put("APPLICATION_FS_NAME",
   438             secondaryLauncherData.put("APPLICATION_FS_NAME",
   439                     data.get("APPLICATION_FS_NAME"));
   439                     data.get("APPLICATION_FS_NAME"));
   440             secondaryLauncherData.put("DESKTOP_MIMES", "");
   440             secondaryLauncherData.put("DESKTOP_MIMES", "");
   441 
   441 
   442             if (!Arguments.CREATE_JRE_INSTALLER.fetchFrom(params)) {
   442             if (!RUNTIME_INSTALLER.fetchFrom(params)) {
   443                 // prepare desktop shortcut
   443                 // prepare desktop shortcut
   444                 Writer w = new BufferedWriter(new FileWriter(
   444                 Writer w = new BufferedWriter(new FileWriter(
   445                         getConfig_DesktopShortcutFile(
   445                         getConfig_DesktopShortcutFile(
   446                                 rootDir, secondaryLauncher)));
   446                                 rootDir, secondaryLauncher)));
   447                 String content = preprocessTextResource(
   447                 String content = preprocessTextResource(
   638                 data.put("FILE_ASSOCIATION_REMOVE", deregistrations.toString());
   638                 data.put("FILE_ASSOCIATION_REMOVE", deregistrations.toString());
   639                 data.put("DESKTOP_MIMES", desktopMimes.toString());
   639                 data.put("DESKTOP_MIMES", desktopMimes.toString());
   640             }
   640             }
   641         }
   641         }
   642 
   642 
   643         if (!Arguments.CREATE_JRE_INSTALLER.fetchFrom(params)) {
   643         if (!RUNTIME_INSTALLER.fetchFrom(params)) {
   644             //prepare desktop shortcut
   644             //prepare desktop shortcut
   645             Writer w = new BufferedWriter(new FileWriter(
   645             Writer w = new BufferedWriter(new FileWriter(
   646                     getConfig_DesktopShortcutFile(rootDir, params)));
   646                     getConfig_DesktopShortcutFile(rootDir, params)));
   647             String content = preprocessTextResource(
   647             String content = preprocessTextResource(
   648                     getConfig_DesktopShortcutFile(
   648                     getConfig_DesktopShortcutFile(
   754         data.put("APPLICATION_INSTALLED_SIZE",
   754         data.put("APPLICATION_INSTALLED_SIZE",
   755                 Long.toString(getInstalledSizeKB(params)));
   755                 Long.toString(getInstalledSizeKB(params)));
   756         String deps = LINUX_PACKAGE_DEPENDENCIES.fetchFrom(params);
   756         String deps = LINUX_PACKAGE_DEPENDENCIES.fetchFrom(params);
   757         data.put("PACKAGE_DEPENDENCIES",
   757         data.put("PACKAGE_DEPENDENCIES",
   758                 deps.isEmpty() ? "" : "Depends: " + deps);
   758                 deps.isEmpty() ? "" : "Depends: " + deps);
   759         data.put("CREATE_JRE_INSTALLER",
   759         data.put("RUNTIME_INSTALLER",
   760                 Arguments.CREATE_JRE_INSTALLER.fetchFrom(params).toString());
   760                 RUNTIME_INSTALLER.fetchFrom(params).toString());
   761 
   761 
   762         return data;
   762         return data;
   763     }
   763     }
   764 
   764 
   765     private File getConfig_DesktopShortcutFile(File rootDir,
   765     private File getConfig_DesktopShortcutFile(File rootDir,
   872             File outputParentDir) throws PackagerException {
   872             File outputParentDir) throws PackagerException {
   873         return bundle(params, outputParentDir);
   873         return bundle(params, outputParentDir);
   874     }
   874     }
   875 
   875 
   876     @Override
   876     @Override
   877     public boolean supported() {
   877     public boolean supported(boolean runtimeInstaller) {
   878         return (Platform.getPlatform() == Platform.LINUX);
   878         return (Platform.getPlatform() == Platform.LINUX);
   879     }
   879     }
   880 
   880 
   881     public int getSquareSizeOfImage(File f) {
   881     public int getSquareSizeOfImage(File f) {
   882         try {
   882         try {