Windows setup freezes or restarts the computer at the point when it is “Installing Devices”.
This usually happens when there is a problem with one or more drivers already installed on the previous XP installation. The solution is to rename the drivers folder.
Note: Some people in the comments section have said that performing these steps is dangerous. Be aware that results may vary and use this tutorial at your own risk. As for me, doing these steps worked for me and didn’t cause any issues.
1. Use a boot disk to boot into DOS. If you don’t have one, you can get one from Bootdisk.com.
2. Rename the Drivers folder at %SystemRoot%\System32\Drivers
3. Restart the computer and continue installing Windows.