2

我尝试将兼容性助手的注册表项添加到这样的 wix 设置中:

<File Id="File1.exe" Name="File1.exe" LongName="File1.exe" Source="..\Binaries\File1.exe" DiskId="1" />
<File Id="File2.exe" Name="File2.exe" LongName="File2.exe" Source="..\Binaries\File2.exe" DiskId="1" />
<File Id="File3.exe" Name="File3.exe" LongName="File3.exe" Source="..\Binaries\File3.exe" DiskId="1" />
<Registry Root="HKLM"
          Key="Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Compatibility Assistant"
          Name="ExecutablesToExclude"
          Type="multiString"
          Action="append">
    <RegistryValue Action="append" Value="[File1.exe]" />
    <RegistryValue Action="append" Value="[File2.exe]" />
    <RegistryValue Action="append" Value="[File3.exe]" />
</Registry>

但是在安装时不会生成任何密钥。我错过了什么或做错了什么吗?我从这个问题和 wix 文档中得到了我正在做的事情的详细信息。

更新:我认为语法有点不同,因为我指出的问题使用了不同版本的 WiX。我使用的语法是 WiX 2 唯一接受的语法,而且这个 wix 文件构建得很好——它只是不会生成新的注册表项。


更新:我误诊了问题;wix 脚本正常工作,但将值放在Wow6432bit注册表的节点中,因为包含组件没有属性Win64="yes"

4

1 回答 1

1

据我所知,WiX2 中的RegistryValue元素没有属性。我想知道,您的示例如何编译时没有错误...

无论如何,尝试像这样重写您的 Registry 元素:

<Registry Root="HKLM"
          Key="Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Compatibility Assistant"
          Name="ExecutablesToExclude"
          Type="multiString"
          Action="append">
    <RegistryValue>[File1.exe]</RegistryValue>
    <RegistryValue>[File2.exe]</RegistryValue>
    <RegistryValue>[File3.exe]</RegistryValue>
</Registry>
于 2011-01-28T08:23:10.320 回答