开发者

Why does an x86 WiX installer on Windows Vista x64 not write keys to Wow6432Node in the registry?

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.


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.


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.


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.


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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜