Bob's suggestion is one way.  You could, for example have a dialog box with a checkbox for each feature, and show/hide them as you like based on a .
 
Another option is to use a custom action - that's what this _vbscript_ code does:

Set installer = Session.Installer

Set database = Session.Database

Function SetFeatureVisible(feature, order)
 Dim view, record, header, parent
 Set view = database.OpenView("SELECT * FROM `Feature` WHERE `Feature` = '" & feature & "'")
 view.execute
 Set record = view.Fetch
 Call view.modify(msiViewModifyDelete, record)

 record.IntegerData(5) = order
 On Error Resume Next
 Call view.modify(msiViewModifyInsertTemporary, record)
  view.close

 database.commit
 Set view = Nothing
End Function

(Yes, yes, I know _vbscript_ is considered a bad idea, but it's far less likely to result in high-velocity fist-monitor interaction than C++, in my experience, and I've never had any issue with it.  But if you want to port this to C++, be my guest.  Of course, what we really need is a way to make MSI-compatible C# custom actions...).
 
I've set up two functions as shown below.  The "order" parameter can be set to 0 to hide the feature, or to any other number to show it.  The features will be displayed ordered by this parameter (well, actually the "Display" column in the database that this parameter relates to)

Function ShowJournalingConnector
 SetFeatureVisible "JournalingConnector", 6
End Function

Function HideJournalingConnector
 SetFeatureVisible "JournalingConnector", 0
End Function

It's pretty obvious what happens from there, I think
 
Hope that helps
 
On 10/9/06, Bob Arnson <[EMAIL PROTECTED]> wrote:
Sigurd Stenersen wrote:
> Is it at all possible to modify the number of features in the feature tree,
> from a DLL or using some sort of action ?
>
> I'm able to set the state of features, but I would like to present users
> with different trees depending on selections made in a previous dialog.
>
> Functionally, this is similar to using a condition to set the feature's
> level, except I want to be able to do this according to user input.  And it
> seems that by the time the user is allowed to enter anything the conditions
> in the feature tree have already been evaluated.
>
Feature conditions are evaluated during the CostFinalize action, which
comes well before most UI. Off the top of my head, I can't think of an
easy way to do what you want. The feature selection tree doesn't really
offer customization beyond what's documented. Unless a feature's install
level is 0 (or it's specifically hidden by its attributes), the
selection tree shows it. You might want to consider custom
feature-selection dialogs instead. From there, you can publish Remove
and AddLocal control events to exactly control which features get installed.

--
sig://boB
http://bobs.org


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to