source: trunk/gli/gli.bat@ 10624

Last change on this file since 10624 was 10624, checked in by kjdon, 18 years ago

if \%GSDLHOME\% == GSDLHOME, then don't use it for GSDLPATH

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