在 x64 机器上的 win32 应用程序中注册

Registry in win32 application on x64 machine

我正在使用 installshield 2010 Express Edition 制作 win32 应用程序的安装文件。

我在注册一些注册表项时遇到问题。

我配置了 installshield 项目 (.ise) 来注册两个注册表项,如下所示。

  1. [HKCU\Software\ProgName\SomeKeys]
  2. [HKLM\Software\ProgName\SomeKeys]

当我在 x64 机器上安装此安装程序时,HK 密钥写入 Wow6432Node [HKLM\Software\Wow6432Node\ProgName\SomeKeys]。这正是我想要的。

但是 HKCU 不会向 Wow6432Node 写入任何内容。 它写在 [HKCU\Software\ProgName\SomeKeys] 而不是 [HKCU\Software\Wow6432Node\ProgName\SomeKeys].

为什么会出现这个问题。

请给我任何建议。谢谢

Microsoft 的设计使它工作正常。请阅读 MSDN 文档:

Registry Redirector

Redirected keys are mapped to physical locations under Wow6432Node.

Registry Keys Affected by WOW64

Under WOW64, certain registry keys are redirected. When a 32-bit or 64-bit application makes a registry call for a redirected key, the registry redirector intercepts the call and maps it to the key's corresponding physical registry location. For more information, see Registry Redirector.

Other registry keys are shared by both 32-bit and 64-bit applications on 64-bit Windows. 32-bit registry calls to shared keys are not redirected. Instead, one physical copy of the key is mapped into each logical view of the registry.

HKCU\Software 下的用户定义子项是 共享的 ,因此它们没有 Wow6432Node 子项。

HKLM\Software 下的用户定义键被 重定向,因此它们有一个 Wow6432Node 子键。