Remove HKCU registries from all users
About
This is custom created predefined action by Master Packager team that remove specific HKEY_CURRENT_USER registries from all users during SYSTEM context installation.
It works by storing a deletion command into Windows Active Setup under HKEY_LOCAL_MACHINE. When a user logs in, Active Setup runs a silent regedit command with a .reg file that deletes the specified HKCU keys from the user’s profile.
Note: This ensures HKCU registry keys are removed for new users or existing users after logoff/logon.
When you use it?
When it is needed to remove per-user HKEY_CURRENT_USER (HKCU) registries from all users while MSI is installed or uninstalled under SYSTEM context.
For application packagers usually it is needed when it is required to remove some specific per-user registry configuration.
How to use it?
- Open MSI/MST with Master Packager
- Click on Custom Actions in left menu
- Click on Predefined Actions tab
- Click “Add Predefined Action” and choose “Remove HKCU registries from all users”
- Click Browse HKCU .reg file or click edit
Format must be following:
Windows Registry Editor Version 5.00
[-HKEY_CURRENT_USER\Software\SomeKey]
Or to delete a specific value:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\SomeKey]
"SomeValue"=-
Master Packager stores these deletion commands in Active Setup, ensuring they execute for all users upon login.