MSI注册dll-自注册被认为是有害的 [英] MSI register dll - Self-Registration considered harmful

查看:172
本文介绍了MSI注册dll-自注册被认为是有害的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 .NET Winform应用程序,该应用程序需要在安装过程中注册本机dll.我的问题是如何在MSI安装过程中注册一个dll( regsvr32 ABC.dll )?类似地,如何在卸载过程中注销dll?

I have a .NET winform application that requires to register a native dll during installation. My question is how can I register a dll (regsvr32 ABC.dll) as part of MSI installion process? Similary how can I un-register a dll as part of un-installation process?

推荐答案

vsdrfCOMSelfReg不是最佳实践.尝试使用vsdrfCOM.这将从DLL中提取"(或尝试使用vdproj有时是POS)DLL的COM元数据并将其创作到正确的COM表中.最好是在安装时希望对DllRegisterServer的进程外调用能够正常工作.

vsdrfCOMSelfReg is not a best practice. Try vsdrfCOM instead. This will "extract" ( or try, vdproj is a POS sometimes ) the COM metadata from the DLL and author it into the correct COM tables. This is better then hoping an out of process call to DllRegisterServer will work at install time.

现在,MSI本身就知道您的COM资源,它将为您处理安装和卸载.

Now that MSI is natively aware of your COM resources, it will handle install and uninstall for you.

这篇关于MSI注册dll-自注册被认为是有害的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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