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

Last change on this file since 26571 was 25678, checked in by davidb, 12 years ago

Added svn:executable property

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