如何在WiX 3中注册Win32 COM DLL文件? [英] How do you register a Win32 COM DLL file in WiX 3?

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

问题描述

我找到了注册DLL的示例,使用Windows Installer XML工具集在MSI文件中注册COM Interop。 ,WiX抱怨AssemblyRegisterComInterop属性。

I found an example on registering DLLs, Registering an Assembly for COM Interop in a MSI file with the Windows Installer XML toolset., and WiX complains about the "AssemblyRegisterComInterop" attribute.

我删除它,并将Assembly属性更改为win32,它说我需要指定AssemblyManifest属性,但我应该放在哪里?

I removed that and changed the "Assembly" attribute to win32, and it says I need to specify the AssemblyManifest attribute, but what should I put there?

推荐答案

最简单的方法(和Rob M将会讨论并讨论这是否是错误的)只是使用 SelfRegCost = 1 对于DLL的文件标记。

The easiest way (and Rob M will rant and rave about how this is wrong) is just to use SelfRegCost=1 on the File tag for the DLL.

这是错误的,因为我们应该明确地控制DLL的注册,不允许它只是通过DllRegisterServer运行任意代码。理论上,除了在调用DllRegisterServer时在注册表中放置适当的条目之外,DLL不应该做任何事情。不幸的是,他们中的很多人做的比这更多,所以自注册可能是使安装工作的唯一方法。

This is wrong, because we should be explicitly controlling the registration of the DLL, not allowing it just to run arbitrary code via DllRegisterServer. The theory being that a DLL should do nothing beyond putting the appropriate entries in the registry when DllRegisterServer is called. Unfortunately, a lot of of them do more than that, so self-registration might be the only way to get your install to work.

这也是错误的,因为这意味着Windows安装系统不知道任何关于这些注册表项,什么应该和不应该在那里。

It's also wrong, because that means the Windows installation system doesn't know anything about those registry keys, and what should and shouldn't be there. That means repairing won't work, and possibly un-installation won't clean up properly, etc.

否则,您可以通过指向<$ p>生成适当的WiX代码, c $ c> heat.exe ,并将其输出集成到当前的WiX项目中。您将获得各种类,ProgID,TypeLib和注册表标签。您可能需要手动编辑该输出以便进行编译。

Otherwise, you can generate the appropriate WiX code by pointing heat.exe at your DLL, and integrating its output into your current WiX project. You'll get a variety of Class, ProgID, TypeLib, and Registry tags. You may need to manually edit that output to get it to compile.

我希望能有所帮助。

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

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