How To Create a Universally Applicable Transform (306443)



The information in this article applies to:

  • Microsoft Windows Installer 1.1
  • Microsoft Windows Installer 1.2
  • Microsoft Windows Installer 2.0

This article was previously published under Q306443

SUMMARY

This article describes how to create a transform that can be used to add or replace elements in any Windows Installer (.msi) package.

MORE INFORMATION

In order to add or replace elements in an .msi database you will need to create a transform (.mst) file. To create a universally applicable transform that can be applied to any .msi package, the transform must create a new hidden feature. The reason that you need to add a new feature to a target installation is because you cannot tell ahead of time what the features of a particular target .msi file are and then make changes to the transform. Therefore, if you create in your transform a new unique feature (hidden so that it is not visible to the user), the feature can be applied to different .msi files, thereby avoiding the restrictions of having to be tied into any existing features.

The following steps add a registry key value by creating a transform that can be applied universally to any .msi package:
  1. Create an empty msi package, Package1.msi.
  2. Copy Package1.msi to a different location and rename it as Package2.msi.
  3. Add a feature to Package2.msi (Use a unique name for the feature. In other words, use a feature name that will not be present in any other .msi package). In the feature table, set Display to "0" (not displayed) and Attributes to "0" (favor local).
  4. Add a registry value to the registry table and create a component for the registry value. The component must have a Directory_ field entry that will exist in all packages that the transform will be applied to, such as TARGETDIR.
  5. Map the component to the hidden feature you created previously.
  6. Create your transform by using Package1.msi and Package2.msi.
You should now be able to apply this transform to any .msi package.


Modification Type:MinorLast Reviewed:8/30/2004
Keywords:kbhowto KB306443