Creation of the .msi is driven by dist/s_winmsi, dist/winmsi/s_winmsi_dbxml.fcn
(built from s_winmsi_dbxml.fcn.template) and various configuration files and 
scripts in dist/winmsi. The scripts must be run from a cygwin bash shell.
The scripts look for required files and utilities, including:
o Cygwin
o Visual Studio (Visual Studio 2008)
o WiX (uses version 3.0)
o Perl (uses ActivePerl 5.16 now), make sure Perl is installed in a directory without spaces in the PATH, or nmake will fail.
o Python (uses ActivePython 2.7)
o Java 
o XQilla (xqilla command line is used to help construct
  WiX .wxs files which are in an XML format)

Note: 
1. Must use Perl and Python from windows installation but not from Cygwin, otherwise
can not build them. 
2. Be sure there is no Berkeley DB installed in the machine, that may causes
unexpected errors.

To build the msi, do the following:
1. Unpack a release ready source version of dbxml-x.x.x.zip.
2. Start cygwin.
3. Add all the required programs to PATH.
4. Add the path to the Java JDK include and include/win32 directories to INCLUDE.
5. Make sure nmake.exe is in your PATH
6. Change to dbxml-x.x.x/dbxml/dist and execute "sh s_winmsi".  Execution should take about 30 minutes, and the msi will be placed in dbxml-x.x.x/wix.

The order of events can be seen in the s_winmsi script and 
is roughly:
1.  Build BDB XML and dependent libraries (Debug and Release)
   winmsi/build.bat and winmsi/project.list.in drive this
2.  Build Perl and Python
3.  Build "component" lists for WiX.  This process is driven
by the shell script winmsi/generateWix.sh which also uses a
Python script (genWix.py) and XQuery Update scripts to construct
dbxml_components.wxs which contains the majority of the files
for the binary distribution.

Relatively static WiX files include:
 o dbxml.wxs ("main" WiX input file that includes the 
    features to be installed).  This file references the
    components/component groups that are generated in 
    dbxml_components.wxs
 o links_frag.wxs (references the links that become part of
    the Windows application menu after installation)
 o required_frag.wxs (license file, readme and other required
   bits of installation)

Steps of build installer:
1.  Check dist/winmsi/build.bat and src/perl/build.bat, set Visual
Studio installation path.
2.  Add Windows Python and Perl to PATH, make sure the Windows versions
are used and not those from Cygwin or the build will fail.
3.  Add WiX installation dir to PATH.
4.  Set <JDK installation dir>/include and <JDK installation dir>/include/win32 
to environment variable INCLUDE.
5.  Check php_db4.vcproj and php_dbxml.vcproj, make sure 
the "AdditionalIncludeDirectories" and "AdditionalLibraryDirectories" contain
the right PHP source path and PHP library path.  
6.  If changing the major version (2.4.x->2.5.x), you must change 
UpgradeCode and Upgrade id in dbxml.wxs, it is a GUID. You can generate
a GUID form Python shell:
  import uuid
  uuid.uuid1()
This GUID is used for upgrade between patch releases.
7.  Run: bash s_winmsi, under dist. 


The .msi file is built into dbxml-x.y.z/wix/dbxml-x.y.z.msi

Test it this way:
1. Install: msiexec /i blah.msi
 a. Can upgrade patch release (e.g. 2.5.16 -> 2.5.17) - this feature only works after 2.5.16.
 b. Can coexist with another major version installation ( 2.4.x vs 2.5.x).
2. Check bin/lib/jar/python/perl directories, all files are exist.
3. Check dbxml shell can work, smoke test dbxml shell ( run test/dbxml_smoketest).
4. Check Python api can work, run Python examples.
5. Check Perl api can work, run Perl examples.
6. Check Java jars can work, run Java examples in basic/event/misc.
7. Check the environment variable is correct, PATH contains <installdir>/bin, CLASSPATH contains all jars.
8. Uninstall: msiexec /uninstall blah.msi

