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