Hi,
I am developing an installer using WiX 3.7 and want to implement freature
selection dialog to install the feature. I have three of them:
- FEATURE_DEFAULT
- FEATURE_CLASS_A
- FEATURE_CLASS_B
As per name, FEATURE_DEFAULT will always install, FEATURE_CLASS_A and
FEATURE_CLASS_B will get installed on checkbox selection. Here is the code:
<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56"
Height="17" Disabled="yes" Text="!(loc.ButtonText_Next)"> <Publish
Event="AddLocal" Value="ALL" Order="3">1</Publish> <Publish
Event="Remove" Value="FEATURE_CLASS_A" Order="4">NOT
CHKBOX_A</Publish> <Publish Event="Remove" Value="FEATURE_CLASS_B"
Order="5">NOT CHKBOX_B</Publish></Control>
Things are working fine while installing. But Now I have to attach Add /
Remove feature in the installer. So After MaintenanceDlg, I switch to
FeaturesDlg. Here I see two checkboxes, both unchecked (actually installed
feature checkbox must be checked). Also I want to implement Add feature so
if user want to install a new feature the only this will get installed and
not other feature get touched.
For this I used custom action to control the checkbox property. Code:
foreach (FeatureInfo fi in session.Features)
{
if (fi.Name == "FEATURE_CLASS_A" && fi.CurrentState == InstallState.Local)
{
GetSetProperties.SetSessionProperty(session, "CHECKBOX_ENABLE", "1");
}
}
So if feature is installed previously checkbox gets checked. But if I check
other checkbox, then installer installs both features (which I don't want).
If I uncheck previous checkbox (as I am adding new feature and removing old
one), then previous feature gets removed. I am stuck here.
How can I achieve what I want to do? Is there a better solution for this
(apart from what I am doing)?
Help needed, its really urgent.
--
Thanks and Regards,
Ravi Raj
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and
their applications. This 200-page book is written by three acclaimed
leaders in the field. The early access version is available now.
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users