setup.bat revision 5deb404a3d276c42ef3e4adef5e584211ab1e8dd
72f94547e31c3584590f10d737d53cecab94092chouz@echo off
72f94547e31c3584590f10d737d53cecab94092chouz:
72f94547e31c3584590f10d737d53cecab94092chouz: DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
72f94547e31c3584590f10d737d53cecab94092chouz:
72f94547e31c3584590f10d737d53cecab94092chouz: Copyright (c) 2007 Sun Microsystems Inc. All Rights Reserved
72f94547e31c3584590f10d737d53cecab94092chouz:
72f94547e31c3584590f10d737d53cecab94092chouz: The contents of this file are subject to the terms
57140ea04ccb17163a58c30a159550b0e079ae52Marc Jeanmougin: of the Common Development and Distribution License
10685fde592a9b5a36e38bab2565e5c48013cad9Moritz Eberl: (the License). You may not use this file except in
57140ea04ccb17163a58c30a159550b0e079ae52Marc Jeanmougin: compliance with the License.
57140ea04ccb17163a58c30a159550b0e079ae52Marc Jeanmougin:
57140ea04ccb17163a58c30a159550b0e079ae52Marc Jeanmougin: You can obtain a copy of the License at
21e474a256cb591b6ff6de3213a91d84308d82b3Marc Jeanmougin: https://opensso.dev.java.net/public/CDDLv1.0.html or
21e474a256cb591b6ff6de3213a91d84308d82b3Marc Jeanmougin: opensso/legal/CDDLv1.0.txt
21e474a256cb591b6ff6de3213a91d84308d82b3Marc Jeanmougin: See the License for the specific language governing
21e474a256cb591b6ff6de3213a91d84308d82b3Marc Jeanmougin: permission and limitations under the License.
21e474a256cb591b6ff6de3213a91d84308d82b3Marc Jeanmougin:
21e474a256cb591b6ff6de3213a91d84308d82b3Marc Jeanmougin: When distributing Covered Code, include this CDDL
21e474a256cb591b6ff6de3213a91d84308d82b3Marc Jeanmougin: Header Notice in each file and include the License file
21e474a256cb591b6ff6de3213a91d84308d82b3Marc Jeanmougin: at opensso/legal/CDDLv1.0.txt.
21e474a256cb591b6ff6de3213a91d84308d82b3Marc Jeanmougin: If applicable, add the following below the CDDL Header,
21e474a256cb591b6ff6de3213a91d84308d82b3Marc Jeanmougin: with the fields enclosed by brackets [] replaced by
21e474a256cb591b6ff6de3213a91d84308d82b3Marc Jeanmougin: your own identifying information:
21e474a256cb591b6ff6de3213a91d84308d82b3Marc Jeanmougin: "Portions Copyrighted [year] [name of copyright owner]"
21e474a256cb591b6ff6de3213a91d84308d82b3Marc Jeanmougin:
21e474a256cb591b6ff6de3213a91d84308d82b3Marc Jeanmougin: $Id: setup.bat,v 1.13 2009/01/28 05:34:46 ww203982 Exp $
21e474a256cb591b6ff6de3213a91d84308d82b3Marc Jeanmougin:
57140ea04ccb17163a58c30a159550b0e079ae52Marc Jeanmougin
bd32c87c8d0db3da20c9ae4184f5e2e222f0f69dMoritz Eberlif not "%JAVA_HOME%" == "" goto checkJavaHome
bd32c87c8d0db3da20c9ae4184f5e2e222f0f69dMoritz Eberlecho Please define JAVA_HOME environment variable before running this program
echo setup program will use the JVM defined in JAVA_HOME for all the CLI tools
goto exit
:checkJavaHome
if not exist "%JAVA_HOME%\bin\java.exe" goto invalidJavaHome
goto validJavaHome
:invalidJavaHome
echo The defined JAVA_HOME environment variable is not correct
echo setup program will use the JVM defined in JAVA_HOME for all the CLI tools
goto exit
:validJavaHome
SETLOCAL
CALL %JAVA_HOME%\bin\java.exe -version 2>&1|more > java_version.txt
SET /P java_version=< java_version.txt
DEL java_version.txt
CALL :GET_VERSION_NUM %java_version:"1.= %
CALL :GET_MID_VERSION_NUM %java_version:.= %
IF "%java_version%" == "0" goto invalidJavaVersion
IF "%java_version%" == "1" goto invalidJavaVersion
IF "%java_version%" == "2" goto invalidJavaVersion
IF "%java_version%" == "3" goto invalidJavaVersion
goto runSetup
:invalidJavaVersion
echo This program is designed to work with 1.4 or newer JRE.
goto exit
:GET_VERSION_NUM
SET java_version=%3
goto exit
:GET_MID_VERSION_NUM
SET java_version=%1
goto exit
:runSetup
IF "%1" == "-h" SET help_print=yes
IF "%1" == "--help" SET help_print=yes
IF "%1" == "-l" SET path_log=%~2
IF "%1" == "--log" SET path_log=%~2
IF "%1" == "-d" SET path_debug=%~2
IF "%1" == "--debug" SET path_debug=%~2
IF "%1" == "-p" SET path_AMConfig=%~2
IF "%1" == "--path" SET path_AMConfig=%~2
IF "%3" == "-l" SET path_log=%~4
IF "%3" == "--log" SET path_log=%~4
IF "%3" == "-d" SET path_debug=%~4
IF "%3" == "--debug" SET path_debug=%~4
IF "%3" == "-p" SET path_AMConfig=%~4
IF "%3" == "--path" SET path_AMConfig=%~4
IF "%5" == "-l" SET path_log=%~6
IF "%5" == "--log" SET path_log=%~6
IF "%5" == "-d" SET path_debug=%~6
IF "%5" == "--debug" SET path_debug=%~6
IF "%5" == "-p" SET path_AMConfig=%~6
IF "%5" == "--path" SET path_AMConfig=%~6
: lib/amserver.jar;lib/amadm_setup.jar;lib/opensso-sharedlib.jar;lib/OpenDJ.jar;resources
set CLASSPATH="@CONFIG_DIR@"
: set CLASSPATH="%CLASSPATH%;lib/amadm_setup.jar"
set CLASSPATH="%CLASSPATH%;lib/OpenDJ-2012-20-02.jar"
set CLASSPATH="%CLASSPATH%;lib/mail-1.4.5.jar"
set CLASSPATH="%CLASSPATH%;lib/j2ee-2007-18-10.jar"
set CLASSPATH="%CLASSPATH%;lib/webservices-api-2009-14-01.jar"
set CLASSPATH="%CLASSPATH%;lib/webservices-rt-2009-29-07.jar"
set CLASSPATH="%CLASSPATH%;lib/wwebservices-tools-2.1-b16.jar"
set CLASSPATH="%CLASSPATH%;lib/json-20090211.jar"
set CLASSPATH="%CLASSPATH%;lib/xalan-2.7.1.jar"
set CLASSPATH="%CLASSPATH%;lib/xercesImpl-2.10.0.jar"
set CLASSPATH="%CLASSPATH%;lib/xml-apis-1.4.01.jar"
set CLASSPATH="%CLASSPATH%;lib/xmlsec-1.3.0.jar"
set CLASSPATH="%CLASSPATH%;lib/openam-core-10.1.0-SNAPSHOT.jar"
set CLASSPATH="%CLASSPATH%;lib/openam-shared-10.1.0-SNAPSHOT.jar"
set CLASSPATH="%CLASSPATH%;lib/openam-dtd-schema-10.1.0-SNAPSHOT.jar"
set CLASSPATH="%CLASSPATH%;lib/openam-rest-10.1.0-SNAPSHOT.jar"
"%JAVA_HOME%/bin/java.exe" -D"load.config=yes" -D"help.print=%help_print%" -D"path.AMConfig=%path_AMConfig%" -D"path.log=%path_log%" -D"path.debug=%path_debug%" -cp "%CLASSPATH%" com.sun.identity.tools.bundles.Main
ENDLOCAL
:exit
exit /b 1