Uninstall app for user, then install app for system?
With SCCM, I need to install an app for system (all users), but first remove any version of that app that was installed for user. Because pre-SCCM that's how the software was installed (manually). How do I put together a deployment that combines the two actions of uninstalling the app for user, then installing the app for system?
I think I want to use supersedence, so I set up two apps, one with the install that runs for system, and one with a dummy install and an uninstaller that is set to run for user. But in testing it leaves behind the old app, it doesn't even try to uninstall it, as if the supersedence is being ignored. Does anyone have experience with this situation - should supersedence still work when the uninstall action is for user but the install action is for system? I have a working uninstall script, that's not the problem. The detection methods for both deployment types are based on file existence; the install folder for this software is different when you install for single user vs all users. Addendum: I checked ccmcache and it does not appear to be caching the uninstaller, which is further indication that it's not even trying to run the uninstaller for supersedence.
Another way might be to set up the 'uninstall for user' action as an install instead, and then chain the two installs together using either App Groups, or a task sequence, or a dependency. I've tested that method successfully but I don't want to do it that way due to problems such as it leaving behind an entry in Software Center for the uninstalled app.
edit: My whole assumption was wrong, and the problem is not with supersedence which turns out to work fine in this situation.
I should have thought to test the uninstall exclusively. Turns out to be a problem with the detection method for the uninstall (for user). I cannot include a user-based environment variable such as %LOCALAPPDATA% in the detection method because it doesn't get evaluated properly, possibly because detection is evaluated in system context instead of user? So that stinks. How do I detect a single-user install then?
Posted Feb 28, 2022, 5:35 AM UTC · edited
Two deployment types in same app
one uninstalls in user context with a requirement of the presence of the user installed app
one installs app as system but has dependency on the other DT
Yeah this is the only way I've found that's a workable way to chain together user-based and system-based actions.