1

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.

sourcenouveau
  • 29,356
  • 35
  • 146
  • 243
  • AFAIK I can't install a 32-bit version of the Windows SDK on a Windows 7 (64-bit) machine. The x86 ISO doesn't work on Windows 7 (64-bit). – sourcenouveau Oct 10 '12 at 20:10

1 Answers1

2

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

sourcenouveau
  • 29,356
  • 35
  • 146
  • 243