Windows’ ActiveSetup vs. Execute-ProcessAsUser vs. Invoke-HKCURegistrySettingsForAllUsers
Some applications need each user profile or HKCU registry hive to be updated to make them work.
Sadly, most users of PSADT do not know how to use the different methods or when to use which.
Some methods can only make the user changes during installation AND need to have the user logged-on at installation time to do this with success.
Below is a table showing what each solution have to offer and their limitations.
Capabilities/features: | ActiveSetup | Execute-ProcessAsUser | Invoke-HKCURegistrySettingsForAllUsers |
---|---|---|---|
File changes as the user | Yes | Yes | No |
HKCU registry changes as the user | Yes | Yes | Yes |
Can do HKLM registry changes | No | No | No |
Can launch exe as the user | Yes | Yes | No |
Updates current logged-on user (If logged in at install time) | Yes * | Yes | Yes |
Updates existing user profiles (logged-in at install time or not) | Yes | No | Yes |
Can update users created after application installation | Yes | No | No |
Changes are triggered by | Registry value in HKLM | Scheduled task at install time | Deploy-Application.ps1 at install time |
Intended purpose of method | User changes for ALL Users | Interact with CURRENT user | Cleanup of user registry hive (one or many) |
Shared Computer compatible ? | Yes | No | No |
Limitations: | |||
Target User MUST be logged-on at install time | No | Yes | No |
Needs to create Scheduled Task to run as the user | No | Yes | No |
Depends on PSADT functions to work | No | Yes | Yes |
Needs external script/EXE to perform changes | Yes | Yes | No |
External script or EXE must be user accessible | Yes | Yes | No |
Cleanup needed at Uninstallation | Yes | No | No |
*
Windows’ ActiveSetup does not update the current user but PSADT triggers the payload on the current user for you.
While ActiveSetup is the preferred choice, there are few examples of scripts used as the “payload” for ActiveSetup. I hope to publish my PowerShell version in an other post with instructions on how to use it.
NOTE: Some documentation will claim MSI can update user profiles/HKCU hives but it is tricky and unreliable. Many times it just doesn’t work and when it does, the entire MSI file must be read to accomplish the task.
.
.