/*
   * OI hook to call individual product configurations.
   */
  public ResultReport unConfigure(final PropertySheet propSheet, final boolean validateFlag) {

    try {
      if (productRef.getProductName().equals("Domain")) {
        LOGGER.log(Level.INFO, Msg.get("UNCONFIGURING_GLASSFISH", null));
        unconfigureGlassfish();
      }

      if (productRef.getProductName().equals("UpdateTool")) {
        LOGGER.log(Level.INFO, Msg.get("UNCONFIGURING_UPDATETOOL", null));
        unconfigureUpdatetool();
        org.glassfish.installer.util.FileUtils.deleteDirectory(
            new File(productRef.getInstallLocation() + File.separator + "updatetool"));
        org.glassfish.installer.util.FileUtils.deleteDirectory(
            new File(productRef.getInstallLocation() + File.separator + "pkg"));
      }
      /* Delete the newly created folder, on windows. No incremental uninstallation, so delete everything.*/
      String folderName = (String) TemplateProcessor.getInstance().getFromDataModel("PRODUCT_NAME");
      if (OSUtils.isWindows()) {
        WindowsShortcutManager wsShortMgr = new WindowsShortcutManager();
        wsShortMgr.deleteFolder(folderName);
      }
    } catch (Exception e) {
      LOGGER.log(Level.FINEST, e.getMessage());
    }

    return new ResultReport(
        ResultReport.ResultStatus.SUCCESS,
        "http://www.oracle.com/pls/topic/lookup?ctx=821-2427&id=sjsaseeig",
        "http://www.oracle.com/pls/topic/lookup?ctx=821-2427&id=sjsaseeig",
        null,
        productError);
  }
  /* 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("\\", "\\\\"));
  }
 /* 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");
 }