使用 WiX 添加 multiString 注册表值? [英] Add multiString registry value using WiX?

查看:57
本文介绍了使用 WiX 添加 multiString 注册表值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在我使用这样的东西:

Now I use something like this:

<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" 在表 'Registry' 中重复.请删除其中一个条目或重命名主键的一部分以避免冲突.

The primary key "reg<key>" is duplicated in table 'Registry'. Please remove one of the entries or rename a part of the primary key to avoid the collision.

答案:Yan's 回答我的 xml 看起来像:

ANSWER: After Yan's answer my xml looks like:

<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 添加 multiString 注册表值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆