wix - 使用WiX添加multiString注册表值?

标签 wix registry windows-installer

现在我使用这样的东西:

<Component Id="RegistryEntries" Guid="<guid>" KeyPath="yes">  
  <RegistryKey Root="HKCU" Key="<path>" Action="createAndRemoveOnUninstall">  
    <RegistryValue Name="myStrings" Action="append" Type="multiString">  
      1  
    </RegistryValue>  
    <RegistryValue Name="myStrings" Action="append" Type="multiString">  
      2
    </RegistryValue>  
    <RegistryValue Name="myStrings" Action="append" Type="multiString">  
      3
    </RegistryValue>  
    <RegistryValue Name="myString" Value="x" Type="string"/>  
  </RegistryKey>  
</Component>  

但是我有下一个错误:

主键"reg<key>"在表“注册表”中重复。请删除其中一项或重命名主键的一部分,以免发生冲突。

回答:Yan's回答后,我的xml如下:
<Component Id="RegistryEntries" Guid="<guid>">
  <RegistryKey Root="HKCU" Key="<path>" Action="createAndRemoveOnUninstall">
    <RegistryValue Name="myStrings" Action="append" Type="multiString">
      <MultiStringValue Name="myStrings" Action="append" Type="multiString">  
        1
      </MultiStringValue>
      <MultiStringValue Name="myStrings" Action="append" Type="multiString">  
        2
      </MultiStringValue>
      <MultiStringValue Name="myStrings" Action="append" Type="multiString">  
        3
      </MultiStringValue>
    </RegistryValue>
    <RegistryValue Name="myString" Value="x" Type="string"/>
  </RegistryKey>
</Component>

最佳答案

使用MultiStringValue元素。

关于wix - 使用WiX添加multiString注册表值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3749863/

相关文章:

c# - 删除子项错误 (C#)

windows-installer - 将 Microsoft 安装程序输出重命名为当前版本

c# - .Net 注册表安全权限 - 具有权限的用户无法访问注册表

c# - 无人值守(命令行)安装强制接受 EULA

wix - 如何在 WIX 中使用长命令行定义 CustomAction?

WIX 错误文档元素名称 'Wix' 无效

wix - 使用自定义操作卸载多个产品

c# - Wix - 在哪里安装 Windows 功能

c# - 蜡 & T4 : no "Custom Tool" option

windows - 如何在 WiX 片段中获得编辑注册表 CLSID 的提升权限