Hello,
I was in the process of converting some user-based Firefox installs, that were completed by end-users, to system installs and noticed by default the Application deployment keeps both the user-based appdata install and installs the "Program Files" install as well.
My first thought was having a pre-script search and run helper.exe /S before installing but was curious if there was built-in functionality that I am missing to complete this without my extra work.
Thanks,
Hello
Basically, you need a pre-script to parse through each user profile and remove the files, reg keys, etc. because running a user-based uninstall will only work for the currently logged-on user.
We provide the ability to call a script however you will need to create this prescript to do that cleanup. Hope that helps and answers your question.
Thanks! That was my plan, but thought perhaps there was a built-in method that I could utilize and I just wasn't seeing it.
Much appreciated.
There are a few ways to go about this - some of these examples can be made easier by using PSAppDeployToolkit / PSADT.
- Run the uninstall as the logged in user - if you're in System account context, this can be launched in as the user by leveraging Scheduled Tasks. PSADT has an Execute-ProcessAsUser function to make this easy. If the uninstall process needs admin rights though, users may get a UAC prompt unless you have a privilege management system in place to auto-elevate certain processes.
- Set up a Run key or Active Setup to run the uninstall per user. Can be used in conjunction with the above to cater for users not logged on during deployment. PSADT has a function Set-ActiveSetup that can be used to set this up, and it will also automatically trigger it to run as the logged in user much like the above.
- Surgical mop-up of files/reg for every user - for this you will need to know every file, folder, shortcut and reg key that needs to be removed. PowerShell's Remove-Item accepts wildcards (e.g. Remove-Item -Path 'C: \Users\*\AppData\Local\AppName' -Recurse -Force). Registry is harder is it required mounting each user registry hive - again PSADT can help here with the Invoke-HKCURegistrySettingsForAllUsers function.
Awesome. Thank you for your input. I was not aware of the HKCU function in PSADT. Looks like I should read their reference document. :)