root/trunk/gli/gli4gs3.bat @ 13027

Revision 13027, 13.9 KB (checked in by mdewsnip, 13 years ago)

No longer uses the -wget option.

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