source: main/trunk/greenstone2/setup.bat@ 28759

Last change on this file since 28759 was 28759, checked in by kjdon, 10 years ago

need to call the local setup.bat outside of setlocal commands, otherwise the environment variables aren't set properly. In particular, INCLUDE and LIB, which are needed for c++ compiling, are set by calling vcvarsall.bat in visual studio

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