Spencer Booth
Spencer Booth

Reputation: 1562

How to create an installer condition that test for 32 and 64 bit Windows

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.

Upvotes: 8

Views: 3380

Answers (1)

JaredPar
JaredPar

Reputation: 754893

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.

Upvotes: 5

Related Questions