COM 组件的 Windows 安装程序
我有一个 C++ activex 控件,需要为其制作安装程序。它需要删除 dll 并创建一些注册表项。
我有大约 6 个 .RGS 文件,这些文件是我通过 regsvr32 进行自我注册而制作的,它们可以工作。
为了进行安装程序,我手动将 RGS 脚本移植到 Visual Studio 2008 Windows 安装程序注册表 GUI 中。我觉得不可能进行精确的移植(例如 RGS 关键字,如 ForceRemove)。
没有办法从 IDL 文件生成这些文件吗?我这样做错了吗?
I have a C++ activex control that I need to make an installer for. It needs to drop the dll and make some registry keys.
I have about 6 .RGS files which I made for self-registration via regsvr32, which work.
To do an installer I am manually porting the RGS scripts into the visual studio 2008 windows installer registry GUI. I feel like its not possible to do an exact port (e.g. RGS keywords like ForceRemove).
Isn't there a way to generate these files from the IDL file? Am I doing this wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
SelfReg 不是 MSI 安装中的最佳实践,因为它不在进程中且脆弱。 Visual Studio 2008 安装程序受到限制,但您应该能够将 Register 属性设置为 vsdrfCOM 而不是 vsdrfCOMSelfReg。这将导致从 DLL 中获取 COM 元数据并在 MSI 中本地编写。
构建 MSI 后,您应该注意到 SelfReg 表是空的,并且注册表中为您的 COM 数据自动创建了一系列行。
注意:VDPROJ 在提取此 COM 时有点不稳定,因此它可能无法工作。您可能需要考虑更强大的工具,例如 InstallShield 或 Windows Installer XML。
SelfReg is not a best practice in an MSI install because it's out of process and fragile. Visual Studio 2008 Installers are limited but you should be able to set the Register property to vsdrfCOM instead of vsdrfCOMSelfReg. This will cause the COM meta data to be harvested from your DLL and authored natively in MSI.
After you build your MSI, you should notice the SelfReg table is empty and a serious of automatically authored rows in the Registry table for you COM data.
Note: VDPROJ is kind of flakey at extracting this COM so it may not work. You might have to consider a stronger tool such as InstallShield or Windows Installer XML.
你做错了。 .rgs 文件在那里,以便组件可以自行安装。任何安装程序都支持让组件自行安装。例如,以 Visual Studio 安装项目为例,设置 Register 属性。
You are doing it wrong. The .rgs files are there so that the component can install itself. Any installer supports letting a component install itself. A Visual Studio Setup project for example, set the Register property.