@echo off set LANGUAGE=en :: -------- Run the GS3DemoClient on Windows -------- :: This script must be run from within the directory in which it lives echo I am here if exist gs3democlient.bat goto start if "%LANGUAGE%" == "en" echo This script must be run from the directory in which it resides. if "%LANGUAGE%" == "es" echo Este guiвn deberа ejecutarse desde el directorio en el que reside. if "%LANGUAGE%" == "fr" echo Ce script doit Иtre exВcutВ Е partir du rВpertoire dans lequel il se trouve. if "%LANGUAGE%" == "ru" echo Этот скрипт должен быть взят из директории, в которой он расположен goto exit :start :findJava :: ---- Check Java exists ---- set JAVAPATH= :: Some users may set the above line manually if not "%JAVAPATH%" == "" goto testJava :: If it is set, use the JAVA_HOME environment variable if not "%JAVA_HOME%" == "" goto javahome :: Check if Java is on the search path echo %PATH%| winutil\which.exe java.exe | winutil\setvar.exe JAVAPATH > setjava.bat call setjava.bat del setjava.bat if not "%JAVAPATH%" == "" goto testJava :: Still haven't found anything, so try looking in the registry (gulp!) type nul > jdk.reg regedit /E jdk.reg "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit" type jdk.reg > jdk.txt del jdk.reg type nul > jre.reg regedit /E jre.reg "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment" type jre.reg > jre.txt del jre.reg winutil\findjava.exe jdk.txt jre.txt | winutil\setvar.exe JAVAPATH > setjava.bat del jdk.txt del jre.txt call setjava.bat del setjava.bat :: If nothing was found in the registry, we're stuck if "%JAVAPATH%" == "" goto noJava set JAVAPATH=%JAVAPATH%\bin goto testJava :javahome set JAVAPATH=%JAVA_HOME%\bin :testJava :: Check that a Java executable has been found if "%LANGUAGE%" == "en" echo Checking Java: %JAVAPATH% if "%LANGUAGE%" == "es" echo Revisando Java: %JAVAPATH% if "%LANGUAGE%" == "fr" echo VВrification de Java: %JAVAPATH% if "%LANGUAGE%" == "ru" echo Проверка Java: %JAVAPATH% if exist "%JAVAPATH%\java.exe" goto checkJavaVersion :noJava echo. if "%LANGUAGE%" == "en" echo Failed to locate an appropriate version of Java. You must install a if "%LANGUAGE%" == "en" echo Java Runtime Environment (version 1.5 or greater) before running the if "%LANGUAGE%" == "en" echo Greenstone Librarian Interface. if "%LANGUAGE%" == "es" echo No se pudo localizar una versiвn apropiada de Java. Usted deberа if "%LANGUAGE%" == "es" echo instalar un Ambiente de Ejecuciвn Java (versiвn 1.5 o superior) if "%LANGUAGE%" == "es" echo antes de correr la Interfaz de la Biblioteca Digital Greenstone. if "%LANGUAGE%" == "fr" echo Une version adВquate de Java n'a pas pu Иtre localisВe. Vous devez if "%LANGUAGE%" == "fr" echo installer un Java Runtime Environment (version 1.5 ou supВrieur) if "%LANGUAGE%" == "fr" echo avant de dВmarrer Greenstone Librarian Interface. if "%LANGUAGE%" == "ru" echo Не удалось определить местонахождение соответствующей версии Java. if "%LANGUAGE%" == "ru" echo Вы должны установить Java Runtime Environment (версию 1.5 или выше) перед вводом if "%LANGUAGE%" == "ru" echo библиотечного интерфейса Greenstone. goto exit :checkJavaVersion :: ---- Ensure that the JavaVersion is 1.5.x or more, run CheckJavaVersion with --- "%JAVAPATH%\java" CheckJavaVersion 1.5 GS3democlient if ERRORLEVEL 2 goto checkGS3democlient if ERRORLEVEL 1 goto exit :checkGS3democlient :: ---- Check that the GS3democlient has been compiled ---- if exist "GS3democlient.jar" goto runGS3democlient echo. if "%LANGUAGE%" == "en" echo You need to build the GS3democlient (using "ant build-demo-client") if "%LANGUAGE%" == "en" echo before running this script. if "%LANGUAGE%" == "es" echo Usted necesita compilar la GS3democlient if "%LANGUAGE%" == "es" echo (por medio de "ant build-demo-client") antes de ejecutar este guiвn. if "%LANGUAGE%" == "fr" echo Vous devez compiler le GS3democlient (en utilisant "ant build-demo-client") if "%LANGUAGE%" == "fr" echo avant d'exВcuter ce script. if "%LANGUAGE%" == "ru" echo Вы должны компилировать библиотечный интерфейс GS3democlient if "%LANGUAGE%" == "ru" echo (используя "ant build-demo-client") перед вводом этого скрипта goto exit :runGS3democlient :: ---- Finally, run the runGS3democlient ---- echo. if "%LANGUAGE%" == "en" echo Running the GS3democlient ... if "%LANGUAGE%" == "es" echo Ejecutando GS3democlient ... if "%LANGUAGE%" == "fr" echo ExВcution de GS3democlient if "%LANGUAGE%" == "ru" echo Текущий библиотечный интерфейс GS3democlient ... :: -Xms32M To set minimum memory :: -Xmx32M To set maximum memory :: -verbose:gc To set garbage collection messages :: -Xincgc For incremental garbage collection :: -Xprof Function call profiling :: -Xloggc: Write garbage collection log :localLib "%JAVAPATH%\java" -jar GS3democlient.jar :exit echo. pause :done :: ---- Clean up ---- set JAVAPATH=