rgl / packer-plugin-windows-update

Packer plugin for installing Windows updates
Mozilla Public License 2.0
299 stars 71 forks source link

Handle different exit code on windows 2012 #134

Closed matt-richardson closed 8 months ago

matt-richardson commented 11 months ago

On Server 2012, scheduled task does not exit 101, rather exits 2147942501 when reboot required

On many of our VM builds, this works fine, but on Server 2012 in particular this appears to get stuck, printing Waiting for the Windows Modules Installer to exit... to the console and logging Retryable error: Windows update script exited with non-zero exit status: 2147942501 to the log.

This PR adds the exit code in the 2 spots it's required, so that it can detect the reboot required state.

Fixes https://github.com/rgl/packer-plugin-windows-update/issues/130

matt-richardson commented 10 months ago

Hey @rgl - just a polite bump to hopefully get this onto your radar. We've tested this across all our VM builds and we're happy it solves the problem well.

matt-richardson commented 8 months ago

Thanks @rgl!