What are you switches for the first package, it might be the package is initiating the reboot and that's not what you want.
I've got it to the point where there are no restarts occuring at all, however that's not what I want. I want a restart to happen at the end of installing ALL the packages. Is there an easy way to set this?
I assumed that setting the Agent Reboot Settings to "always act like a restart is needed" would be applied at the end of the entire task.. however it is applied at the end of each package installation. That's no good for this.
I tried that. We have machines that won't bootup after the final restart to report a successful installation though. I need it to report success before the restart.
Try to add this at the end of the script:
EXIT /B %ERRORLEVEL%
Checking it now.
To answer my own question, I had to create a custom reboot settings to allow reboots if needed. Then at the end, use the SDclient.exe /Reboot switch in a batch file.
The key is to ensure the distribution packages are configured to not ask to reboot. Another hurdle was that the Agent Configuration had the option to "NEVER REBOOT" outside of any custom agent settings. So even if your agent reboot settings says to allow reboots it wont because the NEVER REBOOT option under agent configuration is checked.
It would be nice to be able to have our clients never reboot upon patches/software installs ect unless EXPLICITLY defined reboot is issued. The reason we use NEVER REBOOT is user experience is high on our list and we don't want to inconvenience people for deployments.
In the end, it was the NEVER REBOOT option that was screwing me up. I feel like a lot of these settings are confusing and need to be more simplified. Honestly, a "sdclient /reboot override agent configuration" command would be nice.