Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the harm to install a "AnyCPU" program on a 64-bit Windows using a 32-bit MSI?

Tags:

c#

wix

My application is built using the "Any CPU" configuration. The WIX installer for the application is built with platform=x86 so the resultant MSI is 32-bit.

When I run the 32-bit MSI on a 64-bit Windows. The [ProgramFilesFolder] property is resolved to "C:\Program Files (x86)" and the registry paths are resolved to the Wow6432Node. When I run the application, the process is 64bit - as expected.

As far as I understand after reading lots of related posts on SO. On a 64-bit Windows, to make the [ProgramFilesFolder] resolved to "C:\Program Files" and registry path to normal path (not under Wow6432Node). I need a separate 64-bit MSI. Which I am trying to avoid - For me, to have a separate 64-bit MSI merely for [ProgramFilesFolder] and regsitry path to resolve to correct location is not worthwhile. As long as my program still runs 64-bit on a 64-bit Windows, I don't really care about it is installed at "C:\Program Files (x86)" by default and some registry values exist at Wow6432Node.

So, my question is, is there the other consequences when I install a "AnyCPU" program on a 64-bit Windows using a 32-bit MSI other than by default the installDir is "C:\Program Files (x86)" and some registry values are stored under the Wow6432Node?

like image 481
sean717 Avatar asked Sep 05 '13 18:09

sean717


1 Answers

The only real harm that could arise is if your program tries to read the values that are stored in the 32 bit registry view. Of course it will fail to find them when running as a 64 bit process. If that happens then you could simply use the RegistryView enumeration to force reading from the 32 bit view. But I guess that the registry settings you mention are related to the installer.

In fact the scenario you describe is how I deploy my app. Because I deploy both 32 and 64 bit versions to the same machine, and because they share some files, I install everything to 32 bit program files. And then all registry access is to the 32 bit view. There's really no alternative if you want both 32 and 64 bit versions to share the same values in the redirected portions of the registry.

like image 193
David Heffernan Avatar answered Oct 14 '22 04:10

David Heffernan