I have an WIX installation with a feature and two subfeatures. I would like the feature to be required and the two subfeatures optional but not to install by default. Here is my feature tree:
<Feature Id="A" Level="3" AllowAdvertise="no" TypicalDefault="install"
InstallDefault="local" Absent="disallow" >
<Feature Id="A1" Level="1" AllowAdvertise="no" />
<Feature Id="A2" Level="1" AllowAdvertise="no" />
</Feature>
I thought that adding:
<Property Id="INSTALLLEVEL" Value=3 />
would set the main feature to install and the subfeatures to not install. That isn’t the case; all features are installed by default.
I’m using the WixUI_FeatureTree. I wonder if that might be messing up the INSTALLLEVEL property.
So is what I am attempting even possible? How can I disable the two subfeatures by default?
Edit: Interesting. I set INSTALLLEVEL=1000 and tried it again and all features were still set to install. Could WixUI_FeatureTree be clobbering INSTALLLEVEL?
I think your problem is in overwriting the value of INSTALLLEVEL property duting execution of the UISequence. Adding code
initializes property value on the very beginning of installation process. But when you are moving from dialog to dialog the INSTALLLEVEL property may change before you are seeing the FeathreTree dialog. Please verify verbose log entries of “Propery value changed” and the final value of INSTALLLEVEL property in the end of the log file.
You may need to create custom action to set INSTALLLEVEL to whatever value you need.
Example can be found in WIX sources: SetupType dialog does exactly this: