Update 16/8/2015: many people are are getting stuck during in upgrade of windows 10 and it starts getting stuck anddoing an endless reboot. If you get this issue you will want to do a clean install of windows ten.
Update 3/8/2015: This issue has been happening with Windows 10 installations as well, the same fix described in this post works with Windows Vista, Windows 7, Windows 8, Windows 8.1 and Windows 10.
The error message “The Computer Restarted unexpectedly or encountered an unexpected error” is most commonly caused by an interruption of the power supply such as power failure or pressing restart during the final stage of windows installation process.
When the error appears press SHIFT+F10 and it will open up the command prompt.
Open the registry editor by typing in the command “regedit”
Now the registry editor appears, you now need to navigate to:
Now find the key called “setup.exe” the value needs to get changed from 1 to 3. To do this just double click on the registry key and change the keys value.
Now exit regedit and hit ok on the error message. Now your computer will restart and continue on the Windows setup process as normal.