Hi,

I am new to Wix trying to create an installer where certain files are removed 
by the uninstaller depending on a checkbox in the user interface. I have seen 
some similar questions on the Wix mailing lists, but no definitive answers on 
how to get it to work.

Some of the comments I have seen include that it has to be a secure public 
property to be accessed by the install sequence after being set in the UI, and 
that the feature has to have been installed in the first place to be able to be 
removed.

>From testing, it seems that the setting of the property in the UI is 
>completely ignored, i.e., the installer has already made up its mind as to 
>whether the component will run or not. The files either get removed every 
>time, or never.

The bits of code being used essentially are:

<Component Id="RemoveConfiguration" Guid="79aba5ff-e091-460a-a212-34448e1460f2" 
Directory="MyAppData">
            <Condition><![CDATA[REMOVECONFIGURATION OR (WixUI_InstallMode <> 
"Remove")]]></Condition>
<!-I have tried a variety of other conditions such as NOT Installed for the 
second part, but thought it had to do something to ensure it ran during 
installation, not just uninstallation -->

            <RemoveFile Id="MyXML" Name="Configuration.xml" 
Directory="MyAppData" On="uninstall" />

            <RemoveFolder Id="MyAppData" On="uninstall" />

</Component>

<Property Id="REMOVECONFIGURATION" Secure="yes" />
<!-also tried removing this and letting the UI just set it -->

<!-- The control on the modified maintenance type dialog -->
<Control Id="RemoveConfigCheckBox" Type="CheckBox" X="104" Y="162" Width="180" 
Height="20" CheckBoxValue="1" Property="REMOVECONFIGURATION"
            Text="Also remove application configuration settings">
            <Condition Action="hide">ARPNOREMOVE</Condition>
</Control>

Is there something fundamentally wrong with this approach? Is it too late in 
the UI to change a property which affects a component condition (due to 
CostFinalize or something)?

Thanks,
Edward

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to