source: main/trunk/gli/client-gli.bat@ 31639

Last change on this file since 31639 was 24829, checked in by ak19, 12 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
File size: 4.8 KB
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‚ …
30 partir du r‚pertoire dans lequel il se trouve.
31 if "%GLILANG%" == "ru" echo â®â áªàš¯â €®«Š¥­ ¡ëâì ¢§ïâ š§ €šà¥ªâ®àšš, ¢ ª®â®à®© ®­ à á¯®«®Š¥­
32 goto exit
33
34:start
35if "%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.
48call findgsdl.bat
49if "%GSDLHOME%" == "" goto findJava
50 call findperl.bat
51
52:findJava
53:: Need to find Java. If found, JAVA_EXECUTABLE will be set
54call findjava.bat
55if "%JAVA_EXECUTABLE%" == "" goto exit
56
57:checkGLI
58:: ---- Check that the GLI has been compiled ----
59if exist "classes/org/greenstone/gatherer/Gatherer.class" goto runGLI
60if 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'ex‚cuter 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 ----
78echo.
79
80
81if "%GLILANG%" == "en" echo Running the %PROGNAME_EN%...
82if "%GLILANG%" == "es" echo Ejecutando la Interfaz de la %PROGFULLNAME%...
83if "%GLILANG%" == "fr" echo Ex‚cution de %PROGNAME_EN%
84if "%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.
97if "%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/qfslib.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
104echo 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/qfslib.jar org.greenstone.gatherer.GathererProg -use_remote_greenstone %1 %2 %3 %4 %5 %6 %7 %8 %9
106
107:finish
108if "%GLILANG%" == "en" echo Done!
109if "%GLILANG%" == "es" echo ­Hecho!
110if "%GLILANG%" == "fr" echo Termin‚!
111if "%GLILANG%" == "ru" echo ‚믮«­¥­®!
112goto done
113
114:exit
115echo.
116pause
117
118:done
119:: ---- Clean up ----
120set PERLPATH=
121set JAVA_EXECUTABLE=
122set GLIMODE=
123set PROGNAME=
124set PROGNAME_EN=
125set PROGFULLNAME=
126set PROGABBR=
127popd
128endlocal
Note: See TracBrowser for help on using the repository browser.