是否有可能以任何语言(c/c++/c#、VB 等我不关心)导出所有 COM 注册信息(例如 clsid、progid、typelib、interface、appid ETC)?或者您是否知道可以导出该信息(包括所有 32 位和 64 位信息)的可靠工具?
基本上我想做的是 regsvr32 所做的,但“在一个文件中”,而不是将其写入注册表。解决方案可以是 API 调用或程序集类或任何支持我这样做的东西,也可以是一个可以将信息导出到文件的工具。请注意,该工具(如果是的话)应对 COM 和互操作程序集执行此操作。 (我对 wisecomcaputure 或 adminstudio 的等价物不感兴趣)
为了澄清,我的观点在这里: 我是一名安装工程师。我基本上想知道一种方法来获取通常通过调用 regsvr32 放置在注册表中的 COM 或互操作对象的所有注册信息。
我很高兴得到任何帮助或提示
伊莲娜
最佳答案
有一个鲜为人知但非常方便的 API:RegOverridePredefKey
.它允许完全按照您的要求进行操作:
The
RegOverridePredefKey
function is intended for software installation programs. It allows them to remap a predefined key, load a DLL component that will be installed on the system, call an entry point in the DLL, and examine the changes to the registry that the component attempted to make. The installation program can then write those changes to the locations intended by the DLL, or make changes to the data before writing it.
关注the docs了解更多详情。重新映射 HKEY_CLASSES_ROOT
键并调用 COM 服务器的 DllRegisterServer
后,使用 RegSaveKey
将重新映射的 key 保存到文件,处理文件并将映射更改回 HKEY_CLASSES_ROOT
。
关于c++ - 导出 COM 注册信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23427797/