Page 1 of 1

[SOLVED] Uninstallation - User Registry Keys

Published: June 18, 2019 - 11:31
by Christophe0110
Hello,

I'd like to be able to delete registry keys that were added during session setup in the user's HKEY_CURRENT_USER file when uninstalling a package.

I read somewhere that it was possible to do this by manipulating the ".DEFAULT" part of the registry and using "reg load"?
Is there any way to get a code snippet explaining how to do this?

Thanks,
Christophe.

Re: Uninstallation - User registry keys

Published: June 21, 2019 - 12:34
by dcardon
Hello Christophe0110,
Christophe0110 wrote: June 18, 2019 - 11:31 AM I would like to be able to delete registry keys that were added during session setup in the user's HKEY_CURRENT_USER file when uninstalling a package.

I read somewhere that it was possible to do this by manipulating the ".DEFAULT" part of the registry and using "reg load"?
Is there any way to get a code snippet explaining how to do this?
To do this, you need to mount the various NTUSER.DAT files on the machine and delete the relevant keys, then unmount them. Be aware that the hive of the current user during uninstallation (if there is one) will already have its hive mounted; you will need to make the modification directly in HKCU for that hive.

Sincerely,

Denis

Re: Uninstallation - User registry keys

Published: June 25, 2019 - 10:28
by Christophe0110
Hi Denis,

thanks for your reply.

Do you know how I can mount the user's hive during uninstallation?
How can I tell which user is currently logged in?

Cheers,
Christophe.

Re: Uninstallation - User registry keys

Published: June 25, 2019 - 11:06 PM
by sfonteneau
The pyscripter package opens and closes registry hives (to place the RUNASADMIN value in the registry to avoid certain UAC issues).

You can find a code example here:

https://wapt.tranquil.it/store/details- ... 6_all.wapt