Forum Discussion
Uninstall and Install Application on same Policy
Just off the top of my head I'm thinking:
- Deploy the 'new' app but add a detection rule that detects the 'old' app, preventing it from installing as long as the 'old' app is present.
- Create another app/script that will uninstall the 'old' app (and restart the device).
This works under the following assumptions:
- You can create a detection rule to specifically target the 'old' app (maybe a file version or date?).
- You can afford a (slight) delay between removal and installation.
Oh, and then there's "Supersedence" but that's still in preview.
- May 31, 2022Mmm sounds like a good idea... but I guess when the old version is deleted and the new version is installed it sort of fails at detection.....
- dmarquesgnMay 31, 2022Iron ContributorHi,
Thanks for the replies.
One of my main problems on dealing separately is precisely the delay. We cannot control when will Intune really uninstall the app on all devices. This can take up a couple of days from the tests I've done with Intune. Then only when the first task ran on all devices, I can launch the second task. So this will take a long time and create an issue, which is that some users will need the VPN agent installed off working hours. That's the main reason I would want to do it all in one task.- May 31, 2022But if you have 1 task... (that creates the second scheduled task on the device) uninstalls the app and forces the reboot... after login the second task will be run? or am I forgetting something
- NielsScheffersMay 31, 2022Iron Contributor
That's the idea. Detection should fail when the old version is deleted. It should, of course, stop failing when the new version is installed .
A single rule would need to see the app as 'already installed', whether the old or new version is present. Maybe check for the existence of the executable or folder. That'll prevent installation until the separate script has removed the old version.
One BIG "if": the old and new version have to share the same location.
Anyway, it doesn't really matter as timing is of the essence here. And that makes your solution much, much more predictable and suitable.