- Timestamp:
- 2008-05-21T12:05:37+12:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gli/trunk/gli.bat
r15354 r15608 15 15 16 16 :start 17 if "%OS%" == "Windows_NT" goto findGSDL17 if "%OS%" == "Windows_NT" goto progName 18 18 :: Invoke a new command processor to ensure there's enough environment space 19 if "%1" == "Second" goto findGSDL19 if "%1" == "Second" goto progName 20 20 command /E:2048 /C %0 Second %1 %2 %3 %4 %5 %6 %7 %8 %9 21 21 goto done 22 22 23 24 :progName 25 if not "%PROGNAME%" == "" goto findGSDL 26 :: otherwise PROGNAME was not set, so default to the Greenstone Librarian Interface (GLI) program 27 if "%GLILANG%" == "es" set PROGNAME=Biblioteca Digital Greenstone 28 if "%GLILANG%" == "fr" set PROGNAME=Bibliothécaire Greenstone 29 if "%GLILANG%" == "ru" set PROGNAME=ÉÎÔÅÒÆÅÊÓ Greenstone 30 :: if the PROGNAME is still not set, then set the language to English 31 if "%PROGNAME%" == "" set PROGNAME=Greenstone Librarian Interface 32 33 34 if "%PROGABBR%" == "" set PROGABBR=GLI 35 if "%PROGNAME_EN%" == "" set PROGNAME_EN=Greenstone Librarian Interface 36 23 37 :findGSDL 24 38 echo. 25 if "%GLILANG%" == "en" echo Greenstone Librarian Interface (GLI)39 if "%GLILANG%" == "en" echo %PROGNAME% (%PROGABBR%) 26 40 if "%GLILANG%" == "en" echo Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato 27 if "%GLILANG%" == "en" echo GLIcomes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt41 if "%GLILANG%" == "en" echo %PROGABBR% comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt 28 42 if "%GLILANG%" == "en" echo This is free software, and you are welcome to redistribute it 29 43 30 if "%GLILANG%" == "es" echo Interfaz de la Biblioteca Digital Greenstone (Greenstone Librarian Interface - GLI)44 if "%GLILANG%" == "es" echo Interfaz de la %PROGNAME% (%PROGNAME_EN% - %PROGABBR%) 31 45 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 GreenstoneNO INCLUYE ABSOLUTAMENTE NINGUNA GARANTÖA.46 if "%GLILANG%" == "es" echo La Interfaz de la %PROGNAME% NO INCLUYE ABSOLUTAMENTE NINGUNA GARANTÖA. 33 47 if "%GLILANG%" == "es" echo Para mayor informaci¢n vea los trminos de la licencia en LICENSE.txt 34 48 if "%GLILANG%" == "es" echo Este es un software abierto, por lo que lo invitamos a que lo distribuya de forma gratuita 35 49 36 if "%GLILANG%" == "fr" echo Interface du Bibliothcaire Greenstone (Greenstone Librarian Interface - GLI)50 if "%GLILANG%" == "fr" echo Interface du %PROGNAME% (%PROGNAME_EN% - %PROGABBR%) 37 51 if "%GLILANG%" == "fr" echo Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato 38 if "%GLILANG%" == "fr" echo GLIest fourni sans AUCUNE GARANTIE; pour des dtails, voir LICENSE.txt52 if "%GLILANG%" == "fr" echo %PROGABBR% est fourni sans AUCUNE GARANTIE; pour des dtails, voir LICENSE.txt 39 53 if "%GLILANG%" == "fr" echo Ceci est un logiciel libre, et vous tes invit 40 54 le redistribuer 41 55 42 if "%GLILANG%" == "ru" echo š¡«š®â¥çë© šâ¥à䥩á Greenstone (Greenstone Librarian Interface - GLI)56 if "%GLILANG%" == "ru" echo š¡«š®â¥çë© šâ¥à䥩á %PROGNAME% (%PROGNAME_EN% - %PROGABBR%) 43 57 if "%GLILANG%" == "ru" echo Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato 44 58 if "%GLILANG%" == "ru" echo ¥ € ¥â ; €¥â «š á¬. ¢ ⥪á⥠LICENSE.TXT … … 46 60 47 61 echo. 48 :: ---- Determine GSDLHOME----62 :: ---- Determine path to Greenstone home for GS2 and GS3 ---- 49 63 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 55 set GSDLPATH=.. 56 57 :: If it is set, use the GSDLHOME environment variable 58 if "%GSDLHOME%" == "" goto testGSDL 59 set GSDLPATH=%GSDLHOME% 64 :: Some users may set the above line manually, or it may be set as an argument 65 66 set _VERSION= 67 if not "%GSDLPATH%" == "" goto getVer 68 :: Otherwise gsdlpath is not yet set 69 :: Check the env vars first 70 if not "%GSDL3SRCHOME%" == "" goto ver3 71 if not "%GSDLHOME%" == "" goto ver2 72 :: If not set, the default location for the GLI is a subdirectory of Greenstone 73 set GSDLPATH=.. 74 goto getVer 75 76 :getVer 77 call gsdlver.bat %GSDLPATH% %_VERSION% SetEnv > nul 78 if "%_VERSION%" == "1" goto exit 79 goto testGSDL 80 81 82 :ver3 83 set _VERSION=3 84 set GSDLPATH=%GSDL3SRCHOME% 85 :: if GS2 is now also set, then both GS3 and GS2 are set: 86 :: warn the user that we have defaulted to GS3 87 if not "%GSDLHOME%" == "" echo Both Greenstone 2 and Greenstone 3 environments are set. 88 if not "%GSDLHOME%" == "" echo It is assumed you want to run Greenstone 3. 89 if not "%GSDLHOME%" == "" echo If you want to run Greenstone 2, please unset the 90 if not "%GSDLHOME%" == "" echo environment variable GSDL3SRCHOME before running GLI. 91 if not "%GSDLHOME%" == "" echo. 92 goto testGSDL 93 94 95 :ver2 96 set _VERSION=2 97 set GSDLPATH=%GSDLHOME% 98 goto testGSDL 99 60 100 61 101 :testGSDL 62 :: Check that the Greenstone installation looks OK 63 if "%GLILANG%" == "en" echo Checking GSDL: %GSDLPATH% 64 if "%GLILANG%" == "es" echo Revisando GSDL: %GSDLPATH% 65 if "%GLILANG%" == "fr" echo Vrification de GSDL: %GSDLPATH% 66 if "%GLILANG%" == "ru" echo ஢¥àª GSDL: %GSDLPATH% 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. 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 incomplte. Essayez 76 if "%GLILANG%" == "fr" echo de rinstaller Greenstone et excutez ce script 77 nouveau. 78 79 if "%GLILANG%" == "ru" echo áâ ««ïæšï Greenstone ¥ ¡ë« ©€¥ š«š ® ¥¯®« . ®¯à®¡ã©â¥ ¯®¢â®à® 80 if "%GLILANG%" == "ru" echo ãáâ ®¢šâì Greenstone, § ⥬ ¢¢¥áâš íâ®â áªàš¯â ᮢ . 81 goto exit 102 set CHECK=1 103 call chkinst.bat "%GSDLPATH%" %_VERSION% %GLILANG% %CHECK% SetEnv > nul 104 if "%CHECK%" == "1" goto exit 105 :: otherwise installation worked well 106 goto prepGSDL 107 82 108 83 109 :prepGSDL 84 :: Setup Greenstone, unless it has already been done 110 :: Greenstone 3 case 111 if "%_VERSION%" == "3" goto prepGS3 112 113 if not "%_VERSION%" == "2" echo "Greenstone version unknown" 114 if not "%_VERSION%" == "2" goto :exit 115 116 :: Otherwise, we are dealing with Greenstone 2 117 :: Setup Greenstone 2, unless it has already been done 85 118 if not "%GSDLHOME%" == "" goto doneGSDL 86 119 call "%GSDLPATH%\setup.bat" SetEnv > nul 120 goto doneGSDL 121 122 123 :prepGS3 124 set GSDL2PATH= 125 : Some users may set the above line manually 126 127 if "%GSDL3SRCHOME%" == "" goto setup3 128 if "%GSDL3HOME%" == "" goto setup3 129 ::otherwise 130 goto gs2build 131 132 133 :setup3 134 :: Setup Greenstone 3, unless it has already been done 135 cd | winutil\setvar.exe GLIDIR > %TMP%\setgli.bat 136 call %TMP%\setgli.bat 137 del %TMP%\setgli.bat 138 cd "%GSDLPATH%" 139 call gs3-setup.bat SetEnv > nul 140 cd %GLIDIR% 141 goto gs2build 142 143 144 :gs2build 145 :: If Greenstone version 3 is running, we want to set gsdl2path 146 :: Determine GSDLHOME for GS3 147 if not "%GSDL2PATH%" == "" goto setupGS2 148 :: GSDL2PATH is not yet set. 149 :: And if GSDLHOME is not set either, then assume 150 :: that the gs2build subdir of GS3 exists 151 if "%GSDLHOME%" == "" set GSDL2PATH=%GSDL3SRCHOME%\gs2build 152 if "%GSDLHOME%" == "" goto setupGS2 153 :: Otherwise GSDLHOME is set, so set GSDL2PATH to GSDLHOME 154 echo GSDLHOME environment variable is set to %GSDLHOME%. 155 echo Will use this to find build scripts. 156 set GSDL2PATH=%GSDLHOME% 157 158 :setupGS2 159 set CHECK=1 160 call chkinst.bat "%GSDL2PATH%" 2 %GLILANG% %CHECK% SetEnv > nul 161 if "%CHECK%" == "1" goto exit 162 :: otherwise installation worked well 163 :: Setup Greenstone, unless it has already been done 164 if "%GSDLHOME%" == "" call "%GSDL2PATH%\setup.bat" SetEnv > nul 165 :: Either way, we can now dispose of GSDL2PATH 166 set GSDL2PATH= 167 goto doneGSDL 168 87 169 88 170 :doneGSDL … … 133 215 134 216 :testPerl 217 echo. 135 218 :: Check that a Perl executable has been found 136 219 if "%GLILANG%" == "en" echo Checking Perl: %PERLPATH% … … 210 293 if "%GLILANG%" == "fr" echo Vrification de Java: %JAVAPATH% 211 294 if "%GLILANG%" == "ru" echo ஢¥àª Java: %JAVAPATH% 212 if exist "%JAVAPATH%\java.exe" goto check GLI295 if exist "%JAVAPATH%\java.exe" goto checkJV 213 296 214 297 :noJava … … 230 313 if "%GLILANG%" == "ru" echo ¡š¡«š®â¥ç®£® šâ¥à䥩á Greenstone. 231 314 goto exit 315 316 317 :: Check the version of Java is new enough (1.4.0 or higher) to run the GLI 318 :checkJV 319 "%JAVAPATH%\java" -classpath . CheckJavaVersion 320 if ERRORLEVEL 2 goto checkGLI 321 :: Otherwise, errorlevel was an error value 322 if "%GLILANG%" == "es" La versión del Ambiente de Ejecución Java (JRE por sus siglas en 323 if "%GLILANG%" == "es" inglés) que usted tiene instalada es demasiado vieja para ejecutar 324 if "%GLILANG%" == "es" la Interfaz de la %PROGNAME%. Por favor instale 325 if "%GLILANG%" == "es" una nueva versión del Ambiente de Ejecución Java (versión 1.4 o 326 if "%GLILANG%" == "es" posterior) y ejecute nuevamente este guión. 327 328 if "%GLILANG%" == "fr" La version de Java Runtime Environment que vous avez installée est 329 if "%GLILANG%" == "fr" trop vielle pour faire fonctionner %PROGNAME%. 330 if "%GLILANG%" == "fr" Veuillez installer une nouvelle version du JRE (version 1.4 ou plus 331 if "%GLILANG%" == "fr" récente) et redémarrez le script. 332 333 if "%GLILANG%" == "ru" ÷ÅÒÓÉÑ Java Runtime Environment, ËÏÔÏÒÕÀ ÷Ù ÕÓÔÁÎÏ×ÉÌÉ, ÏÞÅÎØ ÓÔÁÒÁ, 334 if "%GLILANG%" == "ru" ÞÔÏÂÙ ÕÐÒÁ×ÌÑÔØ ÂÉÂÌÉÏÔÅÞÎÙÍ %PROGNAME%. ðÏÖÁÌÕÊÓÔÁ, 335 if "%GLILANG%" == "ru" ÕÓÔÁÎÏ×ÉÔÅ ÎÏ×ÕÀ ×ÅÒÓÉÀ JRE (×ÅÒÓÉÀ 1.4 ÉÌÉ ÂÏÌÅÅ ÎÏ×ÕÀ) É 336 if "%GLILANG%" == "ru" ÐÅÒÅÕÓÔÁÎÏ×ÉÔÅ ÜÔÏÔ ÓËÒÉÐÔ 337 338 if "%GLILANG%" == "en" The version of the Java Runtime Environment you have installed is too 339 if "%GLILANG%" == "en" old to run the %PROGNAME%. Please install a new 340 if "%GLILANG%" == "en" version of the JRE (version 1.4 or newer) and rerun this script. 341 goto exit 232 342 233 343 … … 254 364 :: ---- Finally, run the GLI ---- 255 365 echo. 366 echo ****gsdlhome is %GSDLHOME% 367 echo ****gsdl3home is %GSDL3HOME% 368 echo ****gsdl3srchome is %GSDL3SRCHOME% 256 369 257 370 if "%GLILANG%" == "en" echo Running the Greenstone Librarian Interface... … … 267 380 :: -Xloggc:<file> Write garbage collection log 268 381 269 if exist "%GSDLHOME%\server.exe" goto localLib 382 383 :: Run GS3 if version = 3 384 if "%_VERSION%" == "3" "%JAVAPATH%\java" -cp classes/;GLI.jar;lib/apache.jar;lib/qfslib.jar org.greenstone.gatherer.GathererProg -gsdl %GSDLHOME% -gsdlos %GSDLOS% -gsdl3 %GSDL3HOME% -gsdl3src %GSDL3SRCHOME% -perl %PERLPATH% %1 %2 %3 %4 %5 %6 %7 %8 %9 385 if "%_VERSION%" == "3" goto finRun 386 387 :: Run GS2 since version is 2: 388 :: if FLI is running, we don't want the local Greenstone library server running 389 if "%PROGABBR%" == "FLI" goto webLib 390 :: Else we're running GLI, so we want the local Greenstone library server (if server.exe exists, otherwise it will be webLib) 391 if exist "%GSDLHOME%\server.exe" goto localLib 270 392 271 393 :webLib 272 394 "%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 273 274 395 if ERRORLEVEL 2 goto webLib 275 396 goto finRun 397 398 :localLib 399 "%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 400 if ERRORLEVEL 2 goto localLib 401 goto finRun 402 403 404 :finRun 276 405 if "%GLILANG%" == "en" echo Done! 277 406 if "%GLILANG%" == "es" echo Hecho! … … 280 409 goto done 281 410 282 :localLib283 "%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 %9284 285 if ERRORLEVEL 2 goto localLib286 287 if "%GLILANG%" == "en" echo Done!288 if "%GLILANG%" == "es" echo Hecho!289 if "%GLILANG%" == "fr" echo Termin!290 if "%GLILANG%" == "ru" echo 믮«¥®!291 goto done292 411 293 412 :exit
Note:
See TracChangeset
for help on using the changeset viewer.