我正在尝试创建一个单独的功能,用于在WiX安装程序中注册文件关联:
<Feature Id="AssociationFeature" Title="File Association" Description="Register file association">
<ComponentRef Id="AssociationComponent" />
</Feature>
但是,负责注册文件关联和安装可执行文件本身的部分位于不同的组件中:
<!-- Component containing application executable -->
<Component Id="ExeComponent" Guid="F183BFA1-A7AB-45E4-1FB7-0A680826C58E">
<File Name="my-application.exe" Id="Executable" />
</Component>
<!-- Component registering the file extension association -->
<Component Id="AssociationComponent" Guid="1575A831-5FE0-4720-9646-535C88CDE46B">
<RegistryValue Root="HKLM" Key="SOFTWARE\Classes\my-application.abc" Name="FriendlyTypeName" Value="My Application" Type="string" />
<ProgId Id="my-application.abc">
<Extension Id="abc">
<Verb Id="Open" TargetFile="Executable" /> <!-- This gives the error -->
</Extension>
</ProgId>
</Component>
这会导致以下错误:
错误LGHT0204: ICE69 :组件参考不匹配。注册表表的条目“ ...”属于组件“
AssociationComponent
”。但是,列“Value
”中的格式化字符串引用了文件“Executable
”,该文件属于组件“ExeComponent
”。组件属于不同的功能
有什么方法可以在与可执行文件不同的单独组件中注册文件关联?
答案 0 :(得分:0)
处理此问题的一般方法是由两个部分组成。两者都包含文件,但是只有一个组件包含快捷方式。在安装时,只需选择适当的组件即可。只要组件(或功能部件)上的条件确保不会同时安装两个组件,就可以正常工作。