DEVEL15-cvsignore-updates-20080612
[openafs.git] / README-NT
1 This software has been released under the terms of the IBM Public
2 License.  For details, see the LICENSE file in the top-level source
3 directory or on-line at http://www.openafs.org/dl/license10.html
4
5 The document now provides a step by step procedure that takes the user 
6 from a basic Windows 2000/XP/2003 workstation to an OpenAFS development 
7 environment.   Details are provided so that a 'beginning' windows 
8 developer can build an OpenAFS installable package for Windows 
9 2000/XP/2003/Vista/2008.
10
11 NOTE 1:
12 As of the OpenAFS 1.3 release series, Windows platforms released
13 prior to Windows 2000 are no longer supported.  As of the OpenAFS 1.5
14 series, the Windows 9x components are being removed from the source tree.
15
16 ***********   Windows 2000/XP/2003/Vista/2008 Build Process *************
17
18 Building OpenAFS for Windows requires configuring a Windows
19 development system by installing compilation tools and header files.
20 Open AFS Software development can be done on Windows 2000, XP, 2003, 
21 or Vista.  The target system, where OpenAFS will be installed, can be 
22 one of:
23
24  * Windows 2000
25  * Windows XP
26  * Windows XP SP2
27  * Windows 2003 
28  * Windows 2003 SP1
29  * Windows XP 64
30  * Windows 2003 64
31  * Windows 2003 R2 (32 or 64)
32  * Windows Vista (32 or 64)
33  * Windows 2008 (32 or 64)
34
35 The build process is controlled by a nmake file that generates the 
36 necessary binaries and binds them into an install package.
37
38 The following steps describe how to configure Windows 2000/XP:
39
40    A. Obtain a copy of the OpenAFS Source Tree
41    B. Install Compiler and Development tools.
42    C. Install SDK header files
43    D. Configure NTBUILD.BAT
44    E. Set program version Level
45    F. Build the binaries
46    G. Install NSIS 2.30
47    H. Build NSIS Install Package
48    I. Install Wix 2.0.5325
49    J. Build Wix MSI Install Package
50    K. Final Results
51    L. Optional Items
52         
53 The Microsoft development tools require anywhere from 660 MB to 1.8GB
54 of storage depending on which compilers are selected.  The following 
55 versions are supported:
56
57     Microsoft Visual Studio .NET 
58       available via a MSDN subscription
59
60     Microsoft Visual Studio .NET 2003
61       available via a MSDN subscription
62
63     Microsoft Visual Studio .NET 2005
64       available via a MSDN subscription
65       (recommended - required for 64-bit builds)
66
67     Microsoft Visual Studio 2008 is not supported
68
69 The following Microsoft SDK is required:
70
71     Microsoft Platform SDK for Windows XP SP2 or Server 2003 SP1 or Vista or 2008
72       http://www.microsoft.com/msdownload/platformsdk/sdkupdate/downlevel.htm [IE required]
73       http://www.microsoft.com/msdownload/platformsdk/sdkupdate/XPSP2FULLInstall.htm
74
75 The following Microsoft DDK is required:
76
77     Microsoft Windows Server 2003 SP1 DDK
78       available via a MSDN subscription or via free CD
79       http://www.microsoft.com/whdc/devtools/ddk/orderddkcd.mspx
80
81 The Microsoft HTML Help Workshop is required:
82
83     http://www.microsoft.com/downloads/details.aspx?familyid=00535334-c8a6-452f-9aa0-d597d16580cc&displaylang=en
84
85 The Microsoft Internationalized Domain Names (IDN) Mitigation APIs 1.1 is required:
86
87     http://www.microsoft.com/downloads/details.aspx?FamilyId=AD6158D7-DDBA-416A-9109-07607425A815&displaylang=en
88
89 The NSIS installer requires about 14 MB of storage. The following 
90 version is supported:
91
92     Nullsoft Scriptable Installation System 2.30
93       http://nsis.sourceforge.net/home/
94
95 The WiX installer requires about 18 MB of storage.  The following 
96 version is supported:
97
98     Wix 2.0.5325.0
99       http://prdownloads.sourceforge.net/wix/sources-2.0.5325.0.zip
100
101 The InstallShield scripts (although not supported) require version 5.5
102 of InstallShiled. Version 6.0 or higher of InstallShield are not 
103 compatible.
104
105 The OpenAFS Source directory requires about 360 MB storage. The Source
106 directory size includes additional space for files that will be
107 generated during the build process.
108
109
110 STEP A. Obtain a copy of the Open AFS Source Tree.
111
112 Transfer OpenAFS source tree onto your hardrive.  The source can be
113 downloaded from the OpenAFS web site:
114         http://www.OpenAFS.org/release/snapindex.html.
115
116 For this example, download source for version 1.3.74 using the
117 following URL:
118 http://www.openafs.org/dl/openafs/1.3.74/openafs-1.3.74-src.tar
119
120 HINT: DailySnapShots are pre-release source trees and much more
121 likely to have compilation errors. If this is your first attempt, do
122 your build based on a release version of the source, e.g. 1.3.74. Once
123 you have completed a build process successfully, you can experiment with
124 other source trees.
125
126 You will need an unzip utility that can expand compressed tar files.
127 For example "Pkzip for Windows" from Pkware will uncompress tar files.
128 (http://www.pkware.com/)
129
130 Expand the downloaded tar file (openafs-1.3.74-src.tar) into target
131 directory (c:\OpenAFS), the unzip routine will expand the source into a
132 subdirectory tree:
133     c:\OpenAFS\OpenAFS-1.3.74\src
134
135 Copy the files 'NTMakefile' and 'ntbuild.bat' from 'src' to the OpenAFS 
136 base directory (aka %AFSROOT%):
137
138   From a DOS command prompt window, enter the following copy commands:
139
140     cd c:\OpenAFS\OpenAFS-1.3.74
141     copy src\NTMakefile .
142     copy src\ntbuild.bat .
143
144
145 The OpenAFS base directory should look something like the following:
146
147   c:\OpenAFS\OpenAFS-1.3.74\
148     NTMakefile
149     ntbuild.bat
150     src
151           
152
153 STEP B. Install compiler and development tools.
154
155 Install a copy of Microsoft Visual Studio .NET, Visual Studio .NET 2003, 
156 or Visual Studio .NET 2005.  The "Typical" install setting is sufficient.
157
158 (1) You can reduce the installation size by selecting "Custom" install
159 and remove all but the following Options:
160
161         Microsoft Visual C++
162         Data Access
163
164 (2) When asked, Select to Register Environment Variables.
165
166
167 STEP C. Install SDK header files.
168
169 Files from Microsoft's Platform SDK for Windows XP SP2 or Server 2003 are
170 required to complete a build on Windows 2000/XP/2003.   You can install 
171 the "Core, Data Access and Installer SDKs" from
172
173   http://www.microsoft.com/msdownload/platformsdk/sdkupdate/
174
175 by using Internet Explorer 5.x or higher.  (Active X controls are required)
176 If you do not which to use IE a complete SDK package is available from
177
178   http://www.microsoft.com/msdownload/platformsdk/sdkupdate/XPSP2FULLInstall.htm
179
180 The header files that are required from a Microsoft SDK/DDK are:
181
182    npapi.h    (Windows 2000,XP,2003 builds)
183    netcfgx.h  (NSIS Loopback Adapter installer - Windows 2000,XP,2003 builds)
184    netcfgn.h  (NSIS Loopback Adapter installer - Windows 2000,XP,2003 builds)
185    normalization.h (AFS Cache Manager)
186
187 These files come from the following Microsoft DDKs/SDKs:
188
189    npapi.h:
190         Windows XP SP2 Platform SDK - include/
191
192    netcfgn.h, netcfgx.h:
193         Windows XP/2003 DDK - inc/wxp/
194
195
196    normalization.h:
197         Microsoft IDN Mitigation APIs 1.1 - include/
198
199 STEP D. Configure NTBUILD.BAT.
200
201 The NTBUILD.BAT file copied to the OpenAFS base directory must be 
202 customized for use on your development system.  The following variables
203 must be defined to match your configuration:
204
205   AFSVER_CL: Set to 1200 if using MS Visual C++ 6.0
206              Set to 1300 if using MS Visual Studio .NET
207              Set to 1310 if using MS Visual Studio .NET 2003
208              Set to 1400 if using MS Visual Studio .NET 2005
209
210   MSVCDIR: Set to the short name version of the directory into which
211            the visual C++ compiler was installed regardless of version
212
213   MSVCDIR64: On AMD64 systems, set to the 64-bit visual C++ compiler
214
215   MSSDKDIR: Set to the short name of the directory into which
216             the Platform SDK was installed
217
218   NTDDKDIR: Set to the short name of the INC\WNET DDK directory
219
220   NTDDKDIR2: Set to the short name of the INC\CRT DDK directory
221
222   AFSROOT: Set to the short name of the OpenAFS Base directory.  This
223            cannot be set to a UNC path.
224
225   SYS_NAME: One of "i386_w2k" or "amd64_w2k"
226
227   APPVER:   0x500 for Windows 2000 and above; 0x502 for AMD64 systems
228
229   _WIN32_IE: Must match APPVER
230
231   MSVCVer:  Set to 8.0 if using Visual Studio 8
232
233
234 STEP E. Set version and installation options (optional)
235
236 Add a CellServDB file to install area. CellServDB contains the entries
237 for the various cell names.  You can download a general purpose one
238 from:
239         http://grand.central.org/dl/cellservdb/CellServDB
240 then copy it to %AFSROOT%\src\WINNT\install\NSIS and name it afsdcell.ini
241
242 Edit file %AFSROOT%\src\config\NTMakefile.i386_w2k
243     AFSPRODUCT_VER_MAJOR - Version Major Number
244     AFSPRODUCT_VER_MINOR - Version Minor Number
245     AFSPRODUCT_VER_PATCH - Version Patch Number
246     AFSPRODUCT_VER_BUILD - Version Build Number
247     CELLSERVDB_INSTALL   - The default file name for the CellServDB
248                            included in the install Package.
249     CELLNAME_DEFAULT     - The default home cell name.
250     CELLSERVDB_WEB       - The default web address to obtain CellServDB
251
252 For example: in the file %AFSROOT%\src\config\NTMakefile.i386_nt40 you would
253 see the following:
254
255    AFSPRODUCT_VER_MAJOR=1
256    AFSPRODUCT_VER_MINOR=3
257    AFSPRODUCT_VER_PATCH=7400
258    AFSPRODUCT_VER_BUILD=0
259    CELLNAME_DEFAULT=openafs.org
260    CELLSERVDB_INSTALL=CellServDB.GrandCentral
261    CELLSERVDB_WEB=http://grand.central.org/dl/cellservdb/CellServDB
262
263 During the Open AFS installation process the user will be presented
264 with two choices for the CellServDB: Local copy (CELLSERVDB_INSTALL) and
265 one that can be downloaded from the web (CELLSERVDB_WEB).
266
267 STEP F. Begin the build
268
269 (1) From Windows 2000/XP/2003 open up a DOS prompt window.
270
271 (2) Change to the %AFSROOT% directory
272
273 (3) Configure the environment variables:
274
275     For a release build (SMB version):
276
277     (a) Execute the VCVARS32.BAT or VSVARS32.BAT file which part of the
278         Visual Studio environment you installed.
279
280     (b) Execute the SETENV.BAT file with the parameters "/2000 /RETAIL"
281
282     (c) Execute the NTBUILD.BAT file with the parameter "free"
283
284     For a debug build (SMB version):
285
286     (a) Execute the VCVARS32.BAT or VSVARS32.BAT file which part of the
287         Visual Studio environment you installed.
288
289     (b) Execute the SETENV.BAT file with the parameters "/2000 /DEBUG"
290
291     (c) Execute the NTBUILD.BAT file with the parameter "checked"
292
293 (4) Clean the work area:
294
295     nmake /f NTMakefile clean
296
297 (5) Build the complete Windows 2000/XP/2003 development environment.
298
299     nmake /f NTMakefile install
300
301 While the build is running you will see many compile warnings. This
302 behavior is normal; the build process is successful as long as the build
303 process doesn't terminate with an error ("nmake.exe return code 0x2")
304 and it displays 'Build Finished Successfully'.
305
306
307 STEP G. Install NSIS 2.30 (optional).
308
309 Download the Nullsoft Scriptable Installation System (NSIS) 2.30 from
310
311     http://nsis.sourceforge.net/home/
312
313 Run the nsis-2.30.exe installer and install to "C:\Program Files\NSIS".
314 Then download the large strings build zip file and replace the installed 
315 files with the versions from the zip file.  These versions increase 
316 the maximum string length from 1024 characters to 8192 characters.  
317 This is necessary for installation on systems with long PATH environment 
318 strings.
319
320 Note: The NSIS installer can only be used to produce 32-bit installers.
321
322 STEP H.  Build OpenAFS NSIS install package
323
324 From the %AFSROOT% directory execute:
325
326     nmake /f NTMakefile NSIS
327
328
329 STEP I.  Install Wix MSI Installer
330
331 Download the Wix 2.0.5325.0 installer from 
332
333     http://prdownloads.sourceforge.net/wix/sources-2.0.5325.0.zip
334
335
336 STEP J.  Build Wix MSI install package
337
338 From the %AFSROOT% directory execute:
339
340     nmake /f NTMakefile wix
341
342 Make sure the binaries installed to \src\wix\release\ship are
343 available in the PATH environment variable
344
345
346 STEP K. Final Results
347
348 The build process generates its binaries in %AFSROOT%\DEST. The subdirectory
349 would look like the following:
350
351 %AFSROOT%\DEST\{checked,free}\
352         bin
353         etc
354         include
355         lib
356         root.client
357         root.server
358         WinInstall
359
360     Bin - contains build utilities.
361     root.client - contains Open AFS binaries
362     root.server - contain Open AFS Server binaries
363     WinInstall\OpenAFSforWindows.exe - is the NSIS install package
364     WinInstall\openafs-en_US.msi - is the WiX MSI install package
365
366
367 STEP L. Optional Items
368
369 The build process has an error table that is compiled for many OpenAFS
370 applications.  This table is generated by Unix based tools.  It is not
371 normally necessary to modify this table so pre-generated source files
372 are included in the OpenAFS source.  If you need to make modifications
373 in these areas the Unix base tools that run on Windows can be found on
374 the web. For example:
375
376         http://cygwin.com/
377
378 Below is a short explanation how to update the error table.
379
380 (1) Install flex and bison from a Unix based tool provider.
381
382 (2) Make changes to the source files.
383
384 There are two files in the source tree that are processed with lex
385 and yacc on UNIX systems, src/comerr/et_lex.lex.l and
386 src/comerr/error_table.y, that when processed produce the files
387 et_lex.lex_nt.c, error_table_nt.c, and error_table_nt.h.
388
389 Since NT does not include lex and yacc or any equivalent tools, we
390 have provided the output files that lex and yacc produce (using Win32
391 ports of flex and bison). This will allow builds to work for anyone
392 who does not need to change the .l and .y files.
393
394 If you do need to change et_lex.lex.l, then you will need to install
395 Win32 port of flex on your system. Put flex.exe in a directory on the
396 path and rebuild.
397
398 If you do need to change error_table.y, then you will need to install
399 a Win32 port of bison on your system. Put bison.exe in a directory on
400 the path, configure bison as explained in step 5, and rebuild.
401
402 You can also attempt to use other replacements for lex and yacc. This
403 will require modifying the LEX and YACC settings in
404 /config/NTMakefile.i386_nt40. If the replacements require different
405 command line options than flex and bison, then you may also need to
406 change src/comerr/NTMakefile.
407
408 (3) Generate new OpenAFS binaries