1 | @echo off
|
---|
2 | setlocal enabledelayedexpansion
|
---|
3 |
|
---|
4 | color 0A
|
---|
5 | pushd "%CD%"
|
---|
6 | CD /D "%~dp0"
|
---|
7 | set 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
|
---|
13 | if 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 excut
|
---|
17 | partir du rpertoire dans lequel il se trouve.
|
---|
18 | if "%GLILANG%" == "ru" echo â®â áªàš¯â €®«Š¥ ¡ëâì ¢§ïâ š§ €šà¥ªâ®àšš, ¢ ª®â®à®© ® à ᯮ«®Š¥
|
---|
19 | goto exit
|
---|
20 |
|
---|
21 | :start
|
---|
22 | if "%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
|
---|
31 | if "%GLILANG%" == "es" set PROGNAME=Editar conjuntos de metadatos
|
---|
32 | if "%GLILANG%" == "fr" set PROGNAME=Editer les jeux de méta-données
|
---|
33 | if "%GLILANG%" == "ru" set PROGNAME=Ðåäàêòèðîâàòü íàáîðû ìåòàäàííûõ
|
---|
34 | :: if the PROGNAME is still not set, then set the language to English
|
---|
35 | if "%PROGNAME%" == "" set PROGNAME=Greenstone Editor for Metadata Sets
|
---|
36 |
|
---|
37 | if "%PROGABBR%" == "" set PROGABBR=GEMS
|
---|
38 | if "%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
|
---|
42 | call findgsdl.bat
|
---|
43 | if "%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
|
---|
73 | call findjava.bat
|
---|
74 | if "%JAVA_EXECUTABLE%" == "" goto exit
|
---|
75 |
|
---|
76 |
|
---|
77 | :chkGEMS
|
---|
78 | :: ---- Check that the GEMS has been compiled ----
|
---|
79 | if exist "classes/org/greenstone/gatherer/Gatherer.class" goto runGEMS
|
---|
80 | if 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'excuter ce script.
|
---|
90 |
|
---|
91 | if "%GLILANG%" == "ru" echo ë €®«Šë ª®¬¯š«šà®¢ âì %PROGNAME% (šá¯®«ì§ãï makegli.bat)
|
---|
92 | if "%GLILANG%" == "ru" echo ¯¥à¥€ ¢¢®€®¬ í⮣® áªàš¯â
|
---|
93 | goto exit
|
---|
94 |
|
---|
95 |
|
---|
96 | :runGEMS
|
---|
97 | if not "%_VERSION%" == "" (
|
---|
98 | echo Greenstone Major Version:
|
---|
99 | echo %_VERSION%
|
---|
100 | echo.
|
---|
101 | )
|
---|
102 |
|
---|
103 | if not "%GSDL3SRCHOME%" == "" (
|
---|
104 | echo GSDL3SRCHOME:
|
---|
105 | echo !GSDL3SRCHOME!
|
---|
106 | echo.
|
---|
107 | )
|
---|
108 |
|
---|
109 | if not "%GSDL3HOME%" == "" (
|
---|
110 | echo GSDL3HOME:
|
---|
111 | echo !GSDL3HOME!
|
---|
112 | echo.
|
---|
113 | )
|
---|
114 |
|
---|
115 | if not "%GSDLHOME%" == "" (
|
---|
116 | echo GSDLHOME:
|
---|
117 | echo !GSDLHOME!
|
---|
118 | echo.
|
---|
119 | )
|
---|
120 |
|
---|
121 | :: ---- Finally, run the GEMS ----
|
---|
122 | if "%GLILANG%" == "en" echo Running the %PROGNAME%...
|
---|
123 | if "%GLILANG%" == "es" echo Ejecutando la %PROGNAME%...
|
---|
124 | if "%GLILANG%" == "fr" echo Excution de %PROGNAME%
|
---|
125 | if "%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
|
---|
136 | if "%_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
|
---|
137 | if "%_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
|
---|
151 | echo.
|
---|
152 | pause
|
---|
153 | color 07
|
---|
154 | popd
|
---|
155 | :done
|
---|
156 | :: ---- Clean up ----
|
---|
157 | set JAVAPATH=
|
---|
158 | set JAVA_EXECUTABLE=
|
---|
159 | color 07
|
---|
160 | popd
|
---|
161 |
|
---|
162 | endlocal
|
---|