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

How to set two features to be mutually exclusive?


5 replies to this topic

austinajit

austinajit
  • Members
  • 12 posts

Posted 17 May 2006 - 19:05

Hi,

How to setup mutually exclusive feature selection? Here is what i am looking at...

Let us consider following feature supported in the installer.
Feature1
Feature2
Feature3

When Feature1 is selected Feature2 should be disabled and vice versa.

How to attain this in Basic MSI Project? Any pointers or thoughts to make this
work?

Thanks,
Austin.




turbokitty

turbokitty
  • Full Members
  • 18 posts

Posted 18 May 2006 - 00:41

I don't see why you couldn't do this with a feature condition.

austinajit

austinajit
  • Members
  • 12 posts

Posted 18 May 2006 - 14:00

Yes using feature condition it is possible to install components based on the feature selection. But my requirement is to exclude the feature in the UI when the user selects the other feature and vice versa.

Here if the user clicks on Feature1 then i should automatically cross (X) Feature2. Here is where i had the challenge.

I guess its more of an event handling than to do with condition. Please correct my understanding if i am wrong?

Zweitze

Zweitze
  • Full Members
  • 522 posts

Posted 18 May 2006 - 22:17

This can't be done with the feature tree - no point looking there.

Your best bet is to create your own dialog with radiobuttons, when the user presses Next interprete the value of the radiogroup, and select/deselect the features.
If you have other features too, don't forget to make the exclusive features invisible (otherwise they still show up in the feature tree).

austinajit

austinajit
  • Members
  • 12 posts

Posted 19 May 2006 - 04:06

Thanks Zweitze.

After doing some research I found a way to attain but the drawback came with the unavailability of refresh option.

I used a CA on SelectionTree, which is executed for every change in selection by the user. Even after setting the proper feature state it gets refreshed only when the next selection change or when returning to this screen (Next and Back buttons).

I used MsiGetFeatureState() and MsiSetFeatureState() methods to get and set the selection state of a feature. I used MsiSelectionTreeSelectedFeature to identify which feature is selected by the user.

Because of the refresh disability, i was not able to proceed further. Can anyone suggest a better idea?

Thanks,
Austin.


Zweitze

Zweitze
  • Full Members
  • 522 posts

Posted 19 May 2006 - 09:42

I didn't know you can add control events on selection trees, apparently you can. In that case you can do the 'twin dialog' solution:
First create an identical copy of the dialog (important!). Then schedule another control event after your CA, type "NewDialog" with the copied dialog as argument. Do the same thing in the dialog copy, now referencing the original dialog.
This approach should work, but the selection in the tree might be lost, and the focus moves to the first control in the new dialog.