Changeset 19336

Show
Ignore:
Timestamp:
06.05.2009 13:17:58 (10 years ago)
Author:
ak19
Message:

client-gli.bat and gli.bat both go through the findjava part of the script, so moved this into a separate scriptfile that can be called by both.

Location:
gli/trunk
Files:
1 added
1 modified

Legend:

Unmodified
Added
Removed
  • gli/trunk/gli.bat

    r18415 r19336  
    4040:findGSDL 
    4141echo. 
    42 if "%GLILANG%" == "en" echo %PROGNAME% (%PROGABBR%) 
    43 if "%GLILANG%" == "en" echo Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato 
    44 if "%GLILANG%" == "en" echo %PROGABBR% comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt 
    45 if "%GLILANG%" == "en" echo This is free software, and you are welcome to redistribute it 
    46  
    47 if "%GLILANG%" == "es" echo Interfaz de la %PROGNAME% (%PROGNAME_EN% - %PROGABBR%) 
    48 if "%GLILANG%" == "es" echo Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato 
    49 if "%GLILANG%" == "es" echo La Interfaz de la %PROGNAME% NO INCLUYE ABSOLUTAMENTE NINGUNA GARANTÖA. 
    50 if "%GLILANG%" == "es" echo Para mayor informaci¢n vea los t‚rminos de la licencia en LICENSE.txt 
    51 if "%GLILANG%" == "es" echo Este es un software abierto, por lo que lo invitamos a que lo distribuya de forma gratuita 
    52  
    53 if "%GLILANG%" == "fr" echo Interface du %PROGNAME% (%PROGNAME_EN% - %PROGABBR%) 
    54 if "%GLILANG%" == "fr" echo Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato 
    55 if "%GLILANG%" == "fr" echo %PROGABBR% est fourni sans AUCUNE GARANTIE; pour des d‚tails, voir LICENSE.txt 
    56 if "%GLILANG%" == "fr" echo Ceci est un logiciel libre, et vous ˆtes invit‚  
     42if "%GLILANG%" == "en" ( 
     43        echo %PROGNAME% ^(%PROGABBR%^) 
     44        echo Copyright ^(C^) 2008, New Zealand Digital Library Project, University Of Waikato 
     45        echo %PROGABBR% comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt 
     46        echo This is free software, and you are welcome to redistribute it 
     47    ) 
     48 
     49if "%GLILANG%" == "es" ( 
     50        echo Interfaz de la %PROGNAME% ^(%PROGNAME_EN% - %PROGABBR%^) 
     51        echo Copyright ^(C^) 2008, New Zealand Digital Library Project, University Of Waikato 
     52        echo La Interfaz de la %PROGNAME% NO INCLUYE ABSOLUTAMENTE NINGUNA GARANTÖA. 
     53        echo Para mayor informaci¢n vea los t‚rminos de la licencia en LICENSE.txt 
     54        echo Este es un software abierto, por lo que lo invitamos a que lo distribuya de forma gratuita 
     55    ) 
     56 
     57if "%GLILANG%" == "fr" ( 
     58        echo Interface du %PROGNAME% ^(%PROGNAME_EN% - %PROGABBR%^) 
     59        echo Copyright ^(C^) 2008, New Zealand Digital Library Project, University Of Waikato 
     60        echo %PROGABBR% est fourni sans AUCUNE GARANTIE; pour des d‚tails, voir LICENSE.txt 
     61        echo Ceci est un logiciel libre, et vous ˆtes invit‚  
    5762 le redistribuer 
    58  
    59 if "%GLILANG%" == "ru" echo š¡«š®â¥ç­ë© š­â¥à䥩á %PROGNAME% (%PROGNAME_EN% - %PROGABBR%) 
    60 if "%GLILANG%" == "ru" echo Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato 
    61 if "%GLILANG%" == "ru" echo ˆƒ ­¥ € ¥â €‘Ž‹ž’Ž ˆŠ€Šˆ• ƒ€€’ˆ‰; €¥â «š á¬. ¢ ⥪á⥠LICENSE.TXT 
    62 if "%GLILANG%" == "ru" echo â® - ᢮¡®€­® à á¯à®áâ࠭塞®¥ ¯à®£à ¬¬­®¥ ®¡¥á¯¥ç¥­š¥ š ‚ë ¬®Š¥â¥ à á¯à®áâà ­ïâì ¥£® 
     63    ) 
     64 
     65if "%GLILANG%" == "ru" ( 
     66        echo š¡«š®â¥ç­ë© š­â¥à䥩á %PROGNAME% ^(%PROGNAME_EN% - %PROGABBR%^) 
     67        echo Copyright ^(C^) 2008, New Zealand Digital Library Project, University Of Waikato 
     68        echo ˆƒ ­¥ € ¥â €‘Ž‹ž’Ž ˆŠ€Šˆ• ƒ€€’ˆ‰; €¥â «š á¬. ¢ ⥪á⥠LICENSE.TXT 
     69        echo â® - ᢮¡®€­® à á¯à®áâ࠭塞®¥ ¯à®£à ¬¬­®¥ ®¡¥á¯¥ç¥­š¥ š ‚ë ¬®Š¥â¥ à á¯à®áâà ­ïâì ¥£® 
     70    ) 
    6371 
    6472echo. 
     
    182190 
    183191 
    184 :findPerl 
    185 ::  ---- Check Perl exists ---- 
    186 set PERLPATH= 
    187  
    188 :: Some users may set the above line manually - If you do this, you need to  
    189 :: make sure that perl is in your path otherwise lucene collections may not  
    190 :: work 
    191 if not "%PERLPATH%" == "" goto testPerl 
    192  
    193     :: Check if Perl is on the search path 
    194     echo %PATH%| winutil\which.exe perl.exe | winutil\setvar.exe PERLPATH > %TMP%\setperl.bat 
    195     call %TMP%\setperl.bat 
    196     del %TMP%\setperl.bat 
    197     if not "%PERLPATH%" == "" goto testPerl 
    198  
    199     :: If not, try GSDLHOME\bin\windows\perl\bin 
    200     if exist "%GSDLHOME%\bin\windows\perl\bin\perl.exe" goto gsdlPerl 
    201  
    202     :: Still haven't found anything, so try looking in the registry (gulp!) 
    203     type nul > %TMP%\perl.reg 
    204     regedit /E %TMP%\perl.reg "HKEY_LOCAL_MACHINE\SOFTWARE\Perl" 
    205     type %TMP%\perl.reg > %TMP%\perl.txt 
    206     del %TMP%\perl.reg 
    207  
    208     winutil\findperl.exe %TMP%\perl.txt | winutil\setvar.exe PERLPATH > %TMP%\setperl.bat 
    209     del %TMP%\perl.txt 
    210     call %TMP%\setperl.bat 
    211     del %TMP%\setperl.bat 
    212  
    213     :: If nothing was found in the registry, we're stuck 
    214     if "%PERLPATH%" == "" goto noPerl 
    215  
    216     :: if have found perl in registry, but not in path, then we need to  
    217     :: add it to path for lucene stuff. 
    218     if "%OS%" == "Windows_NT" set PATH=%PATH%;%PERLPATH% 
    219     if "%OS%" == "" set PATH="%PATH%";"%PERLPATH%" 
    220     goto testPerl 
    221  
    222 :gsdlPerl 
    223     set PERLPATH=%GSDLHOME%\bin\windows\perl\bin 
    224          
    225 :testPerl 
    226 :: Check that a Perl executable has been found 
    227 if not exist "%PERLPATH%\perl.exe" goto noPerl 
    228 echo Perl: 
    229 echo %PERLPATH% 
    230 echo. 
    231  
    232 goto findJava 
    233  
    234 :noPerl 
    235     echo. 
    236     if "%GLILANG%" == "en" echo The Greenstone Librarian Interface requires Perl in order to operate, 
    237     if "%GLILANG%" == "en" echo but Perl could not be detected on your system. Please ensure that Perl 
    238     if "%GLILANG%" == "en" echo is installed and is on your search path, then try again. 
    239  
    240     if "%GLILANG%" == "es" echo La Interfaz de la Biblioteca Digital Greenstone requiere Perl para poder 
    241     if "%GLILANG%" == "es" echo operar, pero ‚ste no aparece en su sistema. Por favor aseg£rese de 
    242     if "%GLILANG%" == "es" echo que Perl est  instalado y se encuentra en su ruta de b£squeda. 
    243     if "%GLILANG%" == "es" echo A continuaci¢n ejecute nuevamente este gui¢n. 
    244  
    245     if "%GLILANG%" == "fr" echo Greenstone Librarian Interface n‚cessite perl pour son fonctionnement, 
    246     if "%GLILANG%" == "fr" echo mais perl n'a pas pu ˆtre d‚tect‚ dans votre systŠme. Veuillez vous  
    247     if "%GLILANG%" == "fr" echo assurer que perl est install‚ et est sp‚cifi‚ dans votre chemin de  
    248     if "%GLILANG%" == "fr" echo recherche, puis red‚marrez ce script. 
    249  
    250     if "%GLILANG%" == "ru" echo š¡«š®â¥ç­ë© š­â¥à䥩á Greenstone âॡã¥â Perl, çâ®¡ë š¬¥âì ¢®§¬®Š­®áâì 
    251     if "%GLILANG%" == "ru" echo à ¡®â âì, ­® Perl ­¥ ¡ë« ¢ ¢ è¥© ášá⥬¥. ®Š «ã©áâ , ¯®€â¢¥à€šâ¥, 
    252     if "%GLILANG%" == "ru" echo çâ® Perl ãáâ ­®¢«¥­ š ­ å®€šâáï ­  ¢ è¥¬ ¯ãâš ¯®šáª , § â¥¬ 
    253     if "%GLILANG%" == "ru" echo ¯®¢â®à­®¢¢¥€šâ¥ íâ®â áªàš¯â. 
    254     goto exit 
    255  
    256  
    257 :findJava 
    258     if "%_VERSION%" == "2" ( 
    259         set SEARCH4J_EXECUTABLE=%GSDLHOME%\bin\windows\search4j.exe 
    260         set HINT=%GSDLHOME%\packages\jre 
    261     ) 
    262     if "%_VERSION%" == "3" ( 
    263         set SEARCH4J_EXECUTABLE=%GSDL3SRCHOME%\bin\search4j.exe 
    264         set HINT=%GSDL3SRCHOME%\packages\jre 
    265     ) 
    266      
    267     "%SEARCH4J_EXECUTABLE%" -e -m "1.4.0_00" -p "%HINT%" | winutil\setvar.exe JAVA_EXECUTABLE > %TMP%\set_java_executable.bat 
    268     call "%TMP%\set_java_executable.bat" 
    269     del "%TMP%\set_java_executable.bat" 
    270      
    271     if "%JAVA_EXECUTABLE%" == "" goto noJava 
    272     echo Java: 
    273     echo %JAVA_EXECUTABLE% 
    274     echo. 
    275  
    276     goto checkGLI 
    277  
    278 :noJava 
    279     echo. 
    280     if "%GLILANG%" == "en" echo Failed to locate an appropriate version of Java. You must install a 
    281     if "%GLILANG%" == "en" echo Java Runtime Environment (version 1.4 or greater) before running the 
    282     if "%GLILANG%" == "en" echo Greenstone Librarian Interface. 
    283  
    284     if "%GLILANG%" == "es" echo No se pudo localizar una versi¢n apropiada de Java. Usted deber  
    285     if "%GLILANG%" == "es" echo instalar un Ambiente de Ejecuci¢n Java (versi¢n 1.4 o superior) 
    286     if "%GLILANG%" == "es" echo antes de correr la Interfaz de la Biblioteca Digital Greenstone. 
    287  
    288     if "%GLILANG%" == "fr" echo Une version ad?quate de Java n'a pas pu ?tre localis?e. Vous devez 
    289     if "%GLILANG%" == "fr" echo installer un Java Runtime Environment (version 1.4 ou sup?rieur) 
    290     if "%GLILANG%" == "fr" echo avant de d?marrer Greenstone Librarian Interface. 
    291  
    292     if "%GLILANG%" == "ru" echo ¥ 〠«®áì ®¯à¥€¥«šâì ¬¥áâ®­ 宊€¥­š¥ ᮮ⢥âáâ¢ãî饩 ¢¥àᚚ Java. 
    293     if "%GLILANG%" == "ru" echo ?ë €®«Š­ë ãáâ ­®¢šâì Java Runtime Environment (¢¥àášî 1.4 š«š ¢ëè¥) ¯¥à¥€ ¢¢®€®¬ 
    294     if "%GLILANG%" == "ru" echo ¡š¡«š®â¥ç­®£® š­â¥àä¥©á  Greenstone. 
    295     goto exit 
     192:: Now need to find Perl. If found, PERLPATH will be set 
     193call findperl.bat 
     194if "%PERLPATH%" == "" goto exit 
     195 
     196:: Need to find Java. If found, JAVA_EXECUTABLE will be set 
     197call findjava.bat 
     198if "%JAVA_EXECUTABLE%" == "" goto exit 
     199 
    296200 
    297201:checkGLI