I would like to set a registry value to 0 or 1 depending on whether a
feature is selected or not. It seemed quite simple and I have got 90% of
the way to solving it but can't get it to work when the application is
modified by running it from ARP. This is what I have:

This is used to create the registry value, it is 0 by default but if the
feature AntiPassback is selected it is set to 1.
    <Property Id="ANTIPASSBACK_REG" Value="0" />
    <CustomAction Id="SetANTIPASSBACK_REG" Property="ANTIPASSBACK_REG"
Value="1" />
    <InstallExecuteSequence>
      <Custom Action="SetANTIPASSBACK_REG"
After="CostFinalize"><![CDATA[&AntiPassback = 3]]></Custom>
    </InstallExecuteSequence> 

The value ANTIPASSBACK_REG is then used in a component:
      <Component Id="AntiPassback"
Guid="10D0AF45-E229-4FD2-B687-00DA8C61341A">
        <RegistryValue Id="AntiPassback" Root="HKLM"
Key="SOFTWARE\MyCompany\Application " Name="AntiPassback"
Value="[ANTIPASSBACK_REG]" Type="integer" Action="write" KeyPath="yes"
/>
      </Component>

This works on first install but when it is modified the custom action
triggers but as the component AntiPassback has changed the registry
value is not written.

Does anyone have any ideas how to solve this or a simpler method of
achieving the same thing?

(Note: This code was originally written to use feature conditions on 2
components but as documented here:
http://www.joyofsetup.com/2007/05/30/feature-conditions-and-ui/ that
doesn't work.)

Thanks 

Neil

Neil Sleightholm
X2 Systems Limited
[EMAIL PROTECTED]



-------------------------------------------------------------------------
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