+1 modoran run-time detection is the correct way to do this. Unless you need to start up COM for something else I would use "GetEnvironmentStrings()" to list the available environment variables and look at the "ProgramFiles" variable.
If you do end up using COM then you'd run an "ExecQuery" against 'Win32_Product' and look for the 'Name' property with the "Next" method. Once you find what you're looking for grab the 'InstallLocation' property, it will be in a BSTR format which isn't quite the same as a wchar_t. This way takes a lot longer (as a human being you will notice the difference in time) but it is going to be the one with the fewest mistakes.