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