Mark
Mark

Reputation: 2261

wix modify registry value during Change/Modify

I am using using wix RadioButton to accept values, either "Yes" or "No". Based on the user selection I am setting a property. Based on the property I am setting a registrykey.

<Control Id="Enable" Type="RadioButtonGroup" X="20" Y="100" Width="330" Height="40" Property="ENABLEKEY1" Hidden="yes">
    <RadioButtonGroup Property="ENABLEKEY1">
      <RadioButton Value="1" X="10" Y="0" Width="250" Height="20" Text="!(loc.WixUIYes)" />
      <RadioButton Value="0" X="10" Y="20" Width="250" Height="20" Text="!(loc.WixUINo)" />
    </RadioButtonGroup>
    <Condition Action="show">ALLOWENABLEKEY1=1</Condition>
    <Condition Action="enable">ALLOWENABLEKEY1=1</Condition>
  </Control>

Here is the code to set registry:

  <Component Id="C1" Guid="{A2186658-6214-4D31-21A6-F9AA48889A4A}">
    <RegistryKey Id="R1" Root="HKLM" Key="SOFTWARE\MYPRODUCT" Action="createAndRemoveOnUninstall">
      <RegistryValue Type="integer" Name="EnableKey1" Value="[ALLOWENABLEKEY1]" Action="write"/>
    </RegistryKey>
  </Component>

When I select the radio button "No" option, the registry gets populated correctly to 0. But during maintenance mode (Change/Modify) If i select the "Yes" option , the registry still has the 0 value. It isn't getting updated to 1.

Can anyone please tell what am i doing wrong?

Thanks a lot

Marc

Upvotes: 3

Views: 2876

Answers (2)

Anthony Williams
Anthony Williams

Reputation: 68681

Modify the UI to set the Reinstall and ReinstallMode properties, as described in this answer

Upvotes: 0

Ciprian
Ciprian

Reputation: 3565

Make sure that your reinstall mode contains the "um" flags. http://msdn.microsoft.com/en-us/library/windows/desktop/aa371182(v=vs.85).aspx

Also a log will be very helpfull

Upvotes: 3

Related Questions