views:

44

answers:

1

I am creating a visual studio set-up project. I need to test to see if the version of Windows I am being installed on is 64 or 32 bit. I am planning on checking for the existence of the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node as a way of telling that I am being installed on 64 bit windows. Is this a good idea and/or is there a better way?

The reason that I want to know which version of Windows I am on is so I can create a directory under either System32 or SysWOW64. I would rather not create two installers one targeting 64 bit platforms and one targeting 32 bit platforms.

+2  A: 

The easiest way to check for a 64 bit machine in an MSI installer is to use the VersionNT64 property. This will only be set if the target machine is running a 64 bit operating system.

JaredPar