Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

(WiX) Disable feature (but do not hide it)

1,399 views
Skip to first unread message

pie...@mentalis.org

unread,
Feb 19, 2007, 5:45:30 AM2/19/07
to
Hi everyone,

I have a number of features in my installation project, and some of
them have prerequisites that must be checked (ie. IIS must be
installed, Office must be installed, ...).
Right now I'm using a 'Condition' tag on the Feature that sets the
Level to '0' if the condition isn't met, however this completely hides
the feature. Is it possible to disable (grayed out) the feature
instead of hiding it? I think that this will be easier for our
users...

Thanks!

mgama

unread,
Feb 19, 2007, 12:15:15 PM2/19/07
to
Looks like the SelectionTree control doesn't support disabled features in
it's list. One possible solution, although not exactly what you are asking
for, is to create a second feature which will have the opposite condition
and install level. That way you will have your original "My Office Addin"
feature for when Office is installed, and then you could have a new second
feature "My Office Addin won't be installed because Office isn't found" will
be enabled when Office isn't installed. In the condition table, you would
want to give it a high install level, like 10000, which should be more than
whatever the INSTALLEVEL property is set to. But because the SelectionTree
control doesn't support showing disabled features (maybe someone will prove
me wrong), the user may still be able to click on the little dropbown button
and select to install it locally.

The other route to go is to stick with the single feature & condition, and
then have some static text on this dialog or another dialog explaining that
Feature X isn't available because Office wasn't detected.


<pie...@mentalis.org> wrote in message
news:1171881930....@h3g2000cwc.googlegroups.com...

Stephen Connolly

unread,
Feb 24, 2007, 3:32:53 AM2/24/07
to
I struggled with this. The selection tree doesn't support disabled
nodes. One way to achieve what you want is simply not to use selection
tree but have an array of check boxes. Unless you have a hierarchical
array of features to install this may actually be what you want, and
you can just gray out any features using the check boxes. The downside
is that you'll have to code up the dialog by hand, whereas the feature
tree displays all the features automatically.

Another approach would just be to allow the user to select the feature
and show a message box asking them to deselect it, or even just
deselect it when they click next and say what you just did so that if
they go back they don't get confused about the de-selected feature.

If you do go down this route you should make sure that the feature
deselection logic is implemented server side as well in the
InstallExecuteSequence, otherwise you may still get users selecting
the feature from the command line using ADDLOCAL.

Stephen

Julian

unread,
Jan 28, 2008, 9:04:50 AM1/28/08
to
Hi Stephen,
How would you implement this feature? I'm struggling with it.

You said:
Another approach would just be to allow the user to select the feature
and show a message box asking them to deselect it, or even just
deselect it when they click next and say what you just did so that if
they go back they don't get confused about the de-selected feature.

Thank you

url:http://www.ureader.com/msg/16531457.aspx

Stephen Connolly

unread,
Jan 28, 2008, 4:37:40 PM1/28/08
to
have a look at http://www.appdeploy.com/articles/msicustomactions/

On the next button, you should be able to detect whether a feature has
been selected for instalation and you can condition a CA based on that
condition, or just always run the CA and put the condition logic in
the CA itself.

Get that CA to show an error message (NB you can't rely on using
[Msiprocess]message to show message boxes unless you've got MSI 3 and
you use VBS ProcessMessage) about the feature not being allowed, and
then you can use FeatureRequestState (http://msdn2.microsoft.com/en-
us/library/aa371662(VS.85).aspx) to de-select the feature.

Stephen

0 new messages