upgrade.bat revision 1175
0N/A
1631N/A@echo off
0N/Arem CDDL HEADER START
0N/Arem
0N/Arem The contents of this file are subject to the terms of the
0N/Arem Common Development and Distribution License, Version 1.0 only
0N/Arem (the "License"). You may not use this file except in compliance
0N/Arem with the License.
0N/Arem
0N/Arem You can obtain a copy of the license at
0N/Arem trunk/opends/resource/legal-notices/OpenDS.LICENSE
0N/Arem or https://OpenDS.dev.java.net/OpenDS.LICENSE.
0N/Arem See the License for the specific language governing permissions
0N/Arem and limitations under the License.
0N/Arem
0N/Arem When distributing Covered Code, include this CDDL HEADER in each
0N/Arem file and include the License file at
0N/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]
0N/Arem
0N/Arem CDDL HEADER END
0N/Arem
0N/Arem
0N/Arem Portions Copyright 2006-2007 Sun Microsystems, Inc.
0N/A
671N/Asetlocal
671N/A
671N/Aset DIR_HOME=%~dP0.
671N/Aset INSTANCE_ROOT=%DIR_HOME%
671N/A
671N/A:checkJavaBin
671N/Aif "%JAVA_BIN%" == "" goto noJavaBin
671N/Aif "%*" == "" goto callWebStartUpgrade
671N/Agoto callExtractor
671N/A
671N/A:noJavaBin
if "%JAVA_HOME%" == "" goto noJavaHome
if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
set JAVA_BIN=%JAVA_HOME%\bin\java.exe
set jAVAWS_BIN=%JAVA_HOME%\bin\javaws.exe
if "%*" == "" goto callWebStartUpgrade
goto callExtractor
:noJavaHome
if not exist "%DIR_HOME%\bat\set-java-home.bat" goto noSetJavaHome
call "%DIR_HOME%\bat\set-java-home.bat"
set JAVA_BIN=%JAVA_HOME%\bin\java.exe
set jAVAWS_BIN=%JAVA_HOME%\bin\javaws.exe
if "%*" == "" goto callWebStartUpgrade
goto callExtractor
:noSetJavaHome
echo Error: JAVA_HOME environment variable is not set.
echo Please set it to a valid Java 5 installation.
goto end
set PATH=%SystemRoot%
if "%*" == "" goto callWebStartUpgrade
:callExtractor
if EXIST .\tmp\upgrade rd .\tmp\upgrade /s /q
set CLASSPATH=""
FOR %%x in ("%DIR_HOME%\lib\*.jar") DO call "%DIR_HOME%\bat\setcp.bat" %%x
"%JAVA_BIN%" org.opends.quicksetup.upgrader.BuildExtractor %*
if %ERRORLEVEL%==0 goto callUpgrader
goto end
:callWebStartUpgrade
set JAVAWS_VM_ARGS=-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005 -Dorg.opends.quicksetup.upgrader.Root="%DIR_HOME%"
rem set JAVAWS_VM_ARGS=-Dorg.opends.quicksetup.upgrader.Root="%DIR_HOME%"
if "%OPENDS_UPGRADE_JNLP%" == "" set OPENDS_UPGRADE_JNLP=http://build.opends.org/install/QuickUpgrade.jnlp
"%JAVAWS_BIN%" "%OPENDS_UPGRADE_JNLP%"
goto end
:callUpgrader
set CLASSPATH=""
FOR %%x in ("%DIR_HOME%\tmp\upgrade\lib\*.jar") DO call "%DIR_HOME%\bat\setcp.bat" %%x
"%JAVA_BIN%" org.opends.quicksetup.upgrader.UpgradeLauncher %*
if EXIST .\tmp\upgrade rd .\tmp\upgrade /s /q
goto end
:end