コード例 #1
0
  /* Creates shortcuts for windows. The ones created from OI will be removed due to
  manged names. These shortcuts are in addition to the ones created by default.
  Since the descriptor for defining the short cut entry is not OS specific, we still
  need to carry on the xml entries to create items on Gnome.
   */
  private void createServerShortCuts() throws EnhancedException {
    String folderName = (String) TemplateProcessor.getInstance().getFromDataModel("PRODUCT_NAME");
    LOGGER.log(Level.INFO, Msg.get("CREATE_SHORTCUT_HEADER", new String[] {folderName}));

    WindowsShortcutManager wsShortMgr = new WindowsShortcutManager();
    wsShortMgr.createFolder(folderName);
    String modifiedInstallDir = productRef.getInstallLocation().replace("\\", "\\\\");

    LOGGER.log(Level.FINEST, modifiedInstallDir);
    // Create short cut for uninstall.exe.
    wsShortMgr.createShortCut(
        folderName,
        Msg.get("UNINSTALL", null),
        modifiedInstallDir + "\\\\uninstall.exe",
        Msg.get("UNINSTALL", null),
        "-j \" & chr(34) & \"" + jdkHome.replace("\\", "\\\\") + "\" & chr(34)",
        modifiedInstallDir + "\\\\glassfish\\\\icons\\\\uninstall.ico",
        modifiedInstallDir,
        "2");

    // Create short cut for Quick Start guide.
    wsShortMgr.createShortCut(
        folderName,
        Msg.get("QSGUIDE", null),
        modifiedInstallDir + "\\\\glassfish\\\\docs\\\\quickstart.html");

    // Look for correct page deployed in the installdir before linking it.
    // this code is only w2k specific.
    String aboutFilesLocation = "\\glassfish\\docs\\";
    String aboutFiles[] = {"about_sdk.html", "about_sdk_web.html", "about.html"};
    // The default
    String aboutFile = "about.html";
    // Traverse through the list to find out which file exist first
    for (int i = 0; i < aboutFiles.length; i++) {
      File f = new File(modifiedInstallDir + aboutFilesLocation + aboutFiles[i]);
      if (f.exists()) {
        // then break
        aboutFile = aboutFiles[i];
        break;
      }
      f = null;
    }
    LOGGER.log(Level.FINEST, aboutFile);
    // Create short cut for About Page.
    wsShortMgr.createShortCut(
        folderName,
        Msg.get("ABOUT_GLASSFISH_SERVER", null),
        modifiedInstallDir
            + aboutFilesLocation.replace("\\", "\\\\")
            + aboutFile.replace("\\", "\\\\"));
  }
コード例 #2
0
 /* Creates shortcuts for windows. The ones created from OI will be removed due to
 mangled names. These shortcuts are in addition to the ones created by default.
 Since the descriptor for defining the short cut entry is not OS specific, we still
 need to carry on the xml entries to create items on Gnome.
  */
 private void createUpdatetoolShortCuts() {
   String folderName = (String) TemplateProcessor.getInstance().getFromDataModel("PRODUCT_NAME");
   LOGGER.log(Level.INFO, Msg.get("CREATE_SHORTCUT_HEADER", new String[] {folderName}));
   WindowsShortcutManager wsShortMgr = new WindowsShortcutManager();
   wsShortMgr.createFolder(folderName);
   String modifiedInstallDir = productRef.getInstallLocation().replace("\\", "\\\\");
   LOGGER.log(Level.FINEST, modifiedInstallDir);
   // Create short cut for starting update tool.
   wsShortMgr.createShortCut(
       folderName,
       Msg.get("START_UPDATE_TOOL", null),
       modifiedInstallDir + "\\\\bin\\\\updatetool.exe",
       Msg.get("START_UPDATE_TOOL", null),
       "\"",
       modifiedInstallDir
           + "\\\\updatetool\\\\vendor-packages\\\\updatetool\\\\images\\\\application-update-tool.ico",
       modifiedInstallDir + "\\\\bin",
       "2");
 }