source: gli/branches/2.75/gems.bat@ 14764

Last change on this file since 14764 was 14764, checked in by oranfry, 13 years ago

trying to get these two scripts vista compatible

  • Property svn:mime-type set to application/octet-stream
File size: 9.2 KB
Line 
1@echo off
2set GLILANG=en
3
4
5:: -------- Run the Greenstone Editor for Metadata Sets --------
6
7:: This script must be run from within the directory in which it lives
8if exist gems.bat goto start
9 if "%GLILANG%" == "en" echo This script must be run from the directory in which it resides.
10 if "%GLILANG%" == "es" echo Este gui¢n deber  ejecutarse desde el directorio en el que reside.
11 if "%GLILANG%" == "fr" echo Ce script doit ˆtre ex‚cut‚ …
12 partir du r‚pertoire dans lequel il se trouve.
13 if "%GLILANG%" == "ru" echo â®â áªàš¯â €®«Š¥­ ¡ëâì ¢§ïâ š§ €šà¥ªâ®àšš, ¢ ª®â®à®© ®­ à á¯®«®Š¥­
14 goto exit
15
16:start
17if "%OS%" == "Windows_NT" goto findGSDL
18 :: Invoke a new command processor to ensure there's enough environment space
19 if "%1" == "Second" goto findGSDL
20 command /E:2048 /C %0 Second %1 %2 %3 %4 %5 %6 %7 %8 %9
21 goto done
22
23:findGSDL
24echo.
25if "%GLILANG%" == "en" echo Greenstone Editor for Metadata Sets (GEMS)
26if "%GLILANG%" == "en" echo Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato
27if "%GLILANG%" == "en" echo GEMS comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt
28if "%GLILANG%" == "en" echo This is free software, and you are welcome to redistribute it
29
30if "%GLILANG%" == "es" echo Editar conjuntos de metadatos (Greenstone Editor for Metadata Sets - GEMS)
31if "%GLILANG%" == "es" echo Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato
32if "%GLILANG%" == "es" echo GEMS NO INCLUYE ABSOLUTAMENTE NINGUNA GARANTÖA.
33if "%GLILANG%" == "es" echo Para mayor informaci¢n vea los t‚rminos de la licencia en LICENSE.txt
34if "%GLILANG%" == "es" echo Este es un software abierto, por lo que lo invitamos a que lo distribuya de forma gratuita
35
36if "%GLILANG%" == "fr" echo Editer les jeux de méta-données (Greenstone Editor for Metadata Sets - GEMS)
37if "%GLILANG%" == "fr" echo Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato
38if "%GLILANG%" == "fr" echo GEMS est fourni sans AUCUNE GARANTIE; pour des d‚tails, voir LICENSE.txt
39if "%GLILANG%" == "fr" echo Ceci est un logiciel libre, et vous ˆtes invit‚ …
40 le redistribuer
41
42if "%GLILANG%" == "ru" echo Ðåäàêòèðîâàòü íàáîðû ìåòàäàííûõ (Greenstone Editor for Metadata Sets - GEMS)
43if "%GLILANG%" == "ru" echo Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato
44if "%GLILANG%" == "ru" echo ˆƒ ­¥ € ¥â €‘Ž‹ž’Ž ˆŠ€Šˆ• ƒ€€’ˆ‰; €¥â «š á¬. ¢ ⥪á⥠LICENSE.TXT
45if "%GLILANG%" == "ru" echo â® - ᢮¡®€­® à á¯à®áâ࠭塞®¥ ¯à®£à ¬¬­®¥ ®¡¥á¯¥ç¥­š¥ š ‚ë ¬®Š¥â¥ à á¯à®áâà ­ïâì ¥£®
46
47echo.
48:: ---- Determine GSDLHOME ----
49set GSDLPATH=
50
51:: Some users may set the above line manually
52if not "%GSDLPATH%" == "" goto testGSDL
53
54 :: The default location for the GLI (and thus GEMS) is a subdirectory of Greenstone
55 set GSDLPATH=..
56
57 :: If it is set, use the GSDLHOME environment variable
58 if "%GSDLHOME%" == "" goto testGSDL
59 set GSDLPATH=%GSDLHOME%
60
61:testGSDL
62:: Check that the Greenstone installation looks OK
63if "%GLILANG%" == "en" echo Checking GSDL: %GSDLPATH%
64if "%GLILANG%" == "es" echo Revisando GSDL: %GSDLPATH%
65if "%GLILANG%" == "fr" echo V‚rification de GSDL: %GSDLPATH%
66if "%GLILANG%" == "ru" echo à®¢¥àª  GSDL: %GSDLPATH%
67if exist "%GSDLPATH%\setup.bat" goto prepGSDL
68 echo.
69 if "%GLILANG%" == "en" echo The Greenstone installation could not be found, or is incomplete.
70 if "%GLILANG%" == "en" echo Try reinstalling Greenstone then running this script again.
71
72 if "%GLILANG%" == "es" echo No se pudo encontrar la instalaci¢n de Greenstone o est  incompleta.
73 if "%GLILANG%" == "es" echo Trate de reinstalar Greenstone y a continuaci¢n ejecute nuevamente este gui¢n.
74
75 if "%GLILANG%" == "fr" echo L'installation de Greenstone est introuvable ou incomplŠte. Essayez
76 if "%GLILANG%" == "fr" echo de r‚installer Greenstone et ex‚cutez ce script …
77 nouveau.
78
79 if "%GLILANG%" == "ru" echo ˆ­áâ ««ïæšï Greenstone ­¥ ¡ë«  ­ ©€¥­  š«š ®­  ­¥¯®«­ . ®¯à®¡ã©â¥ ¯®¢â®à­®
80 if "%GLILANG%" == "ru" echo ãáâ ­®¢šâì Greenstone,   § â¥¬ ¢¢¥áâš íâ®â áªàš¯â á­®¢ .
81 goto exit
82
83:prepGSDL
84:: Setup Greenstone, unless it has already been done
85if not "%GSDLHOME%" == "" goto doneGSDL
86 call "%GSDLPATH%\setup.bat" SetEnv > nul
87
88:doneGSDL
89:: GSDLPATH is no longer needed, since GSDLHOME should now be set
90set GSDLPATH=
91
92
93:findJava
94:: ---- Check Java exists ----
95set JAVAPATH=
96
97:: Some users may set the above line manually
98if not "%JAVAPATH%" == "" goto testJava
99
100 :: If it is set, use the JAVA_HOME environment variable
101 if not "%JAVA_HOME%" == "" goto javahome
102
103 :: Check if Java is on the search path
104 echo %PATH%| winutil\which.exe java.exe | winutil\setvar.exe JAVAPATH > %SystemRoot%\Temp\setjava.bat
105 call %SystemRoot%\Temp\setjava.bat
106 del %SystemRoot%\Temp\setjava.bat
107 if not "%JAVAPATH%" == "" goto testJava
108
109 :: Still haven't found anything, so try looking in the registry (gulp!)
110 type nul > %SystemRoot%\Temp\jdk.reg
111 regedit /E %SystemRoot%\Temp\jdk.reg "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit"
112 type %SystemRoot%\Temp\jdk.reg > %SystemRoot%\Temp\jdk.txt
113 del %SystemRoot%\Temp\jdk.reg
114 type nul > %SystemRoot%\Temp\jre.reg
115 regedit /E %SystemRoot%\Temp\jre.reg "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment"
116 type %SystemRoot%\Temp\jre.reg > %SystemRoot%\Temp\jre.txt
117 del %SystemRoot%\Temp\jre.reg
118
119 winutil\findjava.exe %SystemRoot%\Temp\jdk.txt %SystemRoot%\Temp\jre.txt | winutil\setvar.exe JAVAPATH > %SystemRoot%\Temp\setjava.bat
120 del %SystemRoot%\Temp\jdk.txt
121 del %SystemRoot%\Temp\jre.txt
122 call %SystemRoot%\Temp\setjava.bat
123 del %SystemRoot%\Temp\setjava.bat
124
125 :: If nothing was found in the registry, we're stuck
126 if "%JAVAPATH%" == "" goto noJava
127
128 set JAVAPATH=%JAVAPATH%\bin
129 goto testJava
130
131:javahome
132 set JAVAPATH=%JAVA_HOME%\bin
133
134:testJava
135:: Check that a Java executable has been found
136if "%GLILANG%" == "en" echo Checking Java: %JAVAPATH%
137if "%GLILANG%" == "es" echo Revisando Java: %JAVAPATH%
138if "%GLILANG%" == "fr" echo V‚rification de Java: %JAVAPATH%
139if "%GLILANG%" == "ru" echo à®¢¥àª  Java: %JAVAPATH%
140if exist "%JAVAPATH%\java.exe" goto checkGEMS
141
142:noJava
143 echo.
144 if "%GLILANG%" == "en" echo Failed to locate an appropriate version of Java. You must install a
145 if "%GLILANG%" == "en" echo Java Runtime Environment (version 1.4 or greater) before running the
146 if "%GLILANG%" == "en" echo Greenstone Editor for Metadata Sets.
147
148 if "%GLILANG%" == "es" echo No se pudo localizar una versi¢n apropiada de Java. Usted deber 
149 if "%GLILANG%" == "es" echo instalar un Ambiente de Ejecuci¢n Java (versi¢n 1.4 o superior)
150 if "%GLILANG%" == "es" echo antes de correr la Editar conjuntos de metadatos.
151
152 if "%GLILANG%" == "fr" echo Une version ad‚quate de Java n'a pas pu ˆtre localis‚e. Vous devez
153 if "%GLILANG%" == "fr" echo installer un Java Runtime Environment (version 1.4 ou sup‚rieur)
154 if "%GLILANG%" == "fr" echo avant de d‚marrer Editer les jeux de méta-données.
155
156 if "%GLILANG%" == "ru" echo ¥ 〠«®áì ®¯à¥€¥«šâì ¬¥áâ®­ å®Š€¥­š¥ ᮮ⢥âáâ¢ãî饩 ¢¥àášš Java.
157 if "%GLILANG%" == "ru" echo ‚ë €®«Š­ë ãáâ ­®¢šâì Java Runtime Environment (¢¥àášî 1.4 š«š ¢ëè¥) ¯¥à¥€ ¢¢®€®¬
158 if "%GLILANG%" == "ru" echo Ðåäàêòèðîâàòü íàáîðû ìåòàäàííûõ.
159 goto exit
160
161
162:checkGEMS
163:: ---- Check that the GEMS has been compiled ----
164if exist "classes/org/greenstone/gatherer/gems/GEMS.class" goto runGEMS
165if exist "GLI.jar" goto runGEMS
166 echo.
167 if "%GLILANG%" == "en" echo You need to compile the Greenstone Editor for Metadata Sets (using makegli.bat)
168 if "%GLILANG%" == "en" echo before running this script.
169
170 if "%GLILANG%" == "es" echo Usted necesita compilar la Editar conjuntos de metadatos
171 if "%GLILANG%" == "es" echo (por medio de makegli.bat) antes de ejecutar este gui¢n.
172
173 if "%GLILANG%" == "fr" echo Vous devez compiler le Editer les jeux de méta-données (en utilisant
174 if "%GLILANG%" == "fr" echo makegli.bat) avant d'ex‚cuter ce script.
175
176 if "%GLILANG%" == "ru" echo ‚ë €®«Š­ë ª®¬¯š«šà®¢ âì Ðåäàêòèðîâàòü íàáîðû ìåòàäàííûõ (šá¯®«ì§ãï makegli.bat)
177 if "%GLILANG%" == "ru" echo ¯¥à¥€ ¢¢®€®¬ í⮣® áªàš¯â 
178 goto exit
179
180
181:runGEMS
182:: ---- Finally, run the GEMS ----
183echo.
184
185if "%GLILANG%" == "en" echo Running the Greenstone Editor for Metadata Sets...
186if "%GLILANG%" == "es" echo Ejecutando la Editar conjuntos de metadatos...
187if "%GLILANG%" == "fr" echo Ex‚cution de Editer les jeux de méta-données
188if "%GLILANG%" == "ru" echo ’¥ªãéš© Ðåäàêòèðîâàòü íàáîðû ìåòàäàííûõ...
189
190:: -Xms32M To set minimum memory
191:: -Xmx32M To set maximum memory
192:: -verbose:gc To set garbage collection messages
193:: -Xincgc For incremental garbage collection
194:: -Xprof Function call profiling
195:: -Xloggc:<file> Write garbage collection log
196
197"%JAVAPATH%\java" -cp classes/;GLI.jar;lib/apache.jar org.greenstone.gatherer.gems.GEMS -gsdl %GSDLHOME% %1 %2 %3 %4 %5 %6 %7 %8 %9
198
199if "%GLILANG%" == "en" echo Done!
200if "%GLILANG%" == "es" echo ­Hecho!
201if "%GLILANG%" == "fr" echo Termin‚!
202if "%GLILANG%" == "ru" echo ‚믮«­¥­®!
203goto done
204
205:exit
206echo.
207pause
208
209:done
210:: ---- Clean up ----
211set JAVAPATH=
Note: See TracBrowser for help on using the repository browser.