How to prevent Windows 8 from automatically rebooting for update installations

If you configured Windows 8 or Windows 7 to install updates automatically, you might notice that it performs an automatic restart when updates are installed. This can be a really annoying thing if you had no plans to restart your PC and were busy with some important stuff. It can even reboot while you are watching some TV show or important online transaction. Fortunately, it is possible to change the OS behavior and prevent Windows from automatically rebooting for update installations.