root/other-projects/trunk/gs3-webservices-democlient/gs3democlient.bat @ 15347

Revision 15347, 5.6 KB (checked in by ak19, 11 years ago)

Removed funny character from end that was probably introduced when editing the batch script on a Linux machine

  • Property svn:executable set to *
Line 
1@echo off
2set 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
8echo I am here
9if 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 ex‚cut‚ … partir du r‚pertoire dans lequel il se trouve.
13    if "%LANGUAGE%" == "ru" echo â®â áªàš¯â €®«Š¥­ ¡ëâì ¢§ïâ š§ €šà¥ªâ®àšš, ¢ ª®â®à®© ®­ à á¯®«®Š¥­
14    goto exit
15
16:start
17
18
19:findJava
20:: ---- Check Java exists ----
21set JAVAPATH=
22
23:: Some users may set the above line manually
24if not "%JAVAPATH%" == "" goto testJava
25
26    :: If it is set, use the JAVA_HOME environment variable
27    if not "%JAVA_HOME%" == "" goto javahome
28
29    :: Check if Java is on the search path
30    echo %PATH%| winutil\which.exe java.exe | winutil\setvar.exe JAVAPATH > setjava.bat
31    call setjava.bat
32    del setjava.bat
33    if not "%JAVAPATH%" == "" goto testJava
34
35    :: Still haven't found anything, so try looking in the registry (gulp!)
36    type nul > jdk.reg
37    regedit /E jdk.reg "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit"
38    type jdk.reg > jdk.txt
39    del jdk.reg
40    type nul > jre.reg
41    regedit /E jre.reg "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment"
42    type jre.reg > jre.txt
43    del jre.reg
44
45    winutil\findjava.exe jdk.txt jre.txt | winutil\setvar.exe JAVAPATH > setjava.bat
46    del jdk.txt
47    del jre.txt
48    call setjava.bat
49    del setjava.bat
50
51    :: If nothing was found in the registry, we're stuck
52    if "%JAVAPATH%" == "" goto noJava
53
54    set JAVAPATH=%JAVAPATH%\bin
55    goto testJava
56
57:javahome
58    set JAVAPATH=%JAVA_HOME%\bin
59
60
61:testJava
62:: Check that a Java executable has been found
63if "%LANGUAGE%" == "en" echo Checking Java: %JAVAPATH%
64if "%LANGUAGE%" == "es" echo Revisando Java: %JAVAPATH%
65if "%LANGUAGE%" == "fr" echo V‚rification de Java: %JAVAPATH%
66if "%LANGUAGE%" == "ru" echo à®¢¥àª  Java: %JAVAPATH%
67if exist "%JAVAPATH%\java.exe" goto checkJavaVersion
68
69:noJava
70    echo.
71    if "%LANGUAGE%" == "en" echo Failed to locate an appropriate version of Java. You must install a
72    if "%LANGUAGE%" == "en" echo Java Runtime Environment (version 1.5 or greater) before running the
73    if "%LANGUAGE%" == "en" echo Greenstone Librarian Interface.
74
75    if "%LANGUAGE%" == "es" echo No se pudo localizar una versi¢n apropiada de Java. Usted deber 
76    if "%LANGUAGE%" == "es" echo instalar un Ambiente de Ejecuci¢n Java (versi¢n 1.5 o superior)
77    if "%LANGUAGE%" == "es" echo antes de correr la Interfaz de la Biblioteca Digital Greenstone.
78
79    if "%LANGUAGE%" == "fr" echo Une version ad‚quate de Java n'a pas pu ˆtre localis‚e. Vous devez
80    if "%LANGUAGE%" == "fr" echo installer un Java Runtime Environment (version 1.5 ou sup‚rieur)
81    if "%LANGUAGE%" == "fr" echo avant de d‚marrer Greenstone Librarian Interface.
82
83    if "%LANGUAGE%" == "ru" echo ¥ 〠«®áì ®¯à¥€¥«šâì ¬¥áâ®­ å®Š€¥­š¥ ᮮ⢥âáâ¢ãî饩 ¢¥àášš Java.
84    if "%LANGUAGE%" == "ru" echo ‚ë €®«Š­ë ãáâ ­®¢šâì Java Runtime Environment (¢¥àášî 1.5 š«š ¢ëè¥) ¯¥à¥€ ¢¢®€®¬
85    if "%LANGUAGE%" == "ru" echo ¡š¡«š®â¥ç­®£® š­â¥àä¥©á  Greenstone.
86    goto exit
87
88
89:checkJavaVersion
90:: ---- Ensure that the JavaVersion is 1.5.x or more, run CheckJavaVersion with <required java version no prefix> <target exec program name> ---
91    "%JAVAPATH%\java" CheckJavaVersion 1.5 GS3democlient
92    if ERRORLEVEL 2 goto checkGS3democlient
93    if ERRORLEVEL 1 goto exit
94
95
96:checkGS3democlient
97:: ---- Check that the GS3democlient has been compiled ----
98if exist "GS3democlient.jar" goto runGS3democlient
99    echo.
100    if "%LANGUAGE%" == "en" echo You need to build the GS3democlient (using "ant build-demo-client")
101    if "%LANGUAGE%" == "en" echo before running this script.
102
103    if "%LANGUAGE%" == "es" echo Usted necesita compilar la GS3democlient
104    if "%LANGUAGE%" == "es" echo (por medio de "ant build-demo-client") antes de ejecutar este gui¢n.
105
106    if "%LANGUAGE%" == "fr" echo Vous devez compiler le GS3democlient (en utilisant "ant build-demo-client")
107    if "%LANGUAGE%" == "fr" echo avant d'ex‚cuter ce script.
108
109    if "%LANGUAGE%" == "ru" echo ‚ë €®«Š­ë ª®¬¯š«šà®¢ âì ¡š¡«š®â¥ç­ë© š­â¥à䥩á GS3democlient
110    if "%LANGUAGE%" == "ru" echo (šá¯®«ì§ãï "ant build-demo-client") ¯¥à¥€ ¢¢®€®¬ í⮣® áªàš¯â 
111    goto exit
112
113
114:runGS3democlient
115:: ---- Finally, run the runGS3democlient ----
116# Creates new folder "logs", if it does not already exist. Logs dir must exist
117# for log4j to write output files into. MKDIR/mkdir is a synonym for MD/md
118md "logs"
119
120:: Creates new folder "logs", if it does not already exist. Logs dir must exist
121:: for log4j to write output files into. MKDIR/mkdir is a synonym for MD/md
122md "logs"
123echo.
124
125if "%LANGUAGE%" == "en" echo Running the GS3democlient ...
126if "%LANGUAGE%" == "es" echo Ejecutando GS3democlient ...
127if "%LANGUAGE%" == "fr" echo Ex‚cution de GS3democlient
128if "%LANGUAGE%" == "ru" echo ’¥ªãéš© ¡š¡«š®â¥ç­ë© š­â¥à䥩á GS3democlient ...
129
130:: -Xms32M          To set minimum memory
131:: -Xmx32M          To set maximum memory
132:: -verbose:gc      To set garbage collection messages
133:: -Xincgc          For incremental garbage collection
134:: -Xprof           Function call profiling
135:: -Xloggc:<file>   Write garbage collection log
136
137
138:localLib
139    "%JAVAPATH%\java" -jar GS3democlient.jar
140
141:exit
142echo.
143pause
144
145:done
146:: ---- Clean up ----
147set JAVAPATH=
Note: See TracBrowser for help on using the browser.