OK so I got the error: The computer restarted unexpectedly or encountered an unexpected error. Windows installation cannot proceed. To install Windows, click “OK” to restart the computer and then restart installation
Seems a few others are seeing this – not a lot of good information out there about it so let me explain what I did to fix this.
But first, seems appropriate to mention how I broke it.
I was building an image (Windows 7) to test with Windows Deployment Services (WDS) and I decided I wanted a custom install with Office pre-installed. I built the VM and ran sysprep. But I forgot to pick shutdown and chose restart. When the VM started I realized what I had done and shut it off. That essentially left the computer in limbo – it is trying to run setup but the setup process is damaged.
So what you have to do is convince the computer it’s not in setup anymore. This information is in the registry under HKEY_LOCAL_MACHINE\SYSTEM\Setup
But the conundrum is, how….
to get to the registry if you can’t boot into the desktop?
Well, what you need to do is to load that hive offline. The best way to do this is to boot to your install media (which runs Windows PE) and get to the command prompt. As soon as the installer gets to the first screen hold down shift and press F10. It should look like this:
After pressing Shift+F10 it will look like this – so type “regedit” and hit enter:
And the registry editor will open. Now here’s the challenge, the registry you’re looking at is not the settings for your computer. Your machine is offline, this is the registry hives for the Windows Preinstallation Environment (PE) and changing them won’t help you so you need to load YOUR computer’s System hive.
Here’s how. First, click and highlight the HKEY_LOCAL_MACHINE as shown:
No go to File->Load Hive:
And browse out to d:\windows\system32\config. (note the drive in this case is D: not c: remember that your computer is offline, this is why it won’t be under c:\):
Now you will need to give it a name, I called mine system2:
After this you will be able to access the offline system hive by expanding the tree as shown until you get to setup (make sure you expand system2 not system:
After exposing the offline values you’ll see that the hive has a bunch of stuff in there about ongoing setup processes. We’ll need to change these. Specifically, you need to zero out the OOBEInProgress, SetupPhase, SetupType, and SystemSetupInProgress by double-clicking each one and putting a “0” into the value field.
You will also want to clear out all of the text in CmdLine (which currently has the value of oobe\windeploy.exe)
Here is a screenshot from a good system’s registry:
Now you should be able to restart the computer without it trying to load a setup process.
Hope this helps!