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