How I fixed my non-booting macOS High Sierra Installation

Upon downloading and attempting to proceed with the High Sierra installation, I was faced with this message during reboot:

macOS could not be installed on your computer 
The path /System/Installation/Packages/OSInstall.mpkg appears to be missing or damaged.

So, a missing file. First step was getting into Safe mode. That did not work, but recovery mode (command apple R) did. Reinstalling macOS from the Utilities menu failed because it tried to download now-removed Sierra from the App Store. So, I started Disk Utility and tried to mount my main partition, just to confirm it wasn’t totally trashed. It worked. Then I quit Disk Utility, brought up a Terminal window and confirmed the data on the partition were intact. Everything was there, whew! Just in case, I copied over a few files to a USB flash drive that had changed since my last Time Machine backup. I could just restore from Time Machine, but what about just trying to find that missing file? I issued this command in Terminal:

$ find -f / OSInstall.mpkg | grep OSInstall.mpkg

Note that this isn’t the ideal find syntax I’m pretty sure, but it worked in a pinch. It found an instance of OSInstall.mpkg on the recovery partition. This was separate from my boot partition, so I copied the file over to my boot partition at /Volumes/Macintosh HD/System/Installation/Packages/OSInstall.mpkg (after creating the Packages folder). I had no idea if this was the correct OSInstall.mpkg. It was only 700k. So there was a risk it could make things worse, but I still had my Time Machine backup. When I rebooted, it displayed the same Apple installation screen with progress bar. I was encouraged by the fact that the estimated time remaining decreased steadily; when the installation had failed, it just stayed at 40 minutes before erroring out. After about an hour, it rebooted to a login screen, and checking About This Mac confirmed that I was running High Sierra!