I have tried that but, it doesn't work. It seems that the MSI evaluates the 
feature condition during CostFinalize. As CostFinalize takes place before my 
UI sequence, so any property change has no effect on the install behavior. 
So, looking at other similar references, I took a different approach. I set 
my feature's default install level as '1' (i.e. to be installed). In the UI 
control, I am removing the feature depending on the property value:

<Control Id="NextButton" Type="PushButton" X="250" Y="300" Width="60" 
Height="20" Disabled="no" Text="Next" Default="yes">
<Publish Event="Remove" Value="MyDoc"><![CDATA[MYPROPERTY = 0]]></Publish>
<Publish Event="EndDialog" Value="Return"><![CDATA[1]]></Publish>
</Control>


But curiously, if I do so, my installation starts failing. If I comment out 
the 'Remove' event statement above, it installs fine. But, it installs the 
feature too, that I don't want to install (as I have that feature's level 
set to 1).

I am not sure why the '<Publish Event="Remove" Value=...' statement makes 
the installation start failing.

Any ideas on how to do that...


Thanks.
With Regards,
// Sudripta.




----- Original Message ----- 
From: "Sebastian Brand (Instyler Software)" <wix+us...@instyler.com>
To: "'General discussion for Windows Installer XML toolset.'" 
<wix-users@lists.sourceforge.net>
Sent: Monday, December 21, 2009 8:47 PM
Subject: Re: [WiX-users] Conditional installation of a feature


> Do not use 0 and 1 as values as 0 is recognizes as "uninitialized".
> Have you tried strings like "yes" and "no"?
>
> Best regards,
> Sebastian Brand
>
> Deployment consultant
> E-Mail: sebast...@instyler.com
> Blog: www.sebastianbrand.com
>
>
>
>> -----Original Message-----
>> From: Sudripta Nandy [mailto:sudrip...@sarangsoft.co.in]
>> Sent: Monday, December 21, 2009 15:11
>> To: wix-users@lists.sourceforge.net
>> Subject: [WiX-users] Conditional installation of a feature
>>
>> Hi,
>>     I want to install a feature depending on the user's choice. I have a
> property
>> 'MYPROPERTY' whose default value is '0'. If the user checks a checkbox, I
> am
>> setting that property value to '1' and installing that feature. I have 
>> the
>> feature element as below:
>>
>> <Feature Id='Complete' Title='My Product' Level='1'>
>>     <ComponentRef Id='ExeComponent' />
>>     <Feature Id='MyDoc' Level='1'>
>>         <ComponentRef Id='DocComponent' />
>>         <Condition Level='0'>MYPROPERTY = 0</Condition>
>>     </Feature>
>> </Feature>
>>
>>
>> The problem is that the feature is never getting installed. But, if I set
> the
>> default value of 'MYPROPERTY' as '1', it gets installed.
>>
>>
>> Please let me know what am I doing wrong.
>>
>>
>>
>> Thanking You,
>> With Regards,
>> // Sudripta Nandy
>>
>>
>>
> ----------------------------------------------------------------------------
> --
>> This SF.Net email is sponsored by the Verizon Developer Community
>> Take advantage of Verizon's best-in-class app development support
>> A streamlined, 14 day to market process makes app distribution fast and
> easy
>> Join now and get one step closer to millions of Verizon customers
>> http://p.sf.net/sfu/verizon-dev2dev
>> _______________________________________________
>> WiX-users mailing list
>> WiX-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/wix-users
>
>
> ------------------------------------------------------------------------------
> This SF.Net email is sponsored by the Verizon Developer Community
> Take advantage of Verizon's best-in-class app development support
> A streamlined, 14 day to market process makes app distribution fast and 
> easy
> Join now and get one step closer to millions of Verizon customers
> http://p.sf.net/sfu/verizon-dev2dev
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users 


------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to