From bbadcb75d4629441e73ea04782ae2c5decf64fe3 Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Mon, 17 Dec 2007 10:43:53 +0000
Subject: [PATCH] 2730: New - The setup command should perform some basic memory tuning Note: this issue is not fully covered by the proposed modifications but all that is missing in order to fix it is to figure out which are the default memory values that we want to propose in the setup.

---
 opends/resource/setup.bat |   62 ++++--------------------------
 1 files changed, 9 insertions(+), 53 deletions(-)

diff --git a/opends/resource/setup.bat b/opends/resource/setup.bat
index b9d6e2a..5f97e52 100644
--- a/opends/resource/setup.bat
+++ b/opends/resource/setup.bat
@@ -39,39 +39,15 @@
 
 set INSTANCE_ROOT=%DIR_HOME%
 
-:checkOpenDSJavaBin
-if "%OPENDS_JAVA_BIN%" == "" goto checkOpenDSJavaHome
-goto setClassPath
+set SCRIPT_NAME=setup
 
-:checkOpenDSJavaHome
-if "%OPENDS_JAVA_HOME%" == "" goto checkOpenDSJavaHomeFile
-if not exist "%OPENDS_JAVA_HOME%\bin\java.exe" goto checkOpenDSJavaHomeFile
-set OPENDS_JAVA_BIN=%OPENDS_JAVA_HOME%\bin\java.exe
-goto setClassPath
+rem Set environment variables and test java
+set SCRIPT_UTIL_CMD=set-full-environment-and-test-java
+call "%INSTANCE_ROOT%\lib\_script-util.bat"
+if NOT %errorlevel% == 0 exit /B %errorlevel%
 
-:checkOpenDSJavaHomeFile
-if not exist "%DIR_HOME%\lib\set-java-home.bat" goto checkJavaBin
-call "%DIR_HOME%\lib\set-java-home.bat"
-if not exist "%OPENDS_JAVA_HOME%\bin\java.exe" goto checkJavaBin
-set OPENDS_JAVA_BIN=%OPENDS_JAVA_HOME%\bin\java.exe
-goto setClassPath
-
-:checkJavaBin
-if "%JAVA_BIN%" == "" goto checkJavaHome
-set OPENDS_JAVA_BIN=%JAVA_BIN%
-goto setClassPath
-
-:checkJavaHome
-if "%JAVA_HOME%" == "" goto noJavaHome
-if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
-set OPENDS_JAVA_BIN=%JAVA_HOME%\bin\java.exe
-goto setClassPath
-
-:noJavaHome
-echo Error: OPENDS_JAVA_HOME environment variable is not set.
-echo        Please set it to a valid Java 5 (or later) installation.
-pause
-goto end
+if "%~1" == "" goto callLaunch
+goto callJava
 
 :invalidPath
 echo Error: The current path contains a %% character.  OpenDS cannot
@@ -79,31 +55,12 @@
 pause
 goto end
 
-:noValidJavaHome
-echo ERROR:  The detected Java version could not be used.  Please set 
-echo         OPENDS_JAVA_HOME to to a valid Java 5 (or later) installation.
-pause
-goto end
-
-:setClassPath
-FOR %%x in ("%DIR_HOME%\lib\*.jar") DO call "%DIR_HOME%\lib\setcp.bat" %%x
-set CLASSPATH=%DIR_HOME%\classes;%CLASSPATH%
-
-set PATH=%SystemRoot%
-
-rem Test that the provided JDK is 1.5 compatible.
-"%OPENDS_JAVA_BIN%" org.opends.server.tools.InstallDS -t > NUL 2>&1
-if not %errorlevel% == 0 goto noValidJavaHome
-
-if "%~1" == "" goto callLaunch
-goto callJava
-
 :callLaunch
-"%DIR_HOME%\lib\winlauncher.exe" launch "%OPENDS_JAVA_BIN%" %JAVA_ARGS% org.opends.quicksetup.installer.SetupLauncher
+"%DIR_HOME%\lib\winlauncher.exe" launch "%OPENDS_JAVA_BIN%" %OPENDS_JAVA_ARGS% %SCRIPT_NAME_ARG% org.opends.quicksetup.installer.SetupLauncher
 goto end
 
 :callJava
-"%OPENDS_JAVA_BIN%" %JAVA_ARGS% org.opends.quicksetup.installer.SetupLauncher %*
+"%OPENDS_JAVA_BIN%" %OPENDS_JAVA_ARGS% %SCRIPT_NAME_ARG% org.opends.quicksetup.installer.SetupLauncher %*
 
 rem return part
 if %errorlevel% == 50 goto version
@@ -114,4 +71,3 @@
 exit /B 0
 
 :end
-

--
Gitblit v1.10.0