简体   繁体   English

使用WIX工具集和Heat工具集为BHO PLugin开发.msi文件

[英]Develop .msi file using wix toolset and heat toolset for BHO PLugin

Scenario I have created a .dll file for Internet Explorer 10 Plugin. 方案我为Internet Explorer 10插件创建了一个.dll文件。 Using regasm I register the .dll and works fine in IE10. 使用regasm,我注册.dll并在IE10中正常工作。 I want to develop a .msi file so that i can distribute it. 我想开发一个.msi文件,以便我可以分发它。 I am having several problems while developing it. 我在开发它时遇到了几个问题。 During installation the dll files should be registered in the registry, but the files are never getting registered, but without the .msi file, if simply registering the .dll works well. 在安装过程中,应在注册表中注册dll文件,但是如果简单地注册.dll即可,则永远不会注册该文件,但是如果没有.msi文件,则不会注册。 The problem occurs when the .dll files are packaged into .msi file. .dll文件打包到.msi文件中时,会发生此问题。 I have gone through the Wix doc, there it is suggested to use heat toolset. 我已经阅读过Wix文档,建议使用加热工具集。 Following was the output 以下是输出

<?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>

I am getting confused as to where should I include this output into my .wxs file.Even generating the above file , still the problem of registering the .dll exists. 我对应该将此输出包含在.wxs文件中的位置感到困惑。即使生成上述文件,仍然存在注册.dll的问题。

If somebody can throw some light on it would be appreciated.Thank you 如果有人可以对此有所了解,将不胜感激。谢谢

To include the generated output you only have to add a ComponentRef in your feature 要包括生成的输出,您只需在功能中添加ComponentRef

<ComponentRef Id="cmpA742B1B0BA7235FA026C505929929E25" />

You have to specify both your .wxs files (the one containing your product and the generated file) in the candle command and then both generated .wixobj files in your light command. 您必须在Candle命令中指定两个.wxs文件(一个包含产品和生成的文件),然后在light命令中指定两个生成的.wixobj文件。

Check this link for more Information about cross file references: http://wix.tramontana.co.hu/tutorial/upgrades-and-modularization/fragments 检查此链接以获取有关交叉文件引用的更多信息: http : //wix.tramontana.co.hu/tutorial/upgrades-and-modularization/fragments

When harvesting multiple files consider using the "-cg ComponentGroupName" flag with heat. 收获多个文件时,请考虑对热量使用“ -cg ComponentGroupName”标志。 With that you can include all components at once 这样,您可以一次包含所有组件

<ComponentGroupRef Id="ComponentGroupName" />

About the registry keys not getting created, there could be multiple reasons. 关于未创建注册表项,可能有多种原因。 Maybe the file greyhound.dll is already at the desired location. 也许文件greyhound.dll已经在所需的位置。 Windows will only look if the keypath of the component exists, if it does the whole component won't be installed. Windows只会查看组件的键路径是否存在,如果存在,则不会安装整个组件。

Look into the logs in the AppData\\Local\\Temp folder for more information 查看AppData \\ Local \\ Temp文件夹中的日志以获取更多信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM