【问题标题】:Develop .msi file using wix toolset and heat toolset for BHO PLugin使用 wix 工具集和 heat 工具集为 BHO Plugin 开发 .msi 文件
【发布时间】:2014-07-29 13:06:48
【问题描述】:

场景 我为 Internet Explorer 10 插件创建了一个 .dll 文件。使用 regasm 我注册了 .dll 并在 IE10 中正常工作。我想开发一个 .msi 文件以便我可以分发它。我在开发它时遇到了几个问题。在安装过程中,应该在注册表中注册 dll 文件,但这些文件永远不会被注册,但没有 .msi 文件,如果简单地注册 .dll 就可以了。将 .dll 文件打包到 .msi 文件时会出现此问题。我已经浏览了 Wix 文档,建议使用 heat 工具集。以下是输出

<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">


<Fragment>
    <DirectoryRef Id="TARGETDIR">
        <Directory Id="dirCFD54C07EFB094CAD317543172D62CC3" Name="bin" />
    </DirectoryRef>
</Fragment>
<Fragment>
    <DirectoryRef Id="dirCFD54C07EFB094CAD317543172D62CC3">
        <Component Id="cmpA742B1B0BA7235FA026C505929929E25" Guid="{A6A2DF10-0BC0-410d-    8582-79DA83A83F19}">
            <Class Id="{8A194578-81EA-4850-9911-13BA2D71EFBD}" Context="InprocServer32" Description="Greyhound.BHO.BHO" ThreadingModel="both" ForeignServer="mscoree.dll">
                <ProgId Id="Greyhound.BHO.BHO" Description="Greyhound.BHO.BHO" />
            </Class>
            <File Id="filB636C21F357A14C42DFD0FBC9300D2F4" KeyPath="yes" Source="SourceDir\bin\greyhound.dll" />
            <RegistryValue Root="HKCR" Key="CLSID\{8A194578-81EA-4850-9911-13BA2D71EFBD}\Implemented Categories\{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}" Value="" Type="string" Action="write" />
            <RegistryValue Root="HKCR" Key="CLSID\{8A194578-81EA-4850-9911-13BA2D71EFBD}\InprocServer32\1.0.0.0" Name="Class" Value="Greyhound.BHO.BHO" Type="string" Action="write" />
            <RegistryValue Root="HKCR" Key="CLSID\{8A194578-81EA-4850-9911-13BA2D71EFBD}\InprocServer32\1.0.0.0" Name="Assembly" Value="Greyhound, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" Type="string" Action="write" />
            <RegistryValue Root="HKCR" Key="CLSID\{8A194578-81EA-4850-9911-13BA2D71EFBD}\InprocServer32\1.0.0.0" Name="RuntimeVersion" Value="v4.0.30319" Type="string" Action="write" />
            <RegistryValue Root="HKCR" Key="CLSID\{8A194578-81EA-4850-9911-13BA2D71EFBD}\InprocServer32\1.0.0.0" Name="CodeBase" Value="file:///[#filB636C21F357A14C42DFD0FBC9300D2F4]" Type="string" Action="write" />
            <RegistryValue Root="HKCR" Key="CLSID\{8A194578-81EA-4850-9911-13BA2D71EFBD}\InprocServer32" Name="Class" Value="Greyhound.BHO.BHO" Type="string" Action="write" />
            <RegistryValue Root="HKCR" Key="CLSID\{8A194578-81EA-4850-9911-13BA2D71EFBD}\InprocServer32" Name="Assembly" Value="Greyhound, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" Type="string" Action="write" />
            <RegistryValue Root="HKCR" Key="CLSID\{8A194578-81EA-4850-9911-13BA2D71EFBD}\InprocServer32" Name="RuntimeVersion" Value="v4.0.30319" Type="string" Action="write" />
            <RegistryValue Root="HKCR" Key="CLSID\{8A194578-81EA-4850-9911-13BA2D71EFBD}\InprocServer32" Name="CodeBase" Value="file:///[#filB636C21F357A14C42DFD0FBC9300D2F4]" Type="string" Action="write" />
            <RegistryValue Root="HKLM" Key="Software\Microsoft\Windows\CurrentVersion\Explorer\Browser Helper Objects\{8a194578-81ea-4850-9911-13ba2d71efbd}" Name="Alright" Value="1" Type="integer" Action="write" />
        </Component>
    </DirectoryRef>
</Fragment>

我很困惑我应该在哪里将此输出包含到我的 .wxs 文件中。即使生成上述文件,仍然存在注册 .dll 的问题。

如果有人能解释一下,将不胜感激。谢谢

【问题讨论】:

    标签: c# dll wix bho heat


    【解决方案1】:

    要包含生成的输出,您只需在功能中添加一个 ComponentRef

    <ComponentRef Id="cmpA742B1B0BA7235FA026C505929929E25" />
    

    您必须在蜡烛命令中指定两个 .wxs 文件(包含您的产品和生成文件的文件),然后在您的 light 命令中指定两个生成的 .wixobj 文件。

    查看此链接以获取有关交叉文件引用的更多信息: http://wix.tramontana.co.hu/tutorial/upgrades-and-modularization/fragments

    当收集多个文件时,请考虑使用带有 heat 的“-cg ComponentGroupName”标志。 这样您就可以一次包含所有组件

    <ComponentGroupRef Id="ComponentGroupName" />
    

    关于未创建注册表项,可能有多种原因。也许文件 grayhound.dll 已经在所需的位置。 Windows 只会查看组件的 keypath 是否存在,如果存在则不会安装整个组件。

    查看 AppData\Local\Temp 文件夹中的日志以获取更多信息

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多