如何在wiix 3.9中正确注册DLL [英] how to register DLL's properly in wix 3.9

查看:116
本文介绍了如何在wiix 3.9中正确注册DLL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建安装程序,并使用heat.exe收集所有必需的文件.但是我需要注册一些DLL和OCX文件,我环顾四周如何做,因为在stackoverflow以及其他网站和论坛上,如何实现注册这些文件似乎还存在一些争论. 我想使用以下内容:SelfRegCost="1",因为它看起来是注册文件的最简单方法.芽人们不喜欢它,因为它可能会在修复或卸载程序时出现问题.

I am building an installer and use heat.exe to harvest all the required files. however I need to register some DLL and OCX files, I looked around how to do it bud there seems te be some debate aboud how to implement registering those files, on stackoverflow as well as on other websites and forums. I would like to use the following: SelfRegCost="1" since it looks like the most simple way to register files. bud people dont like it because it could give problems when repairing or uninstalling the program.

您对此方法有何看法?您对我有什么建议? 我们将不胜感激推荐的代码实现示例.

what is your opinion regarding this method and what would you suggest me? a example of the code implementation recommended would be highly appreciated.

提前谢谢.

推荐答案

简而言之,任何形式的自我注册(COM都是其中之一)是一种反模式.有多种原因,其中有一些是

Simply put, any form of self registration (COM being one of them) is an antipattern. There are various reasons a few of which are:

1)它们增加了安装的脆弱性

1) They add fragility to the install

2)他们可以在失败时停止静默安装.

2) They can halt a silent install when they fail.

3)他们没有记录有关失败原因的任何信息.

3) They don't log any information on why they failed.

4)它们没有进行;安装程序不知道它们(无法修复)

4) They are out of process; the installer isn't aware of them (no repair)

5)它们破坏了Windows Installer的事务性(不回滚)

5) They break the transactional nature of Windows Installer (no rollback)

6)他们减慢了安装速度

6) They slow the install down

7)它们隐藏了实现细节,无法被观察或变换

7) They hide implementation details and can't be observed or transformed

到目前为止,我要说的不是问题,而是最佳实践的事实.但是,我想最好的做法最终还是意见.不过,在过去的20年中,我已经撰写了成千上万的安装程序,我可以毫无疑问地说,应尽可能跳过自我注册.而是使用Heat来收获" COM元数据并将其创作到您的wxs代码中,以便MSI可以为您本机处理.如果Heat无法获得所有详细信息,则可以采用其他技巧.

I'd go so far to say this isn't a matter of opinion but rather a matter of best practice facts. But I suppose at the end of the day best practices are just opinions also. Still, I've authored thousands of installers over the last 20 years and I can say without a doubt that self registration should be skipped whenever possible. Instead use Heat to "harvest" the COM meta data and author it into your wxs code so MSI can handle this natively for you. There are other tricks that can be employed if Heat is unable to get all the details.

最后,尽可能不要使用COM.例如,您可以考虑使用RegFree COM清单来模拟组件的注册.

Finally, don't use COM whenever possible. For example you could consider using a RegFree COM manifest instead to simulate the registration of the component.

请参阅:不要使用SelfReg和TypeLib表.

这篇关于如何在wiix 3.9中正确注册DLL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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