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