4 # Note: The s_winmsi script in Berkeley DB core closely parallels the
5 # s_winmsi script in Berkeley DB/XML. If you change one,
6 # consider whether your changes apply to the other.
7 # As of this writing, the two s_winmsi scripts 'diff' very closely, and
8 # identical portions have been factored into functions in s_winmsi.fcn.
10 # Usage: s_winmsi [ options ]
12 # See the Usage() function in s_winmsi.fcn for a full list of options.
13 # By default, this script expects a db-X.Y.Z.zip file
14 # to be in this directory, and uses it to build all binaries
15 # needed for an Windows install, and finally builds the an
16 # output db-X.Y.Z.msi file that can be installed on
17 # Windows XP and 2000.
19 # The major other inputs to this script are these files:
21 # features.in list of choosable features (like Java,PHP,...)
22 # files.in what files are in each feature and where they belong
23 # links.in a list of URLs that end up as part of the Start Menu
24 # environment.in a list of environment vars that must be set
26 # This script does a number of operations, using the directory
27 # './winmsi/stage' as a staging area:
29 # extracts the contents of the input ZIP file and uses those
30 # files (minus docs/...) to build a Sources directory for
31 # the Sources features.
33 # builds Berkeley DB using Visual Studio tools using a .BAT
34 # script derived from winbuild.in .
36 # builds Perl and other APIs .
38 # uses {features,files,links,environment}.in to build some include
39 # files in WiX XML format. These files are named
40 # *.wixinc (e.g. directory.wixinc)
42 # run m4 on dbcorewix.in to create dbcore.wxs . dbcorewix.in
43 # uses m4 macros to allow reasonable refactoring of repeated
44 # UI code. Also, m4 is used to include the files created in
47 # Use the WiX compiler/linker on the .wxs files to create the .msi file.
49 ################################################################
51 # Define all needed shell functions
52 . ./winmsi/s_winmsi.fcn
57 # Do this before parsing options, we need the version number
61 # Set variables used by functions to customize this installer
62 PRODUCT_NAME="Berkeley DB"
63 PRODUCT_VERSION="$DB_VERSION"
64 PRODUCT_STAGE=`pwd`/winmsi/stage
65 PRODUCT_LICENSEDIR="${PRODUCT_STAGE}/$dbver"
66 PRODUCT_SUB_BLDDIR="${PRODUCT_STAGE}/$dbver"
67 PRODUCT_BLDDIR="${PRODUCT_STAGE}/$dbver"
68 PRODUCT_SRCDIR="${PRODUCT_STAGE}/$dbver"
69 PRODUCT_DBBUILDDIR="${PRODUCT_STAGE}/$dbver/build_unix"
70 PRODUCT_SHARED_WINMSIDIR=`pwd`/winmsi
71 PRODUCT_IMAGEDIR=$PRODUCT_SHARED_WINMSIDIR/images
72 PRODUCT_ZIP_FILEFMT="db-X.Y.Z.zip"
73 PRODUCT_MSI_FILEFMT="db-X.Y.Z.msi"
74 PRODUCT_MSVC_VERSION=71
76 PRODUCT_MAJOR=`echo "$PRODUCT_VERSION" | \
77 sed -e 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\1/'`
78 PRODUCT_MINOR=`echo "$PRODUCT_VERSION" | \
79 sed -e 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\2/'`
80 PRODUCT_PATCH=`echo "$PRODUCT_VERSION" | \
81 sed -e 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\3/'`
82 PRODUCT_MAJMIN="${PRODUCT_MAJOR}${PRODUCT_MINOR}"
84 # Gather command line options, and use reasonable defaults
87 -output "$dbver.msi" \
90 if [ "$OPT_USEBUILD" != '' ]; then
91 PRODUCT_BLDDIR="${OPT_USEBUILD}"
92 PRODUCT_SUB_BLDDIR="${OPT_USEBUILD}"
95 # Choose the MS runtime libraries to use.
96 if [ -e "/cygdrive/c/Program Files/Microsoft Visual Studio 8/Common7/Tools/vsvars32.bat" ]; then
97 MSVC_ROOT_DIR="/cygdrive/c/Program Files/Microsoft Visual Studio 8/"
98 PRODUCT_MSVC_VERSION=80
101 Progress "s_winmsi starting, errors to $ERRORLOG"
103 # Fail fast for certain missing files
115 CreateSources ${PRODUCT_STAGE}/Sources
117 # The docs are put into a separate feature set
118 mv ${PRODUCT_STAGE}/Sources/docs ${PRODUCT_STAGE}/
120 # Build everything unless we were told to use a preexisting build
121 if [ "$OPT_USEBUILD" = '' ]; then
125 ${PRODUCT_SUB_BLDDIR}/installed_include \
126 ${PRODUCT_SUB_BLDDIR}/dbinc/* \
127 ${PRODUCT_SUB_BLDDIR}/dbinc_auto/* \
128 ${PRODUCT_SUB_BLDDIR}/build_windows/*.h \
129 ${PRODUCT_SUB_BLDDIR}/stl/*.h
133 if ! "$OPT_SKIPGEN" ; then
134 CreateLicenseRtf ../../../LICENSE license.rtf
135 CreateWixIncludeFiles
138 CreateMsi ../dbcorewix.in dbcore.wxs "$OPT_OUTFILE"
140 Progress "s_winmsi finished, $OPT_OUTFILE created."