source: main/trunk/gli/gems.bat@ 24827

Last change on this file since 24827 was 24827, checked in by ak19, 12 years ago

Property change from binary (application/octet-stream) file into no longer having the mime-type property set (which didn't allow me to do a diff on the file).

File size: 5.1 KB
Line 
1@echo off
2color 0A
3pushd "%CD%"
4CD /D "%~dp0"
5set 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
11if 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 ex‚cut‚ …
15 partir du r‚pertoire dans lequel il se trouve.
16 if "%GLILANG%" == "ru" echo â®â áªàš¯â €®«Š¥­ ¡ëâì ¢§ïâ š§ €šà¥ªâ®àšš, ¢ ª®â®à®© ®­ à á¯®«®Š¥­
17 goto exit
18
19:start
20if "%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
29if "%GLILANG%" == "es" set PROGNAME=Editar conjuntos de metadatos
30if "%GLILANG%" == "fr" set PROGNAME=Editer les jeux de méta-données
31if "%GLILANG%" == "ru" set PROGNAME=Ðåäàêòèðîâàòü íàáîðû ìåòàäàííûõ
32:: if the PROGNAME is still not set, then set the language to English
33if "%PROGNAME%" == "" set PROGNAME=Greenstone Editor for Metadata Sets
34
35if "%PROGABBR%" == "" set PROGABBR=GEMS
36if "%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
40call findgsdl.bat
41if "%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
71call findjava.bat
72if "%JAVA_EXECUTABLE%" == "" goto exit
73
74
75:chkGEMS
76:: ---- Check that the GEMS has been compiled ----
77if exist "classes/org/greenstone/gatherer/Gatherer.class" goto runGEMS
78if 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'ex‚cuter ce script.
88
89 if "%GLILANG%" == "ru" echo ‚ë €®«Š­ë ª®¬¯š«šà®¢ âì %PROGNAME% (šá¯®«ì§ãï makegli.bat)
90 if "%GLILANG%" == "ru" echo ¯¥à¥€ ¢¢®€®¬ í⮣® áªàš¯â 
91 goto exit
92
93
94:runGEMS
95if not "%_VERSION%" == "" (
96 echo Greenstone Major Version:
97 echo %_VERSION%
98 echo.
99)
100
101if not "%GSDL3SRCHOME%" == "" (
102 echo GSDL3SRCHOME:
103 echo %GSDL3SRCHOME%
104 echo.
105)
106
107if not "%GSDL3HOME%" == "" (
108 echo GSDL3HOME:
109 echo %GSDL3HOME%
110 echo.
111)
112
113if not "%GSDLHOME%" == "" (
114 echo GSDLHOME:
115 echo %GSDLHOME%
116 echo.
117)
118
119:: ---- Finally, run the GEMS ----
120if "%GLILANG%" == "en" echo Running the %PROGNAME%...
121if "%GLILANG%" == "es" echo Ejecutando la %PROGNAME%...
122if "%GLILANG%" == "fr" echo Ex‚cution de %PROGNAME%
123if "%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
134if "%_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
135if "%_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
149echo.
150pause
151color 07
152popd
153:done
154:: ---- Clean up ----
155set JAVAPATH=
156set JAVA_EXECUTABLE=
157color 07
158popd
Note: See TracBrowser for help on using the repository browser.