1 | @echo off
|
---|
2 | setlocal enabledelayedexpansion
|
---|
3 |
|
---|
4 | pushd "%CD%"
|
---|
5 | CD /D "%~dp0"
|
---|
6 | set GLILANG=en
|
---|
7 | set GLIMODE=client
|
---|
8 |
|
---|
9 | if "%PROGNAME%" == "" set PROGNAME=Greenstone
|
---|
10 |
|
---|
11 | if not "%PROGFULLNAME%" == "" goto setvars
|
---|
12 | if "%GLILANG%" == "es" set PROGFULLNAME="Biblioteca Digital Greenstone"
|
---|
13 | if "%GLILANG%" == "fr" set PROGFULLNAME="Bibliothécaire Greenstone"
|
---|
14 | if "%GLILANG%" == "ru" set PROGFULLNAME="ÉÎÔÅÒÆÅÊÓ Greenstone"
|
---|
15 | :: if the PROGFULLNAME is still not set, then set the language to English
|
---|
16 | if "%PROGFULLNAME%" == "" set PROGNAME=Greenstone Digital Library
|
---|
17 |
|
---|
18 |
|
---|
19 | :setvars
|
---|
20 | if "%PROGABBR%" == "" set PROGABBR=GLI
|
---|
21 | if "%PROGNAME_EN%" == "" set PROGNAME_EN=Greenstone Librarian Interface
|
---|
22 |
|
---|
23 | :: -------- Run the Greenstone Librarian Interface --------
|
---|
24 |
|
---|
25 | :: This script must be run from within the directory in which it lives
|
---|
26 | if exist client-gli.bat goto start
|
---|
27 | if "%GLILANG%" == "en" echo This script must be run from the directory in which it resides.
|
---|
28 | if "%GLILANG%" == "es" echo Este gui¢n deber ejecutarse desde el directorio en el que reside.
|
---|
29 | if "%GLILANG%" == "fr" echo Ce script doit tre excut
|
---|
30 | partir du rpertoire dans lequel il se trouve.
|
---|
31 | if "%GLILANG%" == "ru" echo â®â áªàš¯â €®«Š¥ ¡ëâì ¢§ïâ š§ €šà¥ªâ®àšš, ¢ ª®â®à®© ® à ᯮ«®Š¥
|
---|
32 | goto exit
|
---|
33 |
|
---|
34 | :start
|
---|
35 | if "%OS%" == "Windows_NT" goto findGSDL
|
---|
36 | :: Invoke a new command processor to ensure there's enough environment space
|
---|
37 | if "%1" == "Second" goto findGSDL
|
---|
38 | command /E:2048 /C %0 Second %1 %2 %3 %4 %5 %6 %7 %8 %9
|
---|
39 | goto done
|
---|
40 |
|
---|
41 | :findGSDL
|
---|
42 | :: Try to detect a local GSDLHOME installation (gs2build). If none can be
|
---|
43 | :: found, then client-gli won't have a download panel. We're calling
|
---|
44 | :: findgsdl.bat purely for knowing if there's a GSDLHOME around and to set and
|
---|
45 | :: use that for downloading. If there IS a local GSDLHOME, then we can download
|
---|
46 | :: (and build) locally, but ONLY if we have perl. Else downloading and building
|
---|
47 | :: will have to be done remotely anyway. If Perl is found, PERLPATH will be set.
|
---|
48 | call findgsdl.bat
|
---|
49 | if "%GSDLHOME%" == "" goto findJava
|
---|
50 | call findperl.bat
|
---|
51 |
|
---|
52 | :findJava
|
---|
53 | :: Need to find Java. If found, JAVA_EXECUTABLE will be set
|
---|
54 | call findjava.bat
|
---|
55 | if "%JAVA_EXECUTABLE%" == "" goto exit
|
---|
56 |
|
---|
57 | :checkGLI
|
---|
58 | :: ---- Check that the GLI has been compiled ----
|
---|
59 | if exist "classes/org/greenstone/gatherer/Gatherer.class" goto runGLI
|
---|
60 | if exist "GLI.jar" goto runGLI
|
---|
61 | echo.
|
---|
62 | if "%GLILANG%" == "en" echo You need to compile the %PROGNAME_EN% (using makegli.bat)
|
---|
63 | if "%GLILANG%" == "en" echo before running this script.
|
---|
64 |
|
---|
65 | if "%GLILANG%" == "es" echo Usted necesita compilar la Interfaz de la %PROGFULLNAME%
|
---|
66 | if "%GLILANG%" == "es" echo (por medio de makegli.bat) antes de ejecutar este gui¢n.
|
---|
67 |
|
---|
68 | if "%GLILANG%" == "fr" echo Vous devez compiler le %PROGNAME% Interface (en utilisant makegil.bat)
|
---|
69 | if "%GLILANG%" == "fr" echo avant d'excuter ce script.
|
---|
70 |
|
---|
71 | if "%GLILANG%" == "ru" echo ë €®«Šë ª®¬¯š«šà®¢ âì ¡š¡«š®â¥çë© šâ¥à䥩á %PROGNAME% (šá¯®«ì§ãï makegli.bat)
|
---|
72 | if "%GLILANG%" == "ru" echo ¯¥à¥€ ¢¢®€®¬ í⮣® áªàš¯â
|
---|
73 | goto exit
|
---|
74 |
|
---|
75 |
|
---|
76 | :runGLI
|
---|
77 | :: ---- Finally, run the GLI ----
|
---|
78 | echo.
|
---|
79 |
|
---|
80 |
|
---|
81 | if "%GLILANG%" == "en" echo Running the %PROGNAME_EN%...
|
---|
82 | if "%GLILANG%" == "es" echo Ejecutando la Interfaz de la %PROGFULLNAME%...
|
---|
83 | if "%GLILANG%" == "fr" echo Excution de %PROGNAME_EN%
|
---|
84 | if "%GLILANG%" == "ru" echo ¥ªãéš© ¡š¡«š®â¥çë© šâ¥à䥩á %PROGNAME%...
|
---|
85 |
|
---|
86 | :: -Xms32M To set minimum memory
|
---|
87 | :: -Xmx32M To set maximum memory
|
---|
88 | :: -verbose:gc To set garbage collection messages
|
---|
89 | :: -Xincgc For incremental garbage collection
|
---|
90 | :: -Xprof Function call profiling
|
---|
91 | :: -Xloggc:<file> Write garbage collection log
|
---|
92 |
|
---|
93 |
|
---|
94 | :: If there's a local GS2 installation (GSDLHOME set), we'd have looked for Perl. If we had
|
---|
95 | :: found Perl, PERLPATH would have been set. If no perl, can't download or build locally on
|
---|
96 | :: the client side. If we have Perl, pass in GSDLHOME for the -gsdl option and the PERLPATH.
|
---|
97 | if "%PERLPATH%" == "" goto nogsdl
|
---|
98 | echo Perl and GSDLHOME (!GSDLHOME!) detected. Downloading is enabled.
|
---|
99 | echo.
|
---|
100 | "%JAVA_EXECUTABLE%" -Xmx128M -cp classes/;GLI.jar;lib/apache.jar;lib/jna.jar;lib/jna-platform.jar;lib/qfslib.jar;lib/rsyntaxtextarea.jar org.greenstone.gatherer.GathererProg -use_remote_greenstone -gsdl "%GSDLHOME%" -perl "%PERLPATH%" %1 %2 %3 %4 %5 %6 %7 %8 %9
|
---|
101 | goto finish
|
---|
102 |
|
---|
103 | :nogsdl
|
---|
104 | echo Since there's no GSDLHOME, client-GLI's download panel will be deactivated.
|
---|
105 | "%JAVA_EXECUTABLE%" -Xmx128M -cp classes/;GLI.jar;lib/apache.jar;lib/jna.jar;lib/jna-platform.jar;lib/qfslib.jar;lib/rsyntaxtextarea.jar org.greenstone.gatherer.GathererProg -use_remote_greenstone %1 %2 %3 %4 %5 %6 %7 %8 %9
|
---|
106 |
|
---|
107 | :finish
|
---|
108 | if "%GLILANG%" == "en" echo Done!
|
---|
109 | if "%GLILANG%" == "es" echo Hecho!
|
---|
110 | if "%GLILANG%" == "fr" echo Termin!
|
---|
111 | if "%GLILANG%" == "ru" echo 믮«¥®!
|
---|
112 | goto done
|
---|
113 |
|
---|
114 | :exit
|
---|
115 | echo.
|
---|
116 | pause
|
---|
117 |
|
---|
118 | :done
|
---|
119 | :: ---- Clean up ----
|
---|
120 | set PERLPATH=
|
---|
121 | set JAVA_EXECUTABLE=
|
---|
122 | set GLIMODE=
|
---|
123 | set PROGNAME=
|
---|
124 | set PROGNAME_EN=
|
---|
125 | set PROGFULLNAME=
|
---|
126 | set PROGABBR=
|
---|
127 | popd
|
---|
128 | endlocal
|
---|