[5824] | 1 | @echo off
|
---|
[6749] | 2 | set GLILANG=en
|
---|
[5824] | 3 |
|
---|
[6749] | 4 |
|
---|
[5824] | 5 | :: -------- Run the Greenstone Librarian Interface --------
|
---|
| 6 |
|
---|
| 7 | :: This script must be run from within the directory in which it lives
|
---|
| 8 | if exist gli.bat goto start
|
---|
[6749] | 9 | if "%GLILANG%" == "en" echo This script must be run from the directory in which it resides.
|
---|
[6753] | 10 | if "%GLILANG%" == "es" echo Este gui¢n deber ejecutarse desde el directorio en el que reside.
|
---|
[6749] | 11 | if "%GLILANG%" == "fr" echo Ce script doit tre excut
|
---|
[6754] | 12 | partir du rpertoire dans lequel il se trouve.
|
---|
[5824] | 13 | if "%GLILANG%" == "ru" echo â®â áªàš¯â €®«Š¥ ¡ëâì ¢§ïâ š§ €šà¥ªâ®àšš, ¢ ª®â®à®© ® à ᯮ«®Š¥
|
---|
| 14 | goto exit
|
---|
| 15 |
|
---|
| 16 | :start
|
---|
| 17 | if "%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
|
---|
[6669] | 22 |
|
---|
[6667] | 23 | :findGSDL
|
---|
[6749] | 24 | echo.
|
---|
[12453] | 25 | if "%GLILANG%" == "en" echo Greenstone Librarian Interface (GLI)
|
---|
[6749] | 26 | if "%GLILANG%" == "en" echo Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato
|
---|
| 27 | if "%GLILANG%" == "en" echo GLI comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt
|
---|
| 28 | if "%GLILANG%" == "en" echo This is free software, and you are welcome to redistribute it
|
---|
[6959] | 29 |
|
---|
[12453] | 30 | if "%GLILANG%" == "es" echo Interfaz de la Biblioteca Digital Greenstone (Greenstone Librarian Interface - GLI)
|
---|
[6959] | 31 | if "%GLILANG%" == "es" echo Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato
|
---|
| 32 | if "%GLILANG%" == "es" echo La Interfaz de la Biblioteca Digital Greenstone NO INCLUYE ABSOLUTAMENTE NINGUNA GARANTÖA.
|
---|
| 33 | if "%GLILANG%" == "es" echo Para mayor informaci¢n vea los trminos de la licencia en LICENSE.txt
|
---|
[6753] | 34 | if "%GLILANG%" == "es" echo Este es un software abierto, por lo que lo invitamos a que lo distribuya de forma gratuita
|
---|
[6955] | 35 |
|
---|
[12453] | 36 | if "%GLILANG%" == "fr" echo Interface du Bibliothcaire Greenstone (Greenstone Librarian Interface - GLI)
|
---|
[6955] | 37 | if "%GLILANG%" == "fr" echo Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato
|
---|
| 38 | if "%GLILANG%" == "fr" echo GLI est fourni sans AUCUNE GARANTIE; pour des dtails, voir LICENSE.txt
|
---|
[6754] | 39 | if "%GLILANG%" == "fr" echo Ceci est un logiciel libre, et vous tes invit
|
---|
[7041] | 40 | le redistribuer
|
---|
[12453] | 41 |
|
---|
[7041] | 42 | if "%GLILANG%" == "ru" echo š¡«š®â¥çë© šâ¥à䥩á Greenstone (Greenstone Librarian Interface - GLI)
|
---|
| 43 | if "%GLILANG%" == "ru" echo Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato
|
---|
| 44 | if "%GLILANG%" == "ru" echo ¥ € ¥â ; €¥â «š á¬. ¢ ⥪á⥠LICENSE.TXT
|
---|
[6667] | 45 | if "%GLILANG%" == "ru" echo â® - ᢮¡®€® à á¯à®áâà 塞®¥ ¯à®£à ¬¬®¥ ®¡¥á¯¥ç¥š¥ š ë ¬®Š¥â¥ à á¯à®áâà ïâì ¥£®
|
---|
[5824] | 46 |
|
---|
| 47 | echo.
|
---|
| 48 | :: ---- Determine GSDLHOME ----
|
---|
| 49 | set GSDLPATH=
|
---|
| 50 |
|
---|
| 51 | :: Some users may set the above line manually
|
---|
| 52 | if not "%GSDLPATH%" == "" goto testGSDL
|
---|
| 53 |
|
---|
| 54 | :: The default location for the GLI is a subdirectory of Greenstone
|
---|
[10625] | 55 | set GSDLPATH=..
|
---|
[5824] | 56 |
|
---|
| 57 | :: If it is set, use the GSDLHOME environment variable
|
---|
| 58 | if "%GSDLHOME%" == "" goto testGSDL
|
---|
| 59 | set GSDLPATH=%GSDLHOME%
|
---|
| 60 |
|
---|
[6749] | 61 | :testGSDL
|
---|
[6753] | 62 | :: Check that the Greenstone installation looks OK
|
---|
[6749] | 63 | if "%GLILANG%" == "en" echo Checking GSDL: %GSDLPATH%
|
---|
[6754] | 64 | if "%GLILANG%" == "es" echo Revisando GSDL: %GSDLPATH%
|
---|
[5824] | 65 | if "%GLILANG%" == "fr" echo Vrification de GSDL: %GSDLPATH%
|
---|
| 66 | if "%GLILANG%" == "ru" echo ஢¥àª GSDL: %GSDLPATH%
|
---|
[6749] | 67 | if exist "%GSDLPATH%\setup.bat" goto prepGSDL
|
---|
| 68 | echo.
|
---|
| 69 | if "%GLILANG%" == "en" echo The Greenstone installation could not be found, or is incomplete.
|
---|
[6753] | 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.
|
---|
[6749] | 73 | if "%GLILANG%" == "es" echo Trate de reinstalar Greenstone y a continuaci¢n ejecute nuevamente este gui¢n.
|
---|
| 74 |
|
---|
[6754] | 75 | if "%GLILANG%" == "fr" echo L'installation de Greenstone est introuvable ou incomplte. Essayez
|
---|
| 76 | if "%GLILANG%" == "fr" echo de rinstaller Greenstone et excutez ce script
|
---|
| 77 | nouveau.
|
---|
[5824] | 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
|
---|
| 85 | if 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
|
---|
| 90 | set GSDLPATH=
|
---|
| 91 |
|
---|
| 92 |
|
---|
| 93 | :findPerl
|
---|
[15199] | 94 | :: ---- Check Perl exists ----
|
---|
| 95 | set PERLPATH=
|
---|
| 96 |
|
---|
[5824] | 97 | :: Some users may set the above line manually - If you do this, you need to
|
---|
| 98 | :: make sure that perl is in your path otherwise lucene collections may not
|
---|
| 99 | :: work
|
---|
| 100 | if not "%PERLPATH%" == "" goto testPerl
|
---|
| 101 |
|
---|
| 102 | :: Check if Perl is on the search path
|
---|
| 103 | echo %PATH%| winutil\which.exe perl.exe | winutil\setvar.exe PERLPATH > setperl.bat
|
---|
| 104 | call setperl.bat
|
---|
| 105 | del setperl.bat
|
---|
| 106 | if not "%PERLPATH%" == "" goto testPerl
|
---|
| 107 |
|
---|
| 108 | :: If not, try GSDLHOME\bin\windows\perl\bin
|
---|
| 109 | if exist "%GSDLHOME%\bin\windows\perl\bin\perl.exe" goto gsdlPerl
|
---|
| 110 |
|
---|
| 111 | :: Still haven't found anything, so try looking in the registry (gulp!)
|
---|
| 112 | type nul > perl.reg
|
---|
| 113 | regedit /E perl.reg "HKEY_LOCAL_MACHINE\SOFTWARE\Perl"
|
---|
| 114 | type perl.reg > perl.txt
|
---|
| 115 | del perl.reg
|
---|
| 116 |
|
---|
| 117 | winutil\findperl.exe perl.txt | winutil\setvar.exe PERLPATH > setperl.bat
|
---|
| 118 | del perl.txt
|
---|
| 119 | call setperl.bat
|
---|
| 120 | del setperl.bat
|
---|
| 121 |
|
---|
[15199] | 122 | :: If nothing was found in the registry, we're stuck
|
---|
| 123 | if "%PERLPATH%" == "" goto noPerl
|
---|
| 124 |
|
---|
| 125 | :: if have found perl in registry, but not in path, then we need to
|
---|
[5824] | 126 | :: add it to path for lucene stuff.
|
---|
| 127 | if "%OS%" == "Windows_NT" set PATH=%PATH%;%PERLPATH%
|
---|
| 128 | if "%OS%" == "" set PATH="%PATH%";"%PERLPATH%"
|
---|
| 129 | goto testPerl
|
---|
[15199] | 130 |
|
---|
[5824] | 131 | :gsdlPerl
|
---|
| 132 | set PERLPATH=%GSDLHOME%\bin\windows\perl\bin
|
---|
[6749] | 133 |
|
---|
[6753] | 134 | :testPerl
|
---|
[6749] | 135 | :: Check that a Perl executable has been found
|
---|
[6754] | 136 | if "%GLILANG%" == "en" echo Checking Perl: %PERLPATH%
|
---|
[5824] | 137 | if "%GLILANG%" == "es" echo Revisando Perl: %PERLPATH%
|
---|
| 138 | if "%GLILANG%" == "fr" echo Vrification de Perl: %PERLPATH%
|
---|
| 139 | if "%GLILANG%" == "ru" echo ஢¥àª Perl: %PERLPATH%
|
---|
| 140 | if exist "%PERLPATH%\perl.exe" goto findJava
|
---|
[6749] | 141 |
|
---|
| 142 | :noPerl
|
---|
| 143 | echo.
|
---|
| 144 | if "%GLILANG%" == "en" echo The Greenstone Librarian Interface requires perl in order to operate,
|
---|
[6753] | 145 | if "%GLILANG%" == "en" echo but perl could not be detected on your system. Please ensure that perl
|
---|
| 146 | if "%GLILANG%" == "en" echo is installed and is on your search path, then rerun this script.
|
---|
| 147 |
|
---|
| 148 | if "%GLILANG%" == "es" echo La Interfaz de la Biblioteca Digital Greenstone requiere Perl para poder
|
---|
| 149 | if "%GLILANG%" == "es" echo operar, pero ste no aparece en su sistema. Por favor aseg£rese de
|
---|
[6749] | 150 | if "%GLILANG%" == "es" echo que Perl est instalado y se encuentra en su ruta de b£squeda.
|
---|
| 151 | if "%GLILANG%" == "es" echo A continuaci¢n ejecute nuevamente este gui¢n.
|
---|
| 152 |
|
---|
| 153 | if "%GLILANG%" == "fr" echo Greenstone Librarian Interface ncessite perl pour son fonctionnement,
|
---|
[6754] | 154 | if "%GLILANG%" == "fr" echo mais perl n'a pas pu tre dtect dans votre systme. Veuillez vous
|
---|
| 155 | if "%GLILANG%" == "fr" echo assurer que perl est install et est spcifi dans votre chemin de
|
---|
| 156 | if "%GLILANG%" == "fr" echo recherche, puis redmarrez ce script.
|
---|
| 157 |
|
---|
| 158 | if "%GLILANG%" == "ru" echo š¡«š®â¥çë© šâ¥à䥩á Greenstone âॡã¥â Perl, çâ®¡ë š¬¥âì ¢®§¬®Š®áâì
|
---|
[5824] | 159 | if "%GLILANG%" == "ru" echo à ¡®â âì, ® Perl ¥ ¡ë« ¢ ¢ 襩 ášá⥬¥. ®Š «ã©áâ , ¯®€â¢¥à€šâ¥,
|
---|
| 160 | if "%GLILANG%" == "ru" echo çâ® Perl ãáâ ®¢«¥ š 宀šâáï ¢ 襬 ¯ãâš ¯®šáª , § ⥬
|
---|
| 161 | if "%GLILANG%" == "ru" echo ¯®¢â®à®¢¢¥€šâ¥ íâ®â áªàš¯â.
|
---|
| 162 | goto exit
|
---|
| 163 |
|
---|
| 164 |
|
---|
| 165 | :findJava
|
---|
| 166 | :: ---- Check Java exists ----
|
---|
| 167 | set JAVAPATH=
|
---|
| 168 |
|
---|
[6467] | 169 | :: Some users may set the above line manually
|
---|
| 170 | if not "%JAVAPATH%" == "" goto testJava
|
---|
[5824] | 171 |
|
---|
| 172 | :: If it is set, use the JAVA_HOME environment variable
|
---|
| 173 | if not "%JAVA_HOME%" == "" goto javahome
|
---|
| 174 |
|
---|
| 175 | :: Check if Java is on the search path
|
---|
| 176 | echo %PATH%| winutil\which.exe java.exe | winutil\setvar.exe JAVAPATH > setjava.bat
|
---|
| 177 | call setjava.bat
|
---|
| 178 | del setjava.bat
|
---|
| 179 | if not "%JAVAPATH%" == "" goto testJava
|
---|
| 180 |
|
---|
| 181 | :: Still haven't found anything, so try looking in the registry (gulp!)
|
---|
| 182 | type nul > jdk.reg
|
---|
| 183 | regedit /E jdk.reg "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit"
|
---|
| 184 | type jdk.reg > jdk.txt
|
---|
| 185 | del jdk.reg
|
---|
| 186 | type nul > jre.reg
|
---|
| 187 | regedit /E jre.reg "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment"
|
---|
| 188 | type jre.reg > jre.txt
|
---|
| 189 | del jre.reg
|
---|
| 190 |
|
---|
| 191 | winutil\findjava.exe jdk.txt jre.txt | winutil\setvar.exe JAVAPATH > setjava.bat
|
---|
| 192 | del jdk.txt
|
---|
| 193 | del jre.txt
|
---|
| 194 | call setjava.bat
|
---|
| 195 | del setjava.bat
|
---|
| 196 |
|
---|
| 197 | :: If nothing was found in the registry, we're stuck
|
---|
| 198 | if "%JAVAPATH%" == "" goto noJava
|
---|
| 199 |
|
---|
| 200 | set JAVAPATH=%JAVAPATH%\bin
|
---|
[6467] | 201 | goto testJava
|
---|
[5824] | 202 |
|
---|
| 203 | :javahome
|
---|
| 204 | set JAVAPATH=%JAVA_HOME%\bin
|
---|
[6749] | 205 |
|
---|
[6753] | 206 | :testJava
|
---|
[6749] | 207 | :: Check that a Java executable has been found
|
---|
[6754] | 208 | if "%GLILANG%" == "en" echo Checking Java: %JAVAPATH%
|
---|
[5824] | 209 | if "%GLILANG%" == "es" echo Revisando Java: %JAVAPATH%
|
---|
| 210 | if "%GLILANG%" == "fr" echo Vrification de Java: %JAVAPATH%
|
---|
| 211 | if "%GLILANG%" == "ru" echo ஢¥àª Java: %JAVAPATH%
|
---|
| 212 | if exist "%JAVAPATH%\java.exe" goto checkGLI
|
---|
[6749] | 213 |
|
---|
| 214 | :noJava
|
---|
| 215 | echo.
|
---|
| 216 | if "%GLILANG%" == "en" echo Failed to locate an appropriate version of Java. You must install a
|
---|
[6753] | 217 | if "%GLILANG%" == "en" echo Java Runtime Environment (version 1.4 or greater) before running the
|
---|
| 218 | if "%GLILANG%" == "en" echo Greenstone Librarian Interface.
|
---|
| 219 |
|
---|
| 220 | if "%GLILANG%" == "es" echo No se pudo localizar una versi¢n apropiada de Java. Usted deber
|
---|
[6749] | 221 | if "%GLILANG%" == "es" echo instalar un Ambiente de Ejecuci¢n Java (versi¢n 1.4 o superior)
|
---|
| 222 | if "%GLILANG%" == "es" echo antes de correr la Interfaz de la Biblioteca Digital Greenstone.
|
---|
| 223 |
|
---|
[6754] | 224 | if "%GLILANG%" == "fr" echo Une version adquate de Java n'a pas pu tre localise. Vous devez
|
---|
| 225 | if "%GLILANG%" == "fr" echo installer un Java Runtime Environment (version 1.4 ou suprieur)
|
---|
| 226 | if "%GLILANG%" == "fr" echo avant de dmarrer Greenstone Librarian Interface.
|
---|
| 227 |
|
---|
[5824] | 228 | if "%GLILANG%" == "ru" echo ¥ 〠«®áì ®¯à¥€¥«šâì ¬¥á⮠宊€¥š¥ ᮮ⢥âáâ¢ãî饩 ¢¥àášš Java.
|
---|
| 229 | if "%GLILANG%" == "ru" echo ë €®«Šë ãáâ ®¢šâì Java Runtime Environment (¢¥àášî 1.4 š«š ¢ëè¥) ¯¥à¥€ ¢¢®€®¬
|
---|
| 230 | if "%GLILANG%" == "ru" echo ¡š¡«š®â¥ç®£® šâ¥à䥩á Greenstone.
|
---|
| 231 | goto exit
|
---|
| 232 |
|
---|
| 233 |
|
---|
| 234 | :checkGLI
|
---|
| 235 | :: ---- Check that the GLI has been compiled ----
|
---|
[6749] | 236 | if exist "classes/org/greenstone/gatherer/Gatherer.class" goto runGLI
|
---|
| 237 | if exist "GLI.jar" goto runGLI
|
---|
| 238 | echo.
|
---|
[6753] | 239 | if "%GLILANG%" == "en" echo You need to compile the Greenstone Librarian Interface (using makegli.bat)
|
---|
| 240 | if "%GLILANG%" == "en" echo before running this script.
|
---|
| 241 |
|
---|
[10787] | 242 | if "%GLILANG%" == "es" echo Usted necesita compilar la Interfaz de la Biblioteca Digital Greenstone
|
---|
[6749] | 243 | if "%GLILANG%" == "es" echo (por medio de makegli.bat) antes de ejecutar este gui¢n.
|
---|
[6754] | 244 |
|
---|
| 245 | if "%GLILANG%" == "fr" echo Vous devez compiler le Greenstone Interface (en utilisant makegli.bat)
|
---|
| 246 | if "%GLILANG%" == "fr" echo avant d'excuter ce script.
|
---|
[5824] | 247 |
|
---|
| 248 | if "%GLILANG%" == "ru" echo ë €®«Šë ª®¬¯š«šà®¢ âì ¡š¡«š®â¥çë© šâ¥à䥩á Greenstone (šá¯®«ì§ãï makegli.bat)
|
---|
| 249 | if "%GLILANG%" == "ru" echo ¯¥à¥€ ¢¢®€®¬ í⮣® áªàš¯â
|
---|
| 250 | goto exit
|
---|
| 251 |
|
---|
| 252 |
|
---|
[7680] | 253 | :runGLI
|
---|
[6749] | 254 | :: ---- Finally, run the GLI ----
|
---|
[6753] | 255 | echo.
|
---|
[6749] | 256 |
|
---|
[6754] | 257 | if "%GLILANG%" == "en" echo Running the Greenstone Librarian Interface...
|
---|
[5824] | 258 | if "%GLILANG%" == "es" echo Ejecutando la Interfaz de la Biblioteca Digital Greenstone...
|
---|
| 259 | if "%GLILANG%" == "fr" echo Excution de Greenstone Librarian Interface
|
---|
| 260 | if "%GLILANG%" == "ru" echo ¥ªãéš© ¡š¡«š®â¥çë© šâ¥à䥩á Greenstone...
|
---|
| 261 |
|
---|
| 262 | :: -Xms32M To set minimum memory
|
---|
| 263 | :: -Xmx32M To set maximum memory
|
---|
| 264 | :: -verbose:gc To set garbage collection messages
|
---|
| 265 | :: -Xincgc For incremental garbage collection
|
---|
[12695] | 266 | :: -Xprof Function call profiling
|
---|
| 267 | :: -Xloggc:<file> Write garbage collection log
|
---|
[12689] | 268 |
|
---|
[13027] | 269 | if exist "%GSDLHOME%\server.exe" goto localLib
|
---|
[5824] | 270 |
|
---|
[12689] | 271 | :webLib
|
---|
| 272 | "%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
|
---|
[6749] | 273 |
|
---|
[6753] | 274 | if ERRORLEVEL 2 goto webLib
|
---|
[6749] | 275 |
|
---|
[6754] | 276 | if "%GLILANG%" == "en" echo Done!
|
---|
[5927] | 277 | if "%GLILANG%" == "es" echo Hecho!
|
---|
[5824] | 278 | if "%GLILANG%" == "fr" echo Termin!
|
---|
| 279 | if "%GLILANG%" == "ru" echo 믮«¥®!
|
---|
[13027] | 280 | goto done
|
---|
[5824] | 281 |
|
---|
[12689] | 282 | :localLib
|
---|
| 283 | "%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
|
---|
[6749] | 284 |
|
---|
[6753] | 285 | if ERRORLEVEL 2 goto localLib
|
---|
[6749] | 286 |
|
---|
[6754] | 287 | if "%GLILANG%" == "en" echo Done!
|
---|
[5927] | 288 | if "%GLILANG%" == "es" echo Hecho!
|
---|
[5824] | 289 | if "%GLILANG%" == "fr" echo Termin!
|
---|
| 290 | if "%GLILANG%" == "ru" echo 믮«¥®!
|
---|
| 291 | goto done
|
---|
| 292 |
|
---|
| 293 | :exit
|
---|
[5927] | 294 | echo.
|
---|
[5824] | 295 | pause
|
---|
| 296 |
|
---|
| 297 | :done
|
---|
| 298 | :: ---- Clean up ----
|
---|
| 299 | set PERLPATH=
|
---|
| 300 | set JAVAPATH=
|
---|