User Guide
65
Component Rules
file name of the keypath file, or the naming convention specified in the Default field
above.
6. To make the options in the Component Key Values section the defaults for all
future installations, mark Make this the default key naming convention for all
installations.
7. Click OK on the Component Rule Selection dialog.
All resources that you add to this installation from this time forward will be organized
into components according to the rule set and other conventions you specified.
Using Component Rules to Align GUIDs in an Upgrade
Component rules can help you align component GUIDs in an upgrade with component
GUIDs in previous versions of the installation. If GUIDS or key paths for the same
component don’t match between the new and old .MSI, the component could
inadvertently get deleted because Windows Installer does not recognize the components
as being the same. Aligning component GUIDs for matching components prevents
upgrades from deleting necessary files in the newer version.
If you are working on an upgrade installation, you specify the previous versions of the
installation on the Previous Installation Versions dialog. Then, make sure you use a
component rule set that contains a rule for aligning component GUIDs with previous
versions. Example: The 2 predefined rule sets contain a rule in which, if the keypath
resource matches a resource in the previous .MSI list, the component layout of the
previous .MSI is matched and the component key is set to match the previous version.
All new resources you add to the upgrade installation will be checked against the
previous installations.
To ensure that all resources you add to an upgrade installation are aligned with previous
versions, specify the previous installation versions before adding any resources to the
installation. If you have already added resources to the installation, as is the case when
you use a copy of a previous .WSI as a starting point for creating an upgrade
installation, you must run UpgradeSync to align GUIDs for existing components.
To use component rules to align GUIDs in an upgrade:
1. Create or open the upgrade installation.
2. If you have already added resources to the upgrade installation, run UpgradeSync to
align GUIDs for existing components. See Using UpgradeSync on page 300.
3. Select a rule set to use for this upgrade. See Selecting a Component Rule Set on
page 64. Make sure the rule set you select contains a rule for aligning component
GUIDs with previous versions; this should be the first rule in the rule set.
For best results, use the same rule set, if any, that was used in the previous
versions. That way, component creation in the upgrade will be consistent with the
previous versions.
4. Select Component Rules menu > Previous Versions. (In Visual Studio: Project menu
> Component Rules > Previous Versions.)
The Previous Installation Versions dialog appears.
5. On the Previous Installation Versions dialog, specify the previous versions of this
installation.
• To add a previous version .MSI to the list, click Add, click to browse to the
.MSI, and click Open. The .MSI is added to the list.
• The previous versions will be checked in the order they appear in this list.