| 1 | @echo off
|
---|
| 2 | color 0A
|
---|
| 3 | pushd "%CD%"
|
---|
| 4 | CD /D "%~dp0"
|
---|
| 5 | set GLILANG=en
|
---|
| 6 |
|
---|
| 7 |
|
---|
| 8 | :: -------- Run the Greenstone Librarian Interface --------
|
---|
| 9 |
|
---|
| 10 | :: This script must be run from within the directory in which it lives
|
---|
| 11 | if exist gems.bat goto start
|
---|
| 12 | if "%GLILANG%" == "en" echo This script must be run from the directory in which it resides.
|
---|
| 13 | if "%GLILANG%" == "es" echo Este gui¢n deber ejecutarse desde el directorio en el que reside.
|
---|
| 14 | if "%GLILANG%" == "fr" echo Ce script doit tre excut
|
---|
| 15 | partir du rpertoire dans lequel il se trouve.
|
---|
| 16 | if "%GLILANG%" == "ru" echo â®â áªàš¯â €®«Š¥ ¡ëâì ¢§ïâ š§ €šà¥ªâ®àšš, ¢ ª®â®à®© ® à ᯮ«®Š¥
|
---|
| 17 | goto exit
|
---|
| 18 |
|
---|
| 19 | :start
|
---|
| 20 | if "%OS%" == "Windows_NT" goto progName
|
---|
| 21 | :: Invoke a new command processor to ensure there's enough environment space
|
---|
| 22 | if "%1" == "Second" goto progName
|
---|
| 23 | command /E:2048 /C %0 Second %1 %2 %3 %4 %5 %6 %7 %8 %9
|
---|
| 24 | shift
|
---|
| 25 | goto done
|
---|
| 26 |
|
---|
| 27 |
|
---|
| 28 | :progName
|
---|
| 29 | if "%GLILANG%" == "es" set PROGNAME=Editar conjuntos de metadatos
|
---|
| 30 | if "%GLILANG%" == "fr" set PROGNAME=Editer les jeux de méta-données
|
---|
| 31 | if "%GLILANG%" == "ru" set PROGNAME=Ðåäàêòèðîâàòü íàáîðû ìåòàäàííûõ
|
---|
| 32 | :: if the PROGNAME is still not set, then set the language to English
|
---|
| 33 | if "%PROGNAME%" == "" set PROGNAME=Greenstone Editor for Metadata Sets
|
---|
| 34 |
|
---|
| 35 | if "%PROGABBR%" == "" set PROGABBR=GEMS
|
---|
| 36 | if "%PROGNAME_EN%" == "" set PROGNAME_EN=Greenstone Editor for Metadata Sets
|
---|
| 37 |
|
---|
| 38 | :: Now need to work out the _VERSION, GSDLHOME (and if GS3, then GSDL3SRCHOME and GSDL3HOME)
|
---|
| 39 | :findGSDL
|
---|
| 40 | call findgsdl.bat
|
---|
| 41 | if "%GSDLHOME%" == "" goto exit
|
---|
| 42 |
|
---|
| 43 | :checkUserPermissions
|
---|
| 44 | echo.
|
---|
| 45 | echo Checking if the Greenstone collection directory is writable ...
|
---|
| 46 | (echo This is a temporary file. It is safe to delete it. > "%GSDLHOME%\collect\testing.tmp" ) 2>nul
|
---|
| 47 | if exist "%GSDLHOME%\collect\testing.tmp" goto deleteTempFile
|
---|
| 48 | if "%1" == "Elevated" goto printWarning
|
---|
| 49 | echo ... FAILED
|
---|
| 50 | echo The %PROGNAME% cannot write to the collection directory (%GSDLHOME%\collect)
|
---|
| 51 | echo Requesting elevated status to become admin user to continue.
|
---|
| 52 | "%GSDLHOME%\bin\windows\gstart.exe" %0 Elevated %1 %2 %3 %4 %5 %6 %7 %8 %9
|
---|
| 53 | goto done
|
---|
| 54 |
|
---|
| 55 | :printWarning
|
---|
| 56 | echo ... FAILED
|
---|
| 57 | echo The %PROGNAME% cannot write to the log directory (%GSDLHOME%\collect).
|
---|
| 58 | echo Attempting to continue without permissions.
|
---|
| 59 | goto shiftElevated
|
---|
| 60 |
|
---|
| 61 | :deleteTempFile
|
---|
| 62 | echo ... OK
|
---|
| 63 | del "%GSDLHOME%\collect\testing.tmp"
|
---|
| 64 |
|
---|
| 65 | :shiftElevated
|
---|
| 66 | :: Shift "Elevated" (one of our own internal command words) out of the way if present
|
---|
| 67 | :: so the command-line is as it was when the user initiated the command
|
---|
| 68 | if "%1" == "Elevated" shift
|
---|
| 69 |
|
---|
| 70 | :: Need to find Java. If found, JAVA_EXECUTABLE will be set
|
---|
| 71 | call findjava.bat
|
---|
| 72 | if "%JAVA_EXECUTABLE%" == "" goto exit
|
---|
| 73 |
|
---|
| 74 |
|
---|
| 75 | :chkGEMS
|
---|
| 76 | :: ---- Check that the GEMS has been compiled ----
|
---|
| 77 | if exist "classes/org/greenstone/gatherer/Gatherer.class" goto runGEMS
|
---|
| 78 | if exist "GLI.jar" goto runGEMS
|
---|
| 79 | echo.
|
---|
| 80 | if "%GLILANG%" == "en" echo You need to compile the %PROGNAME% (using makegli.bat)
|
---|
| 81 | if "%GLILANG%" == "en" echo before running this script.
|
---|
| 82 |
|
---|
| 83 | if "%GLILANG%" == "es" echo Usted necesita compilar la %PROGNAME%
|
---|
| 84 | if "%GLILANG%" == "es" echo (por medio de makegli.bat) antes de ejecutar este gui¢n.
|
---|
| 85 |
|
---|
| 86 | if "%GLILANG%" == "fr" echo Vous devez compiler le %PROGNAME% (en utilisant makegli.bat)
|
---|
| 87 | if "%GLILANG%" == "fr" echo avant d'excuter ce script.
|
---|
| 88 |
|
---|
| 89 | if "%GLILANG%" == "ru" echo ë €®«Šë ª®¬¯š«šà®¢ âì %PROGNAME% (šá¯®«ì§ãï makegli.bat)
|
---|
| 90 | if "%GLILANG%" == "ru" echo ¯¥à¥€ ¢¢®€®¬ í⮣® áªàš¯â
|
---|
| 91 | goto exit
|
---|
| 92 |
|
---|
| 93 |
|
---|
| 94 | :runGEMS
|
---|
| 95 | if not "%_VERSION%" == "" (
|
---|
| 96 | echo Greenstone Major Version:
|
---|
| 97 | echo %_VERSION%
|
---|
| 98 | echo.
|
---|
| 99 | )
|
---|
| 100 |
|
---|
| 101 | if not "%GSDL3SRCHOME%" == "" (
|
---|
| 102 | echo GSDL3SRCHOME:
|
---|
| 103 | echo %GSDL3SRCHOME%
|
---|
| 104 | echo.
|
---|
| 105 | )
|
---|
| 106 |
|
---|
| 107 | if not "%GSDL3HOME%" == "" (
|
---|
| 108 | echo GSDL3HOME:
|
---|
| 109 | echo %GSDL3HOME%
|
---|
| 110 | echo.
|
---|
| 111 | )
|
---|
| 112 |
|
---|
| 113 | if not "%GSDLHOME%" == "" (
|
---|
| 114 | echo GSDLHOME:
|
---|
| 115 | echo %GSDLHOME%
|
---|
| 116 | echo.
|
---|
| 117 | )
|
---|
| 118 |
|
---|
| 119 | :: ---- Finally, run the GEMS ----
|
---|
| 120 | if "%GLILANG%" == "en" echo Running the %PROGNAME%...
|
---|
| 121 | if "%GLILANG%" == "es" echo Ejecutando la %PROGNAME%...
|
---|
| 122 | if "%GLILANG%" == "fr" echo Excution de %PROGNAME%
|
---|
| 123 | if "%GLILANG%" == "ru" echo ¥ªãéš© %PROGNAME%...
|
---|
| 124 |
|
---|
| 125 | :: -Xms32M To set minimum memory
|
---|
| 126 | :: -Xmx32M To set maximum memory
|
---|
| 127 | :: -verbose:gc To set garbage collection messages
|
---|
| 128 | :: -Xincgc For incremental garbage collection
|
---|
| 129 | :: -Xprof Function call profiling
|
---|
| 130 | :: -Xloggc:<file> Write garbage collection log
|
---|
| 131 |
|
---|
| 132 |
|
---|
| 133 | :: Run GS3 if version = 3
|
---|
| 134 | if "%_VERSION%" == "3" "%JAVA_EXECUTABLE%" -cp classes/;GLI.jar;lib/apache.jar org.greenstone.gatherer.gems.GEMS -gsdl3 %GSDL3HOME% %1 %2 %3 %4 %5 %6 %7 %8 %9
|
---|
| 135 | if "%_VERSION%" == "3" goto finRun
|
---|
| 136 |
|
---|
| 137 | :: Else run GS2 since version is 2:
|
---|
| 138 | "%JAVA_EXECUTABLE%" -cp classes/;GLI.jar;lib/apache.jar org.greenstone.gatherer.gems.GEMS -gsdl %GSDLHOME% %1 %2 %3 %4 %5 %6 %7 %8 %9
|
---|
| 139 |
|
---|
| 140 | :finRun
|
---|
| 141 | if "%GLILANG%" == "en" echo Done!
|
---|
| 142 | if "%GLILANG%" == "es" echo Hecho!
|
---|
| 143 | if "%GLILANG%" == "fr" echo Termin!
|
---|
| 144 | if "%GLILANG%" == "ru" echo 믮«¥®!
|
---|
| 145 | goto done
|
---|
| 146 |
|
---|
| 147 |
|
---|
| 148 | :exit
|
---|
| 149 | echo.
|
---|
| 150 | pause
|
---|
| 151 | color 07
|
---|
| 152 | popd
|
---|
| 153 | :done
|
---|
| 154 | :: ---- Clean up ----
|
---|
| 155 | set JAVAPATH=
|
---|
| 156 | set JAVA_EXECUTABLE=
|
---|
| 157 | color 07
|
---|
| 158 | popd
|
---|