Generate a Transform

The VBScript file WiGenXfm.vbs is provided in the Windows SDK Components for Windows Installer Developers. This sample script can generate a transform from two Windows Installer databases. For more information see Database Transforms.

The sample demonstrates the use of:

OpenDatabase method (Installer Object)

LastErrorRecord method of the Installer object

GenerateTransform method of the Database object

You'll require the CScript.exe or WScript.exe version of Windows Script Host to use this sample. To use CScript.exe to run this sample, type a command line at the command prompt using the following syntax. Help is displayed if the first argument is /? or if too few arguments are specified. To redirect the output to a file, end the command line with VBS > [path to file]. The sample returns a value of 0 for success, 1 if help is invoked, and 2 if the script fails.

cscript WiGenXfm.vbs [path to original database][path to revised database][path to transform file]

Specify the path to the original Windows Installer database. Specify the path to the revised database. Specify the path to the transform file to be created. If the path to the transform file is omitted, the two databases are only compared.

For additional scripting examples, see Windows Installer Scripting Examples. For sample utilities that do not require Windows Script Host, see Windows Installer Development Tools.

Note that A Localization Example demonstrates Generating a Customization Transform.