root/main/trunk/gli/client-gli.bat @ 24893

Revision 24829, 4.8 KB (checked in by ak19, 8 years ago)

Changes to bat files and perl code to deal with brackets in (Windows) filepath. Also checked winmake.bat files to see if changes were needed there. These changes go together with the commits 24826 to 24828 for gems.bat, and commit 24820 on makegs2.bat.

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