software that needs reboot

Topics: Archive - General
Feb 11, 2014 at 1:48 PM

can the script handle software that requires reboot and then continue?

I have a program that needs first to install some prerequisites.. then reboot.. then continue the installation..

How would I best handle this?
Feb 11, 2014 at 1:57 PM
It's not feasible within the script itself - however, closing down apps should be sufficient in most instances to avoid a reboot.

That being said, if you really want to pursue this avenue, I'd like to do something like this in CM12 and we'll assume you're going to use PSAppDeployToolkit:
  • Create "prerequisite" Application. Put all your prerequisites in here. Add "Exit-Script 1641" as the final step in the Post-Installation section. This will tell SCCM a hard reboot is required (nothing else can install until it's complete)
  • Create main installation Application.
  • Set the prerequisite Application as a dependency of the main installation
This should force the prerequisites to install then wait until a reboot before the main app installs.

Hope this helps, Dan.
Marked as answer by Symbiot on 2/12/2014 at 3:51 AM
Feb 12, 2014 at 11:51 AM
the exit-script thing is perfect!

Thanks Dan!
Mar 18, 2014 at 1:47 PM
Hi Dan..

Ok, so I've just tested adding:

exit-script -ExitCode "1641"

to my script..

it seems to run ok, but popup gives an "installation failed"..

is this normal behaviour? Shouldn't the information in the progress popup be different if it's not an error?
Mar 18, 2014 at 2:06 PM
oh.. this is when running the script manually and NOT through SCCM.
Nov 28, 2014 at 3:03 PM
Thanks for the tip @sintaxasn. I've followed this suggestion but am not having any joy. Since this is an old post, has this behavior changed in 3.5.0? In SCCM 2012 R2 I'm getting an exit code 0 when I explicitly set it to 1641, both with and without the -AllowRebootPassThru parameter. The same occurs when I test with 3010, but other error codes behave as expected so presumably these two are being handled.
Jan 16, 2015 at 6:48 PM
Edited Jan 16, 2015 at 9:48 PM
When using the exit script 1641 you need to change -AllowRebootPassThru to true and change the user experience in SCCM to accomidate that change. See below.

The software install program might force a device restart – The client is told that the installation will force a restart.
Configuration Manager client will force a mandatory device restart – The client will always perform a restart.

Here is an article on how SCCM handles the error code.

"Configuration Manager client will force a mandatory device restart" takes the error code from the script and handles the reboot.