root/gli/trunk/gli.bat @ 14129

Revision 13027, 12.3 KB (checked in by mdewsnip, 14 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 gli.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 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 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 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:findPerl
91::  ---- Check Perl exists ----
92set PERLPATH=
93
94:: Some users may set the above line manually
95if not "%PERLPATH%" == "" goto testPerl
96
97    :: Check if Perl is on the search path
98    echo %PATH%| winutil\which.exe perl.exe | winutil\setvar.exe PERLPATH > setperl.bat
99    call setperl.bat
100    del setperl.bat
101    if not "%PERLPATH%" == "" goto testPerl
102
103    :: If not, try GSDLHOME\bin\windows\perl\bin
104    if exist "%GSDLHOME%\bin\windows\perl\bin\perl.exe" goto gsdlPerl
105
106    :: Still haven't found anything, so try looking in the registry (gulp!)
107    type nul > perl.reg
108    regedit /E perl.reg "HKEY_LOCAL_MACHINE\SOFTWARE\Perl"
109    type perl.reg > perl.txt
110    del perl.reg
111
112    winutil\findperl.exe perl.txt | winutil\setvar.exe PERLPATH > setperl.bat
113    del perl.txt
114    call setperl.bat
115    del setperl.bat
116
117    :: If nothing was found in the registry, we're stuck
118    if "%PERLPATH%" == "" goto noPerl
119
120    goto testPerl
121
122:gsdlPerl
123    set PERLPATH=%GSDLHOME%\bin\windows\perl\bin
124
125:testPerl
126:: Check that a Perl executable has been found
127if "%GLILANG%" == "en" echo Checking Perl: %PERLPATH%
128if "%GLILANG%" == "es" echo Revisando Perl: %PERLPATH%
129if "%GLILANG%" == "fr" echo V‚rification de Perl: %PERLPATH%
130if "%GLILANG%" == "ru" echo à®¢¥àª  Perl: %PERLPATH%
131if exist "%PERLPATH%\perl.exe" goto findJava
132
133:noPerl
134    echo.
135    if "%GLILANG%" == "en" echo The Greenstone Librarian Interface requires perl in order to operate,
136    if "%GLILANG%" == "en" echo but perl could not be detected on your system. Please ensure that perl
137    if "%GLILANG%" == "en" echo is installed and is on your search path, then rerun this script.
138
139    if "%GLILANG%" == "es" echo La Interfaz de la Biblioteca Digital Greenstone requiere Perl para poder
140    if "%GLILANG%" == "es" echo operar, pero ‚ste no aparece en su sistema. Por favor aseg£rese de
141    if "%GLILANG%" == "es" echo que Perl est  instalado y se encuentra en su ruta de b£squeda.
142    if "%GLILANG%" == "es" echo A continuaci¢n ejecute nuevamente este gui¢n.
143
144    if "%GLILANG%" == "fr" echo Greenstone Librarian Interface n‚cessite perl pour son fonctionnement,
145    if "%GLILANG%" == "fr" echo mais perl n'a pas pu ˆtre d‚tect‚ dans votre systŠme. Veuillez vous
146    if "%GLILANG%" == "fr" echo assurer que perl est install‚ et est sp‚cifi‚ dans votre chemin de
147    if "%GLILANG%" == "fr" echo recherche, puis red‚marrez ce script.
148
149    if "%GLILANG%" == "ru" echo š¡«š®â¥ç­ë© š­â¥à䥩á Greenstone âॡã¥â Perl, çâ®¡ë š¬¥âì ¢®§¬®Š­®áâì
150    if "%GLILANG%" == "ru" echo à ¡®â âì, ­® Perl ­¥ ¡ë« ¢ ¢ è¥© ášá⥬¥. ®Š «ã©áâ , ¯®€â¢¥à€šâ¥,
151    if "%GLILANG%" == "ru" echo çâ® Perl ãáâ ­®¢«¥­ š ­ å®€šâáï ­  ¢ è¥¬ ¯ãâš ¯®šáª , § â¥¬
152    if "%GLILANG%" == "ru" echo ¯®¢â®à­®¢¢¥€šâ¥ íâ®â áªàš¯â.
153    goto exit
154
155
156:findJava
157:: ---- Check Java exists ----
158set JAVAPATH=
159
160:: Some users may set the above line manually
161if not "%JAVAPATH%" == "" goto testJava
162
163    :: If it is set, use the JAVA_HOME environment variable
164    if not "%JAVA_HOME%" == "" goto javahome
165
166    :: Check if Java is on the search path
167    echo %PATH%| winutil\which.exe java.exe | winutil\setvar.exe JAVAPATH > setjava.bat
168    call setjava.bat
169    del setjava.bat
170    if not "%JAVAPATH%" == "" goto testJava
171
172    :: Still haven't found anything, so try looking in the registry (gulp!)
173    type nul > jdk.reg
174    regedit /E jdk.reg "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit"
175    type jdk.reg > jdk.txt
176    del jdk.reg
177    type nul > jre.reg
178    regedit /E jre.reg "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment"
179    type jre.reg > jre.txt
180    del jre.reg
181
182    winutil\findjava.exe jdk.txt jre.txt | winutil\setvar.exe JAVAPATH > setjava.bat
183    del jdk.txt
184    del jre.txt
185    call setjava.bat
186    del setjava.bat
187
188    :: If nothing was found in the registry, we're stuck
189    if "%JAVAPATH%" == "" goto noJava
190
191    set JAVAPATH=%JAVAPATH%\bin
192    goto testJava
193
194:javahome
195    set JAVAPATH=%JAVA_HOME%\bin
196
197:testJava
198:: Check that a Java executable has been found
199if "%GLILANG%" == "en" echo Checking Java: %JAVAPATH%
200if "%GLILANG%" == "es" echo Revisando Java: %JAVAPATH%
201if "%GLILANG%" == "fr" echo V‚rification de Java: %JAVAPATH%
202if "%GLILANG%" == "ru" echo à®¢¥àª  Java: %JAVAPATH%
203if exist "%JAVAPATH%\java.exe" goto checkGLI
204
205:noJava
206    echo.
207    if "%GLILANG%" == "en" echo Failed to locate an appropriate version of Java. You must install a
208    if "%GLILANG%" == "en" echo Java Runtime Environment (version 1.4 or greater) before running the
209    if "%GLILANG%" == "en" echo Greenstone Librarian Interface.
210
211    if "%GLILANG%" == "es" echo No se pudo localizar una versi¢n apropiada de Java. Usted deber 
212    if "%GLILANG%" == "es" echo instalar un Ambiente de Ejecuci¢n Java (versi¢n 1.4 o superior)
213    if "%GLILANG%" == "es" echo antes de correr la Interfaz de la Biblioteca Digital Greenstone.
214
215    if "%GLILANG%" == "fr" echo Une version ad‚quate de Java n'a pas pu ˆtre localis‚e. Vous devez
216    if "%GLILANG%" == "fr" echo installer un Java Runtime Environment (version 1.4 ou sup‚rieur)
217    if "%GLILANG%" == "fr" echo avant de d‚marrer Greenstone Librarian Interface.
218
219    if "%GLILANG%" == "ru" echo ¥ 〠«®áì ®¯à¥€¥«šâì ¬¥áâ®­ å®Š€¥­š¥ ᮮ⢥âáâ¢ãî饩 ¢¥àášš Java.
220    if "%GLILANG%" == "ru" echo ‚ë €®«Š­ë ãáâ ­®¢šâì Java Runtime Environment (¢¥àášî 1.4 š«š ¢ëè¥) ¯¥à¥€ ¢¢®€®¬
221    if "%GLILANG%" == "ru" echo ¡š¡«š®â¥ç­®£® š­â¥àä¥©á  Greenstone.
222    goto exit
223
224
225:checkGLI
226:: ---- Check that the GLI has been compiled ----
227if exist "classes/org/greenstone/gatherer/Gatherer.class" goto runGLI
228if exist "GLI.jar" goto runGLI
229    echo.
230    if "%GLILANG%" == "en" echo You need to compile the Greenstone Librarian Interface (using makegli.bat)
231    if "%GLILANG%" == "en" echo before running this script.
232
233    if "%GLILANG%" == "es" echo Usted necesita compilar la Interfaz de la Biblioteca Digital Greenstone
234    if "%GLILANG%" == "es" echo (por medio de makegli.bat) antes de ejecutar este gui¢n.
235
236    if "%GLILANG%" == "fr" echo Vous devez compiler le Greenstone Interface (en utilisant makegli.bat)
237    if "%GLILANG%" == "fr" echo avant d'ex‚cuter ce script.
238
239    if "%GLILANG%" == "ru" echo ‚ë €®«Š­ë ª®¬¯š«šà®¢ âì ¡š¡«š®â¥ç­ë© š­â¥à䥩á Greenstone (šá¯®«ì§ãï makegli.bat)
240    if "%GLILANG%" == "ru" echo ¯¥à¥€ ¢¢®€®¬ í⮣® áªàš¯â 
241    goto exit
242
243
244:runGLI
245:: ---- Finally, run the GLI ----
246echo.
247
248if "%GLILANG%" == "en" echo Running the Greenstone Librarian Interface...
249if "%GLILANG%" == "es" echo Ejecutando la Interfaz de la Biblioteca Digital Greenstone...
250if "%GLILANG%" == "fr" echo Ex‚cution de Greenstone Librarian Interface
251if "%GLILANG%" == "ru" echo ’¥ªãéš© ¡š¡«š®â¥ç­ë© š­â¥à䥩á Greenstone...
252
253:: -Xms32M          To set minimum memory
254:: -Xmx32M          To set maximum memory
255:: -verbose:gc      To set garbage collection messages
256:: -Xincgc          For incremental garbage collection
257:: -Xprof           Function call profiling
258:: -Xloggc:<file>   Write garbage collection log
259
260if exist "%GSDLHOME%\server.exe" goto localLib
261
262:webLib
263    "%JAVAPATH%\java" -Xmx128M -cp classes/;GLI.jar;lib/apache.jar;lib/qfslib.jar org.greenstone.gatherer.GathererProg -gsdl %GSDLHOME% -gsdlos %GSDLOS% -perl %PERLPATH% %1 %2 %3 %4 %5 %6 %7 %8 %9
264
265    if ERRORLEVEL 2 goto webLib
266
267    if "%GLILANG%" == "en" echo Done!
268    if "%GLILANG%" == "es" echo ­Hecho!
269    if "%GLILANG%" == "fr" echo Termin‚!
270    if "%GLILANG%" == "ru" echo ‚믮«­¥­®!
271    goto done
272
273:localLib
274    "%JAVAPATH%\java" -Xmx128M -cp classes/;GLI.jar;lib/apache.jar;lib/qfslib.jar org.greenstone.gatherer.GathererProg -gsdl %GSDLHOME% -gsdlos %GSDLOS% -perl %PERLPATH% -local_library %GSDLHOME%\server.exe %1 %2 %3 %4 %5 %6 %7 %8 %9
275
276    if ERRORLEVEL 2 goto localLib
277
278    if "%GLILANG%" == "en" echo Done!
279    if "%GLILANG%" == "es" echo ­Hecho!
280    if "%GLILANG%" == "fr" echo Termin‚!
281    if "%GLILANG%" == "ru" echo ‚믮«­¥­®!
282    goto done
283
284:exit
285echo.
286pause
287
288:done
289:: ---- Clean up ----
290set PERLPATH=
291set JAVAPATH=
Note: See TracBrowser for help on using the browser.