setup.bat revision 1591
1138N/A
1472N/A@echo off
1138N/Arem CDDL HEADER START
1138N/Arem
1138N/Arem The contents of this file are subject to the terms of the
1138N/Arem Common Development and Distribution License, Version 1.0 only
1138N/Arem (the "License"). You may not use this file except in compliance
1138N/Arem with the License.
1138N/Arem
1138N/Arem You can obtain a copy of the license at
1138N/Arem trunk/opends/resource/legal-notices/OpenDS.LICENSE
1138N/Arem or https://OpenDS.dev.java.net/OpenDS.LICENSE.
1138N/Arem See the License for the specific language governing permissions
1138N/Arem and limitations under the License.
1138N/Arem
1138N/Arem When distributing Covered Code, include this CDDL HEADER in each
1138N/Arem file and include the License file at
1138N/Arem trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
1472N/Arem add the following below this CDDL HEADER, with the fields enclosed
1472N/Arem by brackets "[]" replaced with your own identifying information:
1472N/Arem Portions Copyright [yyyy] [name of copyright owner]
1138N/Arem
1138N/Arem CDDL HEADER END
1138N/Arem
1138N/Arem
1138N/Arem Portions Copyright 2006-2007 Sun Microsystems, Inc.
1138N/A
1138N/Asetlocal
1138N/A
1138N/Aset DIR_HOME=%~dP0.
1138N/Aset INSTANCE_ROOT=%DIR_HOME%
1138N/A
1138N/A:checkJavaBin
1138N/Aif "%JAVA_BIN%" == "" goto noJavaBin
1138N/Agoto setClassPath
1138N/A
1138N/A:noJavaBin
1138N/Aif "%JAVA_HOME%" == "" goto noJavaHome
1138N/Aif not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
1138N/Aset JAVA_BIN=%JAVA_HOME%\bin\java.exe
1138N/Agoto setClassPath
1138N/A
1138N/A:noJavaHome
1138N/Aif not exist "%DIR_HOME%\lib\set-java-home.bat" goto noSetJavaHome
1138N/Acall "%DIR_HOME%\lib\set-java-home.bat"
1138N/Aset JAVA_BIN=%JAVA_HOME%\bin\java.exe
goto setClassPath
:noSetJavaHome
echo Error: JAVA_HOME environment variable is not set.
echo Please set it to a valid Java 5 (or later) installation.
pause
goto end
:noValidJavaHome
echo ERROR: The detected Java version could not be used. Please set
echo 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.
"%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 "%DIR_HOME%" "%JAVA_BIN%" %JAVA_ARGS% org.opends.quicksetup.installer.InstallLauncher -P setup.bat
goto end
:callJava
"%JAVA_BIN%" %JAVA_ARGS% org.opends.quicksetup.installer.InstallLauncher -P setup.bat %*
goto end
:end