I'm using:
FileInfo(System.Environment.GetFolderPath(System.Environment.SpecialFolder.ProgramFiles) + @"\MyInstalledApp"
In order to determine if a program is detected on a users machine (it's not ideal, but the program I'm looking for is a right old kludge of a MS-Dos application, and I couldn't think of another method).
On XP and 32-Bit versions of Vista this works fine. However, on x64 Vista the code returns the x64 Program Files folder, whereas the application is installed in Program Files x86. Is there a way to programatically return the path the path to Program Files x86 without hard wiring "C:\Program Files (x86)"?