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

Last change on this file since 22574 was 22574, checked in by sjm84, 14 years ago

Updated the messages printed by gli.bat and gems.bat when extra permissions are required

  • Property svn:mime-type set to application/octet-stream
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 Checking if the Greenstone collection directory is writable ...
45 (echo This is a temporary file. It is safe to delete it. > "%GSDLHOME%\collect\testing.tmp" ) 2>nul
46 if exist "%GSDLHOME%\collect\testing.tmp" goto deleteTempFile
47 if "%1" == "Elevated" goto printWarning
48 echo ... FAILED
49 echo The %PROGNAME% cannot write to the collection directory (%GSDLHOME%\collect)
50 echo Requesting elevated status to become admin user to continue.
51 "%GSDLHOME%\bin\windows\gstart.exe" %0 Elevated %1 %2 %3 %4 %5 %6 %7 %8 %9
52 goto done
53
54:printWarning
55 echo ... FAILED
56 echo The %PROGNAME% cannot write to the log directory (%GSDLHOME%\collect).
57 echo Attempting to continue without permissions.
58 goto shiftElevated
59
60:deleteTempFile
61 echo ... OK
62 del "%GSDLHOME%\collect\testing.tmp"
63
64:shiftElevated
65:: Shift "Elevated" (one of our own internal command words) out of the way if present
66:: so the command-line is as it was when the user initiated the command
67 if "%1" == "Elevated" shift
68
69:: Need to find Java. If found, JAVA_EXECUTABLE will be set
70call findjava.bat
71if "%JAVA_EXECUTABLE%" == "" goto exit
72
73
74:chkGEMS
75:: ---- Check that the GEMS has been compiled ----
76if exist "classes/org/greenstone/gatherer/Gatherer.class" goto runGEMS
77if exist "GLI.jar" goto runGEMS
78 echo.
79 if "%GLILANG%" == "en" echo You need to compile the %PROGNAME% (using makegli.bat)
80 if "%GLILANG%" == "en" echo before running this script.
81
82 if "%GLILANG%" == "es" echo Usted necesita compilar la %PROGNAME%
83 if "%GLILANG%" == "es" echo (por medio de makegli.bat) antes de ejecutar este gui¢n.
84
85 if "%GLILANG%" == "fr" echo Vous devez compiler le %PROGNAME% (en utilisant makegli.bat)
86 if "%GLILANG%" == "fr" echo avant d'ex‚cuter ce script.
87
88 if "%GLILANG%" == "ru" echo ‚ë €®«Š­ë ª®¬¯š«šà®¢ âì %PROGNAME% (šá¯®«ì§ãï makegli.bat)
89 if "%GLILANG%" == "ru" echo ¯¥à¥€ ¢¢®€®¬ í⮣® áªàš¯â 
90 goto exit
91
92
93:runGEMS
94if not "%_VERSION%" == "" (
95 echo Greenstone Major Version:
96 echo %_VERSION%
97 echo.
98)
99
100if not "%GSDL3SRCHOME%" == "" (
101 echo GSDL3SRCHOME:
102 echo %GSDL3SRCHOME%
103 echo.
104)
105
106if not "%GSDL3HOME%" == "" (
107 echo GSDL3HOME:
108 echo %GSDL3HOME%
109 echo.
110)
111
112if not "%GSDLHOME%" == "" (
113 echo GSDLHOME:
114 echo %GSDLHOME%
115 echo.
116)
117
118:: ---- Finally, run the GEMS ----
119if "%GLILANG%" == "en" echo Running the %PROGNAME%...
120if "%GLILANG%" == "es" echo Ejecutando la %PROGNAME%...
121if "%GLILANG%" == "fr" echo Ex‚cution de %PROGNAME%
122if "%GLILANG%" == "ru" echo ’¥ªãéš© %PROGNAME%...
123
124:: -Xms32M To set minimum memory
125:: -Xmx32M To set maximum memory
126:: -verbose:gc To set garbage collection messages
127:: -Xincgc For incremental garbage collection
128:: -Xprof Function call profiling
129:: -Xloggc:<file> Write garbage collection log
130
131
132:: Run GS3 if version = 3
133if "%_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
134if "%_VERSION%" == "3" goto finRun
135
136 :: Else run GS2 since version is 2:
137 "%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
138
139:finRun
140 if "%GLILANG%" == "en" echo Done!
141 if "%GLILANG%" == "es" echo ­Hecho!
142 if "%GLILANG%" == "fr" echo Termin‚!
143 if "%GLILANG%" == "ru" echo ‚믮«­¥­®!
144 goto done
145
146
147:exit
148echo.
149pause
150color 07
151popd
152:done
153:: ---- Clean up ----
154set JAVAPATH=
155set JAVA_EXECUTABLE=
156color 07
157popd
Note: See TracBrowser for help on using the repository browser.