How to Apply Current User (HKCU) Registry Values for All Users During Installation
In an enterprise environment, applications are often deployed via configuration management tools like Intune, SCCM (MECM), or similar. These installations typically occur in the system context because end users lack administrative privileges. As a result, user-specific registry keys under the HKEY_CURRENT_USER (HKCU) hive are not applied during the installation process.
In this article, I will show you two methods to apply HKCU registry keys for all users on a machine during application installation:
- Using the PowerShell App Deployment Toolkit (PSADT).
- Using Advanced Installer’s predefined custom action.
A common method for setting HKCU registry keys is Active Setup. However, Active Setup runs after installation is complete and requires the user to log in again for the changes to take effect. Since this article focuses on applying HKCU registry keys during the installation process, we will not be covering Active Setup.
For a deeper understanding of Active Setup, explore the Active Setup Mechanism section in the MSI Packaging free eBook.
Apply HKCU Registry Keys Using PSADT
The PowerShell App Deployment Toolkit (PSADT) provides built-in functions and cmdlets that can help apply registry changes for all users on a system.
Below is the specific code you need to add in the post-install section of your .ps1.
If you are new to PSADT, take a look at our guide: How to Use PowerShell App Deployment Toolkit for Wrapper Handling.
[scriptblock]$HKCURegistrySettings = { Set-RegistryKey -Key "HKEY_CURRENT_USER\SOFTWARE\Manufacturer\Product" -Name "CheckForUpdate" -Value "false" -Type String -SID $UserProfile.SID } Invoke-HKCURegistrySettingsForAllUsers -RegistrySettings $HKCURegistrySettings
Understanding the Code
Let’s break it down to understand the logic behind better:
Set-RegistryKey is the cmdlet that modifies a registry entry under the HKEY_CURRENT_USER hive.
It contains the following parameters
- -Key: This specifies the registry path where a setting will be applied. In this case, it's "HKEY_CURRENT_USER\SOFTWARE\Manufacturer\Product"
- -Name: Represents the name of the registry value being changed. The value name here is "CheckForUpdate".
- -Value: The new value that will be assigned to the registry entry. Here, it is set to "false", meaning the script is disabling an automatic update check feature.
- -Type: Indicates the data type for the registry entry. It is set to "String", meaning the value will be stored as a string type.
- -SID: Refers to a user's Security Identifier (SID). The $UserProfile.SID indicates that the SID is being dynamically fetched for the currently logged-in user.
[scriptblock]$HKCURegistrySettings contains instructions to modify the HKEY_CURRENT_USER registry key.
Invoke-HKCURegistrySettingsForAllUsers function applies the registry settings for all users on the system by executing the script block for each user profile.
That’s it. After running the PSADT install script, the registry key will be applied to each user on the machine.
Apply HKCU Registry Keys Using Advanced Installer
With its intuitive GUI, Advanced Installer simplifies applying HKCU registry keys during the installation process using a predefined custom action.
Let’s go through the simple process:
1. Go to the Resources -> Registry page and declare the registry key under the Current User (HKCU) hive.

2. Navigate to Custom Behavior -> Custom Actions and search for the HKCU predefined custom action. Add the custom action to your sequence.

3. In the Property section, assign the registry key that was declared earlier.

4. Under Execution Stage Condition, ensure the Install checkbox is selected and apply the condition Not Installed. This ensures the custom action is only triggered during the installation phase.

That’s it! After building your installer, the HKCU registry key will be applied to all users during installation.
Video Tutorial: How to Apply an HKCU Registry Key to All Users
Conclusion
Applying HKCU registry keys for all users during system-level application installations can be challenging, especially in enterprise environments where the install context is at the system level.
In this article, we discussed two effective methods to ensure these registry keys are applied for all users.
The PowerShell App Deployment Toolkit (PSADT) offers a script-based solution by leveraging built-in cmdlets like Set-RegistryKey and Invoke-HKCURegistrySettingsForAllUsers. This approach is ideal for those familiar with PowerShell and looking for a flexible and powerful way to control application installations.
On the other hand, Advanced Installer provides a user-friendly, GUI-based method by using a predefined custom action and setting the appropriate execution conditions, you can easily apply registry changes for all users with minimal coding required.
Download the latest version of Advanced Installer to take full advantage of the new predefined custom action: Apply HKCU to All Users.
Existing customers can update to the latest release, and new users can try Advanced Installer for free by starting a trial version here.