Forum Discussion
dmarquesgn
May 31, 2022Iron Contributor
Uninstall and Install Application on same Policy
Hi,
I'm new to Intune and trying to set up some Application policies.
Now I've got a challenge which I'm not sure if I can accomplish it via Intune and I need some guidance just to understand if this is possible or not.
I have an Application, basically a VPN Agent installed on most of our 2000 computers, it's a Win32 app, which was not installed via Intune and now I need to remove that application and install the new one with an updated version and the VPN configurations.
For that, basically we need the following steps:
1 - Uninstall VPN App
2 - Restart Computer
3 - Install New VPN App
Is this something I can do within Intune App management?
Thanks
- NielsScheffersIron Contributor
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.
- Mmm 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.....
- NielsScheffersIron 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.
Probably when packaging the VPN app and creating a powershell script that first removes the software ... configures a scheduled task (that runs only ONCE at system and will launch the second part .. a powershell script that silently install the new VPN software..) and reboots the device?