加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

如何运行heat.exe并在wix中注册一个dll

发布时间:2020-12-14 02:05:35 所属栏目:Windows 来源:网络整理
导读:我需要在regAsm中注册一个dll,现在我正在使用它 CustomAction Id='comReg' Directory='INSTALLLOCATION' ExeCommand='"[WindowsFolder]Microsoft.NETFrameworkv4.0.30319regasm.exe" "[INSTALLLOCATION]myProduct.dll" /codebase' Return='check' / 注册
我需要在regAsm中注册一个dll,现在我正在使用它

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

注册和注销

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

我使用它,有时它的安装和somne??times它给出错误.
但所有人都建议使用Heat.exe,
http://wixtoolset.org/documentation/manual/v3/overview/heat.html甚至我经历了这个链接,但我需要如何在wix中使用它以及如何处理这些东西.我需要一些tuitorial

解决方法

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

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

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

<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}InprocServer325.5.6.8" Name="Class" Value="ExactaDatabaseAccess.DatabaseAccessObj" Type="string" Action="write" />
    <RegistryValue Root="HKCR" Key="CLSID{E5CF8A66-AA42-432F-A036-97A3FC7E6EBC}InprocServer325.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}InprocServer325.5.6.8" Name="RuntimeVersion" Value="v2.0.50727" Type="string" Action="write" />
    <RegistryValue Root="HKCR" Key="CLSID{E5CF8A66-AA42-432F-A036-97A3FC7E6EBC}InprocServer325.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,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.然后卸载将删除这些注册表项.

以下是如何将其包含在主安装程序中:

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读