我想在安裝過程中有條件地設置文件擴展名。據我所知,爲了在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。但是這是一個不包含任何文件的組件!
我該如何解決這個錯誤,或者我會以這種錯誤的方式解決問題?