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