PDA

View Full Version : Suite Project - Controlling Feature visibility



AttilaB
10-08-2012, 04:07 AM
Hi,

I'm trying to create a Suite project which will contain some small setups. Some of the setups have prerequisites (SharePoint 2010), so if this prerequisite is not installed on the machine these setups could not be installed. My current design for the suite project is, that each small setup has it's own Feature (1 Package = 1 Feature).

I've found the Eligibility Condition property on the Package page where I can set this prerequisite, so if this condition is not met then this package won't be installed however the feature is still in the custom setup page. Practically this means I can select this feature to be installed on the custom setup page (InstallationFeatures wizard page), however it won't install anything because of the Eligibility Condition on the package.

My question is if there is any possibility to hide the Feature if some conditions are not met? If no then how the suite project was designed, how it should handle such configuration?

Thanks,
Attila

MichaelU
10-10-2012, 08:54 AM
Right now there's no way to conditionally hide or show a feature. If you have few enough features and you're willing to do the lifting yourself there are some alternatives. Instead of using the feature selection tree, you can wire individual checkboxes to features by setting their property to FEATURE[featurename].actionState==install. Then you can also set visibility conditions on that checkbox. Do enough of these in the right manner, and you might be able to present the conditional selections you want.

AttilaB
10-11-2012, 08:32 AM
Hi Michael,

Thank you very much for your answer! I was also thinking about that, but it is just the last choice if there isn't any other one. The reason is that in this case I had to somehow manage the position of the other checkboxes. If I don't do that and hide some checkboxes then there will be a huge space between the others.

I was also thinking about a custom validation approach. I already use a custom C++ dll in my setup and wondering if I could somehow validate the checkboxes and disallowing checking them or at least show a message to the customer that he cannot continue because for some selected features the requirements are not met. What do you think about this? Is this a viable approach? If yes, then which attribute (event) should be used for this? (I just see the "Action" attribute there). Also how can I prevent continuing with such feature selections (enable/disable the next button)?
The second question is, how can I access the "FEATURE[featurename].actionState" property from C++ code? :confused:

Thank you very much!

Cheers,
Attila

MichaelU
10-24-2012, 08:32 AM
You can hook up an Action on the FeatureSelectionTree that will be called whenever the end user toggles a selection in the tree. Ideally this would also set a property that would be used to enable and disable the Next button.

Reading and setting that property should be possible off the ISuiteUIExtension interface, with get_Property and put_Property, passing the property name as you've already used it.

One more option would be to use a CheckList control. You can provide it a property that contains a list of LABEL\rPROPERTY\n pairs, where LABEL can be the name of a string identifier, and property is set when the checkbox should be checked. Since the list comes from a property, you can build this up in an action and only include the features you want to allow the user to select. However this cannot represent a tree of options.