Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I write to all users to their HKEY_CURRENT_USER using inno-setup

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?

like image 398
Toda Raba Avatar asked Nov 04 '10 15:11

Toda Raba


2 Answers

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.

like image 116
Damien_The_Unbeliever Avatar answered Sep 28 '22 04:09

Damien_The_Unbeliever


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.

like image 41
Dirk Vollmar Avatar answered Sep 28 '22 04:09

Dirk Vollmar