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

在wix中注册com dll

发布时间:2020-12-13 22:44:42 所属栏目:Windows 来源:网络整理
导读:如果不是自我注册.那么我们如何在使用WIX进行安装时执行COM dll注册? 根据tutorial,我使用了ComPlusApplication示例(非.net dll).但它不起作用.它没有注册. 我可以成功地从命令行使用regsvr32进行注册. 我读到没有为注册com dll创建自定义操作. 那么最好的
如果不是自我注册.那么我们如何在使用WIX进行安装时执行COM dll注册?

根据tutorial,我使用了ComPlusApplication示例(非.net dll).但它不起作用.它没有注册.

我可以成功地从命令行使用regsvr32进行注册.
我读到没有为注册com dll创建自定义操作.

那么最好的方法是什么?
如果我们需要使用heat,我们在哪里编写命令并将结果wxs添加到主项目中?

我强烈建议使用Wix工具Heat.exe来获取注册com组件所需的所有数据,然后引用.wxs文件中的片段,如下所示:
<ComponentGroupRef Id="FooBar.dll" />

或者将它包含在.wxs文件中,如下所示:

<?include FooBar.dll.wxi?>

此方法使您可以完全控制Com组件的注册/取消注册期间发生的情况.

但是,您仍然可以在Wix项目中使用Regsvr32.但它依赖于COM组件中RegisterServer / UnregisterServer函数的正确实现

<CustomAction Id="RegisterFooBar" 
                  Directory="INSTALLDIR" 
                  ExeCommand='regsvr32.exe /s "[INSTALLDIR]FooBar.dll"'> 
    </CustomAction> 
    <CustomAction Id="UnregisterFooBar" 
                  Directory="INSTALLDIR" 
                  ExeCommand='regsvr32.exe /s /u "[INSTALLDIR]FooBar.dll"'> 
    </CustomAction>

然后将您的操作添加到安装序列.

<InstallExecuteSequence> 
        <Custom Action="RegisterFooBar" After="InstallFinalize">NOT Installed</Custom>
        <Custom Action="UnregisterFooBar" After="InstallFinalize">REMOVE="ALL"</Custom>
    </InstallExecuteSequence>

(编辑:李大同)

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

    推荐文章
      热点阅读