[10759] | 1 | @echo off
|
---|
[17947] | 2 | pushd "%CD%"
|
---|
| 3 | CD /D "%~dp0"
|
---|
[10759] | 4 | set GLILANG=en
|
---|
[19388] | 5 | set GLIMODE=client
|
---|
[10759] | 6 |
|
---|
[19388] | 7 | if "%PROGNAME%" == "" set PROGNAME=Greenstone
|
---|
[10759] | 8 |
|
---|
[19388] | 9 | if not "%PROGFULLNAME%" == "" goto setvars
|
---|
[16401] | 10 | if "%GLILANG%" == "es" set PROGFULLNAME="Biblioteca Digital Greenstone"
|
---|
| 11 | if "%GLILANG%" == "fr" set PROGFULLNAME="Bibliothécaire Greenstone"
|
---|
| 12 | if "%GLILANG%" == "ru" set PROGFULLNAME="ÉÎÔÅÒÆÅÊÓ Greenstone"
|
---|
| 13 | :: if the PROGFULLNAME is still not set, then set the language to English
|
---|
| 14 | if "%PROGFULLNAME%" == "" set PROGNAME=Greenstone Digital Library
|
---|
| 15 |
|
---|
| 16 |
|
---|
| 17 | :setvars
|
---|
| 18 | if "%PROGABBR%" == "" set PROGABBR=GLI
|
---|
| 19 | if "%PROGNAME_EN%" == "" set PROGNAME_EN=Greenstone Librarian Interface
|
---|
| 20 |
|
---|
[10759] | 21 | :: -------- Run the Greenstone Librarian Interface --------
|
---|
| 22 |
|
---|
| 23 | :: This script must be run from within the directory in which it lives
|
---|
| 24 | if exist client-gli.bat goto start
|
---|
| 25 | if "%GLILANG%" == "en" echo This script must be run from the directory in which it resides.
|
---|
| 26 | if "%GLILANG%" == "es" echo Este gui¢n deber ejecutarse desde el directorio en el que reside.
|
---|
| 27 | if "%GLILANG%" == "fr" echo Ce script doit tre excut
|
---|
| 28 | partir du rpertoire dans lequel il se trouve.
|
---|
| 29 | if "%GLILANG%" == "ru" echo â®â áªàš¯â €®«Š¥ ¡ëâì ¢§ïâ š§ €šà¥ªâ®àšš, ¢ ª®â®à®© ® à ᯮ«®Š¥
|
---|
| 30 | goto exit
|
---|
| 31 |
|
---|
| 32 | :start
|
---|
| 33 | if "%OS%" == "Windows_NT" goto findGSDL
|
---|
| 34 | :: Invoke a new command processor to ensure there's enough environment space
|
---|
| 35 | if "%1" == "Second" goto findGSDL
|
---|
| 36 | command /E:2048 /C %0 Second %1 %2 %3 %4 %5 %6 %7 %8 %9
|
---|
| 37 | goto done
|
---|
| 38 |
|
---|
[19388] | 39 | :findGSDL
|
---|
| 40 | :: Try to detect a local GSDLHOME installation (gs2build). If none can be
|
---|
| 41 | :: found, then client-gli won't have a download panel. We're calling
|
---|
| 42 | :: findgsdl.bat purely for knowing if there's a GSDLHOME around and to set and
|
---|
| 43 | :: use that for downloading. If there IS a local GSDLHOME, then we can download
|
---|
| 44 | :: (and build) locally, but ONLY if we have perl. Else downloading and building
|
---|
| 45 | :: will have to be done remotely anyway. If Perl is found, PERLPATH will be set.
|
---|
| 46 | call findgsdl.bat
|
---|
[19310] | 47 | if "%GSDLHOME%" == "" goto findJava
|
---|
| 48 | call findperl.bat
|
---|
[10759] | 49 |
|
---|
[19353] | 50 | :findJava
|
---|
| 51 | :: Need to find Java. If found, JAVA_EXECUTABLE will be set
|
---|
| 52 | call findjava.bat
|
---|
[10759] | 53 | if "%JAVA_EXECUTABLE%" == "" goto exit
|
---|
| 54 |
|
---|
| 55 | :checkGLI
|
---|
| 56 | :: ---- Check that the GLI has been compiled ----
|
---|
| 57 | if exist "classes/org/greenstone/gatherer/Gatherer.class" goto runGLI
|
---|
| 58 | if exist "GLI.jar" goto runGLI
|
---|
[16401] | 59 | echo.
|
---|
[10759] | 60 | if "%GLILANG%" == "en" echo You need to compile the %PROGNAME_EN% (using makegli.bat)
|
---|
| 61 | if "%GLILANG%" == "en" echo before running this script.
|
---|
[16401] | 62 |
|
---|
[10759] | 63 | if "%GLILANG%" == "es" echo Usted necesita compilar la Interfaz de la %PROGFULLNAME%
|
---|
| 64 | if "%GLILANG%" == "es" echo (por medio de makegli.bat) antes de ejecutar este gui¢n.
|
---|
[16401] | 65 |
|
---|
[10759] | 66 | if "%GLILANG%" == "fr" echo Vous devez compiler le %PROGNAME% Interface (en utilisant makegil.bat)
|
---|
| 67 | if "%GLILANG%" == "fr" echo avant d'excuter ce script.
|
---|
[16401] | 68 |
|
---|
[10759] | 69 | if "%GLILANG%" == "ru" echo ë €®«Šë ª®¬¯š«šà®¢ âì ¡š¡«š®â¥çë© šâ¥à䥩á %PROGNAME% (šá¯®«ì§ãï makegli.bat)
|
---|
| 70 | if "%GLILANG%" == "ru" echo ¯¥à¥€ ¢¢®€®¬ í⮣® áªàš¯â
|
---|
| 71 | goto exit
|
---|
| 72 |
|
---|
| 73 |
|
---|
| 74 | :runGLI
|
---|
| 75 | :: ---- Finally, run the GLI ----
|
---|
| 76 | echo.
|
---|
| 77 |
|
---|
[16401] | 78 |
|
---|
| 79 | if "%GLILANG%" == "en" echo Running the %PROGNAME_EN%...
|
---|
| 80 | if "%GLILANG%" == "es" echo Ejecutando la Interfaz de la %PROGFULLNAME%...
|
---|
| 81 | if "%GLILANG%" == "fr" echo Excution de %PROGNAME_EN%
|
---|
[10759] | 82 | if "%GLILANG%" == "ru" echo ¥ªãéš© ¡š¡«š®â¥çë© šâ¥à䥩á %PROGNAME%...
|
---|
| 83 |
|
---|
| 84 | :: -Xms32M To set minimum memory
|
---|
| 85 | :: -Xmx32M To set maximum memory
|
---|
| 86 | :: -verbose:gc To set garbage collection messages
|
---|
| 87 | :: -Xincgc For incremental garbage collection
|
---|
| 88 | :: -Xprof Function call profiling
|
---|
| 89 | :: -Xloggc:<file> Write garbage collection log
|
---|
[19307] | 90 |
|
---|
[19391] | 91 |
|
---|
[19388] | 92 | :: If there's a local GS2 installation (GSDLHOME set), we'd have looked for Perl. If we had
|
---|
[19391] | 93 | :: found Perl, PERLPATH would have been set. If no perl, can't download or build locally on
|
---|
[19388] | 94 | :: the client side. If we have Perl, pass in GSDLHOME for the -gsdl option and the PERLPATH.
|
---|
| 95 | if "%PERLPATH%" == "" goto nogsdl
|
---|
| 96 | echo Perl and GSDLHOME (%GSDLHOME%) detected. Downloading is enabled.
|
---|
| 97 | echo.
|
---|
[19307] | 98 | "%JAVA_EXECUTABLE%" -Xmx128M -cp classes/;GLI.jar;lib/apache.jar;lib/qfslib.jar org.greenstone.gatherer.GathererProg -use_remote_greenstone -gsdl "%GSDLHOME%" -perl "%PERLPATH%" %1 %2 %3 %4 %5 %6 %7 %8 %9
|
---|
| 99 | goto finish
|
---|
| 100 |
|
---|
[19388] | 101 | :nogsdl
|
---|
[19353] | 102 | echo Since there's no GSDLHOME, client-GLI's download panel will be deactivated.
|
---|
[10759] | 103 | "%JAVA_EXECUTABLE%" -Xmx128M -cp classes/;GLI.jar;lib/apache.jar;lib/qfslib.jar org.greenstone.gatherer.GathererProg -use_remote_greenstone %1 %2 %3 %4 %5 %6 %7 %8 %9
|
---|
[19307] | 104 |
|
---|
[10759] | 105 | :finish
|
---|
| 106 | if "%GLILANG%" == "en" echo Done!
|
---|
| 107 | if "%GLILANG%" == "es" echo Hecho!
|
---|
| 108 | if "%GLILANG%" == "fr" echo Termin!
|
---|
| 109 | if "%GLILANG%" == "ru" echo 믮«¥®!
|
---|
| 110 | goto done
|
---|
| 111 |
|
---|
| 112 | :exit
|
---|
| 113 | echo.
|
---|
| 114 | pause
|
---|
| 115 |
|
---|
| 116 | :done
|
---|
[19310] | 117 | :: ---- Clean up ----
|
---|
[19353] | 118 | set PERLPATH=
|
---|
[19388] | 119 | set JAVA_EXECUTABLE=
|
---|
| 120 | set GLIMODE=
|
---|
| 121 | set PROGNAME=
|
---|
| 122 | set PROGNAME_EN=
|
---|
| 123 | set PROGFULLNAME=
|
---|
[17947] | 124 | set PROGABBR=
|
---|
| 125 | popd
|
---|