This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Setting a feature as "Required" programmatically
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Dec 03, 2009
07:47 AM
Setting a feature as "Required" programmatically
Hi,
I have a feature whose "Required" setting is set to No.
I have investigated a bit, and I have found that this "Required" setting corresponds to the bit 4 (LSB is bit 0) of the feature attribute (decimal value of 16), which corresponds to the msidbFeatureAttributesUIDisallowAbsent flag.
I thought the MsiSetFeatureAttributes function would do the job.
But I don't think I can use it to set the msidbFeatureAttributesUIDisallowAbsent flag, can I?
The funny thing is: if I set the feature "Required" setting to "Yes", and then use MsiSetFeatureAttributes, the feature is no longer required at installation.
So, the MsiSetFeatureAttributes can clear this msidbFeatureAttributesUIDisallowAbsent flag, but cannot set it. Is that right?
I have a feature whose "Required" setting is set to No.
- If certain conditions are satisfied on the target system, I would like this feature to be required, so that the user cannot deselect it.
- If these conditions are not satisfied on the target system, the end user can choose whether he wants to install the feature or not.
I have investigated a bit, and I have found that this "Required" setting corresponds to the bit 4 (LSB is bit 0) of the feature attribute (decimal value of 16), which corresponds to the msidbFeatureAttributesUIDisallowAbsent flag.
I thought the MsiSetFeatureAttributes function would do the job.
But I don't think I can use it to set the msidbFeatureAttributesUIDisallowAbsent flag, can I?
The funny thing is: if I set the feature "Required" setting to "Yes", and then use MsiSetFeatureAttributes, the feature is no longer required at installation.
So, the MsiSetFeatureAttributes can clear this msidbFeatureAttributesUIDisallowAbsent flag, but cannot set it. Is that right?
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Dec 03, 2009
11:49 AM
The MSDN documentation does not zindicate that msidbFeatureAttributesUIDisallowAbsent can be passed to MsiSetFeatureAttributes. This would seem to imply that changing this attribute at runtime with this API is not supported. Unfortunately, since this is a function implemented by Windows Installer, we don't have any additional information on how it works besides what is documented on MSDN.