mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

neil_a_wilson
11.15.2006 7926b4fde36b76848d123186eeea60a075984c44
opends/src/server/org/opends/server/tools/InstallDS.java
@@ -41,7 +41,7 @@
import org.opends.server.types.DN;
import org.opends.server.types.ExistingFileBehavior;
import org.opends.server.types.LDIFExportConfig;
import org.opends.server.util.CreateTemplate;
import org.opends.server.util.SetupUtils;
import org.opends.server.util.LDIFWriter;
import org.opends.server.util.PasswordReader;
import org.opends.server.util.args.ArgumentException;
@@ -81,7 +81,7 @@
  /**
   * Indicates whether we think we're running on a Windows system.
   */
  private static boolean isWindows = false;
  private static final boolean isWindows = SetupUtils.isWindows();
@@ -156,14 +156,6 @@
   */
  public static int installMain(String[] args)
  {
    // Determine whether we think we're running on Windows.
    String osName = System.getProperty("os.name");
    if ((osName != null) && (osName.toLowerCase().indexOf("windows") >= 0))
    {
      isWindows = true;
    }
    // Construct the product version string and the setup filename.
    versionString = DirectoryServer.getVersionString();
@@ -784,7 +776,7 @@
    {
      try
      {
        File templateFile = CreateTemplate.createTemplateFile(
        File templateFile = SetupUtils.createTemplateFile(
                                 baseDNs.getFirst().toString(), numUsers);
        if (ldifFiles == null)
        {
@@ -861,6 +853,24 @@
    }
    // Try to write a file that can be used to set the JAVA_HOME environment
    // variable for the administrative scripts and client tools provided with
    // the server.  If this fails, then it's not a big deal.
    try
    {
      String serverRoot = System.getenv("INSTANCE_ROOT");
      if ((serverRoot == null) || (serverRoot.length() == 0))
      {
        File f = new File(configFileName);
        serverRoot = f.getParentFile().getParentFile().getAbsolutePath();
      }
      // This isn't likely to happen, and it's not a serious problem even if it
      // does.
      SetupUtils.writeSetJavaHome(serverRoot);
    } catch (Exception e) {}
    // If we've gotten here, then everything seems to have gone smoothly.
    if (! silentInstall.isPresent())
    {