[wix-users] Use property to save registry path

Elena Aralla elena.aralla at gmail.com
Thu May 9 02:30:02 PDT 2019


Hi everyone,

I’ve some problem with Property!


I defined a variable in the Product.wxs file in this way:

<Property Id="REG_KEY_PATH" Value="empty” Secure=“yes” />

The value of the variable is modified by an immediate custom action (as seen in the setup logs):

MSI (c) (10! 88) [10: 40: 26: 693]: PROPERTY CHANGE: Modifying REG_KEY_PATH property. Its current value is 'empty'. Its new value: 'SOFTWARE\ManufacturerTest\ProductTest\Default'.

I've used this variable to write registry key in this way:


      <Component Id = "_ 89F85C42_0066_4D90_970C_22D7E308554A" Guid = "7925E183-E7F6-4DB6-9822-FC41468F7E05" Transitive = "no" Directory = "TARGETDIR">
        <RegistryKey Root = "HKLM" Key = "[REG_KEY_PATH]" ForceCreateOnInstall = "no" ForceDeleteOnUninstall = "yes" />
        <Condition> <! [CDATA [Not Installed]]> </Condition>
      </ Component>

When I do the install, it seems all right; the registers are written in the correct way; but when I uninstall, something doesn't work (machine crashes)

If I look in the uninstall logs, the variable still has the initial ‘empty' value, not the value set in the custom action.

Property(S): REG_KEY_PATH = empty

Why uninstall doesn’t read the new value?

How can I define different registry set depending on user choice in the same Product.wxs file?

Thanks a lot, 
Elena.


More information about the wix-users mailing list