Windows 7 increased registry access

I am working on an installer for our application. The installer makes some changes to the registry key HKEY_CURRENT_USER \ Software \ Company \ AppName, which the application then looks for on first launch. Then the application performs various actions based on the registry keys found.

This works fine until you try to install the application as a user account (i.e. non-admin) on Windows 7 (and maybe Vista, I haven't tested it yet).

When a user tries to install the application, Windows rises to the credentials of the administrator account. This means that any changes to the HKCU in the registry are made to the administrator registry, and not to the registry of starting users. Thus, the keys are not visible to the application when it is launched for the first time under a user account.

We cannot be the only people whose installer must establish a connection with the installed application. Is there any way to reliably use the registry for this?

We cannot rely on the user launching the application after installing it, so passing information as a command line parameter is not a viable solution. The only way I can do this is to force the installer to call the utility as the original user, who receives or sets the registry key himself; it seems a little silly hoop to jump.

Edit: The application must delete the keys after using them, so I cannot just put them in HKEY_LOCAL_MACHINE.

+3
source share
2 answers

There are two recommended approaches for what you want:

  • , . HKEY_CURRENT_USER, .

  • , . , . HKEY_CURRENT_USER , .

, , HKEY_LOCAL_MACHINE . , HKEY_CURRENT_USER. , .

+3

, HKEY_LOCAL_MACHINE.

EDIT - 2 :

+2

Source: https://habr.com/ru/post/1779351/


All Articles