There have been times where I’ve had an SCCM application deployment fail because the app install writes to the user’s registry hive. In other words, since the application is installed under the local system account, the HKCU specific keys are not written. To get around this easily is to have the application set to be run by the logged-in user. However, many environments are locked down and user’s don’t have the rights to install software.
One option is to add an Active Setup registry key via install script that will force an app to self heal once when the user logs on. But there’s an easier way using PSADT.
In the Post installation section and add:
[scriptblock]$HKCURegistrySettings = {
Set-RegistryKey -Key ‘HKEY_CURRENT_USER\SOFTWARE\Classes\Asdjgfeiyrbdi4wjf3s9’ -Name ‘NoOpenWith’ -Value ‘””‘-Type String -ContinueOnError:$True
}
Invoke-HKCURegistrySettingsForAllUsers -RegistrySettings $HKCURegistrySettings
Of course, you’d edit the reg key above to the one you want to write to HKCU.
Now you can have the application installed under the system context but still have the needed key(s) written to HKCU.
Leave a Reply