I have an application with an installer in Visual Studio 2008 which can be installed for Everyone or Just Me by the user. The installer writes some registry values that can be changed by the application. The installer is configured for any cpu.
From documentation on MSDN I’ve put the registry values under the “Machine/User Hive” key in the installer, the behaviour seems to be that for Everyone the registry keys appear under HKLM\Software\Wow6432Node\My App and for Just Me they appear under HKCU\Software\My App.
My problem comes when trying to read the values inside the application. It seems to me that with this cleverness in the installer there might be some “right way” of ensuring my app gets the right registry location, but try as I might my books and my google-fu has failed me 🙁
I’d be very grateful for any assistance with this.
Edit:
No replies and still no luck in documentation, so I guess there isn’t a nice way of doing this, I went with checking for the localmachine key then the currentuser key (if localmachine was blank). Seemed a bit odd but gets the job done!
I guess there isn’t a nice way of doing this, I went with checking for the localmachine key then the currentuser key (if localmachine was blank) in a ternary operation, and it seems to have worked.