Hello!
Scenario:
The user enters a serial number in a dialog. Based on that serial number, I want to disable a feature. That is, I want to prevent the feature from being installed, and I want to prevent the feature from being displayed in CustomizeDlg.
Implementation:
I have a custom action that analyzes the serial number and sets properties based on the results. For example, if the serial number does not allow "FeatureA" to be installed, it will set the property INSTALL_FEATURE_A=0.
Now, I'm not sure what the proper way to handle this is. I've tried using the feature's "Installation Behaviour" properties by setting "Disabled if:" to INSTALL_FEATURE_A=0. However, the issue here is the feature can still be seen (and enabled by the user) in CustomizeDlg. It appears in the feature list with an X icon. The conclusion I came to (after reading this: http://198.154.230.79/forums/viewtopic.php?f=2&t=1162) is that you cannot disable a feature (hide it in CustomizeDlg) after CostFinalize. Since the serial number is analyzed (and the INSTALL_FEATURE_A property set) after CostFinalize, I don't believe I can use the "Disabled if:" field of the feature.
So, is there a "standard" way to handle this scenario? The only solution I can think of is to write a custom action that disables the feature by modifying the in-memory MSI (also discussed here: http://198.154.230.79/forums/viewtopic.php?f=2&t=1162). I just wanted to check if there was a better way to handle this before I went down this road.
Thanks.
FOLLOW US
Get the latest news in Application Packaging