source: trunk/gli/gli.bat@ 6749

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

Now with French strings!

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 8.1 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%" == "fr" echo Ce script doit ˆtre ex‚cut‚ …
11 partir du r‚pertoire dans lequel il se trouve.
12 goto exit
13
14:start
15if "%OS%" == "Windows_NT" goto findGSDL
16 :: Invoke a new command processor to ensure there's enough environment space
17 if "%1" == "Second" goto findGSDL
18 command /E:2048 /C %0 Second %1 %2 %3 %4 %5 %6 %7 %8 %9
19 goto done
20
21:findGSDL
22echo.
23if "%GLILANG%" == "en" echo Greenstone Librarian Interface (GLI)
24if "%GLILANG%" == "en" echo Copyright (C) 2004, New Zealand Digital Library Project, University Of Waikato
25if "%GLILANG%" == "en" echo GLI comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt
26if "%GLILANG%" == "en" echo This is free software, and you are welcome to redistribute it
27
28if "%GLILANG%" == "fr" echo -- Still coming --
29echo.
30:: ---- Determine GSDLHOME ----
31set GSDLPATH=
32
33:: Some users may set the above line manually
34if not "%GSDLPATH%" == "" goto testGSDL
35
36 :: The default location for the GLI is a subdirectory of Greenstone
37 set GSDLPATH=..
38
39 :: If it is set, use the GSDLHOME environment variable
40 if "%GSDLHOME%" == "" goto testGSDL
41 set GSDLPATH=%GSDLHOME%
42
43:testGSDL
44:: Check that the Greenstone installation looks OK
45if "%GLILANG%" == "en" echo Checking GSDL: %GSDLPATH%
46if "%GLILANG%" == "fr" echo V‚rification de GSDL: %GSDLPATH%
47if exist "%GSDLPATH%\setup.bat" goto prepGSDL
48 echo.
49 if "%GLILANG%" == "en" echo The Greenstone installation could not be found, or is incomplete.
50 if "%GLILANG%" == "en" echo Try reinstalling Greenstone then running this script again.
51
52 if "%GLILANG%" == "fr" echo L'installation de Greenstone est introuvable ou incomplŠte. Essayez
53 if "%GLILANG%" == "fr" echo de r‚installer Greenstone et ex‚cutez ce script …
54 nouveau.
55 goto exit
56
57:prepGSDL
58:: Setup Greenstone, unless it has already been done
59if not "%GSDLHOME%" == "" goto doneGSDL
60 call "%GSDLPATH%\setup.bat" SetEnv > nul
61
62:doneGSDL
63:: GSDLPATH is no longer needed, since GSDLHOME should now be set
64set GSDLPATH=
65
66
67:findPerl
68:: ---- Check Perl exists ----
69set PERLPATH=
70
71:: Some users may set the above line manually
72if not "%PERLPATH%" == "" goto testPerl
73
74 :: Check if Perl is on the search path
75 echo %PATH%| winutil\which.exe perl.exe | winutil\setvar.exe PERLPATH > setperl.bat
76 call setperl.bat
77 del setperl.bat
78 if not "%PERLPATH%" == "" goto testPerl
79
80 :: If not, try GSDLHOME\bin\windows\perl\bin
81 if exist "%GSDLHOME%\bin\windows\perl\bin\perl.exe" goto gsdlPerl
82
83 :: Still haven't found anything, so try looking in the registry (gulp!)
84 type nul > perl.reg
85 regedit /E perl.reg "HKEY_LOCAL_MACHINE\SOFTWARE\Perl"
86 type perl.reg > perl.txt
87 del perl.reg
88
89 winutil\findperl.exe perl.txt | winutil\setvar.exe PERLPATH > setperl.bat
90 del perl.txt
91 call setperl.bat
92 del setperl.bat
93
94 :: If nothing was found in the registry, we're stuck
95 if "%PERLPATH%" == "" goto noPerl
96
97 goto testPerl
98
99:gsdlPerl
100 set PERLPATH=%GSDLHOME%\bin\windows\perl\bin
101
102:testPerl
103:: Check that a Perl executable has been found
104if "%GLILANG%" == "en" echo Checking Perl: %PERLPATH%
105if "%GLILANG%" == "fr" echo V‚rification de Perl: %PERLPATH%
106if exist "%PERLPATH%\perl.exe" goto findJava
107
108:noPerl
109 echo.
110 if "%GLILANG%" == "en" echo The Greenstone Librarian Interface requires perl in order to operate,
111 if "%GLILANG%" == "en" echo but perl could not be detected on your system. Please ensure that perl
112 if "%GLILANG%" == "en" echo is installed and is on your search path, then rerun this script.
113
114 if "%GLILANG%" == "fr" echo Greenstone Librarian Interface n‚cessite perl pour son fonctionnement,
115 if "%GLILANG%" == "fr" echo mais perl n'a pas pu ˆtre d‚tect‚ dans votre systŠme. Veuillez vous
116 if "%GLILANG%" == "fr" echo assurer que perl est install‚ et est sp‚cifi‚ dans votre chemin de
117 if "%GLILANG%" == "fr" echo recherche, puis red‚marrez ce script.
118 goto exit
119
120
121:findJava
122:: ---- Check Java exists ----
123set JAVAPATH=
124
125:: Some users may set the above line manually
126if not "%JAVAPATH%" == "" goto testJava
127
128 :: If it is set, use the JAVA_HOME environment variable
129 if not "%JAVA_HOME%" == "" goto javahome
130
131 :: Check if Java is on the search path
132 echo %PATH%| winutil\which.exe java.exe | winutil\setvar.exe JAVAPATH > setjava.bat
133 call setjava.bat
134 del setjava.bat
135 if not "%JAVAPATH%" == "" goto testJava
136
137 :: Still haven't found anything, so try looking in the registry (gulp!)
138 type nul > jdk.reg
139 regedit /E jdk.reg "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit"
140 type jdk.reg > jdk.txt
141 del jdk.reg
142 type nul > jre.reg
143 regedit /E jre.reg "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment"
144 type jre.reg > jre.txt
145 del jre.reg
146
147 winutil\findjava.exe jdk.txt jre.txt | winutil\setvar.exe JAVAPATH > setjava.bat
148 del jdk.txt
149 del jre.txt
150 call setjava.bat
151 del setjava.bat
152
153 :: If nothing was found in the registry, we're stuck
154 if "%JAVAPATH%" == "" goto noJava
155
156 set JAVAPATH=%JAVAPATH%\bin
157 goto testJava
158
159:javahome
160 set JAVAPATH=%JAVA_HOME%\bin
161
162:testJava
163:: Check that a Java executable has been found
164if "%GLILANG%" == "en" echo Checking Java: %JAVAPATH%
165if "%GLILANG%" == "fr" echo V‚rification de Java: %JAVAPATH%
166if exist "%JAVAPATH%\java.exe" goto checkGLI
167
168:noJava
169 echo.
170 if "%GLILANG%" == "en" echo Failed to locate an appropriate version of Java. You must install a
171 if "%GLILANG%" == "en" echo Java Runtime Environment (version 1.4 or greater) before running the
172 if "%GLILANG%" == "en" echo Greenstone Librarian Interface.
173
174 if "%GLILANG%" == "fr" echo Une version ad‚quate de Java n'a pas pu ˆtre localis‚e. Vous devez
175 if "%GLILANG%" == "fr" echo installer un Java Runtime Environment (version 1.4 ou sup‚rieur)
176 if "%GLILANG%" == "fr" echo avant de d‚marrer Greenstone Librarian Interface.
177 goto exit
178
179
180:checkGLI
181:: ---- Check that the GLI has been compiled ----
182if exist "classes/org/greenstone/gatherer/Gatherer.class" goto runGLI
183if exist "GLI.jar" goto runGLI
184 echo.
185 if "%GLILANG%" == "en" echo You need to compile the Greenstone Librarian Interface (using makegli.bat)
186 if "%GLILANG%" == "en" echo before running this script.
187
188 if "%GLILANG%" == "fr" echo Vous devez compiler le Greenstone Interface (en utilisant makegil.bat)
189 if "%GLILANG%" == "fr" echo avant d'ex‚cuter ce script.
190 goto exit
191
192
193:runGLI
194:: ---- Finally, run the GLI ----
195echo.
196if "%GLILANG%" == "en" echo Running the Greenstone Librarian Interface...
197if "%GLILANG%" == "fr" echo Ex‚cution de Greenstone Librarian Interface
198
199:: -Xms32M To set minimum memory
200:: -Xmx32M To set maximum memory
201:: -verbose:gc To set garbage collection messages
202:: -Xincgc For incremental garbage collection
203:: -Xprof Function call profiling
204:: -Xloggc:<file> Write garbage collection log
205
206if exist "%GSDLHOME%\server.exe" goto localLib
207 "%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
208
209 if "%GLILANG%" == "en" echo Done!
210 if "%GLILANG%" == "fr" echo Termin‚!
211 goto done
212
213:localLib
214 "%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
215
216 if "%GLILANG%" == "en" echo Done!
217 if "%GLILANG%" == "fr" echo Termin‚!
218 goto done
219
220:exit
221echo.
222pause
223
224:done
225:: ---- Clean up ----
226set PERLPATH=
227set JAVAPATH=
Note: See TracBrowser for help on using the repository browser.