setup.bat revision 55a486e817405c80611b149af6990af39a1da1fe
0N/A
1204N/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 legal-notices/CDDLv1_0.txt
0N/Arem or http://forgerock.org/license/CDDLv1.0.html.
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 legal-notices/CDDLv1_0.txt.
0N/Arem If applicable, add the following below this CDDL HEADER, with the
0N/Arem fields enclosed by brackets "[]" replaced with your own identifying
0N/Arem information:
0N/Arem Portions Copyright [yyyy] [name of copyright owner]
0N/Arem
0N/Arem CDDL HEADER END
0N/Arem
0N/Arem
0N/Arem Copyright 2006-2010 Sun Microsystems, Inc.
0N/Arem Portions Copyright 2011-2016 ForgeRock AS
0N/A
0N/Asetlocal
0N/A
0N/Arem check that the path does not contain the ^% character which breaks
0N/Arem the batch files.
0N/Afor %%i in (%~sf0) do set NON_ESCAPED=%%~dPsi..
0N/A
0N/A
0N/AFOR /F "tokens=1-2* delims=%%" %%1 IN ("%NON_ESCAPED%") DO (
0N/Aif NOT "%%2" == "" goto invalidPath)
0N/A
0N/Afor %%i in (%~sf0) do set DIR_HOME=%%~dPsi.
0N/A
0N/Aset INSTALL_ROOT=%DIR_HOME%
0N/Aset INSTANCE_DIR=
0N/Aif exist "%INSTALL_ROOT%\instance.loc" (
0N/A set /p INSTANCE_DIR=<%INSTALL_ROOT%\instance.loc
0N/A) else (
0N/Aset INSTANCE_DIR=.
0N/A)
0N/Aif not exist "%INSTANCE_DIR%" mkdir "%INSTANCE_DIR%"
0N/A
0N/Aset CUR_DIR=%CD%
0N/Acd /d %INSTALL_ROOT%
0N/Acd /d %INSTANCE_DIR%
0N/Aset INSTANCE_ROOT=%CD%
0N/Acd /d %CUR_DIR%
0N/A
0N/Aset SCRIPT_NAME=setup
0N/A
0N/Arem Set environment variables and test java
0N/Aset SCRIPT_UTIL_CMD=set-full-environment-and-test-java
0N/Acall "%INSTALL_ROOT%\lib\_script-util.bat"
0N/Aif NOT %errorlevel% == 0 exit /B %errorlevel%
0N/A
0N/Aif "%~1" == "" goto callLaunch
0N/Agoto callJava
0N/A
0N/A:invalidPath
0N/Aecho Error: The current path contains a %% character. OpenDJ cannot
0N/Aecho be installed on a path containing this character.
0N/Apause
0N/Agoto end
0N/A
0N/A:callLaunch
0N/A"%INSTALL_ROOT%\lib\winlauncher.exe" launch "%OPENDJ_JAVA_BIN%" %OPENDJ_JAVA_ARGS% %SCRIPT_NAME_ARG% org.opends.quicksetup.installer.SetupLauncher
0N/Agoto end
0N/A
0N/A:callJava
0N/A"%OPENDJ_JAVA_BIN%" %OPENDJ_JAVA_ARGS% %SCRIPT_NAME_ARG% org.opends.quicksetup.installer.SetupLauncher %*
0N/A
0N/Arem return part
0N/Aif %errorlevel% == 50 goto version
0N/Aif NOT %errorlevel% == 0 exit /B %errorlevel%
0N/Agoto end
0N/A
0N/A:version
0N/Arem version information was requested. Return code should be 0.
0N/Aexit /B 0
0N/A
0N/A:end
0N/A