I'm installing third party software that must read from HKEY_CURRENT_USER\SOFTWARE... using inno-setup. I need to write this value to all users, how can I do it?
As 0xA3 says, you cannot. One of the major reasons is Roaming Profiles. Basically, the profile data for a particular user may not even be present on the machine, at this time, or it may be a stale copy.
If you need a setting that applies to all users, then obvious HKEY_LOCAL_MACHINE would be preferred. If you need a setting that will be the default for all users, then store that default in HKEY_LOCAL_MACHINE, and copy it into a users profile if they don't currently have a valud there.
Basically you can't do this (in a simple and supported manner). To do this, all user hives would need to be loaded and that is not necessarily the case for all users.
You can write to the default profile under HKEY_USERS\.DEFAULT
which will affect all new user profiles, or you can write to the machine hive under HKEY_LOCAL_MACHINE
.
Probably the preferred option would be to run the setup separately for every user, e.g. as part of a logon script.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With