• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

READMEH A D09-Sep-20136.5 KiB159134

build.batH A D09-Sep-20132.7 KiB7262

db.wxsH A D09-Sep-20137.5 KiB144134

fixup2010.xqH A D09-Sep-2013845 2922

fixupCsharp.xqH A D09-Sep-20131.3 KiB3830

genWix.pyH A D09-Sep-201310.6 KiB317190

generateEnv.xqH A D09-Sep-2013996 3629

generateGroups.xqH A D09-Sep-20131.4 KiB5245

generateWix.shH A D09-Sep-20132.2 KiB8340

links_frag.wxsH A D09-Sep-20133.3 KiB105104

pruneComponents.xqH A D09-Sep-2013567 2216

required_frag.wxsH A D09-Sep-20133.2 KiB111110

s_winmsi.fcnH A D09-Sep-201318.1 KiB579505

wixEnv.xmlH A D09-Sep-2013830 1811

README

1This file describes the software needed to build Windows Binaries
2for Berkeley DB as well as how to ensure that new, renamed
3or deleted files are properly handled.  For that piece, see the end
4of this file.
5
6How to Build Windows Binaries
7-----------------------------
8
9Creation of the Windows binary installation file (db-x.y.z.msi)
10is driven by dist/s_winmsi, dist/winmsi/s_winmsi.fcn
11as well as various configuration files and scripts in dist/winmsi.
12The scripts must be run from a cygwin bash shell.
13Prerequisites:
14o Cygwin
15o Visual Studio (Visual Studio 2005)
16o WiX (version 3.x)
17o Python
18o Java/JDK
19o WiX 3.x
20o XQilla (xqilla command line is used to help construct
21  WiX .wxs files which are in an XML format)
22
23Important: It is necessary to use Python from a Windows installation
24vs Cygwin because of the pathname manipulation.
25
26Build checklist (this normally is only done once when
27setting up your machine):
28
291.  Check dist/winmsi/build.bat to set Visual Studio installation path.
302.  Add Windows Python PATH.  Cygwin's will not work.
313.  Install WiX 3.x and add the installation dir to PATH
32if it is not already set.
334.  Install a recent Java JDK and make sure java and javac
34are in your PATH.  Also modify the proper variables in Visual
35Studio to find jni.h (<JDK installation dir>/include and
36<JDK installation dir>/include/win32).
375.  If changing the release minor version (5.x->5.y), you must change
38UpgradeCode and Upgrade id in db.wxs.  It is a GUID/UUID. You can generate
39a GUID from the Python shell:
40  import uuid
41  uuid.uuid1()
42This GUID is used for upgrade between releases.
436.  From db-x.y.z/dist run "bash s_winmsi"
44
45The "staged" tree for building the binaries is created
46in db-x.y.z/stage.  The resulting .msi ends up in stage/wix.
47
48To test basic installation of the .msi:
49cd <db-x.y.z>/stage/wix
50  msiexec /i db-x.y.z.msi
51Uninstall:
52  msiexec /uninstall db-x.y.z.msi
53  (or use the Control Panel's uninstall programs tool)
54
55
56What is going on under the covers?
57----------------------------------
58
59The order of events can be seen in the s_winmsi script and
60is roughly:
611.  stage source components to be packaged from a clean tree.
62These include examples, doc, project files, and header files.
632.  Build Berkeley DB using winmsi/build.bat.
64This will build the basic library, utilities as well as SQL,
65STL, C#, and SQL's JDBC and ODBC components.
663.  Copy build artifacts (libraries, dlls, pdbs, exes) to
67the staging area.
68NOTE: the staging process also creates lists of files, one for
69each installation "group."  More on this below.
704.  Build "component" lists for WiX.  This process is driven
71by the shell script winmsi/generateWix.sh which also uses a
72Python script (genWix.py) and XQuery Update scripts to construct
73db_components.wxs which contains the majority of the files
74for the binary distribution.  These all end up in the
75stage/wix directory.
765.  Call WiX to generate the db-x.y.z.msi install file
77
78What files drive this process?
79------------------------------
80
81Relatively static WiX files include:
82 o db.wxs ("main" WiX input file that includes the
83    features to be installed).  This file references the
84    components/component groups that are generated in
85    db_components.wxs
86 o links_frag.wxs (references the links that become part of
87    the Windows application menu after installation)
88 o required_frag.wxs (license file, readme and other required
89   bits of installation)
90
91The main generated file is db_components.wxs which is
92created by a combination of the Python script genWix.py,
93group.* files (created by staging process), and XQuery.
94There are several XQuery scripts (dist/winmsi/*.xq) that
95perform various transformations on generated XML to make it
96ready for WiX.  They have internal comments about what they
97are doing.
98
99db_components.wxs has the complete list of files and components
100that are to be part of the install.
101
102How to change what files are included
103-------------------------------------
104
105Many files will be included automatically but some are custom.
106The files included are driven by "group.*" files that are
107created by the functions StageSourceComponents() and StageRuntimeComponents()
108in s_winmsi.fcn.  These put the paths to files in the various
109stage/group.* files based on which "feature" they are a part of.
110E.g. bin/libdb??.dll and bin/*.exe go into "group.runtime"
111and include/* go into "group.devo."  Example files go into
112"group.examples."
113
114After staging the Python script genWix.py walks the staging
115directories looking for files that match those in the group.*
116files and it generates a Component element for each set of
117files that belong to a given group in a given directory.  Let's
118look at the include directory as an example.
119In the resulting file there will be XML that looks like this:
120...
121<Directory Id="dir_include_3" Name="include">
122  <Component DiskId="1" Guid="b2ff36c0-36a8-11df-a6b5-00262db1b537" Id="_group_cxx_3" KeyPath="yes">
123    <File Id="dir_include_3_dbstl_base_iterator.h" Name="dbstl_base_iterator.h" Source="C:\Users\gmf\hg\db-5.0.13\stage\include\dbstl_base_iterator.h"/>
124    <File Id="dir_include_3_dbstl_common.h" Name="dbstl_common.h" Source="C:\Users\gmf\hg\db-5.0.13\stage\include\dbstl_common.h"/>
125    ...
126  </Component
127  <Component DiskId="1" Guid="b2ff5dd1-36a8-11df-bfe6-00262db1b537" Id="_group_devo_3" KeyPath="yes">
128    <File Id="dir_include_3_db.h" Name="db.h" Source="C:\Users\gmf\hg\db-5.0.13\stage\include\db.h"/>
129    <File Id="dir_include_3_db_cxx.h" Name="db_cxx.h" Source="C:\Users\gmf\hg\db-5.0.13\stage\include\db_cxx.h"/>
130  </Component>
131  ...
132</Directory>
133...
134
135The directory "include" has multiple components, one for "group_cxx" that
136includes the STL header files and one for "group_devo" that includes
137db.h and db_cxx.h.
138
139The output of genWix.py is massaged by various XQuery scripts to
140(1) remove stray empty components (2) add in ComponentGroup elements
141that group components into lists for inclusion by Feature
142elements (from db.wxs) and (3) insertion of Environment elements
143to modify Windows environment on install/uninstall.
144
145XQuery is a simple way to manipulate the files because they are XML.
146
147Back to how to change the lists of files...
148The important work is in the StageSourceComponents() an
149StageRuntimeComponents() functions.  That's all that should
150really need to be changed to add/rename/remove files or
151to change which group they are a part of.
152
153I'm seeing warnings when generating the package, what's wrong?
154-------------------------------------
155
156Warnings in "light.exe" that are documented in the WiX manual can be safely
157ignored.  Errors cannot be ignored.
158
159