My iMac's a mid-2011 model and, after upgrading from macOS Sierra 10.12.5 to 10.12.6, my iMac now won't boot. I've tried the upgrade via the App Store and also the Internet but both methods fail. After booting, the progress bar either gets stuck on 100% or only gets to 75%. I've also tried installing Mavericks with a bootable USB drive that has worked in the past but I get the installer crash log appear each time. An Internet Recovery installation doesn't work, either. I can, however, get into OS X by restoring macOS 10.12.5 from a Time Machine backup. It's when I reboot that things go wrong again. Thanks.