source: gli/branches/2.75/gli.bat@ 14764

Last change on this file since 14764 was 14764, checked in by oranfry, 13 years ago

trying to get these two scripts vista compatible

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