Dear future people: Install Windows 7 in BIOS mode. GPT and UEFI are not properly supported.
Longer answer: If you have an EFI partition on another HDD, even if it's your only EFI partition, the UEFI mode Win7 installer will keep writing EFI partitions until it can't anymore. After that, it will write the System Reserved partition, format the rest of the blank space as NTFS, and the installer will fail. When you try to delete the NTFS and install on top of what you're formatted, you will be informed that Windows 7 can't be installed on a GPT disk.
This post is going to be kind of long because I've done a lot of testing. Until proven otherwise, I'm going to assume this incredibly bizarre issue is caused by my computer being haunted. I'm also kind of busy, so I may not be able to try out the proposed fixes for a few days.
Backstory: I just built a new desktop. I have 3 hard drives in it: a 1TB from someone's old PC (which I completely reformatted to put a fresh Windows install on), an 80gig I bought clean (completely reformatted), and one from my old BIOS laptop that I'm still using because it's only a few months old. I just installed 17.3 on top of 17.2 (both based on Ubuntu 14.04) due to hardware compatibility issues. Aside from that and a few other things (partition resize to remove laptop's Windows install) it's exactly the same setup that worked. It's just in a UEFI system instead of BIOS. My Linux hard drive shows an MBR-type partition table, but that shouldn't be the problem. Every partition on the laptop drive is part of an extended partition.
Problem: Windows can't boot. When I try, the Windows logo pops up for a second, then the screen goes black and a progress bar appears saying "Windows is loading files". Then it tells me that Windows failed to start. Safe mode does not work. I've tried putting in the installation media and running startup repair, but it immediately goes to "Attempting repairs" and the repair operation cannot be canceled except by turning off the machine.
What I've done (at the time of question posting) (this is just what I remember doing off the top of my head, there may be some other things I forgot to mention):
All installs and boots are done in UEFI mode, not legacy BIOS mode. Firmware is flashed with latest version. Yes, I shut down before I unplug hard drives. No, secure boot is not enabled.
First attempt: First install on new machine. Installed Windows to 1TB, resized laptop partitions, and installed Linux on laptop HDD. Rebooted to Linux, worked fine. Later discovered that Windows is fubar now.
Second attempt: Deleted partitions on 1T. Unplugged 1T and laptop. Installed Windows to 80G (to generate a new EFI partition). Booted to Windows, everything works. Unplugged 80G, replugged 1T. Reinstalled Windows to 1T, then deleted everything on 80G except EFI. Booted to Windows, everything works. Unplugged 1T and reinstalled Linux, selecting the EFI partition on 80G as the boot partition. Replugged 1T and booted to Linux, then ran update-grub. Booted to GRUB, selected Windows. Windows failed to start.
Third attempt: Deleted 1T again and ran update-grub to remove the Windows entry, then edited .bash_aliases to make sure I couldn't somehow update GRUB by accident (yes, I know this is per-user and not for system). Unplugged laptop and 80G. Reinstalled Windows. Replugged laptop and 80G. This time I boot to windows using the BIOS boot menu instead of GRUB. Windows loads fine. Rebooted to Linux. Looking at GRUB, no Windows entry. Linux loads fine. Now I'm feeling pretty confident, but just to be 10,000% sure, I rebooted to Windows, again through the mainboard's UEFI boot menu. Windows fails to load. GRUB still doesn't show an entry for Windows.
At this point, I'm at a complete loss. These shouldn't even be interacting, much less doing this. Does Windows 7 now have piece of code that detects Linux and pukes itself, but only in UEFI mode? I'm half tempted to think it has something to do with my MBR laptop drive, but that's where my Linux install is hosted, not to mention that last attempt completely eliminated the possibility of any accidental overwrites. This is a real problem for me because some of my work requires programs that don't run under WINE. I can do it at the college, but if I realize Friday afternoon that I made a mistake I'm completely SOL. Can anybody tell me what's going on and how I can fix this? Research tells me that multiple EFI partitions shouldn't create a problem, and my perfectly functional MBR Linux install shouldn't affect my Windows on a separate drive. I'm kind hesitant to try and convert it to GPT just to see what happens, because for some reason my backup program freezes when it gets to steam.pipe (and a few others, but it usually hits that one first) and I can't afford to lose all my data.
Can this be fixed, or should I call an exorcist?