When updating Applications to a newer Version in ConfigMgr, you often need to deal with Restarts after a successful Installation. This is mostly handled completely automatically by the Installer terminating with a common exit code (e.g. 3010), which is telling the ConfigMgr Client to prompt for a Restart.
A few days ago, I needed to update an Application to a newer Version, however with a mandatory Restart after the Uninstallation of the old Application. The complete Update Process was as followed:
- Uninstall App A
- Restart
- Install App B
- Restart
For the sake of this blog post, I created two Dummy Applications, which are called App A and App B. Both Applications have an Installer and an Uninstaller, that terminates with an exit code 3010. This pretty much reflects the real Situation that I had.
Important: This will only work if the Deployment Purpose for both Apps are set to Required and not Available!
So, let’s have a look at the Deployment Type of both Applications
Additionally, on App B there is a Supersedence configured, that forces an Uninstallation of App A.
Now, let’s see what happens on a PC where App A is already installed and App B is being deployed. While monitoring AppEnforce.log, we can see the following:
App A was successfully uninstalled and terminated with an exit code 3010. However, the ConfigMgr Client ignores the PendingSoftReboot here and just continues with the Installation of App B. The Installer of App B also terminates with an Exit Code 3010, which finally triggers a Restart Notification in Software Center.
Kudos to my Lab, this all happened within one second 🙂
So, the expected result here wasn’t really what I thought it would be. To get our additional Restart in the Update Process, we need to Modify the Return Code Table of App A.
Below you see the unmodified Return Codes table that you get when creating a new Deployment Type. As we saw in AppEnforce.log, the common exit code 3010 means Soft Reboot.
For this to work, we need to change the Code type from Soft Reboot to Hard Reboot.
With this configured, we can run the same Test again as above.
Now, the Update Process will stop after the Uninstallation of App A with a PendingHardReboot instead of a PendingSoftReboot. Software Center will now prompt the User to perform a Reboot.
Additionally, Software Center will now show the Status “Waiting for restart before completing changes”.
After the Restart, the ConfigMgr Client will continue with the Installation of App B.
The Installer of App B will now terminate with a PendingSoftReboot as before, which will trigger again a Restart Notification in Software Center.
Thanks for the post,
I am trying to make this work but I am not able to, Can you please guide me. app A is uninstalling and restarting and then nothing
I am having a similar issue to dj3094. I have my 2 apps set up almost exactly the same way as you described however application B is not installing after the reboot triggered by the uninstall of application A. Any help is appreciated.
Same here – I’m really thankfull for the Blogpost first of all! 🙂
But the result is application A gets removed sucessfully, the restart with status “hard reboot” also works fine but application B does not get installed after the restart.
ok, found the solution by myself.
You may need to mention that this only works with required deployments 🙂
Thank you, I made a comment in the blog post regarding the Deployment purpose.
Thanks Simon,
Just a quick question, will this work for clients on VPN? so after uninstall of app A and reboot client will disconnect from the network. Does it pre-cache all the files and polices so it can install app B offline?
Hi Oleg
The SCCM Client should download App A and App B before attempting to install App A. Therefore the content for App B should be available after Reboot, even though the VPN is disconnected.
I can verify that this is still an issue! I can also verify that it works for clients on VPN because I use it to uppgrade our VPN client.