现在我使用这样的东西:
<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/