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

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

GEMS now asks for elevated permissions if the collection folder cannot be written to

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