2

We have an MSI currently in production (say Broker.msi). As part of installation, the MSI (defined in Wix) creates a new registry key(Broker) and adds 2 subkeys under it. After installation, when user registers our product, 1 more registry key called "Key3" is added under "Broker" node. Please note that "Key3" contains registration key which is extremely important & accessed by other layers of the product.

[Registry Structure post install & register]

HKLM\Software\Microsoft\Broker

  • Key1 (added by installer)

  • Key2 (added by installer)

  • Key3 (added when user registers the product)

[Wix Code Snippet]

  <Component Id="RegistryEntries" Guid="*" Win64="$(var.WIN64_COMPONENT)">
          <RegistryKey Root="HKLM" Key="Software\Microsoft\Broker"  Action="createAndRemoveOnUninstall">
            <RegistryValue Type="string" Name="Key1" Value="1rp1users" KeyPath="yes"/>
            <RegistryValue Type="string" Name="Key2" Value="http://windowsbackup/m1" />
          </RegistryKey>
    </Component>
....
 <ComponentRef Id="RegistryEntries" />

Problem: So far since we were using patching, we dint face any issues with the upgrade. From the next release, we want to move to major upgrades but the biggest challenge is : During major upgrade, the old product will get uninstalled. As per the wix snippet, the action element for the "Broker" registry element is "CreateAndRemoveOnUninstall" so the entire "Broker" node is getting deleted, along with the "Key3" subkey.

If I update action to "Create", the problem will get fixed with new installations, but since the msi is already in production how do I prevent it from deleting the registry as part of major upgrade for existing products?

4

1 回答 1

2

您需要实现记住属性模式。这将导致新的 MSI 在主要升级删除旧版本之前检索数据,然后在最后重新应用它。

于 2015-04-20T14:43:07.723 回答