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

Last change on this file since 23665 was 23665, checked in by ak19, 12 years ago

More corrections to setup.bat to get it to work with extensions like for OpenOffice and PDFBox: these latest corrections are needed when installing Greenstone in an admin area in a path with spaces.

File size: 5.5 KB
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\perl\bin;!GSDLHOME!\bin\windows;!GSDLHOME!\bin\script;!PATH!
42set GS_CP_SET=yes
43goto Success
44
45:Win95
46if "%1" == "SetEnv" goto Win95Env
47REM We'll invoke a second copy of the command processor to make
48REM sure there's enough environment space
49COMMAND /E:2048 /K %0 SetEnv
50goto End
51
52:Win95Env
53set GSDLHOME=%CD%
54set GSDLOS=windows
55
56REM Override Imagemagick and Ghostscript paths to the bundled applications shipped with greenstone if they exists otherwise use default environment variables.
57if exist "!GSDLHOME!\bin\windows\ghostscript\bin\gsdll32.dll" set GS_DLL="!GSDLHOME!\bin\windows\ghostscript\bin\gsdll32.dll"
58if exist "!GSDLHOME!\bin\windows\ghostscript\lib\*.*" set GS_LIB="!GSDLHOME!\bin\windows\ghostscript\lib"
59if exist "!GSDLHOME!\bin\windows\ghostscript\bin\*.*" set PATH="!GSDLHOME!\bin\windows\ghostscript\bin";"!PATH!"
60if exist "!GSDLHOME!\bin\windows\imagemagick\*.*" set PATH="!GSDLHOME!\bin\windows\imagemagick";"!PATH!"
61
62if "!GS_CP_SET!" == "yes" goto Success
63set PATH="!GSDLHOME!\bin\windows\perl\bin";"!GSDLHOME!\bin\windows";"!GSDLHOME!\bin\script";"!PATH!"
64set GS_CP_SET=yes
65goto Success
66
67
68:Success
69if "!GSDLLANG!" == "en" echo.
70if "!GSDLLANG!" == "en" echo Your environment has successfully been set up to run Greenstone.
71if "!GSDLLANG!" == "en" echo Note that these settings will only have effect within this MS-DOS
72if "!GSDLLANG!" == "en" echo session. You will therefore need to rerun setup.bat if you want
73if "!GSDLLANG!" == "en" echo to run Greenstone programs from a different MS-DOS session.
74if "!GSDLLANG!" == "en" echo.
75
76if "!GSDLLANG!" == "es" echo.
77if "!GSDLLANG!" == "es" echo Su ambiente ha sido configurado para correr los programas Greenstone.
78if "!GSDLLANG!" == "es" echo Recuerde que estos ajustes £nicamente tendr n efecto dentro de esta sesi¢n
79if "!GSDLLANG!" == "es" echo MS-DOS. Por lo tanto deber  ejecutar nuevamente setup.bat si desea
80if "!GSDLLANG!" == "es" echo correr los programas de Greenstone desde una sesi¢n MS-DOS diferente.
81if "!GSDLLANG!" == "es" echo.
82
83if "!GSDLLANG!" == "fr" echo.
84if "!GSDLLANG!" == "fr" echo Votre environnement a ‚t‚ configu‚re avec succŠs pour ex‚cuter Greenstone
85if "!GSDLLANG!" == "fr" echo Notez que ces paramŠtrages n'auront d'effet que dans cette session MS-DOS.
86if "!GSDLLANG!" == "fr" echo Vous devrez par cons‚quent r‚ex‚cuter setup.bat si vous voulez faire
87if "!GSDLLANG!" == "fr" echo lancer des programmes Greenstone dans une autre session MS-DOS.
88if "!GSDLLANG!" == "fr" echo.
89
90if "!GSDLLANG!" == "ru" echo.
91if "!GSDLLANG!" == "ru" echo ‚ è¥ ®ªà㊥­š¥ ¡ë«® ãᯥ譮 ­ áâ஥­®, ç⮡ë ãáâ ­®¢šâì Greenstone Ž¡à âšâ¥
92if "!GSDLLANG!" == "ru" echo ¢­š¬ ­š¥, çâ® íâš ­ §­ ç¥­šï ¡ã€ãâ ⮫쪮 š¬¥âì íä䥪⠢ ¯à¥€¥« å í⮣® MS DOS
93if "!GSDLLANG!" == "ru" echo á¥áášï. ‚ë ¡ã€¥â¥ ¯®í⮬㠀®«Š­ë ¯®¢â®à­® ã¯à ¢«ïâì setup.bat, ¥á«š ‚ë å®âšâ¥
94if "!GSDLLANG!" == "ru" echo ã¯à ¢«ïâì ¯à®£à ¬¬ ¬š ‡¥«ñ­ëå š§¢¥àŠ¥­­ëå ¯®à®€ ®â à §«šç­®© á¥áášš MS DOS.
95if "!GSDLLANG!" == "ru" echo.
96
97:End
98endlocal & set PATH=%PATH%& set GSDLHOME=%GSDLHOME%& set GSDLOS=%GSDLOS%
99
100set savedir=%CD%
101cd "%GSDLHOME%"
102if exist ext (
103 for /D %%e IN ("ext/*") do call :addexts %%e
104)
105cd "%savedir%"
106set savedir=
107goto :doneexts
108
109:addexts
110set folder=%1
111cd "ext\%folder%"
112if EXIST setup.bat call setup.bat
113cd ..\..
114goto :eof
115
116:doneexts
117setlocal enabledelayedexpansion
118
119if exist "%GSDLHOME%\apache-httpd" (
120 echo +Adding in executable path for apache-httpd
121 set PATH=!GSDLHOME!\apache-httpd\!GSDLOS!\bin;!PATH!
122 set PATH=!GSDLHOME!\apache-httpd\!GSDLOS!\lib;!PATH!
123)
124
125if exist "%GSDLHOME%\local" (
126 if exist "!GSDLHOME!\local\setup.bat" (
127 echo.
128 echo Running !GSDLHOME!\local\setup.bat
129 cd "!GSDLHOME!\local"
130 call setup.bat
131 cd "!GSDLHOME!"
132 )
133 set PATH=!GSDLHOME!\local\bin;!PATH!
134)
135
136:: test writability of GSDLHOME
137@call "!GSDLHOME!\bin\script\checkwritability.bat"
138popd
139endlocal & set PATH=%PATH%& set GSDLHOME=%GSDLHOME%& set GSDLOS=%GSDLOS%
Note: See TracBrowser for help on using the repository browser.