我想在安装过程中有条件地设置文件扩展名。据我所知,为了在Wix中有条件地做任何事情,它应该是一个独立的组件。因此,对于每个文件类型关联,我想允许用户设置,我有一个组件类似以下内容:如何使用Wix有条件地设置文件扩展名?
<Component Id="FileAssocComponent_PS" Guid="DAFE9461-2DF0-934A-F204-6B28CEA23C01">
<Condition>FILE_ASSOC_PS</Condition>
<RegistryValue Root="HKLM" Key="SOFTWARE\PrinterApp\Capabilities\FileAssociations" Name=".prn" Value="PrinterApp.ps" Type="string" />
<RegistryValue Root="HKLM" Key="SOFTWARE\PrinterApp\Capabilities\MIMEAssociations" Name="application/postscript" Value="PrinterApp.ps" Type="string" />
<RegistryValue Root="HKLM" Key="SOFTWARE\Classes\PrinterApp.ps" Name="FriendlyTypeName" Value="PostScript File" Type="string" />
<ProgId Id="PrinterApp.ps" Description="PostScript File" Icon="PrinterApp.ico" Advertise="yes">
<Extension Id="ps">
<Verb Id="open" Command="Open" Argument=""%1""/>
</Extension>
</ProgId>
</Component>
但是这给了我以下错误:
error LGHT0204: ICE19: Extension: 'ps' advertises component: 'FileAssocComponent_PS'. This component cannot be advertised because the KeyPath type disallows it.
我已经尝试在其中一个注册表项上设置KeyPath =“yes”,但这不起作用 - 并且从我已经能够找到它期望的文件KeyPath。但是这是一个不包含任何文件的组件!
我该如何解决这个错误,或者我会以这种错误的方式解决问题?