Winwonk.Build Manifest Generator v.1.0

Background

These are my brief ideas on build/release manifests. I'm sure there are formal studies on the subject, but I have yet to see any. Please direct me if you know any resources.

Build and release manifests helps change and release management in the following ways:

A good manifest should be: See next section for a proposed solution.

Proposed solution

Winwonk.Build is an extensible, XML-based, automated manifest generator.

It supports registering custom tasks per file specification, and then traverses a release directory executing the respective task(s) for every file. Each task adds its results to an XML document, which is constructed by the actual generator.

A manifest consists of two mandatory nodes; Product and Build, which can both be added custom key-value properties. Also, the generator is passed a root directory, which it traverses, and for every file occurrence it gathers the following information:

It is up to other, custom tasks, to extract further information.

The package comes with predefined tasks for extracting:

Anyone can implement a custom task, as long as it implements the single-method interface
	interface IManifestFileTask : IUnknown
	{
		HRESULT Execute([in] BSTR FilePath, [in] IUnknown* pTaskParameters, [in] IUnknown* pParentXMLNode);
	};		
or a dispatch-interface with the same method signature.

The second parameter, pTaskParameters, is a way for tasks to get custom configuration data. An untyped object instance can be specified when the task is registered, and this same instance is passed to the task upon execution. The package contains a default implementation (Winwonk.Build.ManifestTaskParameters) of a key-value collection that can be used to pass this config data.

Usage

Since this is implemented as a COM DLL, you need a host language to actually use it. Reasonable candidates are VBS or JScript through the shell script engine.

Typical usage:

	Dim oGenerator
	Set oGenerator = CreateObject("Winwonk.Build.ManifestGenerator")
	
	Dim oManifest
	Set oManifest = CreateObject("Winwonk.Build.Manifest")
	
	oManifest.Product.Properties("name") = "Interesting Product"
	oManifest.Product.Properties("version") = "1.0"

	oManifest.Build.Properties("config") = "debug"
	
	oGenerator.RegisterFileTask "*.exe;*.dll", Nothing, CreateObject("Winwonk.Build.TaskVersionInfo")
	oGenerator.RegisterFileTask "*.exe", Nothing, CreateObject("Winwonk.Build.TaskDebugInfo")
	
	oGenerator.GenerateManifest oManifest, "C:\BuildRoot", "*.*", "C:\BuildRoot\Build-Manifest.xml"
This code would generate an XML file containing a listing of all files under C:\BuildRoot, with version info for all .DLL and .EXE, and debug info for all .EXE.

Sample

The attached sample project is a simple VB app that, given a root directory, scans all files and builds an XML manifest.

Its default settings point to the \WINNT directory of a Windows 2000 installation, but you can change the root directory to anything you see fit for testing.

I've done my best to comment the sample code thoroughly, to make it serve as a good template for real implementations.

Feedback

I'd really like to hear about any bugs, missing features, etc. Also, if you build a really cool custom task, I'd be happy to host it here.

Contact me if you have any comments.

Todo

For future versions, I'm looking into:

Downloads

Known prerequisites are:

I'd love to hear about any missing-prerequisite-related problems.

Winwonk.Build Component and sample VB application w/ source (64k)

To install, register Winwonk.Build.dll, using regsvr32.exe or similar.