现在我使用类似这样的东西:
<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>"
在表'Registry'中重复。请删除其中一个条目或重命名主键的一部分以避免冲突。
答案:根据Yan的回答,我的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>