MsiTask.

MsiFeaturesElement Property

Summary

Groups sets of components into named sets, these can be used to layout the tree control that allows users to select and deselect features of your software product when a custom installation is selected at runtime.

Parameters

Attribute Type Description Required
name string A name used to refer to the feature. True
display int The number in this field specifies the order in which the feature is to be displayed in the user interface. The value also determines if the feature is initially displayed expanded or collapsed.
If the value is null or zero, the record is not displayed. If the value is odd, the feature node is expanded initially. If the value is even, the feature node is collapsed initially.
True
title string Short string of text identifying the feature. This string is listed as an item by the SelectionTree control of the Selection Dialog. False
typical bool Determines if the feature should be included in a "typical" install. This is useful for when the user selects to just install the typical features. False
directory string Refrence to a directory. Specify a corresponding directory to go with the feature. False
attr int Any combination of the following: DescriptionComponents of this feature that are not marked for installation from source are installed locally.Components of this feature not marked for local installation are installed to run from the source CD-ROM or server.Set this attribute and the state of the feature is the same as the state of the feature's parent.Set this attribute and the feature state is Advertise.Note that this bit works only with features that are listed by the ADVERTISE property.
Set this attribute to prevent the feature from being advertised.
Set this attribute and the user interface does not display an option to change the feature state to Absent. Setting this attribute forces the feature to the installation state, whether or not the feature is visible in the UI.Set this attribute and advertising is disabled for the feature if the operating system shell does not support Windows Installer descriptors.
Value
0
1
2
4
8
16
32
More information found here: http://msdn.microsoft.com/library/en-us/msi/setup/feature_table.asp
False

Nested Elements:

<feature>

    Nested feature elements are supported.

</feature>

<description>

    Longer string of text describing the feature. This localizable string is displayed by the Text control of the Selection Dialog.

</description>

<conditions>

    <condition>

      Attribute Type Description Required expression string If this conditional expression evaluates to TRUE, then the Level column in the Feature table is set to the conditional install level.
      The expression in the Condition column should not contain reference to the installed state of any feature or component. This is because the expressions in the Condition column are evaluated before the installer evaluates the installed states of features and components. Any expression in the Condition table that attempts to check the installed state of a feature or component always evaluates to false.
      For information on the syntax of conditional statements, see Conditional Statement Syntax.
      True
      level int The installer sets the install level of this feature to the level specified in this column if the expression in the Condition column evaluates to TRUE. Set this value to 0 to have the component not install if the condition is not met.
      For any installation, there is a defined install level, which is an integral value from 1 to 32,767. The initial value is determined by the InstallLevel property, which is set in the Property table.
      A feature is installed only if the feature level value is less than or equal to the current install level. The user interface can be authored such that once the installation is initialized, the installer allows the user to modify the install level of any feature in the Feature table. For example, an author can define install level values that represent specific installation options, such as Complete, Typical, or Minimum, and then create a dialog box that uses SetInstallLevel ControlEvents to enable the user to select one of these states. Depending on the state the user selects, the dialog box sets the install level property to the corresponding value. If the author assigns Typical a level of 100 and the user selects Typical, only those features with a level of 100 or less are installed. In addition, the Custom option could lead to another dialog box containing a Selection Tree control. The Selection Tree would then allow the user to individually change whether each feature is installed.
      True

    </condition>

</conditions>

Examples

Define a sample features structure. <features> <feature name="F__Default" title="My Product" display="1" typical="true" directory="TARGETDIR"> <description>My Product from ACME, Inc. </description> <feature name="F__MainFiles" display="0" typical="true" /> </feature> <feature name="F__Help" title="My Product Help Files" display="1" typical="false" directory="D__ACME_MyProduct_Help" /> </features>
Assembly
NAnt.Contrib.dll
Namespace
NAnt.Contrib.Tasks.Msi
Containing Type
MsiTask

Syntax

[BuildElement("features", ProcessXml = false)]
public SchemaElement[] MsiFeaturesElement { get; set; }

Attributes

Type Description
BuildElement

Value

Type Description
SchemaElement[]