1rem *************************************************************
2rem
3rem  Licensed to the Apache Software Foundation (ASF) under one
4rem  or more contributor license agreements.  See the NOTICE file
5rem  distributed with this work for additional information
6rem  regarding copyright ownership.  The ASF licenses this file
7rem  to you under the Apache License, Version 2.0 (the
8rem  "License"); you may not use this file except in compliance
9rem  with the License.  You may obtain a copy of the License at
10rem
11rem    http://www.apache.org/licenses/LICENSE-2.0
12rem
13rem  Unless required by applicable law or agreed to in writing,
14rem  software distributed under the License is distributed on an
15rem  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16rem  KIND, either express or implied.  See the License for the
17rem  specific language governing permissions and limitations
18rem  under the License.
19rem
20rem *************************************************************
21@echo off
22REM This script sets all enviroment variables, which
23REM are necessary for building the examples of the Office Development Kit.
24REM The Script was developed for the operating systems Windows.
25REM The SDK name
26REM Example: @set "OO_SDK_NAME=openoffice4.0_sdk"
27@set "OO_SDK_NAME=<your_input_here>"
28
29REM Installation directory of the Software Development Kit.
30REM Example: @set "OO_SDK_HOME=C:\Program Files\OpenOffice\4\sdk"
31@set "OO_SDK_HOME=<your_input_here>"
32
33REM Office installation directory.
34REM Example: @set "OFFICE_HOME=C:\Program Files\OpenOffice 4"
35@set "OFFICE_HOME=<your_input_here>"
36
37REM Directory of the make command.
38REM Example: @set "OO_SDK_MAKE_HOME=C:\UnxUtils\usr\local\wbin"
39@set "OO_SDK_MAKE_HOME=<your_input_here>"
40
41REM Directory of the zip tool.
42REM Example: @set "OO_SDK_ZIP_HOME=C:\UnxUtils\usr\local\wbin"
43@set "OO_SDK_ZIP_HOME=<your_input_here>"
44
45REM Directory of the cat tool.
46REM Example: @set "OO_SDK_CAT_HOME=C:\UnxUtils\usr\local\wbin"
47@set "OO_SDK_CAT_HOME=<your_input_here>"
48
49REM Directory of the sed tool.
50REM Example: @set "OO_SDK_SED_HOME=C:\UnxUtils\usr\local\wbin"
51@set "OO_SDK_SED_HOME=<your_input_here>"
52
53REM Directory of the C++ compiler.
54REM Example: @set "OO_SDK_CPP_HOME=C:\Program Files\Microsoft Visual Studio 9.0\VC\bin"
55@set "OO_SDK_CPP_HOME=<your_input_here>"
56@set "CPP_MANIFEST=true"
57@set "CPP_WINDOWS_SDK=<your_input_here>"
58
59REM Directory of the C# and VB.NET compilers.
60REM Example: @set "OO_SDK_CLI_HOME=C:\WINXP\Microsoft.NET\Framework\v1.0.3705"
61@set "OO_SDK_CLI_HOME=<your_input_here>"
62
63REM Java SDK installation directory.
64REM Example: @set "OO_SDK_JAVA_HOME=C:\Program Files\Java\jdk1.6.0_05"
65@set "OO_SDK_JAVA_HOME=<your_input_here>"
66
67REM Special output directory
68REM Example: @set "OO_SDK_OUT=C:\openoffice4.0_sdk"
69@set "OO_SDK_OUT=<your_input_here>"
70
71REM Automatic deployment
72REM Example: @set "SDK_AUTO_DEPLOYMENT=YES"
73@set "SDK_AUTO_DEPLOYMENT=YES"
74
75REM Check installation path for the Office Development Kit.
76if not defined OO_SDK_HOME (
77   echo Error: the variable OO_SDK_HOME is missing!
78   goto :error
79 )
80
81
82REM Check installation path for GNU make.
83if not defined OO_SDK_MAKE_HOME (
84   echo Error: the variable OO_SDK_MAKE_HOME is missing!
85   goto :error
86 )
87
88REM Check installation path for the zip tool.
89if not defined OO_SDK_ZIP_HOME (
90   echo Error: the variable OO_SDK_ZIP_HOME is missing!
91   goto :error
92 )
93
94REM Check installation path for the cat tool.
95if not defined OO_SDK_CAT_HOME (
96   echo Error: the variable OO_SDK_CAT_HOME is missing!
97   goto :error
98 )
99
100REM Check installation path for the sed tool.
101if not defined OO_SDK_SED_HOME (
102   echo Error: the variable OO_SDK_SED_HOME is missing!
103   goto :error
104 )
105
106REM Set library path.
107@set "LIB=%OO_SDK_HOME%\lib;%LIB%"
108if defined CPP_WINDOWS_SDK (
109   @set "LIB=%LIB%;%CPP_WINDOWS_SDK%\lib"
110 )
111
112REM Set office program path.
113if defined OFFICE_HOME (
114   @set "OFFICE_PROGRAM_PATH=%OFFICE_HOME%\program"
115 )
116REM Set UNO path, necessary to ensure that the cpp examples using the
117REM new UNO bootstrap mechanism use the configured office installation
118REM (only set when using an Office).
119if defined OFFICE_HOME (
120   @set "UNO_PATH=%OFFICE_PROGRAM_PATH%"
121 )
122
123
124@set "OO_SDK_OFFICE_BIN_DIR=%OFFICE_PROGRAM_PATH%"
125@set "OO_SDK_OFFICE_LIB_DIR=%OFFICE_BASE_PROGRAM_PATH%"
126@set "OO_SDK_OFFICE_JAVA_DIR=%OFFICE_BASE_PROGRAM_PATH%\classes"
127
128REM Set classpath
129@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"
130
131REM Add directory of the SDK tools to the path.
132set "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%"
133
134REM Set PATH appropriate to the output directory
135if defined OO_SDK_OUT (
136   @set "PATH=%OO_SDK_OUT%\WINexample.out\bin;%PATH%"
137 ) else (
138   @set "PATH=%OO_SDK_HOME%\WINexample.out\bin;%PATH%"
139 )
140
141REM Add directory of the Win SDK to the path, if necessary.
142if defined CPP_WINDOWS_SDK (
143   @set "PATH=%CPP_WINDOWS_SDK\bin%;%PATH%"
144   @set "INCLUDE=%CPP_WINDOWS_SDK\Include%;%INCLUDE%"
145)
146REM Add directory of the C# and VB.NET compilers to the path, if necessary.
147if defined OO_SDK_CLI_HOME @set "PATH=%OO_SDK_CLI_HOME%;%PATH%"
148
149REM Add directory of the Java tools to the path, if necessary.
150if defined OO_SDK_JAVA_HOME @set "PATH=%OO_SDK_JAVA_HOME%\bin;%OO_SDK_JAVA_HOME%\jre\bin;%PATH%"
151
152REM Set environment for C++ compiler tools, if necessary.
153if defined OO_SDK_CPP_HOME call "%OO_SDK_CPP_HOME%\VCVARS32.bat"
154
155REM Set tilte to identify the prepared shell.
156title Shell prepared for SDK
157
158REM Prepare shell with all necessary environment variables.
159echo.
160echo  ******************************************************************
161echo  *
162echo  * SDK environment is prepared for Windows
163echo  *
164echo  * SDK = %OO_SDK_HOME%
165echo  * Office = %OFFICE_HOME%
166echo  * Make = %OO_SDK_MAKE_HOME%
167echo  * Zip = %OO_SDK_ZIP_HOME%
168echo  * cat = %OO_SDK_CAT_HOME%
169echo  * sed = %OO_SDK_SED_HOME%
170echo  * C++ Compiler = %OO_SDK_CPP_HOME%
171echo  * C# and VB.NET compilers = %OO_SDK_CLI_HOME%
172echo  * Java = %OO_SDK_JAVA_HOME%
173echo  * Special Output directory = %OO_SDK_OUT%
174echo  * Auto deployment = %SDK_AUTO_DEPLOYMENT%
175echo  *
176echo  ******************************************************************
177echo.
178goto end
179
180 :error
181Error: Please insert the necessary environment variables into the batch file.
182
183 :end
184