如何运行heat.exe并在WIX中注册一个DLL [英] How to run heat.exe and register a dll in wix

查看:109
本文介绍了如何运行heat.exe并在WIX中注册一个DLL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在regAsm中注册一个dll,现在我正在使用

I need to register a dll in regAsm and now i was using

 <CustomAction Id='comReg' Directory='INSTALLLOCATION'  
                ExeCommand='"[WindowsFolder]Microsoft.NET\Framework\v4.0.30319\regasm.exe" "[INSTALLLOCATION]myProduct.dll"  /codebase' Return='check' />

注册和注销

<CustomAction Id='comUnreg' Directory='INSTALLLOCATION' ExeCommand='"[WindowsFolder]Microsoft.NET\Framework\v4.0.30319\regasm.exe" /u "[INSTALLLOCATION]myProduct.dll"  /codebase' Return='check' />

我正在使用它,有时会安装它,有时会出现错误. 但所有人都建议使用Heat.exe, http://wixtoolset.org/documentation/manual/v3/overview/heat.html 甚至我都通过此链接,但我需要如何在wix中使用它以及如何处理这些东西.我需要一些教程

Am using it and sometimes its installing and somnetimes it gives error. But all are recommending to use something Heat.exe, http://wixtoolset.org/documentation/manual/v3/overview/heat.html even i went through this link,but i need how to use it in wix and what to do with this stuff.I need some tuitorial

推荐答案

热用于刮擦目录或文件并生成.wxs文件以包含在安装程序中.如果希望使用COM接口从.net dll生成注册表信息,则可以使用如下命令:

Heat is used to scrape directories or files and generate .wxs files to include in your installer. If you wish to generate registry information from a .net dll with a COM interface you can use a command like the following:

Heat.exe file C:\<path_to_com_dll>\com.dll -dr INSTALLFOLDER -srd -gg -sfrag -suid -out C:\<path+wxs_file_name_to_output>

以下是上述命令的一些示例输出:

Here is some sample output from a command like the above:

<Component Id="ExactaDatabaseAccess.dll" Guid="{96F922A0-38C8-4B58-9E3B-E6B0C24EE09D}">
    <Class Id="{E5CF8A66-AA42-432F-A036-97A3FC7E6EBC}" Context="InprocServer32" Description="ExactaDatabaseAccess.DatabaseAccessObj" ThreadingModel="both" ForeignServer="mscoree.dll">
        <ProgId Id="ExactaDatabaseAccess.DatabaseAccessObj" Description="ExactaDatabaseAccess.DatabaseAccessObj" />
    </Class>
    <File Id="ExactaDatabaseAccess.dll" KeyPath="yes" Source="$(var.BasePath)\ExactaDatabaseAccess.dll" />
    <RegistryValue Root="HKCR" Key="CLSID\{E5CF8A66-AA42-432F-A036-97A3FC7E6EBC}\Implemented Categories\{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}" Value="" Type="string" Action="write" />
    <RegistryValue Root="HKCR" Key="CLSID\{E5CF8A66-AA42-432F-A036-97A3FC7E6EBC}\InprocServer32\5.5.6.8" Name="Class" Value="ExactaDatabaseAccess.DatabaseAccessObj" Type="string" Action="write" />
    <RegistryValue Root="HKCR" Key="CLSID\{E5CF8A66-AA42-432F-A036-97A3FC7E6EBC}\InprocServer32\5.5.6.8" Name="Assembly" Value="ExactaDatabaseAccess, Version=5.5.6.8, Culture=neutral, PublicKeyToken=null" Type="string" Action="write" />
    <RegistryValue Root="HKCR" Key="CLSID\{E5CF8A66-AA42-432F-A036-97A3FC7E6EBC}\InprocServer32\5.5.6.8" Name="RuntimeVersion" Value="v2.0.50727" Type="string" Action="write" />
    <RegistryValue Root="HKCR" Key="CLSID\{E5CF8A66-AA42-432F-A036-97A3FC7E6EBC}\InprocServer32\5.5.6.8" Name="CodeBase" Value="file:///[#ExactaDatabaseAccess.dll]" Type="string" Action="write" />
    <RegistryValue Root="HKCR" Key="CLSID\{E5CF8A66-AA42-432F-A036-97A3FC7E6EBC}\InprocServer32" Name="Class" Value="ExactaDatabaseAccess.DatabaseAccessObj" Type="string" Action="write" />
    <RegistryValue Root="HKCR" Key="CLSID\{E5CF8A66-AA42-432F-A036-97A3FC7E6EBC}\InprocServer32" Name="Assembly" Value="ExactaDatabaseAccess, Version=5.5.6.8, Culture=neutral, PublicKeyToken=null" Type="string" Action="write" />
    <RegistryValue Root="HKCR" Key="CLSID\{E5CF8A66-AA42-432F-A036-97A3FC7E6EBC}\InprocServer32" Name="RuntimeVersion" Value="v2.0.50727" Type="string" Action="write" />
    <RegistryValue Root="HKCR" Key="CLSID\{E5CF8A66-AA42-432F-A036-97A3FC7E6EBC}\InprocServer32" Name="CodeBase" Value="file:///[#ExactaDatabaseAccess.dll]" Type="string" Action="write" />
</Component>

基本上,heat命令会生成一个包含上述组件的wxs文件.然后,您所需要做的就是在主安装程序中包含此组件或组件组.然后,它将创建注册表项,而不是运行regasm.然后,卸载将删除这些注册表项.

Basically the heat command generates a wxs file with the above component in it. Then all you need to do is to include this component or component group in your main installer. It will then create the registry entries instead of running regasm. The uninstall would then remove these registry entries.

这是将其包含在主安装程序中的方法:

Here is how you might include it in your main installer:

<Feature Id="ProductFeature" Title="ExactaSmallPick" Level="1">
    <ComponentRef Id="ExactaDatabaseAccess.dll"/>
</Feature>

这篇关于如何运行heat.exe并在WIX中注册一个DLL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆