root/main/trunk/gli/gems.bat @ 25678

Revision 25678, 5.1 KB (checked in by davidb, 8 years ago)

Added svn:executable property

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