我是 WiX 的新手。我刚刚安装了WixW 3.7以构建一个开源JiraSVN 插件。但是在 Visual Studio 中构建中断并出现以下错误:
The RegistryKey element contains an unexpected attribute 'ForceDeleteOnUninstall'.
The RegistryKey element contains an unexpected attribute 'ForceCreateOnInstall'.
Run Code Online (Sandbox Code Playgroud)
这些错误引用了 product.wxs 文件,其中包含以下元素:
<Component Id="C__Registry" Guid="{40D60013-...D30D5}" Win64="yes">
<RegistryKey Root="HKCR" Key="CLSID\{CF732FD7-...1A7E9D}" ForceDeleteOnUninstall="yes">
<RegistryValue Value="TortoiseSVN Jira Plugin" Type="string" Action="write" />
<RegistryKey Key="Implemented Categories">
<RegistryKey Key="{3494FA92-...5E7831}" ForceCreateOnInstall="yes" /> </RegistryKey>
</RegistryKey>
</Component>
Run Code Online (Sandbox Code Playgroud)
我也收到警告,例如:
The 'ForceDeleteOnUninstall' attribute is not declared.
The 'ForceCreateOnInstall' attribute is not declared.
Run Code Online (Sandbox Code Playgroud)
从我在 WiX 文档中可以找到的内容来看,这些是 WiX 框架中的标准属性。那么是什么原因导致他们无法识别呢?凡应他们被宣布?
首先,为什么要添加这些属性?从您发送的代码段来看,它们是不必要的,只会让您的安装变得臃肿。没有必要在那里强加任何东西。
其次,您的 Visual Studio 机器上必须安装了 WiX v3.5 或更低版本。这些属性是在 WiX v3.6 中添加的。