While setting up some new development workstations, we encountered an error during SharePoint 2013 + SP1 installation which we had seen again and again.
To recap: The prerequisites install fine, SharePoint Setup runs, and then seemingly at the last step, it fails with:
osiserver.msi: “SharePoint Server 2013 encountered an error during setup”, Error Code 1603
Unsatisfied with the workarounds (read MSIBreak or the ORCA tool or changing the number of processors), and after having updated Windows with the latest patches, I called Microsoft and worked for weeks with their engineers at diagnosing the root issue of the problem, which for us was:
The SharePoint ArpWrite action (registering SharePoint 2013 as installed in the registry) attempted to access a missing registry key at HKLM:\SOFTWARE\Policies\Microsoft\Windows\Installer
So to resolve this, we wrote the following PowerShell script (run as Administrator):