My previous blog discussed a method using InstallScript to determine whether a Feature had been selected by the customer in the Custom Setup dialog .
This blog posting will be about preselecting Features, the methodology and the issues involved.
In my sample Custom Setup Dialog, I have three major Features as shown in this Custom Setup Dialog:
I have some scripting to do, checking various components installed on the workstation. Now suppose that if:
- .NET Framework 2.0 is not installed, deselect Feature “.NET Applications” before the dialog Custom Setup is presented
- .NET Framework 2.0 was found installed, have the Feature “.NET Applications” preselected before the dialog Custom Setup is presented
I abbreviated the script logic to the critical script that sets a MSI Property “DOTNET_FEATURE” to a value of “FALSE” to test the logic:
NOTE: This script function MUST be sequenced before the standard action “CostFinalize”!
Now we need to set a Condition on the Feature “.NET Applications” that will make the feature be preselected or deselected.
Navigate to the Feature panel and create a Feature condition:
This Condition will alter the InstallLevel to be 200 if the MSI Property “DOTNET_FEATURE”=”FALSE”.
The InstallLevel, by default is set to 100, so any Feature or component that has a value from 1 to 100 will install. If you reset the level for a Feature (or sub-feature) to any number >100, the feature will be displayed Unselected.
Here are the results:
WARNING: if you set the InstallLevel to a value of 0, then the entry for Client Server will disappear from viewing in the Custom Setup Dialog.
If might be a nice option, but then the customer can never select the feature!
Hope this helps!