Windows SDK path common to Windows XP (32-bit) and Windows 7 (64-bit)

1.9k Views Asked by At

I'm using a tool from the Windows SDK in my Visual Studio project. I need to support both Windows XP (32-bit) and Windows 7 (64-bit) development environments.

The Windows SDK gets installed under Program Files in both OSes. This is the problem!

I can't figure out what environment variable to use for the path. From a 32-bit process like Visual Studio the environment variables that map to Program Files are:

  • Windows XP (32-bit): %ProgramFiles%
  • Windows 7 (64-bit): %ProgramW6432%

These are different, so how can I tell Visual Studio what the path is to the Windows SDK?

I'd like to avoid any special configuration, like hardcoding the path or adding more environment variables.

1

There are 1 best solutions below

0
On BEST ANSWER

I'm just going to specify the path as %SystemDrive%\Program Files\Microsoft SDKs\Windows\v7.0, but I don't like it!