source: trunk/gli/gli.bat@ 6753

Last change on this file since 6753 was 6753, checked in by mdewsnip, 20 years ago

Now with Spanish strings!

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 9.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 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) 2004, 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 -- Still coming --
30
31if "%GLILANG%" == "fr" echo -- Still coming --
32echo.
33:: ---- Determine GSDLHOME ----
34set GSDLPATH=
35
36:: Some users may set the above line manually
37if not "%GSDLPATH%" == "" goto testGSDL
38
39 :: The default location for the GLI is a subdirectory of Greenstone
40 set GSDLPATH=..
41
42 :: If it is set, use the GSDLHOME environment variable
43 if "%GSDLHOME%" == "" goto testGSDL
44 set GSDLPATH=%GSDLHOME%
45
46:testGSDL
47:: Check that the Greenstone installation looks OK
48if "%GLILANG%" == "en" echo Checking GSDL: %GSDLPATH%
49if "%GLILANG%" == "es" echo Revisando GSDL: %GSDLPATH%
50if "%GLILANG%" == "fr" echo V‚rification de GSDL: %GSDLPATH%
51if exist "%GSDLPATH%\setup.bat" goto prepGSDL
52 echo.
53 if "%GLILANG%" == "en" echo The Greenstone installation could not be found, or is incomplete.
54 if "%GLILANG%" == "en" echo Try reinstalling Greenstone then running this script again.
55
56 if "%GLILANG%" == "es" echo No se pudo encontrar la instalaci¢n de Greenstone o est  incompleta.
57 if "%GLILANG%" == "es" echo Trate de reinstalar Greenstone y a continuaci¢n ejecute nuevamente este gui¢n.
58
59 if "%GLILANG%" == "fr" echo L'installation de Greenstone est introuvable ou incomplŠte. Essayez
60 if "%GLILANG%" == "fr" echo de r‚installer Greenstone et ex‚cutez ce script …
61 nouveau.
62 goto exit
63
64:prepGSDL
65:: Setup Greenstone, unless it has already been done
66if not "%GSDLHOME%" == "" goto doneGSDL
67 call "%GSDLPATH%\setup.bat" SetEnv > nul
68
69:doneGSDL
70:: GSDLPATH is no longer needed, since GSDLHOME should now be set
71set GSDLPATH=
72
73
74:findPerl
75:: ---- Check Perl exists ----
76set PERLPATH=
77
78:: Some users may set the above line manually
79if not "%PERLPATH%" == "" goto testPerl
80
81 :: Check if Perl is on the search path
82 echo %PATH%| winutil\which.exe perl.exe | winutil\setvar.exe PERLPATH > setperl.bat
83 call setperl.bat
84 del setperl.bat
85 if not "%PERLPATH%" == "" goto testPerl
86
87 :: If not, try GSDLHOME\bin\windows\perl\bin
88 if exist "%GSDLHOME%\bin\windows\perl\bin\perl.exe" goto gsdlPerl
89
90 :: Still haven't found anything, so try looking in the registry (gulp!)
91 type nul > perl.reg
92 regedit /E perl.reg "HKEY_LOCAL_MACHINE\SOFTWARE\Perl"
93 type perl.reg > perl.txt
94 del perl.reg
95
96 winutil\findperl.exe perl.txt | winutil\setvar.exe PERLPATH > setperl.bat
97 del perl.txt
98 call setperl.bat
99 del setperl.bat
100
101 :: If nothing was found in the registry, we're stuck
102 if "%PERLPATH%" == "" goto noPerl
103
104 goto testPerl
105
106:gsdlPerl
107 set PERLPATH=%GSDLHOME%\bin\windows\perl\bin
108
109:testPerl
110:: Check that a Perl executable has been found
111if "%GLILANG%" == "en" echo Checking Perl: %PERLPATH%
112if "%GLILANG%" == "es" echo Revisando Perl: %PERLPATH%
113if "%GLILANG%" == "fr" echo V‚rification de Perl: %PERLPATH%
114if exist "%PERLPATH%\perl.exe" goto findJava
115
116:noPerl
117 echo.
118 if "%GLILANG%" == "en" echo The Greenstone Librarian Interface requires perl in order to operate,
119 if "%GLILANG%" == "en" echo but perl could not be detected on your system. Please ensure that perl
120 if "%GLILANG%" == "en" echo is installed and is on your search path, then rerun this script.
121
122 if "%GLILANG%" == "es" echo La Interfaz de la Biblioteca Digital Greenstone requiere Perl para poder
123 if "%GLILANG%" == "es" echo operar, pero ‚ste no aparece en su sistema. Por favor aseg£rese de
124 if "%GLILANG%" == "es" echo que Perl est  instalado y se encuentra en su ruta de b£squeda.
125 if "%GLILANG%" == "es" echo A continuaci¢n ejecute nuevamente este gui¢n.
126
127 if "%GLILANG%" == "fr" echo Greenstone Librarian Interface n‚cessite perl pour son fonctionnement,
128 if "%GLILANG%" == "fr" echo mais perl n'a pas pu ˆtre d‚tect‚ dans votre systŠme. Veuillez vous
129 if "%GLILANG%" == "fr" echo assurer que perl est install‚ et est sp‚cifi‚ dans votre chemin de
130 if "%GLILANG%" == "fr" echo recherche, puis red‚marrez ce script.
131 goto exit
132
133
134:findJava
135:: ---- Check Java exists ----
136set JAVAPATH=
137
138:: Some users may set the above line manually
139if not "%JAVAPATH%" == "" goto testJava
140
141 :: If it is set, use the JAVA_HOME environment variable
142 if not "%JAVA_HOME%" == "" goto javahome
143
144 :: Check if Java is on the search path
145 echo %PATH%| winutil\which.exe java.exe | winutil\setvar.exe JAVAPATH > setjava.bat
146 call setjava.bat
147 del setjava.bat
148 if not "%JAVAPATH%" == "" goto testJava
149
150 :: Still haven't found anything, so try looking in the registry (gulp!)
151 type nul > jdk.reg
152 regedit /E jdk.reg "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit"
153 type jdk.reg > jdk.txt
154 del jdk.reg
155 type nul > jre.reg
156 regedit /E jre.reg "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment"
157 type jre.reg > jre.txt
158 del jre.reg
159
160 winutil\findjava.exe jdk.txt jre.txt | winutil\setvar.exe JAVAPATH > setjava.bat
161 del jdk.txt
162 del jre.txt
163 call setjava.bat
164 del setjava.bat
165
166 :: If nothing was found in the registry, we're stuck
167 if "%JAVAPATH%" == "" goto noJava
168
169 set JAVAPATH=%JAVAPATH%\bin
170 goto testJava
171
172:javahome
173 set JAVAPATH=%JAVA_HOME%\bin
174
175:testJava
176:: Check that a Java executable has been found
177if "%GLILANG%" == "en" echo Checking Java: %JAVAPATH%
178if "%GLILANG%" == "es" echo Revisando Java: %JAVAPATH%
179if "%GLILANG%" == "fr" echo V‚rification de Java: %JAVAPATH%
180if exist "%JAVAPATH%\java.exe" goto checkGLI
181
182:noJava
183 echo.
184 if "%GLILANG%" == "en" echo Failed to locate an appropriate version of Java. You must install a
185 if "%GLILANG%" == "en" echo Java Runtime Environment (version 1.4 or greater) before running the
186 if "%GLILANG%" == "en" echo Greenstone Librarian Interface.
187
188 if "%GLILANG%" == "es" echo No se pudo localizar una versi¢n apropiada de Java. Usted deber 
189 if "%GLILANG%" == "es" echo instalar un Ambiente de Ejecuci¢n Java (versi¢n 1.4 o superior)
190 if "%GLILANG%" == "es" echo antes de correr la Interfaz de la Biblioteca Digital Greenstone.
191
192 if "%GLILANG%" == "fr" echo Une version ad‚quate de Java n'a pas pu ˆtre localis‚e. Vous devez
193 if "%GLILANG%" == "fr" echo installer un Java Runtime Environment (version 1.4 ou sup‚rieur)
194 if "%GLILANG%" == "fr" echo avant de d‚marrer Greenstone Librarian Interface.
195 goto exit
196
197
198:checkGLI
199:: ---- Check that the GLI has been compiled ----
200if exist "classes/org/greenstone/gatherer/Gatherer.class" goto runGLI
201if exist "GLI.jar" goto runGLI
202 echo.
203 if "%GLILANG%" == "en" echo You need to compile the Greenstone Librarian Interface (using makegli.bat)
204 if "%GLILANG%" == "en" echo before running this script.
205
206 if "%GLILANG%" == "es" echo Usted necesita compilar la Interfaz de la Biblioteca Digital Greenstone
207 if "%GLILANG%" == "es" echo (por medio de makegli.bat) antes de ejecutar este gui¢n.
208
209 if "%GLILANG%" == "fr" echo Vous devez compiler le Greenstone Interface (en utilisant makegil.bat)
210 if "%GLILANG%" == "fr" echo avant d'ex‚cuter ce script.
211 goto exit
212
213
214:runGLI
215:: ---- Finally, run the GLI ----
216echo.
217if "%GLILANG%" == "en" echo Running the Greenstone Librarian Interface...
218if "%GLILANG%" == "es" echo Ejecutando la Interfaz de la Biblioteca Digital Greenstone...
219if "%GLILANG%" == "fr" echo Ex‚cution de Greenstone Librarian Interface
220
221:: -Xms32M To set minimum memory
222:: -Xmx32M To set maximum memory
223:: -verbose:gc To set garbage collection messages
224:: -Xincgc For incremental garbage collection
225:: -Xprof Function call profiling
226:: -Xloggc:<file> Write garbage collection log
227
228if exist "%GSDLHOME%\server.exe" goto localLib
229 "%JAVAPATH%\java" -cp classes/;GLI.jar;lib/apache.jar;lib/calpa.jar;lib/jp.jar;lib/polloxml.jar;lib/qfslib.jar;lib/skinlf.jar;lib/nanoxml.jar org.greenstone.gatherer.Gatherer -gsdl %GSDLHOME% -perl %PERLPATH% %1 %2 %3 %4 %5 %6 %7 %8 %9
230
231 if "%GLILANG%" == "en" echo Done!
232 if "%GLILANG%" == "es" echo ­Hecho!
233 if "%GLILANG%" == "fr" echo Termin‚!
234 goto done
235
236:localLib
237 "%JAVAPATH%\java" -cp classes/;GLI.jar;lib/apache.jar;lib/calpa.jar;lib/jp.jar;lib/polloxml.jar;lib/qfslib.jar;lib/skinlf.jar;lib/nanoxml.jar org.greenstone.gatherer.Gatherer -gsdl %GSDLHOME% -perl %PERLPATH% -library %GSDLHOME%\server.exe %1 %2 %3 %4 %5 %6 %7 %8 %9
238
239 if "%GLILANG%" == "en" echo Done!
240 if "%GLILANG%" == "es" echo ­Hecho!
241 if "%GLILANG%" == "fr" echo Termin‚!
242 goto done
243
244:exit
245echo.
246pause
247
248:done
249:: ---- Clean up ----
250set PERLPATH=
251set JAVAPATH=
Note: See TracBrowser for help on using the repository browser.