为什么 Windows Vista x64 上的 x86 WiX 安装程序不将密钥写入注册表中的 Wow6432Node?

发布于 2024-09-04 03:42:33 字数 830 浏览 3 评论 0原文

我有一个写入 HKLM\Software\DroidExplorer\InstallPath 的安装程序。在任何 x86 计算机上,它都可以很好地写入预期位置,而在 Windows XP x64 和 Windows 7 x64 上,它也可以写入预期位置,实际上是 HKLM\Software\Wow6432Node\DroidExplorer\InstallPath。

稍后在安装过程中,我的引导程序(也是 x86)尝试读取该值。在所有 x86 Windows 计算机上,它都是成功的,在 Windows XP x64 和 Windows 7 x64 上,但 Windows Vista x64 无法找到密钥。如果我查看注册表,它实际上并没有将其写入 Windows Vista 上的 Wow6432Node;它将其写入Software\DroidExplorer\InstallPath

如果我不强制告诉安装程序写入 Wow6432Node,它会将值写入 Software\DroidExplorer\InstallPath,但引导程序仍会尝试在 Wow6432Node 中查找,因为 注册表反射。这适用于所有 x64 系统。

为什么 Windows Vista x64 是我唯一遇到此问题的系统?有办法解决这个问题吗?

我只想添加一个仍处于打开状态的编辑。以下建议均未解决此问题。

I have an installer that writes to HKLM\Software\DroidExplorer\InstallPath. On any x86 machine it writes just fine to the expected location, and on Windows XP x64 and Windows 7 x64 it also writes to the expected location, which is actually HKLM\Software\Wow6432Node\DroidExplorer\InstallPath.

Later on during the install, my bootstrapper, which is also x86, attempts to read the value. On all x86 Windows machines it is successful, and on Windows XP x64 and Windows 7 x64, but Windows Vista x64 is unable to locate the key. If I look in the registry, it doesn't actually write it to Wow6432Node on Windows Vista; it writes it to Software\DroidExplorer\InstallPath.

If I do not forcefully tell the installer to write to Wow6432Node, it writes the value to Software\DroidExplorer\InstallPath, but the bootstrapper still tries to look in Wow6432Node because of the registry reflection. This is on all x64 systems.

Why is Windows Vista x64 the only one I have this issue with? Is there a way around this?

I just want to add an edit that this is still open. None of the suggestions below have yet to solve this issue.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

帅冕 2024-09-11 03:42:33

注册表重定向在 Windows Vista x64 上失败这一事实非常奇怪,因为根据 MSDN,注册表重定向器,Windows Vista 也应该受到它的影响。

另一个答案中的评论,“当我构建安装在 x64 PFiles 中的应用程序的 x64 版本时,这不起作用,它告诉我我正在使用 64 位安装目录并且不允许Win64=no”让我对您正在构建的 MSI 类型感到有点困惑。

注册表重定向只会影响 MSI 中的 32 位组件。如果 WiX 项目的目标平台是 x86,则生成的 MSI 是 32 位 MSI,并且所有组件都将受到注册表重定向的影响。

另一方面,如果 WiX 项目的目标平台是 x64,则唯一受注册表重定向影响的组件将是那些显式标记为 Win64=no 的组件。 (默认情况下,如果您的目标平台是 x64,WiX 假定所有组件都是 64 位。)

请注意,如果注册表项的组件包含在 ProgramFiles64 文件夹中,则 WiX 将假定它是 64 位组件,并且不会受到注册表重定向的影响。这就是 WiX 不允许您在该组件上指定 Win64=no 的原因。

您应该验证包含您确实想要重定向的注册表项的每个组件是否都配置为使用 ProgramFiles(32 位),因为它是 x86 和 x64 MSI 文件中的父目录。

The fact that registry redirection is failing on Windows Vista x64 is very strange because according to MSDN, Registry Redirector, Windows Vista should also be affected by it.

A comment in another answer, "This does not work, when I build the x64 version of the application, that installs in the x64 PFiles, it tells me that I am using a 64-bit install directory and doesn't allow the Win64=no" left me a bit confused as to what type of MSIs you are building.

Registry redirection is only going to affect 32-bit components in your MSI. If the target platform for the WiX project is x86, then the resulting MSI is a 32-bit MSI and all components will be affected by registry redirection.

On the other hand, if the target platform of the WiX project is x64, then the only components that will be affected by the registry redirection will be those that are explicitly marked as Win64=no. (By default, WiX assumes that all components are 64-bit if your target platform is x64.)

Note that if the component for your registry entry is included inside the ProgramFiles64 folder, then WiX will assume that it is a 64-bit component, and it will not be affected by registry redirection. This is the reason WiX is not allowing you to specify Win64=no on that component.

You should verify that every component that contains a registry entry that you do want to be redirected is configured to use ProgramFiles (the 32-bit one) as it's the parent directory in both your x86 and your x64 MSI files.

独自唱情﹋歌 2024-09-11 03:42:33

可能您必须更改 32 位引导程序的代码。您应该测试应用程序是否在 64 位操作系统下运行,例如关于 IsWow64Process 函数(请参阅 http://msdn.microsoft.com/en-us/library/ms684139.aspx)。如果操作系统是 64 位,那么您应该使用 KEY_QUERY_VALUE | 打开密钥RegOpenKeyEx 中的 KEY_WOW64_64KEY 标志(或与 KEY_WOW64_64KEY 组合的其他标志)。

如果您在 64 位操作系统下遇到文件重定向的严重问题,您可以在引导程序中调用 Wow64DisableWow64FsRedirection (请参阅 http://msdn.microsoft.com/en-us/library/aa365743.aspx)。

根据评论更新:如果您希望 MSI 创建 Software\WOW6432Node\DroidExplorer\InstallPath 密钥(例如,如果您安装 32 位应用程序),您可以直接这样做。当然,您应该让 Windows Installer 在 64 位操作系统上运行,并在组件表中使用 VersionNT64 属性(或 Msix64Intel64,如果需要)。

更新 2 考虑对具有您创建的注册表项的组件使用 msidbComponentAttributesDisableRegistryReflection 或 /and msidbComponentAttributes64bit 标志。此外,验证您在模板摘要x64;1033Intel;1033)和页数摘要中使用的值摘要信息流中的属性(必须为 200 或更大)。

Probably you have to change the code of your 32-bit bootstrapper. You should test whether the application run under 64-bit operation system, for example with respect of IsWow64Process function (see http://msdn.microsoft.com/en-us/library/ms684139.aspx). If the operation system is 64-bit then you should open key with KEY_QUERY_VALUE | KEY_WOW64_64KEY flag (or other flags combined with KEY_WOW64_64KEY) in RegOpenKeyEx.

If you will receive close problems with file redirection under 64-bit operation systems you can call Wow64DisableWow64FsRedirection in the bootstrapper (see http://msdn.microsoft.com/en-us/library/aa365743.aspx).

UPDATED based on the comment: If you want that Software\WOW6432Node\DroidExplorer\InstallPath key will be created by MSI (for example it you install a 32-bit application) you can do this directly. Of cause you should Windows Installer are running on 64-bit operation systems with conditions in the component table using VersionNT64 property (or Msix64 or Intel64 if needed).

UPDATED 2 consider usage of msidbComponentAttributesDisableRegistryReflection or /and msidbComponentAttributes64bit flags for components with registry keys which you create. Moreover verify which values you use in Template Summary (x64;1033 or Intel;1033) and Page Count Summary property (must be 200 or greater) in the summary information stream.

誰認得朕 2024-09-11 03:42:33

执行此操作的唯一方法是通过自定义操作。

您必须调用 RegOpenKeyEx 并将 REGSAM samDesired 参数设置为 0x100,以强制使用 64 位注册表。请参阅此处的 RegOpenKeyEx。

您无法使用标准 .NET 注册表类来执行此操作。如果使用 .NET 语言,则必须手动使用 P/Invoke

提供两个安装程序可能会更好,一个用于 64 位,一个用于 32 位。这就是我们解决这个问题的方法,因为它要简单得多。

The only way to do this is through a custom action.

You would have to call RegOpenKeyEx and set 0x100 to the REGSAM samDesired parameter to force use of the 64 bit registry. See RegOpenKeyEx here.

You could not use the standard .NET Registry classes to do this. You will have to manually use P/Invoke if using a .NET language.

You may be better off by providing two installers, one for 64 bit and one for 32 bit. This is how we have combatted the issue, as it is a lot less complicated.

惜醉颜 2024-09-11 03:42:33

您必须使用 Win64="No"< 将组件设置为 Win32 /代码> 参数。否则,MSI 将使用其运行的任何系统作为默认值(即此类操作系统上的 x64)。

例如:

<Component Id="C__mycomponent" Guid="MYGUID" Win64="No">
  <RegistryKey Root="HKLM" Key="Software\DroidExplorer\InstallPath" Action="createAndRemoveOnUninstall" />
</Component>

You have to set the component to Win32, using the Win64="No" parameter. Otherwise MSI will use whatever system it is run on as the default (that is, x64 on such OS).

So for example:

<Component Id="C__mycomponent" Guid="MYGUID" Win64="No">
  <RegistryKey Root="HKLM" Key="Software\DroidExplorer\InstallPath" Action="createAndRemoveOnUninstall" />
</Component>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文