root/trunk/gli/gems.bat @ 12453

Revision 12453, 8.9 KB (checked in by mdewsnip, 14 years ago)

Changed copyright date to 2006.

  • Property svn:mime-type set to application/octet-stream
Line 
1@echo off
2set GLILANG=en
3
4
5::  -------- Run the Greenstone Editor for Metadata Sets --------
6
7:: This script must be run from within the directory in which it lives
8if exist gems.bat goto start
9    if "%GLILANG%" == "en" echo This script must be run from the directory in which it resides.
10    if "%GLILANG%" == "es" echo Este gui¢n deber  ejecutarse desde el directorio en el que reside.
11    if "%GLILANG%" == "fr" echo Ce script doit ˆtre ex‚cut‚ … partir du r‚pertoire dans lequel il se trouve.
12    if "%GLILANG%" == "ru" echo â®â áªàš¯â €®«Š¥­ ¡ëâì ¢§ïâ š§ €šà¥ªâ®àšš, ¢ ª®â®à®© ®­ à á¯®«®Š¥­
13    goto exit
14
15:start
16if "%OS%" == "Windows_NT" goto findGSDL
17    :: Invoke a new command processor to ensure there's enough environment space
18    if "%1" == "Second" goto findGSDL
19        command /E:2048 /C %0 Second %1 %2 %3 %4 %5 %6 %7 %8 %9
20        goto done
21
22:findGSDL
23echo.
24if "%GLILANG%" == "en" echo Greenstone Editor for Metadata Sets (GEMS)
25if "%GLILANG%" == "en" echo Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato
26if "%GLILANG%" == "en" echo GEMS comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt
27if "%GLILANG%" == "en" echo This is free software, and you are welcome to redistribute it
28
29if "%GLILANG%" == "es" echo Editar conjuntos de metadatos (Greenstone Editor for Metadata Sets - GEMS)
30if "%GLILANG%" == "es" echo Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato
31if "%GLILANG%" == "es" echo GEMS NO INCLUYE ABSOLUTAMENTE NINGUNA GARANTÖA.
32if "%GLILANG%" == "es" echo Para mayor informaci¢n vea los t‚rminos de la licencia en LICENSE.txt
33if "%GLILANG%" == "es" echo Este es un software abierto, por lo que lo invitamos a que lo distribuya de forma gratuita
34
35if "%GLILANG%" == "fr" echo Editer les jeux de méta-données (Greenstone Editor for Metadata Sets - GEMS)
36if "%GLILANG%" == "fr" echo Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato
37if "%GLILANG%" == "fr" echo GEMS est fourni sans AUCUNE GARANTIE; pour des d‚tails, voir LICENSE.txt
38if "%GLILANG%" == "fr" echo Ceci est un logiciel libre, et vous ˆtes invit‚ … le redistribuer
39
40if "%GLILANG%" == "ru" echo Ðåäàêòèðîâàòü íàáîðû ìåòàäàííûõ (Greenstone Editor for Metadata Sets - GEMS)
41if "%GLILANG%" == "ru" echo Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato
42if "%GLILANG%" == "ru" echo ˆƒ ­¥ € ¥â €‘Ž‹ž’Ž ˆŠ€Šˆ• ƒ€€’ˆ‰; €¥â «š á¬. ¢ ⥪á⥠LICENSE.TXT
43if "%GLILANG%" == "ru" echo â® - ᢮¡®€­® à á¯à®áâ࠭塞®¥ ¯à®£à ¬¬­®¥ ®¡¥á¯¥ç¥­š¥ š ‚ë ¬®Š¥â¥ à á¯à®áâà ­ïâì ¥£®
44
45echo.
46::  ---- Determine GSDLHOME ----
47set GSDLPATH=
48
49:: Some users may set the above line manually
50if not "%GSDLPATH%" == "" goto testGSDL
51
52    :: The default location for the GLI (and thus GEMS) is a subdirectory of Greenstone
53    set GSDLPATH=..
54
55    :: If it is set, use the GSDLHOME environment variable
56    if "%GSDLHOME%" == "" goto testGSDL
57    set GSDLPATH=%GSDLHOME%
58
59:testGSDL
60:: Check that the Greenstone installation looks OK
61if "%GLILANG%" == "en" echo Checking GSDL: %GSDLPATH%
62if "%GLILANG%" == "es" echo Revisando GSDL: %GSDLPATH%
63if "%GLILANG%" == "fr" echo V‚rification de GSDL: %GSDLPATH%
64if "%GLILANG%" == "ru" echo à®¢¥àª  GSDL: %GSDLPATH%
65if exist "%GSDLPATH%\setup.bat" goto prepGSDL
66    echo.
67    if "%GLILANG%" == "en" echo The Greenstone installation could not be found, or is incomplete.
68    if "%GLILANG%" == "en" echo Try reinstalling Greenstone then running this script again.
69
70    if "%GLILANG%" == "es" echo No se pudo encontrar la instalaci¢n de Greenstone o est  incompleta.
71    if "%GLILANG%" == "es" echo Trate de reinstalar Greenstone y a continuaci¢n ejecute nuevamente este gui¢n.
72
73    if "%GLILANG%" == "fr" echo L'installation de Greenstone est introuvable ou incomplŠte. Essayez
74    if "%GLILANG%" == "fr" echo de r‚installer Greenstone et ex‚cutez ce script … nouveau.
75
76    if "%GLILANG%" == "ru" echo ˆ­áâ ««ïæšï Greenstone ­¥ ¡ë«  ­ ©€¥­  š«š ®­  ­¥¯®«­ . ®¯à®¡ã©â¥ ¯®¢â®à­®
77    if "%GLILANG%" == "ru" echo ãáâ ­®¢šâì Greenstone,   § â¥¬ ¢¢¥áâš íâ®â áªàš¯â á­®¢ .
78    goto exit
79
80:prepGSDL
81:: Setup Greenstone, unless it has already been done
82if not "%GSDLHOME%" == "" goto doneGSDL
83    call "%GSDLPATH%\setup.bat" SetEnv > nul
84
85:doneGSDL
86:: GSDLPATH is no longer needed, since GSDLHOME should now be set
87set GSDLPATH=
88
89
90:findJava
91:: ---- Check Java exists ----
92set JAVAPATH=
93
94:: Some users may set the above line manually
95if not "%JAVAPATH%" == "" goto testJava
96
97    :: If it is set, use the JAVA_HOME environment variable
98    if not "%JAVA_HOME%" == "" goto javahome
99
100    :: Check if Java is on the search path
101    echo %PATH%| winutil\which.exe java.exe | winutil\setvar.exe JAVAPATH > setjava.bat
102    call setjava.bat
103    del setjava.bat
104    if not "%JAVAPATH%" == "" goto testJava
105
106    :: Still haven't found anything, so try looking in the registry (gulp!)
107    type nul > jdk.reg
108    regedit /E jdk.reg "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit"
109    type jdk.reg > jdk.txt
110    del jdk.reg
111    type nul > jre.reg
112    regedit /E jre.reg "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment"
113    type jre.reg > jre.txt
114    del jre.reg
115
116    winutil\findjava.exe jdk.txt jre.txt | winutil\setvar.exe JAVAPATH > setjava.bat
117    del jdk.txt
118    del jre.txt
119    call setjava.bat
120    del setjava.bat
121
122    :: If nothing was found in the registry, we're stuck
123    if "%JAVAPATH%" == "" goto noJava
124
125    set JAVAPATH=%JAVAPATH%\bin
126    goto testJava
127
128:javahome
129    set JAVAPATH=%JAVA_HOME%\bin
130
131:testJava
132:: Check that a Java executable has been found
133if "%GLILANG%" == "en" echo Checking Java: %JAVAPATH%
134if "%GLILANG%" == "es" echo Revisando Java: %JAVAPATH%
135if "%GLILANG%" == "fr" echo V‚rification de Java: %JAVAPATH%
136if "%GLILANG%" == "ru" echo à®¢¥àª  Java: %JAVAPATH%
137if exist "%JAVAPATH%\java.exe" goto checkGEMS
138
139:noJava
140    echo.
141    if "%GLILANG%" == "en" echo Failed to locate an appropriate version of Java. You must install a
142    if "%GLILANG%" == "en" echo Java Runtime Environment (version 1.4 or greater) before running the
143    if "%GLILANG%" == "en" echo Greenstone Editor for Metadata Sets.
144
145    if "%GLILANG%" == "es" echo No se pudo localizar una versi¢n apropiada de Java. Usted deber 
146    if "%GLILANG%" == "es" echo instalar un Ambiente de Ejecuci¢n Java (versi¢n 1.4 o superior)
147    if "%GLILANG%" == "es" echo antes de correr la Editar conjuntos de metadatos.
148
149    if "%GLILANG%" == "fr" echo Une version ad‚quate de Java n'a pas pu ˆtre localis‚e. Vous devez
150    if "%GLILANG%" == "fr" echo installer un Java Runtime Environment (version 1.4 ou sup‚rieur)
151    if "%GLILANG%" == "fr" echo avant de d‚marrer Editer les jeux de méta-données.
152
153    if "%GLILANG%" == "ru" echo ¥ 〠«®áì ®¯à¥€¥«šâì ¬¥áâ®­ å®Š€¥­š¥ ᮮ⢥âáâ¢ãî饩 ¢¥àášš Java.
154    if "%GLILANG%" == "ru" echo ‚ë €®«Š­ë ãáâ ­®¢šâì Java Runtime Environment (¢¥àášî 1.4 š«š ¢ëè¥) ¯¥à¥€ ¢¢®€®¬
155    if "%GLILANG%" == "ru" echo Ðåäàêòèðîâàòü íàáîðû ìåòàäàííûõ.
156    goto exit
157
158
159:checkGEMS
160:: ---- Check that the GEMS has been compiled ----
161if exist "classes/org/greenstone/gatherer/gems/GEMS.class" goto runGEMS
162if exist "GLI.jar" goto runGEMS
163    echo.
164    if "%GLILANG%" == "en" echo You need to compile the Greenstone Editor for Metadata Sets (using makegli.bat)
165    if "%GLILANG%" == "en" echo before running this script.
166
167    if "%GLILANG%" == "es" echo Usted necesita compilar la Editar conjuntos de metadatos
168    if "%GLILANG%" == "es" echo (por medio de makegli.bat) antes de ejecutar este gui¢n.
169
170    if "%GLILANG%" == "fr" echo Vous devez compiler le Editer les jeux de méta-données (en utilisant
171    if "%GLILANG%" == "fr" echo makegli.bat) avant d'ex‚cuter ce script.
172
173    if "%GLILANG%" == "ru" echo ‚ë €®«Š­ë ª®¬¯š«šà®¢ âì Ðåäàêòèðîâàòü íàáîðû ìåòàäàííûõ (šá¯®«ì§ãï makegli.bat)
174    if "%GLILANG%" == "ru" echo ¯¥à¥€ ¢¢®€®¬ í⮣® áªàš¯â 
175    goto exit
176
177
178:runGEMS
179:: ---- Finally, run the GEMS ----
180echo.
181
182if "%GLILANG%" == "en" echo Running the Greenstone Editor for Metadata Sets...
183if "%GLILANG%" == "es" echo Ejecutando la Editar conjuntos de metadatos...
184if "%GLILANG%" == "fr" echo Ex‚cution de Editer les jeux de méta-données
185if "%GLILANG%" == "ru" echo ’¥ªãéš© Ðåäàêòèðîâàòü íàáîðû ìåòàäàííûõ...
186
187:: -Xms32M          To set minimum memory
188:: -Xmx32M          To set maximum memory
189:: -verbose:gc      To set garbage collection messages
190:: -Xincgc          For incremental garbage collection
191:: -Xprof           Function call profiling
192:: -Xloggc:<file>   Write garbage collection log
193
194"%JAVAPATH%\java" -cp classes/;GLI.jar;lib/apache.jar org.greenstone.gatherer.gems.GEMS -gsdl %GSDLHOME% %1 %2 %3 %4 %5 %6 %7 %8 %9
195
196if "%GLILANG%" == "en" echo Done!
197if "%GLILANG%" == "es" echo ­Hecho!
198if "%GLILANG%" == "fr" echo Termin‚!
199if "%GLILANG%" == "ru" echo ‚믮«­¥­®!
200goto done
201
202:exit
203echo.
204pause
205
206:done
207:: ---- Clean up ----
208set JAVAPATH=
Note: See TracBrowser for help on using the browser.