Installing in user profiles - ActiveSetup vs. Execute-ProcessAsUser

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 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 Yes Yes Yes
Updates existing user profiles Yes No Yes
Can update future users Yes No No
Changes Triggered by Registry value Scheduled task Deploy-Application.ps1
Intended purpose User changes Interact with user Cleanup of user registry (one or many)
Limitations:
Target User MUST be logged-on at install time No Yes No
Creates Scheduled Tasks 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

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.

.
.

How I created a table here in discourse:
2 Likes