Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Disabling a feature in selection tree


4 replies to this topic

fdmourao

fdmourao
  • Members
  • 18 posts

Posted 25 November 2004 - 13:22

Hi all,

My installation has 2 main features.
I present them to the user with the "SdFeatureTree" function (dialog called in setup.rul).
What I'm trying to do is to show the second feature unselected and disabled, based on certain conditions.

To turn the feature unselected before calling "SdFeatureTree" I simply use:
FeatureSelectItem ( MEDIA , "Feature2" , FALSE );
This works fine. But the user can always select it again in the SdFeatureTree dialog. Thus what I need to do is to unselect the feature and disable it.

How can I do this? How can I disable a visible item in the selection tree?
Is there any other way to do something like this?
For instance, is there a way to dinamically change the the visibility property of a feature? If there is, I can put it visible or invisible based on the conditions. It's not what I really want, but as a workaround...


Thanx in advance.

fdmourao

fdmourao
  • Members
  • 18 posts

Posted 25 November 2004 - 13:53

Ok. :-) I discovered how to dinamically change the the visibility property of a feature... Using:
FeatureSetData (MEDIA, "Feature2", FEATURE_FIELD_VISIBLE, FALSE, "");

But I insist with my former question. Is there a way to make it visible but disabled?

Thanx.



Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 25 November 2004 - 17:19

You can have a feature selected and disabled (i.e. it cannot be de-selected) using a trick. But you cannot have it uneselected and disabled (i.e. not selectable). You would have to build a custom dialog for that purpose (e.g. use a dialog with check boxes, without a treeview)

fdmourao

fdmourao
  • Members
  • 18 posts

Posted 25 November 2004 - 17:28

Thanks any way. :-)
Just for curiosity... probably I'll need to use it someday...
what is the trick you're talking in order to have a feature selected and disabled?

Thanx

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 25 November 2004 - 17:37

to make feature A selected and disabled:
1. Create a feature B
2. In the required Features setting of B select A. This will select A whenever B is selected and will disable A in that case.
3. Make sure feature B is selected in your setup types
4. Set feature B to be invisible
(Must do it in this order. Step 2 will not work after step 4)