views:

597

answers:

2

I have an installer that writes to HKLM\Software\DroidExplorer\InstallPath. On any x86 machine it writes just fine to the expected location, 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 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 trys to look in WOW6432Node because of the Registry Reflection. This is on all x64 systems.

Why is 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.

A: 

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.

Oleg
the bootstrapper is not having the problem, it is looking in the right registry hive. its the msi that is writing the value to the wrong hive. on win7 64bit, the 32bit msi, some how writes to the 64bit hive, not the expected WOW6432Node like it should.
Ryan Conrad
i meant vista 64bit in my comment, not win7, but anyhow. I know I can do it manually by forcing WOW6432Node, but I shouldn't have to force it, as it should write to there any how, since the installer is 32bit. why do i not have to force WOW6432Node on Win7?
Ryan Conrad
Sorry, I don't understand your comment. You can just define two components one with the registry key `Software\WOW6432Node\DroidExplorer\InstallPath` and another with the registry key `Software\DroidExplorer\InstallPath`. For the first component you should use the condition `VersionNT64` and for the second one the condition `NOT VersionNT64`. Your setup will create always the 32-bit version of the key `Software\DroidExplorer\InstallPath`.
Oleg
Ryan Conrad
I am not quite understand your doubt. A 64-bit application on 64-bit operation system work with real registry and with the real file system, so it can write in any parts of registry where permission allows es. Because Administrators has full access to HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node then 64-bit application can do this like you can do this with the 64-bit regedit.exe. A 32-bit application on 64-bit operation system works in a virtual world, see and can write only in a subset of registry and file system if the application not explicitly with KEY_WOW64_64KEY flag require other.
Oleg
The MSI writes to the 64 bit path, even if i specify the WOW6432Node. This is only on vista and xp 64 bit, it works fine on win7 64 bit.
Ryan Conrad
What is the values of the properties VersionNT64 and Msix64 on vista and xp 64 bit? Do you started msiexec.exe with the detaied log (/l*v)? Could you post a link where I can download the detaild logs (one from Windows 7 and one from Vista or XP 64) In the detaild log file you can see all standard MSI properties. MSI must create a registry key based on conditions of the corresponding components. Which version of Windows Installer you have on 64-bit vista and xp? Can you install on the computers the last version of Windows Installer and retry the results?
Oleg
Do you define `msidbComponentAttributes64bit` for component? Windows Installer 4.0 and higher supports VersionNT64 Property (see http://msdn.microsoft.com/en-us/library/aa372497.aspx). Which version of Windows Installer is installed of the xp 64 bit where you have problems? Moreover look at http://msdn.microsoft.com/en-us/library/aa367451.aspx, http://msdn.microsoft.com/en-us/library/aa367430.aspx and http://msdn.microsoft.com/en-us/library/aa372070.aspx and verify whether your MSI is marekd as `Intel` or `Intel,x64`. You can use orca.exe or other MSI editor to set your MSI as pure 32-bit MSI
Oleg
A: 

You have to set the component to win32, using the Win64="No" parameter. Otherwise msi will use as the default whatever system it is run on (i.e., 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>
Stefan
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 doesnt allow the Win64=no
Ryan Conrad
Sure, if you have an x64 component, then the whole msi is x64 and won't allow win32 components. It's not possible (without cheating) to have both win32 and x64 components in a single msi.See here for the details: http://blogs.msdn.com/b/heaths/archive/2008/01/15/different-packages-are-required-for-different-processor-architectures.aspx
Stefan
That post says it should allow writing to both 64 and 32 bit hives, but thats the problem i am having, it doesn't write to the 32 bit hive if it is 64 bit install. I am even supplying WOW6432Node in the registry path.
Ryan Conrad