User Guide

64
Component Rules
How Component Rules Are Applied
Component rules are applied in the order they appear from top to bottom in the list of
rules on the Customize Component Rules dialog. When a rule has multiple conditions,
only resources that meet all the conditions have the rule applied to them. Once an
added resource matches the conditions in a rule, the action is applied and no
subsequent rules are evaluated for that resource. If you add a resource that does not
meet any of the conditions in the rule set, then the Microsoft Best Practices rule set is
used for that resource.
Selecting a Component Rule Set
Use the Component Rule Selection dialog to select a rule set and component naming
conventions for the current installation or to set the default rule options for all future
installations.
The component key values you enter on the Component Rule Selection dialog can be
overridden by specific rules. Example: If you use a rule set that contains rules for
naming certain types of components, then only the components that do not meet the
conditions in the rule set will be named using the component key value options you
specify here.
To select a component rule set:
1. Select Component Rules menu > Select Rule Set. (In Visual Studio: Project menu >
Component Rules > Select Rule Set.)
The Component Rule Selection dialog appears.
2. From Rule Set Name, select the rule set to use for this installation.
3. To make the specified rule set the default for all future installations, mark Make
this the default rule set for all Windows Installer files.
4. In the Component Key Values section, select an option from the Default list to
determine the naming convention for new components. If the rule set you use
specifies the component naming under certain conditions, the naming convention
you specify here will be overridden when those conditions are met.
Set component key to a named Base
Select this to name new components with specified text plus an incremental
number. Selecting this option enables the Base field. Enter text to serve as a
base for the component name (example: Component). Component names will be
incremented from this base (example: Component1, Component2, and so on).
Set component key to key of keypath or first resource
Select this to name components as follows:
# If the resource is a file, registry key, or ODBC data source, give the
component the same name as the key of the keypath.
# For any other type of resource, give the component the same name as the
key of the first resource in the component.
Set component key to table name of keypath or first resource
Select this to give new components the name of the table in which the keypath
or first resource resides. If multiple components are named for the same table,
an incremental number is added to the component name (example: File1, File2,
and so on).
5. From Files, you can select a different naming convention for components that are
based on file resources. You can use the long file name of the keypath file, the short