Can I Programmatically Uninstall Per-User Applications In Preparation For Making Those Applications Per-Machine? Hi All,
Hi All,
I know that performing a Major Upgrade of Per-User installs to make way for a Per-Machine version of the application has some weird effects (Per-User registry keys not removed but updated. They should have been removed and rewritten to HKLM, etc).
My plan was to not replace the per-user with per-machine via a Major Upgrade, but to install the Per-Machine version of the application as a completely separate, different product. Then I was going to uninstall the per-user flavor of it programmatically. That is easy to do if the installing user had installed the per-user version.
However, there may be times where there are multiple instances of the per-user application on a particular machine. Is there a way to programmatically uninstall those as well. I did code a utility that would cycle through the users in the registry, check for the app, and create a scheduled task to uninstall it. That required the user used to be part of a certain system policy, which might be a problem.
Then I tried cycling through the SID keys looking for the install app in the Programs key, but I can't find a way to run the uninstall in the context of that user. I was trying PSexec.exe, but can't get that to work.
Long story or question shortened.... Is there a way to remove all instances of a per user context application with a utility run from a Per-Machine installation, but will run in each user's context while uninstalling?