Last change
on this file since 23709 was 23654, checked in by ak19, 13 years ago |
Sam had discovered that env variables in Win Batch files that occur inside round brackets of if-else stmts need to be using setdelayedexpansion (where exclamation marks replace percent signs). Updated this for 3 setup.bat files in the extensions folder.
|
-
Property svn:executable
set to
*
|
File size:
1.5 KB
|
Rev | Line | |
---|
[22228] | 1 | @echo off
|
---|
| 2 | pushd "%CD%"
|
---|
| 3 | CD /D "%~dp0"
|
---|
[22496] | 4 |
|
---|
[22228] | 5 | set extdesc=the OpenOffice Extension
|
---|
| 6 |
|
---|
| 7 | if "%OS%" == "Windows_NT" goto WinNT
|
---|
| 8 | if "%OS%" == "" goto Win95
|
---|
| 9 | if "%GSDLLANG%" == "en" echo Setup failed - your PATH has not been set
|
---|
| 10 | if "%GSDLLANG%" == "es" echo No se pudo realizar la configuraci¢n - no se ha establecido la RUTA.
|
---|
| 11 | if "%GSDLLANG%" == "fr" echo Echc de l'installation - votre variable PATH n'a pas t ajuste
|
---|
| 12 | if "%GSDLLANG%" == "ru" echo áâ ®¢ª ¥ 〠« áì - ¥ ¡ë« ãáâ ®¢«¥
|
---|
| 13 | goto End
|
---|
| 14 |
|
---|
| 15 | :WinNT
|
---|
[22250] | 16 | set GEXT_OPENOFFICE=%CD%
|
---|
| 17 | set PATH=%GEXT_OPENOFFICE%\bin\script;%PATH%
|
---|
[22228] | 18 | set GS_CP_SET=yes
|
---|
| 19 | goto Success
|
---|
| 20 |
|
---|
| 21 | :Win95
|
---|
| 22 | if "%1" == "SetEnv" goto Win95Env
|
---|
| 23 | REM We'll invoke a second copy of the command processor to make
|
---|
| 24 | REM sure there's enough environment space
|
---|
| 25 | COMMAND /E:2048 /K %0 SetEnv
|
---|
| 26 | goto End
|
---|
| 27 |
|
---|
| 28 | :Win95Env
|
---|
[22250] | 29 | set GEXT_OPENOFFICE=%CD%
|
---|
| 30 | set PATH="%GEXT_OPENOFFICE%\bin\script";"%PATH%"
|
---|
[22228] | 31 | set GS_CP_SET=yes
|
---|
| 32 | goto Success
|
---|
| 33 |
|
---|
| 34 | :Success
|
---|
| 35 |
|
---|
[22496] | 36 | set fulldir=%~dp0
|
---|
| 37 |
|
---|
| 38 | :: strip off everything up to (and including) ext dir
|
---|
| 39 | set extdir=%fulldir:*ext\=%
|
---|
| 40 |
|
---|
| 41 | :: remove trailing slash
|
---|
| 42 | set extdir=%extdir:\=%
|
---|
| 43 |
|
---|
[23654] | 44 | setlocal enabledelayedexpansion
|
---|
[22228] | 45 | if "x%GSDLEXTS%" == "x" (
|
---|
[23654] | 46 | set GSDLEXTS=!extdir!
|
---|
[22228] | 47 | ) else (
|
---|
[23654] | 48 | set GSDLEXTS=!GSDLEXTS!:!extdir!
|
---|
[22228] | 49 | )
|
---|
[23654] | 50 | endlocal & set GSDLEXTS=%GSDLEXTS%
|
---|
[22228] | 51 |
|
---|
| 52 | echo +Your environment is now setup for %extdesc%
|
---|
| 53 |
|
---|
[22496] | 54 | :: Back to delayed expansion to avoid problems with environment
|
---|
| 55 | :: variables with brackets in them, such as "Program Files (x86)"
|
---|
| 56 |
|
---|
| 57 |
|
---|
[22228] | 58 | :End
|
---|
| 59 |
|
---|
| 60 | popd |
---|
Note:
See
TracBrowser
for help on using the repository browser.