Ignore:
Timestamp:
2010-06-28T15:30:56+12:00 (14 years ago)
Author:
ak19
Message:

Added enabledelayedexpansion to setup.bat so that it will now work when PATH has brackets in it

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/setup.bat

    r18968 r22318  
    11@echo off
     2
     3setlocal enabledelayedexpansion
     4
    25pushd "%CD%"
    36CD /D "%~dp0"
     
    1720echo.
    1821
    19 if "%OS%" == "Windows_NT" goto WinNT
    20 if "%OS%" == "" goto Win95
    21 if "%GSDLLANG%" == "en" echo Setup failed - your PATH has not been set
    22 if "%GSDLLANG%" == "es" echo No se pudo realizar la configuraci¢n - no se ha establecido la RUTA.
    23 if "%GSDLLANG%" == "fr" echo Ech‚c de l'installation - votre variable PATH n'a pas ‚t‚ ajust‚e
    24 if "%GSDLLANG%" == "ru" echo “áâ ­®¢ª  ­¥ 〠« áì - “’œ ­¥ ¡ë« ãáâ ­®¢«¥­
     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 “áâ ­®¢ª  ­¥ 〠« áì - “’œ ­¥ ¡ë« ãáâ ­®¢«¥­
    2528goto End
    2629
     
    3033
    3134REM Override Imagemagick and Ghostscript paths to the bundled applications shipped with greenstone if they exists otherwise use default environment variables.
    32 if exist "%GSDLHOME%\bin\windows\ghostscript\bin\gsdll32.dll" set GS_DLL=%GSDLHOME%\bin\windows\ghostscript\bin\gsdll32.dll
    33 if exist "%GSDLHOME%\bin\windows\ghostscript\lib\*.*" set GS_LIB=%GSDLHOME%\bin\windows\ghostscript\lib
    34 if exist "%GSDLHOME%\bin\windows\ghostscript\bin\*.*" set PATH=%GSDLHOME%\bin\windows\ghostscript\bin;%PATH%
    35 if exist "%GSDLHOME%\bin\windows\imagemagick\*.*" set PATH=%GSDLHOME%\bin\windows\imagemagick;%PATH%
     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!
    3639
    37 if "%GS_CP_SET%" == "yes" goto Success
    38 set PATH=%GSDLHOME%\bin\windows\perl\bin;%GSDLHOME%\bin\windows;%GSDLHOME%\bin\script;%PATH%
     40if "!GS_CP_SET!" == "yes" goto Success
     41set PATH=!GSDLHOME!\bin\windows\perl\bin;!GSDLHOME!\bin\windows;!GSDLHOME!\bin\script;!PATH!
    3942set GS_CP_SET=yes
    4043goto Success
     
    5255
    5356REM Override Imagemagick and Ghostscript paths to the bundled applications shipped with greenstone if they exists otherwise use default environment variables.
    54 if exist "%GSDLHOME%\bin\windows\ghostscript\bin\gsdll32.dll" set GS_DLL="%GSDLHOME%\bin\windows\ghostscript\bin\gsdll32.dll"
    55 if exist "%GSDLHOME%\bin\windows\ghostscript\lib\*.*" set GS_LIB="%GSDLHOME%\bin\windows\ghostscript\lib"
    56 if exist "%GSDLHOME%\bin\windows\ghostscript\bin\*.*" set PATH="%GSDLHOME%\bin\windows\ghostscript\bin";"%PATH%"
    57 if exist "%GSDLHOME%\bin\windows\imagemagick\*.*" set PATH="%GSDLHOME%\bin\windows\imagemagick";"%PATH%"
     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!"
    5861
    59 if "%GS_CP_SET%" == "yes" goto Success
    60 set PATH="%GSDLHOME%\bin\windows\perl\bin";"%GSDLHOME%\bin\windows";"%GSDLHOME%\bin\script";"%PATH%"
     62if "!GS_CP_SET!" == "yes" goto Success
     63set PATH="!GSDLHOME!\bin\windows\perl\bin";"!GSDLHOME!\bin\windows";"!GSDLHOME!\bin\script";"!PATH!"
    6164set GS_CP_SET=yes
    6265goto Success
     
    6467
    6568:Success
    66 if "%GSDLLANG%" == "en" echo.
    67 if "%GSDLLANG%" == "en" echo Your environment has successfully been set up to run Greenstone.
    68 if "%GSDLLANG%" == "en" echo Note that these settings will only have effect within this MS-DOS
    69 if "%GSDLLANG%" == "en" echo session. You will therefore need to rerun setup.bat if you want
    70 if "%GSDLLANG%" == "en" echo to run Greenstone programs from a different MS-DOS session.
    71 if "%GSDLLANG%" == "en" echo.
     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.
    7275
    73 if "%GSDLLANG%" == "es" echo.
    74 if "%GSDLLANG%" == "es" echo Su ambiente ha sido configurado para correr los programas Greenstone.
    75 if "%GSDLLANG%" == "es" echo Recuerde que estos ajustes £nicamente tendr n efecto dentro de esta sesi¢n
    76 if "%GSDLLANG%" == "es" echo MS-DOS. Por lo tanto deber  ejecutar nuevamente setup.bat si desea
    77 if "%GSDLLANG%" == "es" echo correr los programas de Greenstone desde una sesi¢n MS-DOS diferente.
    78 if "%GSDLLANG%" == "es" echo.
     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.
    7982
    80 if "%GSDLLANG%" == "fr" echo.
    81 if "%GSDLLANG%" == "fr" echo Votre environnement a ‚t‚ configu‚re avec succŠs pour ex‚cuter Greenstone
    82 if "%GSDLLANG%" == "fr" echo Notez que ces paramŠtrages n'auront d'effet que dans cette session MS-DOS.
    83 if "%GSDLLANG%" == "fr" echo Vous devrez par cons‚quent r‚ex‚cuter setup.bat si vous voulez faire
    84 if "%GSDLLANG%" == "fr" echo lancer des programmes Greenstone dans une autre session MS-DOS.
    85 if "%GSDLLANG%" == "fr" echo.
     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.
    8689
    87 if "%GSDLLANG%" == "ru" echo.
    88 if "%GSDLLANG%" == "ru" echo ‚ è¥ ®ªà㊥­š¥ ¡ë«® ãᯥ譮 ­ áâ஥­®, ç⮡ë ãáâ ­®¢šâì Greenstone Ž¡à âšâ¥
    89 if "%GSDLLANG%" == "ru" echo ¢­š¬ ­š¥, çâ® íâš ­ §­ ç¥­šï ¡ã€ãâ ⮫쪮 š¬¥âì íä䥪⠢ ¯à¥€¥« å í⮣® MS DOS
    90 if "%GSDLLANG%" == "ru" echo á¥áášï. ‚ë ¡ã€¥â¥ ¯®í⮬㠀®«Š­ë ¯®¢â®à­® ã¯à ¢«ïâì setup.bat, ¥á«š ‚ë å®âšâ¥
    91 if "%GSDLLANG%" == "ru" echo ã¯à ¢«ïâì ¯à®£à ¬¬ ¬š ‡¥«ñ­ëå š§¢¥àŠ¥­­ëå ¯®à®€ ®â à §«šç­®© á¥áášš MS DOS.
    92 if "%GSDLLANG%" == "ru" echo.
     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.
    9396
    9497:End
     
    104107if exist apache-httpd (
    105108  echo Adding in executable path for apache-httpd
    106   set PATH=%GSDLHOME%\apache-httpd\%GSDLOS%\bin;%PATH%
     109  set PATH=!GSDLHOME!\apache-httpd\!GSDLOS!\bin;!PATH!
    107110)
    108111
     
    115118    cd ..
    116119  )
    117   set PATH=%GSDLHOME%\local\bin;%PATH%
     120  set PATH=!GSDLHOME!\local\bin;!PATH!
    118121)
    119122
    120123:: test writability of GSDLHOME
    121 @call "%GSDLHOME%\bin\script\checkwritability.bat"
     124@call "!GSDLHOME!\bin\script\checkwritability.bat"
    122125popd
     126
     127endlocal & set PATH=%PATH%& set GSDLHOME=%GSDLHOME%
Note: See TracChangeset for help on using the changeset viewer.