I use this very successfully actually and have not had any problems with
it. My feature declaration looks like this:
<Feature Id="MyFeature" Title="My Application Feature" Display="hidden"
Level="1" ConfigurableDirectory="INSTALLDIR" AllowAdvertise="no">
<ComponentRef Id="MyInstallComponent" />
<Condition Level="1"><![CDATA[MY_NEEDED_PROPERTY]]></Condition>
<Condition Level="0"><![CDATA[NOT MY_NEEDED_PROPERTY]]></Condition>
</Feature>
The "Condition" tag sets the feature to 1 or 0 based on the presence of
[MY_NEEDED_PROPERTY]. I use this in several different installs and it works
great. For instance I have an install where the client and server
components are in the same install and you can't install both on the same
box. That is where this example comes from as a matter of fact. You could
go even further to place conditions on the individual components that check
for the install actions of particular features to ensure the desired
installation behavior.
See the following for more information:
http://msdn2.microsoft.com/en-us/library/aa368014.aspx
http://msdn2.microsoft.com/en-us/library/aa368012.aspx
Regards,
//aj
On 5/29/07, Pally Sandher <[EMAIL PROTECTED]> wrote:
I had a similar situation last week & recieved a grand total of 1
replies. I've come to the conclusion that using Condition to set the Level
of a Feature doesn't work (at all, as in it's a bug).
I tried to use it to set the Feature Level to either 1001 or 1 (1001 would
exclude it from any install as my complete install has SetInstallLevel of
1000). I also tried the 1/0 approach for enable/disable as you have but no
matter what I tried it never works as like you I found it is never evaluated
during the running of the installer.
I had to use a Condition under a Component (which do appear to be
evaluated at install time) as all I wanted to do was make a single .ini
change based on a users choice. I don't think this will be sufficient for
what you're trying to do however.
A chap by the name of Don Tasanasanta suggested the following:
Have you tried using the commands:
<Publish Event="Remove" Value="<feature name>">Property="<true>"
</Publish>
<Publish Event="AddLocal" Value="<feature name>">Property="<false>"
</Publish>
The remove will disable a feature and the addlocal will enable a feature
when used with a control.
If you use your CustomAction to set a Property to "true" or "false" you
could something similar in the above code to enable/disable features before
a user chooses the type of install (as in the control which publishes your
equivalent of the SetupTypeDlg in WiXUI_Mondo).
I found something I thought might be useful called FeatureRequestState on
MSDN at http://msdn2.microsoft.com/en-us/library/aa371662.aspx but since
I'd solved the issue I was having I didn't investigate how to implement it
(if possible) in WiX. I think the above code would do a similar if not the
same thing however.
Cheers (and good luck),
<http://www.iesve.com/>
*Palbinder Sandher
Software Deployment and
IT Administrator *
T: +44 (0) 141 945 8500
F: +44 (0) 141 945 8501
http://www.iesve.com
**Design, Simulate + Innovate with the <Virtual Environment>**
Integrated Environmental Solutions Limited. Registered in Scotland No.
SC151456
Registered Office - Helix Building, West Of Scotland Science Park, Glasgow
G20 0SP
Email Disclaimer <http://www.iesve.com/disclaimer.html>
------------------------------
*From:* [EMAIL PROTECTED] [mailto:
[EMAIL PROTECTED] *On Behalf Of *Lewis Henderson
*Sent:* 29 May 2007 17:20
*To:* wix-users@lists.sourceforge.net
*Subject:* [WiX-users] Disabling features in the CustomizeDlg based on
UIinteraction...
Hi All,
I'm still trying to port from InstallShield to wix, and here's the problem
I'm running into: The user enters an authorization key, which is checked
for validity in a CA. The CA also determines which features are available
based on this key, and I want to disable the features that aren't available
so they don't show up in the CustomizeDlg, which is invoked shortly after
the key is entered. My CA is currently setting property values for each
feature to 0 or 1 and checked via Condition clauses on the Feature
declarations. However, the conditions only appear to be evaluated at
compile file, not run time.
Can someone please either tell me how to make these conditions evaluate
after the CA is run, or point me to the right MSI routine call(s) to reset
the feature level to zero in my CA? Thanks.
Lewis
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users