[5824] | 1 | @echo off
|
---|
[17942] | 2 | color 0A
|
---|
| 3 | pushd "%CD%"
|
---|
| 4 | CD /D "%~dp0"
|
---|
[6749] | 5 | set GLILANG=en
|
---|
[5824] | 6 |
|
---|
[19388] | 7 | if "%GLIMODE%" == "" set GLIMODE=local
|
---|
[6749] | 8 |
|
---|
[5824] | 9 | :: -------- Run the Greenstone Librarian Interface --------
|
---|
| 10 |
|
---|
| 11 | :: This script must be run from within the directory in which it lives
|
---|
| 12 | if exist gli.bat goto start
|
---|
[6749] | 13 | if "%GLILANG%" == "en" echo This script must be run from the directory in which it resides.
|
---|
[6753] | 14 | if "%GLILANG%" == "es" echo Este gui¢n deber ejecutarse desde el directorio en el que reside.
|
---|
[6749] | 15 | if "%GLILANG%" == "fr" echo Ce script doit tre excut
|
---|
[6754] | 16 | partir du rpertoire dans lequel il se trouve.
|
---|
[5824] | 17 | if "%GLILANG%" == "ru" echo â®â áªàš¯â €®«Š¥ ¡ëâì ¢§ïâ š§ €šà¥ªâ®àšš, ¢ ª®â®à®© ® à ᯮ«®Š¥
|
---|
| 18 | goto exit
|
---|
| 19 |
|
---|
[15608] | 20 | :start
|
---|
[5824] | 21 | if "%OS%" == "Windows_NT" goto progName
|
---|
[15608] | 22 | :: Invoke a new command processor to ensure there's enough environment space
|
---|
[5824] | 23 | if "%1" == "Second" goto progName
|
---|
| 24 | command /E:2048 /C %0 Second %1 %2 %3 %4 %5 %6 %7 %8 %9
|
---|
| 25 | goto done
|
---|
[15608] | 26 |
|
---|
| 27 |
|
---|
| 28 | :progName
|
---|
| 29 | if not "%PROGNAME%" == "" goto findGSDL
|
---|
| 30 | :: otherwise PROGNAME was not set, so default to the Greenstone Librarian Interface (GLI) program
|
---|
| 31 | if "%GLILANG%" == "es" set PROGNAME=Biblioteca Digital Greenstone
|
---|
| 32 | if "%GLILANG%" == "fr" set PROGNAME=Bibliothécaire Greenstone
|
---|
| 33 | if "%GLILANG%" == "ru" set PROGNAME=ÉÎÔÅÒÆÅÊÓ Greenstone
|
---|
| 34 | :: if the PROGNAME is still not set, then set the language to English
|
---|
| 35 | if "%PROGNAME%" == "" set PROGNAME=Greenstone Librarian Interface
|
---|
| 36 |
|
---|
| 37 |
|
---|
| 38 | if "%PROGABBR%" == "" set PROGABBR=GLI
|
---|
| 39 | if "%PROGNAME_EN%" == "" set PROGNAME_EN=Greenstone Librarian Interface
|
---|
[19388] | 40 |
|
---|
[6669] | 41 | :: Now need to work out the _VERSION, GSDLHOME (and if GS3, then GSDL3SRCHOME and GSDL3HOME)
|
---|
[19388] | 42 | :findGSDL
|
---|
| 43 | call findgsdl.bat
|
---|
[6749] | 44 | if "%GSDLHOME%" == "" goto exit
|
---|
[19336] | 45 |
|
---|
| 46 | :: Now need to find Perl. If found, PERLPATH will be set
|
---|
| 47 | call findperl.bat
|
---|
[5824] | 48 | if "%PERLPATH%" == "" goto exit
|
---|
[19336] | 49 |
|
---|
| 50 | :: Need to find Java. If found, JAVA_EXECUTABLE will be set
|
---|
| 51 | call findjava.bat
|
---|
[5824] | 52 | if "%JAVA_EXECUTABLE%" == "" goto exit
|
---|
| 53 |
|
---|
| 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
|
---|
[6749] | 59 | echo.
|
---|
| 60 | if "%GLILANG%" == "en" echo You need to compile the Greenstone Librarian Interface (using makegli.bat)
|
---|
| 61 | if "%GLILANG%" == "en" echo before running this script.
|
---|
[6753] | 62 |
|
---|
| 63 | if "%GLILANG%" == "es" echo Usted necesita compilar la Interfaz de la Biblioteca Digital Greenstone
|
---|
| 64 | if "%GLILANG%" == "es" echo (por medio de makegli.bat) antes de ejecutar este gui¢n.
|
---|
[10787] | 65 |
|
---|
[6749] | 66 | if "%GLILANG%" == "fr" echo Vous devez compiler le Greenstone Interface (en utilisant makegli.bat)
|
---|
[6754] | 67 | if "%GLILANG%" == "fr" echo avant d'excuter ce script.
|
---|
| 68 |
|
---|
| 69 | if "%GLILANG%" == "ru" echo ë €®«Šë ª®¬¯š«šà®¢ âì ¡š¡«š®â¥çë© šâ¥à䥩á Greenstone (šá¯®«ì§ãï makegli.bat)
|
---|
[5824] | 70 | if "%GLILANG%" == "ru" echo ¯¥à¥€ ¢¢®€®¬ í⮣® áªàš¯â
|
---|
| 71 | goto exit
|
---|
| 72 |
|
---|
| 73 |
|
---|
[17671] | 74 | :runGLI
|
---|
[17332] | 75 |
|
---|
[22409] | 76 | if not "%_VERSION%" == "" (
|
---|
| 77 | echo Greenstone Major Version :
|
---|
[17332] | 78 | echo %_VERSION%
|
---|
| 79 | echo.
|
---|
[7680] | 80 | )
|
---|
[17332] | 81 |
|
---|
| 82 | if not "%GSDL3SRCHOME%" == "" (
|
---|
| 83 | echo GSDL3SRCHOME:
|
---|
| 84 | echo %GSDL3SRCHOME%
|
---|
| 85 | echo.
|
---|
| 86 | )
|
---|
| 87 |
|
---|
| 88 | if not "%GSDL3HOME%" == "" (
|
---|
| 89 | echo GSDL3HOME:
|
---|
| 90 | echo %GSDL3HOME%
|
---|
| 91 | echo.
|
---|
| 92 | )
|
---|
| 93 |
|
---|
| 94 | if not "%GSDLHOME%" == "" (
|
---|
| 95 | echo GSDLHOME:
|
---|
| 96 | echo %GSDLHOME%
|
---|
| 97 | echo.
|
---|
| 98 | )
|
---|
[17671] | 99 |
|
---|
| 100 | :: ---- Explain how to bypass Imagemagick and Ghostscript bundled with Greenstone if needed ----
|
---|
| 101 | echo.
|
---|
| 102 | if exist "%GSDLHOME%\bin\windows\ghostscript\bin\*.*" echo GhostScript bundled with Greenstone will be used, if you wish to use the version installed on your system (if any) please go to %GSDLHOME%\bin\windows and rename the folder called ghostscript to something else.
|
---|
| 103 | echo.
|
---|
| 104 | echo.
|
---|
| 105 | if exist "%GSDLHOME%\bin\windows\imagemagick\*.*" echo ImageMagick bundled with Greenstone will be used, if you wish to use the version installed on your system (if any) please go to %GSDLHOME%\bin\windows and rename the folder called imagemagick to something else.
|
---|
| 106 | echo.
|
---|
| 107 | echo.
|
---|
| 108 |
|
---|
| 109 |
|
---|
[15629] | 110 | :: ---- Finally, run the GLI ----
|
---|
| 111 | if "%GLILANG%" == "en" echo Running the %PROGNAME%...
|
---|
| 112 | if "%GLILANG%" == "es" echo Ejecutando la %PROGNAME%...
|
---|
[16548] | 113 | if "%GLILANG%" == "fr" echo Excution de %PROGNAME%
|
---|
[5824] | 114 | if "%GLILANG%" == "ru" echo ¥ªãéš© ¡š¡«š %PROGNAME%...
|
---|
| 115 |
|
---|
| 116 | :: -Xms32M To set minimum memory
|
---|
| 117 | :: -Xmx32M To set maximum memory
|
---|
| 118 | :: -verbose:gc To set garbage collection messages
|
---|
| 119 | :: -Xincgc For incremental garbage collection
|
---|
| 120 | :: -Xprof Function call profiling
|
---|
| 121 | :: -Xloggc:<file> Write garbage collection log
|
---|
[12695] | 122 |
|
---|
[15608] | 123 |
|
---|
[19390] | 124 | :: Run GS3 if version = 3
|
---|
[15608] | 125 | if "%_VERSION%" == "3" "%JAVA_EXECUTABLE%" -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
|
---|
| 126 | if "%_VERSION%" == "3" goto finRun
|
---|
| 127 |
|
---|
| 128 | :: Run GS2 since version is 2:
|
---|
| 129 | :: if FLI is running, we don't want the local Greenstone library server running
|
---|
[20479] | 130 | if "%PROGABBR%" == "FLI" goto webLib
|
---|
| 131 | :: Else we're running GLI, so we want the local Greenstone library server (if server.exe/gs2-server.bat exists, otherwise it will be webLib)
|
---|
[15608] | 132 | if not exist "%GSDLHOME%\server.exe" if not exist "%GSDLHOME%\gs2-server.bat" goto webLib
|
---|
[20479] | 133 |
|
---|
| 134 | :localLib
|
---|
| 135 | if exist "%GSDLHOME%\server.exe" (
|
---|
| 136 | set locallib=%GSDLHOME%\server.exe
|
---|
| 137 | ) else (
|
---|
[17474] | 138 | set locallib=%GSDLHOME%\gs2-server.bat
|
---|
[12689] | 139 | )
|
---|
[20479] | 140 |
|
---|
[18408] | 141 | "%JAVA_EXECUTABLE%" -Xmx128M -cp classes/;GLI.jar;lib/apache.jar;lib/qfslib.jar org.greenstone.gatherer.GathererProg -gsdl "%GSDLHOME%" -gsdlos %GSDLOS% -perl "%PERLPATH%" -local_library "%locallib%" %1 %2 %3 %4 %5 %6 %7 %8 %9
|
---|
| 142 | if ERRORLEVEL 2 (
|
---|
[17474] | 143 | goto localLib
|
---|
[15608] | 144 | )
|
---|
[12689] | 145 | goto finRun
|
---|
[20479] | 146 |
|
---|
| 147 | :webLib
|
---|
| 148 | "%JAVA_EXECUTABLE%" -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
|
---|
| 149 | if ERRORLEVEL 2 (
|
---|
| 150 | goto webLib
|
---|
| 151 | )
|
---|
[15608] | 152 | goto finRun
|
---|
| 153 |
|
---|
[22409] | 154 | :finRun
|
---|
| 155 | if "%GLILANG%" == "en" echo Done.
|
---|
| 156 | if "%GLILANG%" == "es" echo Hecho.
|
---|
| 157 | if "%GLILANG%" == "fr" echo Termin.
|
---|
[5927] | 158 | if "%GLILANG%" == "ru" echo 믮«¥®.
|
---|
[5824] | 159 | goto done
|
---|
[15608] | 160 |
|
---|
[5824] | 161 |
|
---|
| 162 | :exit
|
---|
| 163 | echo.
|
---|
[17942] | 164 | pause
|
---|
| 165 | color 07
|
---|
[5824] | 166 | popd
|
---|
[5927] | 167 |
|
---|
[5824] | 168 | :done
|
---|
| 169 | :: ---- Clean up ----
|
---|
[17501] | 170 | set PERLPATH=
|
---|
[19388] | 171 | set JAVA_EXECUTABLE=
|
---|
| 172 | set GLIMODE=
|
---|
| 173 | set PROGNAME=
|
---|
| 174 | set PROGNAME_EN=
|
---|
| 175 | set PROGFULLNAME=
|
---|
[17942] | 176 | set PROGABBR=
|
---|
| 177 | color 07
|
---|
| 178 | popd
|
---|