upgrade.bat revision 1186
1051N/A
1051N/A@echo off
1051N/Arem CDDL HEADER START
1051N/Arem
1051N/Arem The contents of this file are subject to the terms of the
1051N/Arem Common Development and Distribution License, Version 1.0 only
1051N/Arem (the "License"). You may not use this file except in compliance
1051N/Arem with the License.
1051N/Arem
1051N/Arem You can obtain a copy of the license at
1051N/Arem trunk/opends/resource/legal-notices/OpenDS.LICENSE
1051N/Arem or https://OpenDS.dev.java.net/OpenDS.LICENSE.
1051N/Arem See the License for the specific language governing permissions
1051N/Arem and limitations under the License.
1051N/Arem
1051N/Arem When distributing Covered Code, include this CDDL HEADER in each
1051N/Arem file and include the License file at
1051N/Arem trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
1051N/Arem add the following below this CDDL HEADER, with the fields enclosed
1051N/Arem by brackets "[]" replaced with your own identifying information:
1051N/Arem Portions Copyright [yyyy] [name of copyright owner]
1051N/Arem
1051N/Arem CDDL HEADER END
1051N/Arem
1051N/Arem
1051N/Arem Portions Copyright 2006-2007 Sun Microsystems, Inc.
1051N/A
1051N/Asetlocal
1051N/A
1051N/Aset DIR_HOME=%~dP0.
1051N/Aset INSTANCE_ROOT=%DIR_HOME%
1051N/A
1051N/A:checkJavaBin
1051N/Aif "%JAVA_BIN%" == "" goto noJavaBin
1175N/Aif "%*" == "" goto callWebStartUpgrade
1111N/Agoto callExtractor
1051N/A
1051N/A:noJavaBin
1051N/Aif "%JAVA_HOME%" == "" goto noJavaHome
1051N/Aif not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
1051N/Aset JAVA_BIN=%JAVA_HOME%\bin\java.exe
1175N/Aset jAVAWS_BIN=%JAVA_HOME%\bin\javaws.exe
1175N/Aif "%*" == "" goto callWebStartUpgrade
1111N/Agoto callExtractor
1051N/A
1051N/A:noJavaHome
1051N/Aif not exist "%DIR_HOME%\bat\set-java-home.bat" goto noSetJavaHome
1051N/Acall "%DIR_HOME%\bat\set-java-home.bat"
1051N/Aset JAVA_BIN=%JAVA_HOME%\bin\java.exe
1175N/Aset jAVAWS_BIN=%JAVA_HOME%\bin\javaws.exe
1175N/Aif "%*" == "" goto callWebStartUpgrade
1111N/Agoto callExtractor
1051N/A
1051N/A:noSetJavaHome
1051N/Aecho Error: JAVA_HOME environment variable is not set.
1186N/Aecho Please set it to a valid Java 5 (or later) installation.
1186N/Agoto end
1186N/A
1186N/A:noValidJavaHome
1186N/Aecho ERROR: The detected Java version could not be used. Please set
1186N/Aecho JAVA_HOME to to a valid Java 5 (or later) installation.
1051N/Agoto end
1051N/A
1051N/Aset PATH=%SystemRoot%
1051N/A
1186N/Arem Test that the provided JDK is 1.5 compatible.
1186N/A"%JAVA_BIN%" org.opends.server.tools.InstallDS -t > NUL 2>&1
1186N/Aif not %errorlevel% == 0 goto noValidJavaHome
1186N/A
1175N/Aif "%*" == "" goto callWebStartUpgrade
1051N/A
1186N/A
1111N/A:callExtractor
1111N/Aif EXIST .\tmp\upgrade rd .\tmp\upgrade /s /q
1111N/Aset CLASSPATH=""
1111N/AFOR %%x in ("%DIR_HOME%\lib\*.jar") DO call "%DIR_HOME%\bat\setcp.bat" %%x
1111N/A"%JAVA_BIN%" org.opends.quicksetup.upgrader.BuildExtractor %*
1111N/Aif %ERRORLEVEL%==0 goto callUpgrader
1111N/Agoto end
1111N/A
1175N/A:callWebStartUpgrade
1175N/Aset 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%"
1175N/Arem set JAVAWS_VM_ARGS=-Dorg.opends.quicksetup.upgrader.Root="%DIR_HOME%"
1175N/Aif "%OPENDS_UPGRADE_JNLP%" == "" set OPENDS_UPGRADE_JNLP=http://build.opends.org/install/QuickUpgrade.jnlp
1175N/A"%JAVAWS_BIN%" "%OPENDS_UPGRADE_JNLP%"
1175N/Agoto end
1175N/A
1111N/A:callUpgrader
1111N/Aset CLASSPATH=""
1111N/AFOR %%x in ("%DIR_HOME%\tmp\upgrade\lib\*.jar") DO call "%DIR_HOME%\bat\setcp.bat" %%x
1111N/A"%JAVA_BIN%" org.opends.quicksetup.upgrader.UpgradeLauncher %*
1111N/Aif EXIST .\tmp\upgrade rd .\tmp\upgrade /s /q
1051N/Agoto end
1051N/A
1051N/A:end