I’m working on updating an old app. It has some dependency files that live in the same directory as the app. Obviously this broke when Windows Vista came out (since it violates the API and Vista/7 now enforce that (XP didn’t)).
Ideally, I’d like to avoid hardcoding anything into the app for just Windows. I can live with that if I have to though. I’ve already been down that path with pulling the APPDATA and LOCALAPPDATA environment variables, but that doesn’t help any since they just give you the current user area… I need these to live somewhere accessible for all users, and I’d like to obey the Windows API expectations that they go into the all user appdata area.
Suggestions?
If you really mean cross platform and not just Vista compliant, the correct way is the Preferences API. Last time I tried that on Vista though, the system store didn’t work, though.
If you just mean Vista, you can get the system environment variables and reference it that way.