cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Change Installation State of a Feature, Based on Another Feature's Selection State

Change Installation State of a Feature, Based on Another Feature's Selection State

Summary

How to modify the MSI CustomSetup dialog to set the installation state of a feature based on the selection state of another feature.

Synopsis

This article provides information on how to modify the MSI CustomSetup dialog to set the installation state of a feature based on the selection state of another feature.

Discussion

This article addresses the following installation requirement:
  1. The project contains two features: Feature1 and Feature2.
  2. Both features are configured to be deselected by default.
  3. On the CustomSetup dialog, if the end user selects Feature1, then Feature2 should also be selected.
The solution described in this article requires that the installation be performed using Microsoft Windows Installer version 3.0 or later.
This technique uses the Windows Installer SelectionTree Control Properties:
  • MsiSelectionTreeSelectedFeature
  • MsiSelectionTreeSelectedAction
To download a sample project, please refer the to 'Attachments' section below. The sample was authored using InstallShield 2008. If you are using a newer version of InstallShield, upon opening the project in InstallShield, the project will automatically be migrated to the version of InstallShield that you are using.
The sample is configured as follows:
  1. Two features have been defined in the project: NewFeature1 and NewFeature2.
  2. Both features have been given an Install Level greater than 100; hence, both features will be deselected by default on the custom setup dialog.
  3. The CustomSetup dialog has been cloned to generate a similar dialog named CustomSetup1.
  4. Go to the Behavior view and select the Tree control on the CustomSetup dialog. Notice two control events are defined, AddLocal and NewDialog. Also view the conditions for these control events.
  5. The AddLocal event selects NewFeature2 to be installed if NewFeature1 is selected.
NOTE: The purpose of the NewDialog event is to display the cloned CustomSetup dialog, as the CustomSetup dialog cannot refresh itself.

Additional Information

For additional information, please refer to these articles:
  1. SelectionTree Control
  2. Q111679: PRB: Feature Conditions Do Not Work as Expected When Based on Other Feature or Component States
  3. Q103163: HOWTO: Disabling Features at Run Time
Was this article helpful? Yes No
No ratings
Version history
Last update:
‎Feb 26, 2010 10:56 AM
Updated by: