This blog entry provides an example of generating MST transforms for an MSI database using VBScript. It follows on from the previous blog post which provided a tutorial on applying transforms to an MSI database using VBScript.
It forms part 13 of an 17-part series that explores how to use VBScript to manipulate MSI relational databases using the Windows Installer API. Throughout this series of tutorials, we identify the common issues that we encounter and the best practises that we use to overcome them.
Now we’re going to attempt to generate a transform from changes which we make to an MSI. An example of this could be adding certain properties for a customer, or possible an audit key in the registry table.
When we’re generating an MST from a script, here’s the idea:
- We take a copy of the original base MSI, and create a new temporary MSI
- We apply any changes we make to this temporary MSI
- We find the difference between the temporary MSI and the base (original) MSI
- We generates a transform from the differences between the base MSI and the temporary MSI.
So, here goes. We’re going to insert the following entry into the Registry table:
The comments throughout the example above explain what each section does. What I would say, though, is:
- Always remember to call the CreateTransformSummaryInfo method! The Windows Installer SDK examples don’t include this. Omitting this may mean your transform wont generate/apply without error.
- Ensure you close every view object, otherwise the temporary file will not delete at the end.
- If no changes are made to the base MSI and you attempt to generate a transform, there will be an error because the difference between the base MSI and the new one will be nothing.
Thanks for reading about generating MST transforms for an MSI database. Next you can find out how to use SQL from with a custom action using VBScript.

