How to Deploy an Application with User Settings (HKCU)

Purpose: How to Deploy an Application with User Settings (HKCU) in SCCM 2012

Many applications contain settings only for the current user (HKCU). There is no way to replicate these settings for the local machine (HKLM) as the program is designed to read the settings only from the current user registry or current user profile documents (%APPDATA%). Now in corporate environment, you can use group policies, logon scripts, and such to manage your user based settings. However, if you want to keep all of it in the SCCM, there is a way for you to do it.

1. Create a deployment type with all the application installations (HKLM details)

Create all the binaries and configuration that you want or can install for the local machine (HKLM) in the first deployment type (just like any normal application package). Leave our all the user based settings that you want to deploy with SCCM from the first deployment type, as you will now separate HKLM-based installation files and HKCU-based installation files in their own deployment types.

2. Create another deployment type with all the user settings (HKCU details)

Create the deployment type for the current user (HKCU). Put all the configuration files, registry changes (and so on) into this deployment type that will target the current user. You need to set this deployment to install ONLY when there is an actual user logged in the workstation.


3. Set deployment type priority so that USER BASED is higher than MACHINE BASED

We need to set the USER BASED -deployment type priority to be higher than the MACHINE BASED -deployment type. This way the system will first try to install the USER BASED -deployment type.

4. Set USER BASED Deployment type to depend on the MACHINE BASED

Because we have set the USER BASED -deployment type to be of a higher priority, we need to set it to depend on the MACHINE BASED -deployment type. This way, the MACHINE BASED -deployment type will launch itself before the USER BASED -deployment type because of the dependency. Now we have an installation order of: First install the application and then install the user based settings.

Downside of this is the fact that the application installs only when there is an user logged in the system, so this method might work well in some cases but horribly in others. You need to use your deduction of how to use this correctly in your environment.

4 Thoughts on “How to Deploy an Application with User Settings (HKCU)

  1. What are the advantages of this method over ActiveSetup?

  2. Jyri Lehtonen on March 23, 2014 at 20:10 said:

    This is an alternative method to ActiveSetup. If you use this method, you can only install the application when an user logs in the system (since it requires the user to login). If you use ActiveSetup, you can install the application when there is no user logged in the system (but it requires you to implement the ActiveSetup feature). The posted method is more straightforward but ActiveSetup is more complete.

  3. narglix on March 24, 2014 at 16:16 said:

    How to do for uninstall ?

    Because user settings have priority, the uninstall will be executed in user context. So the permissions are not enough.

  4. Jyri Lehtonen on March 24, 2014 at 21:37 said:

    That is a valid point!

    I have not yet had the need to uninstall these applications. Uninstalling is rather rare for me because many decent applications update themselves without the need to uninstall them.

    However, should I have the need to uninstall these applications, I would do it from an uninstall application and create it without the user based install (create a copy of the original application, remove the user based settings deployment type and deploy it where needed). So basically I would think it as follows:
    1) If you do not have enough time to do an ActiveSetup approach, you can use this instead and save time. This will backfire when you need to uninstall such application since you need to copy the original application to create an uninstall successfully.
    2) If you have all the time you need, ActiveSetup gives you a solid way to produce a well designed application package with user based settings.

Leave a Reply

Your email address will not be published. Required fields are marked *


+ five = twelve

Post Navigation