[15226] | 1 | @echo off
|
---|
| 2 | set LANGUAGE=en
|
---|
| 3 |
|
---|
| 4 |
|
---|
| 5 | :: -------- Run the GS3DemoClient on Windows --------
|
---|
| 6 |
|
---|
| 7 | :: This script must be run from within the directory in which it lives
|
---|
[15227] | 8 | echo I am here
|
---|
[15226] | 9 | if exist gs3democlient.bat goto start
|
---|
| 10 | if "%LANGUAGE%" == "en" echo This script must be run from the directory in which it resides.
|
---|
| 11 | if "%LANGUAGE%" == "es" echo Este gui¢n deber ejecutarse desde el directorio en el que reside.
|
---|
| 12 | if "%LANGUAGE%" == "fr" echo Ce script doit tre excut
|
---|
| 13 | partir du rpertoire dans lequel il se trouve.
|
---|
| 14 | if "%LANGUAGE%" == "ru" echo â®â áªàš¯â €®«Š¥ ¡ëâì ¢§ïâ š§ €šà¥ªâ®àšš, ¢ ª®â®à®© ® à ᯮ«®Š¥
|
---|
| 15 | goto exit
|
---|
| 16 |
|
---|
| 17 | :start
|
---|
| 18 |
|
---|
| 19 |
|
---|
| 20 | :findJava
|
---|
| 21 | :: ---- Check Java exists ----
|
---|
| 22 | set JAVAPATH=
|
---|
| 23 |
|
---|
| 24 | :: Some users may set the above line manually
|
---|
| 25 | if not "%JAVAPATH%" == "" goto testJava
|
---|
| 26 |
|
---|
| 27 | :: If it is set, use the JAVA_HOME environment variable
|
---|
| 28 | if not "%JAVA_HOME%" == "" goto javahome
|
---|
| 29 |
|
---|
| 30 | :: Check if Java is on the search path
|
---|
| 31 | echo %PATH%| winutil\which.exe java.exe | winutil\setvar.exe JAVAPATH > setjava.bat
|
---|
| 32 | call setjava.bat
|
---|
| 33 | del setjava.bat
|
---|
| 34 | if not "%JAVAPATH%" == "" goto testJava
|
---|
| 35 |
|
---|
| 36 | :: Still haven't found anything, so try looking in the registry (gulp!)
|
---|
| 37 | type nul > jdk.reg
|
---|
| 38 | regedit /E jdk.reg "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit"
|
---|
| 39 | type jdk.reg > jdk.txt
|
---|
| 40 | del jdk.reg
|
---|
| 41 | type nul > jre.reg
|
---|
| 42 | regedit /E jre.reg "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment"
|
---|
| 43 | type jre.reg > jre.txt
|
---|
| 44 | del jre.reg
|
---|
| 45 |
|
---|
| 46 | winutil\findjava.exe jdk.txt jre.txt | winutil\setvar.exe JAVAPATH > setjava.bat
|
---|
| 47 | del jdk.txt
|
---|
| 48 | del jre.txt
|
---|
| 49 | call setjava.bat
|
---|
| 50 | del setjava.bat
|
---|
| 51 |
|
---|
| 52 | :: If nothing was found in the registry, we're stuck
|
---|
| 53 | if "%JAVAPATH%" == "" goto noJava
|
---|
| 54 |
|
---|
| 55 | set JAVAPATH=%JAVAPATH%\bin
|
---|
| 56 | goto testJava
|
---|
| 57 |
|
---|
| 58 | :javahome
|
---|
| 59 | set JAVAPATH=%JAVA_HOME%\bin
|
---|
[15227] | 60 |
|
---|
[15226] | 61 |
|
---|
| 62 | :testJava
|
---|
| 63 | :: Check that a Java executable has been found
|
---|
| 64 | if "%LANGUAGE%" == "en" echo Checking Java: %JAVAPATH%
|
---|
| 65 | if "%LANGUAGE%" == "es" echo Revisando Java: %JAVAPATH%
|
---|
| 66 | if "%LANGUAGE%" == "fr" echo Vrification de Java: %JAVAPATH%
|
---|
[15227] | 67 | if "%LANGUAGE%" == "ru" echo ஢¥àª Java: %JAVAPATH%
|
---|
[15226] | 68 | if exist "%JAVAPATH%\java.exe" goto checkJavaVersion
|
---|
| 69 |
|
---|
| 70 | :noJava
|
---|
| 71 | echo.
|
---|
| 72 | if "%LANGUAGE%" == "en" echo Failed to locate an appropriate version of Java. You must install a
|
---|
| 73 | if "%LANGUAGE%" == "en" echo Java Runtime Environment (version 1.5 or greater) before running the
|
---|
| 74 | if "%LANGUAGE%" == "en" echo Greenstone Librarian Interface.
|
---|
| 75 |
|
---|
| 76 | if "%LANGUAGE%" == "es" echo No se pudo localizar una versi¢n apropiada de Java. Usted deber
|
---|
| 77 | if "%LANGUAGE%" == "es" echo instalar un Ambiente de Ejecuci¢n Java (versi¢n 1.5 o superior)
|
---|
| 78 | if "%LANGUAGE%" == "es" echo antes de correr la Interfaz de la Biblioteca Digital Greenstone.
|
---|
| 79 |
|
---|
| 80 | if "%LANGUAGE%" == "fr" echo Une version adquate de Java n'a pas pu tre localise. Vous devez
|
---|
| 81 | if "%LANGUAGE%" == "fr" echo installer un Java Runtime Environment (version 1.5 ou suprieur)
|
---|
| 82 | if "%LANGUAGE%" == "fr" echo avant de dmarrer Greenstone Librarian Interface.
|
---|
| 83 |
|
---|
| 84 | if "%LANGUAGE%" == "ru" echo ¥ 〠«®áì ®¯à¥€¥«šâì ¬¥á⮠宊€¥š¥ ᮮ⢥âáâ¢ãî饩 ¢¥àášš Java.
|
---|
| 85 | if "%LANGUAGE%" == "ru" echo ë €®«Šë ãáâ ®¢šâì Java Runtime Environment (¢¥àášî 1.5 š«š ¢ëè¥) ¯¥à¥€ ¢¢®€®¬
|
---|
| 86 | if "%LANGUAGE%" == "ru" echo ¡š¡«š®â¥ç®£® šâ¥à䥩á Greenstone.
|
---|
| 87 | goto exit
|
---|
| 88 |
|
---|
[15227] | 89 |
|
---|
| 90 | :checkJavaVersion
|
---|
| 91 | :: ---- Ensure that the JavaVersion is 1.5.x or more, run CheckJavaVersion with <required java version no prefix> <target exec program name> ---
|
---|
[15308] | 92 | "%JAVAPATH%\java" CheckJavaVersion 1.5 GS3democlient
|
---|
| 93 | if ERRORLEVEL 2 goto checkGS3democlient
|
---|
[15227] | 94 | if ERRORLEVEL 1 goto exit
|
---|
| 95 |
|
---|
[15226] | 96 |
|
---|
[15227] | 97 | :checkGS3democlient
|
---|
| 98 | :: ---- Check that the GS3democlient has been compiled ----
|
---|
[15226] | 99 | if exist "GS3democlient.jar" goto runGS3democlient
|
---|
| 100 | echo.
|
---|
| 101 | if "%LANGUAGE%" == "en" echo You need to build the GS3democlient (using "ant build-demo-client")
|
---|
| 102 | if "%LANGUAGE%" == "en" echo before running this script.
|
---|
| 103 |
|
---|
| 104 | if "%LANGUAGE%" == "es" echo Usted necesita compilar la GS3democlient
|
---|
| 105 | if "%LANGUAGE%" == "es" echo (por medio de "ant build-demo-client") antes de ejecutar este gui¢n.
|
---|
| 106 |
|
---|
| 107 | if "%LANGUAGE%" == "fr" echo Vous devez compiler le GS3democlient (en utilisant "ant build-demo-client")
|
---|
| 108 | if "%LANGUAGE%" == "fr" echo avant d'excuter ce script.
|
---|
| 109 |
|
---|
| 110 | if "%LANGUAGE%" == "ru" echo ë €®«Šë ª®¬¯š«šà®¢ âì ¡š¡«š®â¥çë© šâ¥à䥩á GS3democlient
|
---|
| 111 | if "%LANGUAGE%" == "ru" echo (šá¯®«ì§ãï "ant build-demo-client") ¯¥à¥€ ¢¢®€®¬ í⮣® áªàš¯â
|
---|
| 112 | goto exit
|
---|
| 113 |
|
---|
| 114 |
|
---|
| 115 | :runGS3democlient
|
---|
| 116 | :: ---- Finally, run the runGS3democlient ----
|
---|
| 117 | echo.
|
---|
| 118 |
|
---|
| 119 | if "%LANGUAGE%" == "en" echo Running the GS3democlient ...
|
---|
| 120 | if "%LANGUAGE%" == "es" echo Ejecutando GS3democlient ...
|
---|
| 121 | if "%LANGUAGE%" == "fr" echo Excution de GS3democlient
|
---|
| 122 | if "%LANGUAGE%" == "ru" echo ¥ªãéš© ¡š¡«š®â¥çë© šâ¥à䥩á GS3democlient ...
|
---|
| 123 |
|
---|
| 124 | :: -Xms32M To set minimum memory
|
---|
| 125 | :: -Xmx32M To set maximum memory
|
---|
| 126 | :: -verbose:gc To set garbage collection messages
|
---|
| 127 | :: -Xincgc For incremental garbage collection
|
---|
| 128 | :: -Xprof Function call profiling
|
---|
| 129 | :: -Xloggc:<file> Write garbage collection log
|
---|
| 130 |
|
---|
| 131 |
|
---|
| 132 | :localLib
|
---|
| 133 | "%JAVAPATH%\java" -jar GS3democlient.jar
|
---|
| 134 |
|
---|
| 135 | :exit
|
---|
| 136 | echo.
|
---|
| 137 | pause
|
---|
| 138 |
|
---|
| 139 | :done
|
---|
[15308] | 140 | :: ---- Clean up ----
|
---|
| 141 | set JAVAPATH=
|
---|