Index: /gli/trunk/findjava.bat
===================================================================
--- /gli/trunk/findjava.bat	(revision 19336)
+++ /gli/trunk/findjava.bat	(revision 19336)
@@ -0,0 +1,58 @@
+@echo off
+
+:: Environment Variables passed in: _VERSION and GLILANG
+:: As a result of executing this script, the JAVA_EXECUTABLE variable 
+:: will be set, but only if Perl was found.
+
+
+:findJava
+    if "%_VERSION%" == "2" (
+		set SEARCH4J_EXECUTABLE=%GSDLHOME%\bin\windows\search4j.exe
+		set HINT=%GSDLHOME%\packages\jre
+	)
+    if "%_VERSION%" == "3" (
+		set SEARCH4J_EXECUTABLE=%GSDL3SRCHOME%\bin\search4j.exe
+		set HINT=%GSDL3SRCHOME%\packages\jre
+	)
+    
+    "%SEARCH4J_EXECUTABLE%" -e -m "1.4.0_00" -p "%HINT%" | winutil\setvar.exe JAVA_EXECUTABLE > %TMP%\set_java_executable.bat
+    call "%TMP%\set_java_executable.bat"
+    del "%TMP%\set_java_executable.bat"
+    
+    if "%JAVA_EXECUTABLE%" == "" goto noJava
+    echo Java:
+    echo %JAVA_EXECUTABLE%
+    echo.
+
+:: found java, JAVA_EXECUTABLE env var set, can exit this script
+    goto exit
+
+:noJava
+    echo.
+    if "%GLILANG%" == "en" (
+		echo Failed to locate an appropriate version of Java. You must install a
+    		echo Java Runtime Environment ^(version 1.4 or greater^) before running the
+    		echo Greenstone Librarian Interface.
+	)
+
+    if "%GLILANG%" == "es" (
+		echo No se pudo localizar una versi¢n apropiada de Java. Usted deber 
+    		echo instalar un Ambiente de Ejecuci¢n Java ^(versi¢n 1.4 o superior^)
+    		echo antes de correr la Interfaz de la Biblioteca Digital Greenstone.
+	)
+
+    if "%GLILANG%" == "fr" (
+		echo Une version ad?quate de Java n'a pas pu ?tre localis?e. Vous devez
+    		echo installer un Java Runtime Environment ^(version 1.4 ou sup?rieur^)
+    		echo avant de d?marrer Greenstone Librarian Interface.
+	)
+
+    if "%GLILANG%" == "ru" (
+		echo ¥ ã «®áì ®¯à¥¥«âì ¬¥áâ®­ å®¥­¥ á®®â¢¥âáâ¢ãîé¥© ¢¥àá Java.
+    		echo ?ë ®«­ë ãáâ ­®¢âì Java Runtime Environment ^(¢¥àáî 1.4 « ¢ëè¥^) ¯¥à¥ ¢¢®®¬
+    		echo ¡¡«®â¥ç­®£® ­â¥àä¥©á  Greenstone.
+	)
+    goto exit
+
+:exit
+set SEARCH4J_EXECUTABLE=
Index: /gli/trunk/gli.bat
===================================================================
--- /gli/trunk/gli.bat	(revision 19335)
+++ /gli/trunk/gli.bat	(revision 19336)
@@ -40,25 +40,33 @@
 :findGSDL
 echo.
-if "%GLILANG%" == "en" echo %PROGNAME% (%PROGABBR%)
-if "%GLILANG%" == "en" echo Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato
-if "%GLILANG%" == "en" echo %PROGABBR% comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt
-if "%GLILANG%" == "en" echo This is free software, and you are welcome to redistribute it
-
-if "%GLILANG%" == "es" echo Interfaz de la %PROGNAME% (%PROGNAME_EN% - %PROGABBR%)
-if "%GLILANG%" == "es" echo Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato
-if "%GLILANG%" == "es" echo La Interfaz de la %PROGNAME% NO INCLUYE ABSOLUTAMENTE NINGUNA GARANTÖA.
-if "%GLILANG%" == "es" echo Para mayor informaci¢n vea los trminos de la licencia en LICENSE.txt
-if "%GLILANG%" == "es" echo Este es un software abierto, por lo que lo invitamos a que lo distribuya de forma gratuita
-
-if "%GLILANG%" == "fr" echo Interface du %PROGNAME% (%PROGNAME_EN% - %PROGABBR%)
-if "%GLILANG%" == "fr" echo Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato
-if "%GLILANG%" == "fr" echo %PROGABBR% est fourni sans AUCUNE GARANTIE; pour des dtails, voir LICENSE.txt
-if "%GLILANG%" == "fr" echo Ceci est un logiciel libre, et vous tes invit 
+if "%GLILANG%" == "en" (
+		echo %PROGNAME% ^(%PROGABBR%^)
+		echo Copyright ^(C^) 2008, New Zealand Digital Library Project, University Of Waikato
+		echo %PROGABBR% comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt
+		echo This is free software, and you are welcome to redistribute it
+	)
+
+if "%GLILANG%" == "es" (
+		echo Interfaz de la %PROGNAME% ^(%PROGNAME_EN% - %PROGABBR%^)
+		echo Copyright ^(C^) 2008, New Zealand Digital Library Project, University Of Waikato
+		echo La Interfaz de la %PROGNAME% NO INCLUYE ABSOLUTAMENTE NINGUNA GARANTÖA.
+		echo Para mayor informaci¢n vea los trminos de la licencia en LICENSE.txt
+		echo Este es un software abierto, por lo que lo invitamos a que lo distribuya de forma gratuita
+	)
+
+if "%GLILANG%" == "fr" (
+		echo Interface du %PROGNAME% ^(%PROGNAME_EN% - %PROGABBR%^)
+		echo Copyright ^(C^) 2008, New Zealand Digital Library Project, University Of Waikato
+		echo %PROGABBR% est fourni sans AUCUNE GARANTIE; pour des dtails, voir LICENSE.txt
+		echo Ceci est un logiciel libre, et vous tes invit 
  le redistribuer
-
-if "%GLILANG%" == "ru" echo š¡«š®â¥ç­ë© š­â¥àä¥©á %PROGNAME% (%PROGNAME_EN% - %PROGABBR%)
-if "%GLILANG%" == "ru" echo Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato
-if "%GLILANG%" == "ru" echo  ­¥ € ¥â   ; €¥â «š á¬. ¢ â¥ªáâ¥ LICENSE.TXT
-if "%GLILANG%" == "ru" echo â® - á¢®¡®€­® à á¯à®áâà ­ï¥¬®¥ ¯à®£à ¬¬­®¥ ®¡¥á¯¥ç¥­š¥ š ë ¬®Š¥â¥ à á¯à®áâà ­ïâì ¥£®
+	)
+
+if "%GLILANG%" == "ru" (
+		echo š¡«š®â¥ç­ë© š­â¥àä¥©á %PROGNAME% ^(%PROGNAME_EN% - %PROGABBR%^)
+		echo Copyright ^(C^) 2008, New Zealand Digital Library Project, University Of Waikato
+		echo  ­¥ € ¥â   ; €¥â «š á¬. ¢ â¥ªáâ¥ LICENSE.TXT
+		echo â® - á¢®¡®€­® à á¯à®áâà ­ï¥¬®¥ ¯à®£à ¬¬­®¥ ®¡¥á¯¥ç¥­š¥ š ë ¬®Š¥â¥ à á¯à®áâà ­ïâì ¥£®
+	)
 
 echo.
@@ -182,116 +190,12 @@
 
 
-:findPerl
-::  ---- Check Perl exists ----
-set PERLPATH=
-
-:: Some users may set the above line manually - If you do this, you need to 
-:: make sure that perl is in your path otherwise lucene collections may not 
-:: work
-if not "%PERLPATH%" == "" goto testPerl
-
-    :: Check if Perl is on the search path
-    echo %PATH%| winutil\which.exe perl.exe | winutil\setvar.exe PERLPATH > %TMP%\setperl.bat
-    call %TMP%\setperl.bat
-    del %TMP%\setperl.bat
-    if not "%PERLPATH%" == "" goto testPerl
-
-    :: If not, try GSDLHOME\bin\windows\perl\bin
-    if exist "%GSDLHOME%\bin\windows\perl\bin\perl.exe" goto gsdlPerl
-
-    :: Still haven't found anything, so try looking in the registry (gulp!)
-    type nul > %TMP%\perl.reg
-    regedit /E %TMP%\perl.reg "HKEY_LOCAL_MACHINE\SOFTWARE\Perl"
-    type %TMP%\perl.reg > %TMP%\perl.txt
-    del %TMP%\perl.reg
-
-    winutil\findperl.exe %TMP%\perl.txt | winutil\setvar.exe PERLPATH > %TMP%\setperl.bat
-    del %TMP%\perl.txt
-    call %TMP%\setperl.bat
-    del %TMP%\setperl.bat
-
-    :: If nothing was found in the registry, we're stuck
-    if "%PERLPATH%" == "" goto noPerl
-
-    :: if have found perl in registry, but not in path, then we need to 
-    :: add it to path for lucene stuff.
-    if "%OS%" == "Windows_NT" set PATH=%PATH%;%PERLPATH%
-    if "%OS%" == "" set PATH="%PATH%";"%PERLPATH%"
-    goto testPerl
-
-:gsdlPerl
-    set PERLPATH=%GSDLHOME%\bin\windows\perl\bin
-    	
-:testPerl
-:: Check that a Perl executable has been found
-if not exist "%PERLPATH%\perl.exe" goto noPerl
-echo Perl:
-echo %PERLPATH%
-echo.
-
-goto findJava
-
-:noPerl
-    echo.
-    if "%GLILANG%" == "en" echo The Greenstone Librarian Interface requires Perl in order to operate,
-    if "%GLILANG%" == "en" echo but Perl could not be detected on your system. Please ensure that Perl
-    if "%GLILANG%" == "en" echo is installed and is on your search path, then try again.
-
-    if "%GLILANG%" == "es" echo La Interfaz de la Biblioteca Digital Greenstone requiere Perl para poder
-    if "%GLILANG%" == "es" echo operar, pero ste no aparece en su sistema. Por favor aseg£rese de
-    if "%GLILANG%" == "es" echo que Perl est  instalado y se encuentra en su ruta de b£squeda.
-    if "%GLILANG%" == "es" echo A continuaci¢n ejecute nuevamente este gui¢n.
-
-    if "%GLILANG%" == "fr" echo Greenstone Librarian Interface ncessite perl pour son fonctionnement,
-    if "%GLILANG%" == "fr" echo mais perl n'a pas pu tre dtect dans votre systme. Veuillez vous 
-    if "%GLILANG%" == "fr" echo assurer que perl est install et est spcifi dans votre chemin de 
-    if "%GLILANG%" == "fr" echo recherche, puis redmarrez ce script.
-
-    if "%GLILANG%" == "ru" echo š¡«š®â¥ç­ë© š­â¥àä¥©á Greenstone âà¥¡ã¥â Perl, çâ®¡ë š¬¥âì ¢®§¬®Š­®áâì
-    if "%GLILANG%" == "ru" echo à ¡®â âì, ­® Perl ­¥ ¡ë« ¢ ¢ è¥© ášáâ¥¬¥. ®Š «ã©áâ , ¯®€â¢¥à€šâ¥,
-    if "%GLILANG%" == "ru" echo çâ® Perl ãáâ ­®¢«¥­ š ­ å®€šâáï ­  ¢ è¥¬ ¯ãâš ¯®šáª , § â¥¬
-    if "%GLILANG%" == "ru" echo ¯®¢â®à­®¢¢¥€šâ¥ íâ®â áªàš¯â.
-    goto exit
-
-
-:findJava
-    if "%_VERSION%" == "2" (
-		set SEARCH4J_EXECUTABLE=%GSDLHOME%\bin\windows\search4j.exe
-		set HINT=%GSDLHOME%\packages\jre
-	)
-    if "%_VERSION%" == "3" (
-		set SEARCH4J_EXECUTABLE=%GSDL3SRCHOME%\bin\search4j.exe
-		set HINT=%GSDL3SRCHOME%\packages\jre
-	)
-    
-    "%SEARCH4J_EXECUTABLE%" -e -m "1.4.0_00" -p "%HINT%" | winutil\setvar.exe JAVA_EXECUTABLE > %TMP%\set_java_executable.bat
-    call "%TMP%\set_java_executable.bat"
-    del "%TMP%\set_java_executable.bat"
-    
-    if "%JAVA_EXECUTABLE%" == "" goto noJava
-    echo Java:
-    echo %JAVA_EXECUTABLE%
-    echo.
-
-    goto checkGLI
-
-:noJava
-    echo.
-    if "%GLILANG%" == "en" echo Failed to locate an appropriate version of Java. You must install a
-    if "%GLILANG%" == "en" echo Java Runtime Environment (version 1.4 or greater) before running the
-    if "%GLILANG%" == "en" echo Greenstone Librarian Interface.
-
-    if "%GLILANG%" == "es" echo No se pudo localizar una versi¢n apropiada de Java. Usted deber 
-    if "%GLILANG%" == "es" echo instalar un Ambiente de Ejecuci¢n Java (versi¢n 1.4 o superior)
-    if "%GLILANG%" == "es" echo antes de correr la Interfaz de la Biblioteca Digital Greenstone.
-
-    if "%GLILANG%" == "fr" echo Une version ad?quate de Java n'a pas pu ?tre localis?e. Vous devez
-    if "%GLILANG%" == "fr" echo installer un Java Runtime Environment (version 1.4 ou sup?rieur)
-    if "%GLILANG%" == "fr" echo avant de d?marrer Greenstone Librarian Interface.
-
-    if "%GLILANG%" == "ru" echo ¥ ã «®áì ®¯à¥¥«âì ¬¥áâ®­ å®¥­¥ á®®â¢¥âáâ¢ãîé¥© ¢¥àá Java.
-    if "%GLILANG%" == "ru" echo ?ë ®«­ë ãáâ ­®¢âì Java Runtime Environment (¢¥àáî 1.4 « ¢ëè¥) ¯¥à¥ ¢¢®®¬
-    if "%GLILANG%" == "ru" echo ¡¡«®â¥ç­®£® ­â¥àä¥©á  Greenstone.
-    goto exit
+:: Now need to find Perl. If found, PERLPATH will be set
+call findperl.bat
+if "%PERLPATH%" == "" goto exit
+
+:: Need to find Java. If found, JAVA_EXECUTABLE will be set
+call findjava.bat
+if "%JAVA_EXECUTABLE%" == "" goto exit
+
 
 :checkGLI
