xref: /trunk/main/odk/setsdkenv_windows.template (revision 7477dbb9)
1@echo off
2REM This script sets all enviroment variables, which
3REM are necessary for building the examples of the Office Development Kit.
4REM The Script was developed for the operating systems Windows.
5REM The SDK name
6REM Example: @set "OO_SDK_NAME=openoffice4.0_sdk"
7@set "OO_SDK_NAME=<your_input_here>"
8
9REM Installation directory of the Software Development Kit.
10REM Example: @set "OO_SDK_HOME=C:\Program Files\OpenOffice\4\sdk"
11@set "OO_SDK_HOME=<your_input_here>"
12
13REM Office installation directory.
14REM Example: @set "OFFICE_HOME=C:\Program Files\OpenOffice 4"
15@set "OFFICE_HOME=<your_input_here>"
16
17REM Directory of the make command.
18REM Example: @set "OO_SDK_MAKE_HOME=C:\UnxUtils\usr\local\wbin"
19@set "OO_SDK_MAKE_HOME=<your_input_here>"
20
21REM Directory of the zip tool.
22REM Example: @set "OO_SDK_ZIP_HOME=C:\UnxUtils\usr\local\wbin"
23@set "OO_SDK_ZIP_HOME=<your_input_here>"
24
25REM Directory of the cat tool.
26REM Example: @set "OO_SDK_CAT_HOME=C:\UnxUtils\usr\local\wbin"
27@set "OO_SDK_CAT_HOME=<your_input_here>"
28
29REM Directory of the sed tool.
30REM Example: @set "OO_SDK_SED_HOME=C:\UnxUtils\usr\local\wbin"
31@set "OO_SDK_SED_HOME=<your_input_here>"
32
33REM Directory of the C++ compiler.
34REM Example: @set "OO_SDK_CPP_HOME=C:\Program Files\Microsoft Visual Studio 9.0\VC\bin"
35@set "OO_SDK_CPP_HOME=<your_input_here>"
36@set "CPP_MANIFEST=true"
37@set "CPP_WINDOWS_SDK=<your_input_here>"
38
39REM Directory of the C# and VB.NET compilers.
40REM Example: @set "OO_SDK_CLI_HOME=C:\WINXP\Microsoft.NET\Framework\v1.0.3705"
41@set "OO_SDK_CLI_HOME=<your_input_here>"
42
43REM Java SDK installation directory.
44REM Example: @set "OO_SDK_JAVA_HOME=C:\Program Files\Java\jdk1.6.0_05"
45@set "OO_SDK_JAVA_HOME=<your_input_here>"
46
47REM Special output directory
48REM Example: @set "OO_SDK_OUT=C:\openoffice4.0_sdk"
49@set "OO_SDK_OUT=<your_input_here>"
50
51REM Automatic deployment
52REM Example: @set "SDK_AUTO_DEPLOYMENT=YES"
53@set "SDK_AUTO_DEPLOYMENT=YES"
54
55REM Check installation path for the Office Development Kit.
56if not defined OO_SDK_HOME (
57   echo Error: the variable OO_SDK_HOME is missing!
58   goto :error
59 )
60
61
62REM Check installation path for GNU make.
63if not defined OO_SDK_MAKE_HOME (
64   echo Error: the variable OO_SDK_MAKE_HOME is missing!
65   goto :error
66 )
67
68REM Check installation path for the zip tool.
69if not defined OO_SDK_ZIP_HOME (
70   echo Error: the variable OO_SDK_ZIP_HOME is missing!
71   goto :error
72 )
73
74REM Check installation path for the cat tool.
75if not defined OO_SDK_CAT_HOME (
76   echo Error: the variable OO_SDK_CAT_HOME is missing!
77   goto :error
78 )
79
80REM Check installation path for the sed tool.
81if not defined OO_SDK_SED_HOME (
82   echo Error: the variable OO_SDK_SED_HOME is missing!
83   goto :error
84 )
85
86REM Set library path.
87@set "LIB=%OO_SDK_HOME%\lib;%LIB%"
88if defined CPP_WINDOWS_SDK (
89   @set "LIB=%LIB%;%CPP_WINDOWS_SDK%\lib"
90 )
91
92REM Set office program path.
93if defined OFFICE_HOME (
94   @set "OFFICE_PROGRAM_PATH=%OFFICE_HOME%\program"
95 )
96REM Set UNO path, necessary to ensure that the cpp examples using the
97REM new UNO bootstrap mechanism use the configured office installation
98REM (only set when using an Office).
99if defined OFFICE_HOME (
100   @set "UNO_PATH=%OFFICE_PROGRAM_PATH%"
101 )
102
103
104@set "OO_SDK_OFFICE_BIN_DIR=%OFFICE_PROGRAM_PATH%"
105@set "OO_SDK_OFFICE_LIB_DIR=%OFFICE_BASE_PROGRAM_PATH%"
106@set "OO_SDK_OFFICE_JAVA_DIR=%OFFICE_BASE_PROGRAM_PATH%\classes"
107
108REM Set classpath
109@set "CLASSPATH=%OO_SDK_OFFICE_JAVA_DIR%\juh.jar;%OO_SDK_OFFICE_JAVA_DIR%\jurt.jar;%OO_SDK_OFFICE_JAVA_DIR%\ridl.jar;%OO_SDK_OFFICE_JAVA_DIR%\unoloader.jar;%OO_SDK_OFFICE_JAVA_DIR%\unoil.jar"
110
111REM Add directory of the SDK tools to the path.
112set "PATH=%OO_SDK_HOME%\bin;%OO_SDK_OFFICE_BIN_DIR%;%OO_SDK_OFFICE_BIN_DIR%;%OO_SDK_HOME%\WINexample.out\bin;%OO_SDK_MAKE_HOME%;%OO_SDK_ZIP_HOME%;%OO_SDK_CAT_HOME%;%OO_SDK_SED_HOME%;%PATH%"
113
114REM Set PATH appropriate to the output directory
115if defined OO_SDK_OUT (
116   @set "PATH=%OO_SDK_OUT%\WINexample.out\bin;%PATH%"
117 ) else (
118   @set "PATH=%OO_SDK_HOME%\WINexample.out\bin;%PATH%"
119 )
120
121REM Add directory of the Win SDK to the path, if necessary.
122if defined CPP_WINDOWS_SDK (
123   @set "PATH=%CPP_WINDOWS_SDK\bin%;%PATH%"
124   @set "INCLUDE=%CPP_WINDOWS_SDK\Include%;%INCLUDE%"
125)
126REM Add directory of the C# and VB.NET compilers to the path, if necessary.
127if defined OO_SDK_CLI_HOME @set "PATH=%OO_SDK_CLI_HOME%;%PATH%"
128
129REM Add directory of the Java tools to the path, if necessary.
130if defined OO_SDK_JAVA_HOME @set "PATH=%OO_SDK_JAVA_HOME%\bin;%OO_SDK_JAVA_HOME%\jre\bin;%PATH%"
131
132REM Set environment for C++ compiler tools, if necessary.
133if defined OO_SDK_CPP_HOME call "%OO_SDK_CPP_HOME%\VCVARS32.bat"
134
135REM Set tilte to identify the prepared shell.
136title Shell prepared for SDK
137
138REM Prepare shell with all necessary environment variables.
139echo.
140echo  ******************************************************************
141echo  *
142echo  * SDK environment is prepared for Windows
143echo  *
144echo  * SDK = %OO_SDK_HOME%
145echo  * Office = %OFFICE_HOME%
146echo  * Make = %OO_SDK_MAKE_HOME%
147echo  * Zip = %OO_SDK_ZIP_HOME%
148echo  * cat = %OO_SDK_CAT_HOME%
149echo  * sed = %OO_SDK_SED_HOME%
150echo  * C++ Compiler = %OO_SDK_CPP_HOME%
151echo  * C# and VB.NET compilers = %OO_SDK_CLI_HOME%
152echo  * Java = %OO_SDK_JAVA_HOME%
153echo  * Special Output directory = %OO_SDK_OUT%
154echo  * Auto deployment = %SDK_AUTO_DEPLOYMENT%
155echo  *
156echo  ******************************************************************
157echo.
158goto end
159
160 :error
161Error: Please insert the necessary environment variables into the batch file.
162
163 :end
164