source: gs2-extensions/open-office/trunk/src/setup.bat@ 23654

Last change on this file since 23654 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
Line 
1@echo off
2pushd "%CD%"
3CD /D "%~dp0"
4
5set extdesc=the OpenOffice Extension
6
7if "%OS%" == "Windows_NT" goto WinNT
8if "%OS%" == "" goto Win95
9if "%GSDLLANG%" == "en" echo Setup failed - your PATH has not been set
10if "%GSDLLANG%" == "es" echo No se pudo realizar la configuraci¢n - no se ha establecido la RUTA.
11if "%GSDLLANG%" == "fr" echo Ech‚c de l'installation - votre variable PATH n'a pas ‚t‚ ajust‚e
12if "%GSDLLANG%" == "ru" echo “áâ ­®¢ª  ­¥ ã€ « áì - “’œ ­¥ ¡ë« ãáâ ­®¢«¥­
13goto End
14
15:WinNT
16set GEXT_OPENOFFICE=%CD%
17set PATH=%GEXT_OPENOFFICE%\bin\script;%PATH%
18set GS_CP_SET=yes
19goto Success
20
21:Win95
22if "%1" == "SetEnv" goto Win95Env
23REM We'll invoke a second copy of the command processor to make
24REM sure there's enough environment space
25COMMAND /E:2048 /K %0 SetEnv
26goto End
27
28:Win95Env
29set GEXT_OPENOFFICE=%CD%
30set PATH="%GEXT_OPENOFFICE%\bin\script";"%PATH%"
31set GS_CP_SET=yes
32goto Success
33
34:Success
35
36set fulldir=%~dp0
37
38:: strip off everything up to (and including) ext dir
39set extdir=%fulldir:*ext\=%
40
41:: remove trailing slash
42set extdir=%extdir:\=%
43
44setlocal enabledelayedexpansion
45if "x%GSDLEXTS%" == "x" (
46 set GSDLEXTS=!extdir!
47) else (
48 set GSDLEXTS=!GSDLEXTS!:!extdir!
49)
50endlocal & set GSDLEXTS=%GSDLEXTS%
51
52echo +Your environment is now setup for %extdesc%
53
54:: Back to delayed expansion to avoid problems with environment
55:: variables with brackets in them, such as "Program Files (x86)"
56
57
58:End
59
60popd
Note: See TracBrowser for help on using the repository browser.