root/main/trunk/greenstone2/setup.bat @ 24363

Revision 24363, 5.8 KB (checked in by ak19, 9 years ago)

The method of locating perl has changed once more: util.pm now defines the fuction get_perl_exec which is used by other scripts to obtain the path to the perl executable they should use. On Windows, setup.bat sets up the PERLPATH env var to the perl included with Greenstone when working with binaries. The same is done for Linux for symmetry, although perl is not included with GS in a linux GS binary at present.

Line 
1@echo off
2
3setlocal enabledelayedexpansion
4
5pushd "%CD%"
6CD /D "%~dp0"
7set GSDLLANG=en
8
9echo.
10echo.
11echo  ####                        #
12echo ##                           #
13echo #     ###  ##   ##  ### ### ###  ##  ###  ##
14echo #   # #   #### #### # # ##   #  #  # # # ####
15echo ##  # #   #    #    # #   #  #  #  # # # #
16echo  #### #    ###  ### # # ###  ##  ##  # #  ###
17echo (C) 2008, New Zealand Digital Library Project
18echo.
19echo.
20echo.
21
22if "!OS!" == "Windows_NT" goto WinNT
23if "!OS!" == "" goto Win95
24if "!GSDLLANG!" == "en" echo Setup failed - your PATH has not been set
25if "!GSDLLANG!" == "es" echo No se pudo realizar la configuraci¢n - no se ha establecido la RUTA.
26if "!GSDLLANG!" == "fr" echo Ech‚c de l'installation - votre variable PATH n'a pas ‚t‚ ajust‚e
27if "!GSDLLANG!" == "ru" echo “áâ ­®¢ª  ­¥ 〠« áì - “’œ ­¥ ¡ë« ãáâ ­®¢«¥­
28goto End
29
30:WinNT
31set GSDLHOME=%CD%
32set GSDLOS=windows
33
34REM Override Imagemagick and Ghostscript paths to the bundled applications shipped with greenstone if they exists otherwise use default environment variables.
35if exist "!GSDLHOME!\bin\windows\ghostscript\bin\gsdll32.dll" set GS_DLL=!GSDLHOME!\bin\windows\ghostscript\bin\gsdll32.dll
36if exist "!GSDLHOME!\bin\windows\ghostscript\lib\*.*" set GS_LIB=!GSDLHOME!\bin\windows\ghostscript\lib
37if exist "!GSDLHOME!\bin\windows\ghostscript\bin\*.*" set PATH=!GSDLHOME!\bin\windows\ghostscript\bin;!PATH!
38if exist "!GSDLHOME!\bin\windows\imagemagick\*.*" set PATH=!GSDLHOME!\bin\windows\imagemagick;!PATH!
39
40if "!GS_CP_SET!" == "yes" goto Success
41set PATH=!GSDLHOME!\bin\windows;!GSDLHOME!\bin\script;!PATH!
42if exist "!GSDLHOME!\bin\windows\perl\bin" (
43    set PERLPATH=!GSDLHOME!\bin\windows\perl\bin
44    set PATH=!PERLPATH!;!GSDLHOME!\bin\windows;!GSDLHOME!\bin\script;!PATH!
45)
46
47set GS_CP_SET=yes
48goto Success
49
50:Win95
51if "%1" == "SetEnv" goto Win95Env
52REM We'll invoke a second copy of the command processor to make
53REM sure there's enough environment space
54COMMAND /E:2048 /K %0 SetEnv
55goto End
56
57:Win95Env
58set GSDLHOME=%CD%
59set GSDLOS=windows
60
61REM Override Imagemagick and Ghostscript paths to the bundled applications shipped with greenstone if they exists otherwise use default environment variables.
62if exist "!GSDLHOME!\bin\windows\ghostscript\bin\gsdll32.dll" set GS_DLL="!GSDLHOME!\bin\windows\ghostscript\bin\gsdll32.dll"
63if exist "!GSDLHOME!\bin\windows\ghostscript\lib\*.*" set GS_LIB="!GSDLHOME!\bin\windows\ghostscript\lib"
64if exist "!GSDLHOME!\bin\windows\ghostscript\bin\*.*" set PATH="!GSDLHOME!\bin\windows\ghostscript\bin";"!PATH!"
65if exist "!GSDLHOME!\bin\windows\imagemagick\*.*" set PATH="!GSDLHOME!\bin\windows\imagemagick";"!PATH!"
66
67if "!GS_CP_SET!" == "yes" goto Success
68set PATH=!GSDLHOME!\bin\windows;!GSDLHOME!\bin\script;!PATH!
69if exist "!GSDLHOME!\bin\windows\perl\bin" (
70    set PERLPATH=!GSDLHOME!\bin\windows\perl\bin
71    set PATH=!PERLPATH!;!GSDLHOME!\bin\windows;!GSDLHOME!\bin\script;!PATH!
72)
73set GS_CP_SET=yes
74goto Success
75
76
77:Success
78if "!GSDLLANG!" == "en" echo.
79if "!GSDLLANG!" == "en" echo Your environment has successfully been set up to run Greenstone.
80if "!GSDLLANG!" == "en" echo Note that these settings will only have effect within this MS-DOS
81if "!GSDLLANG!" == "en" echo session. You will therefore need to rerun setup.bat if you want
82if "!GSDLLANG!" == "en" echo to run Greenstone programs from a different MS-DOS session.
83if "!GSDLLANG!" == "en" echo.
84
85if "!GSDLLANG!" == "es" echo.
86if "!GSDLLANG!" == "es" echo Su ambiente ha sido configurado para correr los programas Greenstone.
87if "!GSDLLANG!" == "es" echo Recuerde que estos ajustes £nicamente tendr n efecto dentro de esta sesi¢n
88if "!GSDLLANG!" == "es" echo MS-DOS. Por lo tanto deber  ejecutar nuevamente setup.bat si desea
89if "!GSDLLANG!" == "es" echo correr los programas de Greenstone desde una sesi¢n MS-DOS diferente.
90if "!GSDLLANG!" == "es" echo.
91
92if "!GSDLLANG!" == "fr" echo.
93if "!GSDLLANG!" == "fr" echo Votre environnement a ‚t‚ configu‚re avec succŠs pour ex‚cuter Greenstone
94if "!GSDLLANG!" == "fr" echo Notez que ces paramŠtrages n'auront d'effet que dans cette session MS-DOS.
95if "!GSDLLANG!" == "fr" echo Vous devrez par cons‚quent r‚ex‚cuter setup.bat si vous voulez faire
96if "!GSDLLANG!" == "fr" echo lancer des programmes Greenstone dans une autre session MS-DOS.
97if "!GSDLLANG!" == "fr" echo.
98
99if "!GSDLLANG!" == "ru" echo.
100if "!GSDLLANG!" == "ru" echo ‚ è¥ ®ªà㊥­š¥ ¡ë«® ãᯥ譮 ­ áâ஥­®, ç⮡ë ãáâ ­®¢šâì Greenstone Ž¡à âšâ¥
101if "!GSDLLANG!" == "ru" echo ¢­š¬ ­š¥, çâ® íâš ­ §­ ç¥­šï ¡ã€ãâ ⮫쪮 š¬¥âì íä䥪⠢ ¯à¥€¥« å í⮣® MS DOS
102if "!GSDLLANG!" == "ru" echo á¥áášï. ‚ë ¡ã€¥â¥ ¯®í⮬㠀®«Š­ë ¯®¢â®à­® ã¯à ¢«ïâì setup.bat, ¥á«š ‚ë å®âšâ¥
103if "!GSDLLANG!" == "ru" echo ã¯à ¢«ïâì ¯à®£à ¬¬ ¬š ‡¥«ñ­ëå š§¢¥àŠ¥­­ëå ¯®à®€ ®â à §«šç­®© á¥áášš MS DOS.
104if "!GSDLLANG!" == "ru" echo.
105
106:End
107endlocal & set PATH=%PATH%& set GSDLHOME=%GSDLHOME%& set GSDLOS=%GSDLOS%
108
109set savedir=%CD%
110cd "%GSDLHOME%"
111if exist ext ( 
112    for /D %%e IN ("ext/*") do call :addexts %%e
113)
114cd "%savedir%"
115set savedir=
116goto :doneexts
117
118:addexts
119set folder=%1
120cd "ext\%folder%"       
121if EXIST setup.bat call setup.bat
122cd ..\..
123goto :eof
124
125:doneexts
126setlocal enabledelayedexpansion
127
128if exist "%GSDLHOME%\apache-httpd" (
129  echo +Adding in executable path for apache-httpd
130  set PATH=!GSDLHOME!\apache-httpd\!GSDLOS!\bin;!PATH!
131  set PATH=!GSDLHOME!\apache-httpd\!GSDLOS!\lib;!PATH!
132)
133
134if exist "%GSDLHOME%\local" (
135  if exist "!GSDLHOME!\local\setup.bat" (
136    echo.
137    echo Running !GSDLHOME!\local\setup.bat
138    cd "!GSDLHOME!\local"
139    call setup.bat
140    cd "!GSDLHOME!"
141  )
142  set PATH=!GSDLHOME!\local\bin;!PATH!
143)
144
145:: test writability of GSDLHOME
146@call "!GSDLHOME!\bin\script\checkwritability.bat"
147popd
148endlocal & set PATH=%PATH%& set GSDLHOME=%GSDLHOME%& set GSDLOS=%GSDLOS%
Note: See TracBrowser for help on using the browser.