PDA

View Full Version : Custom bootstrappers with updated package codes


BillMcLean
08-25-2008, 09:47 PM
In the Build Settings dialog, there is the option for building a Standard and Custom bootstrapper. The Standard option does everything including providing the bootstrap builder with the correct package code from the Summary Information from the MSI file just built. However it seems to newly create both the bootstrap_config.xml and the bootstrapper_main.lua, making this unsuitable for custom work.

When building a Custom bootstrapper, you need to specify the packagecode on a custom commandline. In order to get the most current packagecode from the MSI, the MSI has to be built first. After the MSI has been built, the package code can be extracted from the MSI using using the vba script WiSumInf.

Unless I know the PackageCode ahead of time, I can not use msifactory.exe in a build script, since I am faced with the chicken and egg problem.

What sequence of command line tools can be used to:

1) Create the MSI File???

2) extract the package-code from the msi file.

3) create the bootstrap file presenting package-code.

Of course I want it to use the msiproj file to drive the process.

Bill

BillMcLean
09-03-2008, 09:46 AM
The following snippet of code is from a bash (cygwin.org/cygwin) script. You can install it from www.cygwin.org (http://www.cygwin.org/cygwin)
You need to get from the Windows SDK the scripts WiSumInf.vbs and WiRunSQL.vbs. These list the product code, package code and product name. The Build_Rev is set from the source control system.

When the MSIFactory is first run it creates both a MSI file and corresponding setup.exe. The Setup.exe at this point in time will not work since the ProductCode, PackageCode and ProductCode have not been embedded in the Setup.exe.

The ProductCode, PackageCode and ProductName are extracted by running the scripts WiSumInf.vbs and WiRunSQL.vbs.

By running the IRMakeBootstrap.exe with the ProductCode, PackageCode, ProductName and ProductVersion set from the command line, a working bootstrapper can be built.


# Build the MSI Factory and disregard the bootstrapper that is built.
MSIFILE /Log:build.setup.log
"$MSIFACTORY" /Build FotobounceSetup/$MSIFILE /Log:build.setup.log

# Get PackageCode, ProductCode, and Product Name. These are passed to the lua file associated with the product.xml file.

export PackageCode=`cscript WiSumInf.vbs $SRCMSI | gawk '$2 == "Revision" { printf "%s", $4 }'`
export ProductCode=`cscript WiRunSQL.vbs $SRCMSI "Select * from Property" | gawk '$1 == "ProductCode" { printf "%s", $2 }'`
export ProductName=`cscript WiRunSQL.vbs $SRCMSI "Select * from Property" | gawk '$1 == "ProductName" { printf "%s", $2 }'`
echo "Building: " $ProductName " ProductCode: " $ProductCode$BUILD_REV " PackageCode: " $PackageCode

# rebuild the bootstrapper
echo "$BOOTSTRAP" $SRCXML c:/ardev/CurrentDev/$SRCEXE -var:ProductCode=\"$ProductCode\" -var:PackageCode=\"$PackageCode\" -var:ProductName=\"$PRoductName\" -var:ProductVersion=\"$BUILD_REV\"