RegDBQueryKey 无法同时列出 32 位和 64 位密钥的密钥
我在 InstallScript 中获取 32 位和 64 位安装的注册表项列表时遇到了问题。
我的机器是Windows Server 2008 64位。我可以在这台机器上安装SQL Server 2008 32位版本或64位版本。
现在,在安装过程中,我需要知道是否安装了任一 SQL Server 版本。
据我了解,
- 64位机器上的64位应用程序存储在
Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall
中。 - 64 位计算机上的 32 位应用程序存储在
Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall
中。
我编写了一个函数,该函数应该使用 RegDBQueryKey 函数在这两个位置搜索 SQL Server 安装。
即使我将 "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall"
传递给 RegDBQueryKey
,它也会列出 Software\\Wow6432Node\\ 的键Microsoft\\Windows\\CurrentVersion\\Uninstall
。
谁能帮我解决这个问题吗?
I have been facing a problem in InstallScript to get the list of registry keys for 32- and 64-bit installations.
My machine is Windows Server 2008 64-bit. I can install the SQL Server 2008 32-bit version or 64-bit version on this machine.
Now during the setup I need to know whether either of the SQL Server versions are installed.
As per my understanding,
- 64-bit applications on 64-bit machine are stored in
Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall
. - 32-bit applications on 64-bit machine are stored in
Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall
.
I have written a function which should search both these locations for SQL Server installation using the RegDBQueryKey
function.
Even if I pass "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall"
to RegDBQueryKey
, it lists the keys of Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall
.
Can anyone help me with this issue?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在调用 RegDBQueryKey 之前设置此标志:
这将禁用默认转发到密钥的 64 位版本,并为您提供 32 位版本。它适用于全局,因此完成后请确保使用以下命令重置标志:
Set this flag before your call to RegDBQueryKey:
That will disable the default forwarding to the 64-bit version of the key, and give you the 32-bit version. It applies globally, so when you're done make sure to reset the flag using: