source: main/trunk/gli/findperl.bat@ 29822

Last change on this file since 29822 was 25678, checked in by davidb, 12 years ago

Added svn:executable property

  • Property svn:executable set to *
File size: 3.3 KB
Line 
1@echo off
2
3:: Environment Variables passed in: GSLDHOME, OS, GLILANG
4:: As a result of executing this script, the PERLPATH variable
5:: will be set, but only if Perl was found.
6
7:findPerl
8:: ---- Check Perl exists ----
9set PERLPATH=
10
11:: Some users may set the above line manually - If you do this, you need to
12:: make sure that perl is in your path otherwise lucene collections may not
13:: work
14if not "%PERLPATH%" == "" goto testPerl
15 :: Check if Perl is on the search path
16 echo %PATH%| winutil\which.exe perl.exe | winutil\setvar.exe PERLPATH > %TMP%\setperl.bat
17 call %TMP%\setperl.bat
18 del %TMP%\setperl.bat
19 if not "%PERLPATH%" == "" goto testPerl
20
21 :: If not, try GSDLHOME\bin\windows\perl\bin
22 if exist "%GSDLHOME%\bin\windows\perl\bin\perl.exe" goto gsdlPerl
23
24 :: Still haven't found anything, so try looking in the registry (gulp!)
25 type nul > %TMP%\perl.reg
26 regedit /E %TMP%\perl.reg "HKEY_LOCAL_MACHINE\SOFTWARE\Perl"
27 type %TMP%\perl.reg > %TMP%\perl.txt
28 del %TMP%\perl.reg
29
30 winutil\findperl.exe %TMP%\perl.txt | winutil\setvar.exe PERLPATH > %TMP%\setperl.bat
31 del %TMP%\perl.txt
32 call %TMP%\setperl.bat
33 del %TMP%\setperl.bat
34
35 :: If nothing was found in the registry, we're stuck
36 if "%PERLPATH%" == "" goto noPerl
37
38 :: if have found perl in registry, but not in path, then we need to
39 :: add it to path for lucene stuff.
40 if "%OS%" == "Windows_NT" set PATH=%PATH%;%PERLPATH%
41 if "%OS%" == "" set PATH="%PATH%";"%PERLPATH%"
42 goto testPerl
43
44:gsdlPerl
45 set PERLPATH=%GSDLHOME%\bin\windows\perl\bin
46
47:testPerl
48:: Check that a Perl executable has been found
49if not exist "%PERLPATH%\perl.exe" goto noPerl
50echo Perl:
51echo %PERLPATH%
52echo.
53
54:: found perl, perlpath set, can exit this script
55goto exit
56
57
58:noPerl
59 echo.
60 if "%GLILANG%" == "en" echo The Greenstone Librarian Interface requires Perl in order to operate,
61 if "%GLILANG%" == "en" echo but Perl could not be detected on your system. Please ensure that Perl
62 if "%GLILANG%" == "en" echo is installed and is on your search path, then try again.
63
64 if "%GLILANG%" == "es" echo La Interfaz de la Biblioteca Digital Greenstone requiere Perl para poder
65 if "%GLILANG%" == "es" echo operar, pero ‚ste no aparece en su sistema. Por favor aseg£rese de
66 if "%GLILANG%" == "es" echo que Perl est  instalado y se encuentra en su ruta de b£squeda.
67 if "%GLILANG%" == "es" echo A continuaci¢n ejecute nuevamente este gui¢n.
68
69 if "%GLILANG%" == "fr" echo Greenstone Librarian Interface n‚cessite perl pour son fonctionnement,
70 if "%GLILANG%" == "fr" echo mais perl n'a pas pu ˆtre d‚tect‚ dans votre systŠme. Veuillez vous
71 if "%GLILANG%" == "fr" echo assurer que perl est install‚ et est sp‚cifi‚ dans votre chemin de
72 if "%GLILANG%" == "fr" echo recherche, puis red‚marrez ce script.
73
74 if "%GLILANG%" == "ru" echo š¡«š®â¥ç­ë© š­â¥à䥩á Greenstone âॡã¥â Perl, çâ®¡ë š¬¥âì ¢®§¬®Š­®áâì
75 if "%GLILANG%" == "ru" echo à ¡®â âì, ­® Perl ­¥ ¡ë« ¢ ¢ è¥© ášá⥬¥. ®Š «ã©áâ , ¯®€â¢¥à€šâ¥,
76 if "%GLILANG%" == "ru" echo çâ® Perl ãáâ ­®¢«¥­ š ­ å®€šâáï ­  ¢ è¥¬ ¯ãâš ¯®šáª , § â¥¬
77 if "%GLILANG%" == "ru" echo ¯®¢â®à­®¢¢¥€šâ¥ íâ®â áªàš¯â.
78 goto exit
79
80:exit
81
82
83
84
85
Note: See TracBrowser for help on using the repository browser.