source: trunk/gli/gli4gs3.bat@ 13027

Last change on this file since 13027 was 13027, checked in by mdewsnip, 15 years ago

No longer uses the -wget option.

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 13.9 KB
Line 
1@echo off
2set GLILANG=en
3
4
5:: -------- Run the Greenstone Librarian Interface --------
6
7:: This script must be run from within the directory in which it lives
8if exist gli4gs3.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‚ …
12 partir du r‚pertoire dans lequel il se trouve.
13 if "%GLILANG%" == "ru" echo â®â áªàš¯â €®«Š¥­ ¡ëâì ¢§ïâ š§ €šà¥ªâ®àšš, ¢ ª®â®à®© ®­ à á¯®«®Š¥­
14 goto exit
15
16:start
17if "%OS%" == "Windows_NT" goto findGSDL3
18 :: Invoke a new command processor to ensure there's enough environment space
19 if "%1" == "Second" goto findGSDL3
20 command /E:2048 /C %0 Second %1 %2 %3 %4 %5 %6 %7 %8 %9
21 goto done
22
23:findGSDL3
24echo.
25if "%GLILANG%" == "en" echo Greenstone Librarian Interface (GLI)
26if "%GLILANG%" == "en" echo Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato
27if "%GLILANG%" == "en" echo GLI comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt
28if "%GLILANG%" == "en" echo This is free software, and you are welcome to redistribute it
29
30if "%GLILANG%" == "es" echo Interfaz de la Biblioteca Digital Greenstone (Greenstone Librarian Interface - GLI)
31if "%GLILANG%" == "es" echo Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato
32if "%GLILANG%" == "es" echo La Interfaz de la Biblioteca Digital Greenstone NO INCLUYE ABSOLUTAMENTE NINGUNA GARANTÖA.
33if "%GLILANG%" == "es" echo Para mayor informaci¢n vea los t‚rminos de la licencia en LICENSE.txt
34if "%GLILANG%" == "es" echo Este es un software abierto, por lo que lo invitamos a que lo distribuya de forma gratuita
35
36if "%GLILANG%" == "fr" echo Interface du Biblioth‚caire Greenstone (Greenstone Librarian Interface - GLI)
37if "%GLILANG%" == "fr" echo Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato
38if "%GLILANG%" == "fr" echo GLI est fourni sans AUCUNE GARANTIE; pour des d‚tails, voir LICENSE.txt
39if "%GLILANG%" == "fr" echo Ceci est un logiciel libre, et vous ˆtes invit‚ …
40 le redistribuer
41
42if "%GLILANG%" == "ru" echo š¡«š®â¥ç­ë© š­â¥à䥩á Greenstone (Greenstone Librarian Interface - GLI)
43if "%GLILANG%" == "ru" echo Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato
44if "%GLILANG%" == "ru" echo ˆƒ ­¥ € ¥â €‘Ž‹ž’Ž ˆŠ€Šˆ• ƒ€€’ˆ‰; €¥â «š á¬. ¢ ⥪á⥠LICENSE.TXT
45if "%GLILANG%" == "ru" echo â® - ᢮¡®€­® à á¯à®áâ࠭塞®¥ ¯à®£à ¬¬­®¥ ®¡¥á¯¥ç¥­š¥ š ‚ë ¬®Š¥â¥ à á¯à®áâà ­ïâì ¥£®
46
47echo.
48:: ---- Determine GSDL3HOME ----
49set GSDL3PATH=%GSDL3PATH%
50
51:: Some users may set the above line manually, or it may be set as an argument
52if not "%GSDL3PATH%" == "" goto testGSDL3
53
54 :: The default location for the GLI is a subdirectory of Greenstone 3
55 set GSDL3PATH=..
56
57 :: If it is set, use the GSDL3HOME environment variable
58 if "%GSDL3SRCHOME%" == "" goto testGSDL3
59 set GSDL3PATH=%GSDL3SRCHOME%
60
61:testGSDL3
62:: Check that the Greenstone 3 installation looks OK
63if "%GLILANG%" == "en" echo Checking GSDL3: %GSDL3PATH%
64if "%GLILANG%" == "es" echo Revisando GSDL3: %GSDL3PATH%
65if "%GLILANG%" == "fr" echo V‚rification de GSDL3: %GSDL3PATH%
66if "%GLILANG%" == "ru" echo à®¢¥àª  GSDL3: %GSDL3PATH%
67if exist "%GSDL3PATH%\gs3-setup.bat" goto prepGSDL3
68 echo.
69 if "%GLILANG%" == "en" echo The Greenstone 3 installation could not be found, or is incomplete.
70 if "%GLILANG%" == "en" echo Try reinstalling Greenstone 3 then running this script again.
71
72 if "%GLILANG%" == "es" echo No se pudo encontrar la instalaci¢n de Greenstone 3 o est  incompleta.
73 if "%GLILANG%" == "es" echo Trate de reinstalar Greenstone 3 y a continuaci¢n ejecute nuevamente este gui¢n.
74
75 if "%GLILANG%" == "fr" echo L'installation de Greenstone 3 est introuvable ou incomplŠte. Essayez
76 if "%GLILANG%" == "fr" echo de r‚installer Greenstone 3 et ex‚cutez ce script …
77 nouveau.
78
79 if "%GLILANG%" == "ru" echo ˆ­áâ ««ïæšï Greenstone 3 ­¥ ¡ë«  ­ ©€¥­  š«š ®­  ­¥¯®«­ . ®¯à®¡ã©â¥ ¯®¢â®à­®
80 if "%GLILANG%" == "ru" echo ãáâ ­®¢šâì Greenstone, 3   § â¥¬ ¢¢¥áâš íâ®â áªàš¯â á­®¢ .
81 goto exit
82
83:prepGSDL3
84:: Setup Greenstone 3, unless it has already been done
85if not "%GSDL3SRCHOME%" == "" goto doneGSDL3
86 cd | winutil\setvar.exe GLIDIR > setgli.bat
87 call setgli.bat
88 del setgli.bat
89 cd "%GSDL3PATH%"
90 call gs3-setup.bat SetEnv > nul
91 cd %GLIDIR%
92
93:doneGSDL3
94:: GSDL3PATH is no longer needed, since GSDL3HOME should now be set
95set GSDL3PATH=
96
97
98:: ---- Determine GSDLHOME ----
99set GSDLPATH=%GSDLPATH%
100
101:: Some users may set the above line manually, or it may be set in the environment
102if not "%GSDLPATH%" == "" goto testGSDL
103
104 :: The default location for Greenstone is a gs2build subdirectory of Greenstone 3
105 set GSDLPATH=%GSDL3SRCHOME%\gs2build
106
107 :: If it is set, use the GSDLHOME environment variable
108 if "%GSDLHOME%" == "" goto testGSDL
109 set GSDLPATH=%GSDLHOME%
110
111:testGSDL
112:: Check that the Greenstone installation looks OK
113if "%GLILANG%" == "en" echo Checking GSDL: %GSDLPATH%
114if "%GLILANG%" == "es" echo Revisando GSDL: %GSDLPATH%
115if "%GLILANG%" == "fr" echo V‚rification de GSDL: %GSDLPATH%
116if "%GLILANG%" == "ru" echo à®¢¥àª  GSDL: %GSDLPATH%
117if exist "%GSDLPATH%\setup.bat" goto prepGSDL
118 echo.
119 if "%GLILANG%" == "en" echo The Greenstone installation could not be found, or is incomplete.
120 if "%GLILANG%" == "en" echo Try reinstalling Greenstone then running this script again.
121
122 if "%GLILANG%" == "es" echo No se pudo encontrar la instalaci¢n de Greenstone o est  incompleta.
123 if "%GLILANG%" == "es" echo Trate de reinstalar Greenstone y a continuaci¢n ejecute nuevamente este gui¢n.
124
125 if "%GLILANG%" == "fr" echo L'installation de Greenstone est introuvable ou incomplŠte. Essayez
126 if "%GLILANG%" == "fr" echo de r‚installer Greenstone et ex‚cutez ce script …
127 nouveau.
128
129 if "%GLILANG%" == "ru" echo ˆ­áâ ««ïæšï Greenstone ­¥ ¡ë«  ­ ©€¥­  š«š ®­  ­¥¯®«­ . ®¯à®¡ã©â¥ ¯®¢â®à­®
130 if "%GLILANG%" == "ru" echo ãáâ ­®¢šâì Greenstone,   § â¥¬ ¢¢¥áâš íâ®â áªàš¯â á­®¢ .
131 goto exit
132
133:prepGSDL
134:: Setup Greenstone, unless it has already been done
135if not "%GSDLHOME%" == "" goto doneGSDL
136 call "%GSDLPATH%\setup.bat" SetEnv > nul
137
138:doneGSDL
139:: GSDLPATH is no longer needed, since GSDLHOME should now be set
140set GSDLPATH=
141
142
143:findPerl
144:: ---- Check Perl exists ----
145set PERLPATH=
146
147:: Some users may set the above line manually
148if not "%PERLPATH%" == "" goto testPerl
149
150 :: Check if Perl is on the search path
151 echo %PATH%| winutil\which.exe perl.exe | winutil\setvar.exe PERLPATH > setperl.bat
152 call setperl.bat
153 del setperl.bat
154 if not "%PERLPATH%" == "" goto testPerl
155
156 :: If not, try GSDLHOME\bin\windows\perl\bin
157 if exist "%GSDLHOME%\bin\windows\perl\bin\perl.exe" goto gsdlPerl
158
159 :: Still haven't found anything, so try looking in the registry (gulp!)
160 type nul > perl.reg
161 regedit /E perl.reg "HKEY_LOCAL_MACHINE\SOFTWARE\Perl"
162 type perl.reg > perl.txt
163 del perl.reg
164
165 winutil\findperl.exe perl.txt | winutil\setvar.exe PERLPATH > setperl.bat
166 del perl.txt
167 call setperl.bat
168 del setperl.bat
169
170 :: If nothing was found in the registry, we're stuck
171 if "%PERLPATH%" == "" goto noPerl
172
173 goto testPerl
174
175:gsdlPerl
176 set PERLPATH=%GSDLHOME%\bin\windows\perl\bin
177
178:testPerl
179:: Check that a Perl executable has been found
180if "%GLILANG%" == "en" echo Checking Perl: %PERLPATH%
181if "%GLILANG%" == "es" echo Revisando Perl: %PERLPATH%
182if "%GLILANG%" == "fr" echo V‚rification de Perl: %PERLPATH%
183if "%GLILANG%" == "ru" echo à®¢¥àª  Perl: %PERLPATH%
184if exist "%PERLPATH%\perl.exe" goto findJava
185
186:noPerl
187 echo.
188 if "%GLILANG%" == "en" echo The Greenstone Librarian Interface requires perl in order to operate,
189 if "%GLILANG%" == "en" echo but perl could not be detected on your system. Please ensure that perl
190 if "%GLILANG%" == "en" echo is installed and is on your search path, then rerun this script.
191
192 if "%GLILANG%" == "es" echo La Interfaz de la Biblioteca Digital Greenstone requiere Perl para poder
193 if "%GLILANG%" == "es" echo operar, pero ‚ste no aparece en su sistema. Por favor aseg£rese de
194 if "%GLILANG%" == "es" echo que Perl est  instalado y se encuentra en su ruta de b£squeda.
195 if "%GLILANG%" == "es" echo A continuaci¢n ejecute nuevamente este gui¢n.
196
197 if "%GLILANG%" == "fr" echo Greenstone Librarian Interface n‚cessite perl pour son fonctionnement,
198 if "%GLILANG%" == "fr" echo mais perl n'a pas pu ˆtre d‚tect‚ dans votre systŠme. Veuillez vous
199 if "%GLILANG%" == "fr" echo assurer que perl est install‚ et est sp‚cifi‚ dans votre chemin de
200 if "%GLILANG%" == "fr" echo recherche, puis red‚marrez ce script.
201
202 if "%GLILANG%" == "ru" echo š¡«š®â¥ç­ë© š­â¥à䥩á Greenstone âॡã¥â Perl, çâ®¡ë š¬¥âì ¢®§¬®Š­®áâì
203 if "%GLILANG%" == "ru" echo à ¡®â âì, ­® Perl ­¥ ¡ë« ¢ ¢ è¥© ášá⥬¥. ®Š «ã©áâ , ¯®€â¢¥à€šâ¥,
204 if "%GLILANG%" == "ru" echo çâ® Perl ãáâ ­®¢«¥­ š ­ å®€šâáï ­  ¢ è¥¬ ¯ãâš ¯®šáª , § â¥¬
205 if "%GLILANG%" == "ru" echo ¯®¢â®à­®¢¢¥€šâ¥ íâ®â áªàš¯â.
206 goto exit
207
208
209:findJava
210:: ---- Check Java exists ----
211set JAVAPATH=
212
213:: Some users may set the above line manually
214if not "%JAVAPATH%" == "" goto testJava
215
216 :: If it is set, use the JAVA_HOME environment variable
217 if not "%JAVA_HOME%" == "" goto javahome
218
219 :: Check if Java is on the search path
220 echo %PATH%| winutil\which.exe java.exe | winutil\setvar.exe JAVAPATH > setjava.bat
221 call setjava.bat
222 del setjava.bat
223 if not "%JAVAPATH%" == "" goto testJava
224
225 :: Still haven't found anything, so try looking in the registry (gulp!)
226 type nul > jdk.reg
227 regedit /E jdk.reg "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit"
228 type jdk.reg > jdk.txt
229 del jdk.reg
230 type nul > jre.reg
231 regedit /E jre.reg "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment"
232 type jre.reg > jre.txt
233 del jre.reg
234
235 winutil\findjava.exe jdk.txt jre.txt | winutil\setvar.exe JAVAPATH > setjava.bat
236 del jdk.txt
237 del jre.txt
238 call setjava.bat
239 del setjava.bat
240
241 :: If nothing was found in the registry, we're stuck
242 if "%JAVAPATH%" == "" goto noJava
243
244 set JAVAPATH=%JAVAPATH%\bin
245 goto testJava
246
247:javahome
248 set JAVAPATH=%JAVA_HOME%\bin
249
250:testJava
251:: Check that a Java executable has been found
252if "%GLILANG%" == "en" echo Checking Java: %JAVAPATH%
253if "%GLILANG%" == "es" echo Revisando Java: %JAVAPATH%
254if "%GLILANG%" == "fr" echo V‚rification de Java: %JAVAPATH%
255if "%GLILANG%" == "ru" echo à®¢¥àª  Java: %JAVAPATH%
256if exist "%JAVAPATH%\java.exe" goto checkGLI
257
258:noJava
259 echo.
260 if "%GLILANG%" == "en" echo Failed to locate an appropriate version of Java. You must install a
261 if "%GLILANG%" == "en" echo Java Runtime Environment (version 1.4 or greater) before running the
262 if "%GLILANG%" == "en" echo Greenstone Librarian Interface.
263
264 if "%GLILANG%" == "es" echo No se pudo localizar una versi¢n apropiada de Java. Usted deber 
265 if "%GLILANG%" == "es" echo instalar un Ambiente de Ejecuci¢n Java (versi¢n 1.4 o superior)
266 if "%GLILANG%" == "es" echo antes de correr la Interfaz de la Biblioteca Digital Greenstone.
267
268 if "%GLILANG%" == "fr" echo Une version ad‚quate de Java n'a pas pu ˆtre localis‚e. Vous devez
269 if "%GLILANG%" == "fr" echo installer un Java Runtime Environment (version 1.4 ou sup‚rieur)
270 if "%GLILANG%" == "fr" echo avant de d‚marrer Greenstone Librarian Interface.
271
272 if "%GLILANG%" == "ru" echo ¥ 〠«®áì ®¯à¥€¥«šâì ¬¥áâ®­ å®Š€¥­š¥ ᮮ⢥âáâ¢ãî饩 ¢¥àášš Java.
273 if "%GLILANG%" == "ru" echo ‚ë €®«Š­ë ãáâ ­®¢šâì Java Runtime Environment (¢¥àášî 1.4 š«š ¢ëè¥) ¯¥à¥€ ¢¢®€®¬
274 if "%GLILANG%" == "ru" echo ¡š¡«š®â¥ç­®£® š­â¥àä¥©á  Greenstone.
275 goto exit
276
277
278:checkGLI
279:: ---- Check that the GLI has been compiled ----
280if exist "classes/org/greenstone/gatherer/GathererProg.class" goto runGLI
281if exist "GLI.jar" goto runGLI
282 echo.
283 if "%GLILANG%" == "en" echo You need to compile the Greenstone Librarian Interface (using makegli.bat)
284 if "%GLILANG%" == "en" echo before running this script.
285
286 if "%GLILANG%" == "es" echo Usted necesita compilar la Interfaz de la Biblioteca Digital Greenstone
287 if "%GLILANG%" == "es" echo (por medio de makegli.bat) antes de ejecutar este gui¢n.
288
289 if "%GLILANG%" == "fr" echo Vous devez compiler le Greenstone Interface (en utilisant makegil.bat)
290 if "%GLILANG%" == "fr" echo avant d'ex‚cuter ce script.
291
292 if "%GLILANG%" == "ru" echo ‚ë €®«Š­ë ª®¬¯š«šà®¢ âì ¡š¡«š®â¥ç­ë© š­â¥à䥩á Greenstone (šá¯®«ì§ãï makegli.bat)
293 if "%GLILANG%" == "ru" echo ¯¥à¥€ ¢¢®€®¬ í⮣® áªàš¯â 
294 goto exit
295
296
297:runGLI
298:: ---- Finally, run the GLI ----
299echo.
300
301if "%GLILANG%" == "en" echo Running the Greenstone Librarian Interface...
302if "%GLILANG%" == "es" echo Ejecutando la Interfaz de la Biblioteca Digital Greenstone...
303if "%GLILANG%" == "fr" echo Ex‚cution de Greenstone Librarian Interface
304if "%GLILANG%" == "ru" echo ’¥ªãéš© ¡š¡«š®â¥ç­ë© š­â¥à䥩á Greenstone...
305
306:: -Xms32M To set minimum memory
307:: -Xmx32M To set maximum memory
308:: -verbose:gc To set garbage collection messages
309:: -Xincgc For incremental garbage collection
310:: -Xprof Function call profiling
311:: -Xloggc:<file> Write garbage collection log
312
313"%JAVAPATH%\java" -cp classes/;GLI.jar;lib/apache.jar;lib/qfslib.jar org.greenstone.gatherer.GathererProg -gsdl %GSDLHOME% -gsdlos %GSDLOS% -gsdl3 %GSDL3HOME% -gsdl3src %GSDL3SRCHOME% -perl %PERLPATH% %1 %2 %3 %4 %5 %6 %7 %8 %9
314
315if "%GLILANG%" == "en" echo Done!
316if "%GLILANG%" == "es" echo ­Hecho!
317if "%GLILANG%" == "fr" echo Termin‚!
318if "%GLILANG%" == "ru" echo ‚믮«­¥­®!
319goto done
320
321:exit
322echo.
323pause
324
325:done
326:: ---- Clean up ----
327set PERLPATH=
328set JAVAPATH=
Note: See TracBrowser for help on using the repository browser.