简体   繁体   English

无法访问HKEY_CLASSES_ROOT的远程DLL注册

[英]Remote DLL Registration without access to HKEY_CLASSES_ROOT

We have a legacy VB6 application that updates itself on startup by pulling down the latest files and registering the COM components. 我们有一个遗留的VB6应用程序,它通过下拉最新文件和注册COM组件在启动时自行更新。 This works for both local (regsvr32) ActiveX COM Components and remote (clireg32) ActiveX COM components registered in COM+ on another machine. 这适用于本地(regsvr32)ActiveX COM组件和在另一台机器上的COM +中注册的远程(clireg32)ActiveX COM组件。

New requirements are preventing us from writing to HKEY_LOCAL_MACHINE (HKLM) for security reasons, which is what obviously happens by default when calling regsvr32 and clireg32. 出于安全原因,新要求阻止我们写入HKEY_LOCAL_MACHINE(H​​KLM),这在调用regsvr32和clireg32时默认情况下显然会发生。

We have come up with an way to register the local COM component under HKEY_CURRENT_USER\\Software\\Classes (HKCU) using the RegOverridePredefKey Windows API method. 我们已经提出了一种使用RegOverridePredefKey Windows API方法在HKEY_CURRENT_USER \\ Software \\ Classes(HKCU)下注册本地COM组件的方法。 This works by redirecting the inserts into the registry to the HKCU location. 这通过将插入重定向到注册表到HKCU位置来工作。 Then when the COM components are instantiated, windows first looks to HKCU before looking for component information in HKLM. 然后,当实例化COM组件时,Windows首先查找HKCU,然后在HKLM中查找组件信息。 This replaces what regsvr32 is doing. 这取代了regsvr32正在做的事情。

The problem we are experiencing at this time is when we attempt to register VBR / TLB using clireg32, this registration process also adds registration keys to HKEY_LOACL_MACHINE. 我们此时遇到的问题是当我们尝试使用clireg32注册VBR / TLB时,此注册过程还会向HKEY_LOACL_MACHINE添加注册密钥。

Is there a way to redirect clireg32.exe to register component is HKEY_CURRENT_USER? 有没有办法将clireg32.exe重定向到注册组件是HKEY_CURRENT_USER? Are there any other methods that would allow us to register these COM+ components on clients machine with limited security access? 是否有任何其他方法可以让我们在具有有限安全访问权限的客户端计算机上注册这些COM +组件?

Our only solution at this time would be to manually write the registration information to the registry, but that is not ideal and would be a maint issue. 我们目前唯一的解决方案是手动将注册信息写入注册表,但这并不理想,并且会成为一个问题。

I see few happy answers here. 我在这里看到几个快乐的答案。 The notion of an app using 12 year old technology needing to install updates is an odd one and just not well supported on modern machines. 使用需要安装更新的12年技术的应用程序的概念是奇怪的,并且在现代机器上得不到很好的支持。 A common solution like reg-free COM is out, I think, not compatible with COM+. 我认为像reg-free COM这样的常见解决方案与COM +不兼容。 It is also pretty strange that a bug-fix style update would need to re-register components. 错误修复样式更新需要重新注册组件也很奇怪。 Have you verified that this is actually required? 你确认这实际上是必需的吗?

Extending on that theme, how often do you actually change GUIDs in deployments? 扩展该主题,您实际更改部署中的GUID的频率是多少? Taking charge of the registration yourself rather than leaving it up to the components themselves should be workable when the keys don't constantly change. 当密钥不经常更改时,自己负责注册而不是将其留给组件本身应该是可行的。 Could be as easy as capturing the registration with SysInternals' ProcMon utility, compose a .reg file that sets HKCU keys instead. 可以像使用SysInternals的ProcMon实用程序捕获注册一样简单,编写一个设置HKCU键的.reg文件。

Beyond that, you really do need to gain the right to registry keys that are not writable. 除此之外,您确实需要获得不可写的注册表项的权限。 If you can't get the okay from the customer then consider asking for a scheduled task that installs updates. 如果您无法从客户那里获得好处,那么请考虑要求安装更新的计划任务。 They can get access, provided the sys admin allows it. 如果系统管理员允许,他们可以访问。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM