Apply HKCU registries to all users

About

This is custom created predefined action by Master Packager team that applies specific HKEY_CURRENT_USER registries to all users during SYSTEM context installation.

The action works by storing HKCU registry keys into the Windows Active Setup mechanism under HKEY_LOCAL_MACHINE. When a user logs in, Active Setup runs an automatic msiexec.exe /fu command, repairing the MSI for that user and writing the HKCU keys into their profile. This ensures the HKCU keys are created for new users or existing users after they log off and log in again.

Master Packager Advanced Editor - predifined Custom Actions - Apply HKCU registries to all users

Note: HKCU keys might not appear for users who remain logged in during the install. A logoff/logon or a manual repair may be needed.

When you use it?

When it is needed to apply per-user HKEY_CURRENT_USER (HKCU) registries to all users while MSI is installed under SYSTEM context.

For application packagers usually it is needed when application configuration is stored in HKCU registries.

How to use it?

  1. Open MSI/MST with Master Packager
  2. Click on Custom Actions in left menu
  3. Click on Predefined Actions tab
  4. Click “Add New Predefined Action” and choose Apply HKCU registries to all users
  5. Click Browse HKCU .REG File to import your registry entries from a .reg file, or click Edit to manually enter the registry data.

Format must be following:

Windows Registry Editor Version 5.00 
[HKEY_CURRENT_USER\Software\SomeKey] 
"SomeValue"="1"


  1. Review your registry entries in the Registry Preview window to ensure they are correct.

This action takes the HKCU keys from the provided .reg file and inserts them into Active Setup. Master Packager then creates an Active Setup entry similar to:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\{ProductCode}]
"StubPath"="msiexec /fu {ProductCode}"

As a result, when users log in, these registry keys get written into their HKCU hive automatically.