Install the printer back to your Windows 7 machine, then run the HP Print and Scan Doctor . This will test your printer and make sure all is working, Than go ahead if the test passes, flash the new firmware to the printer. And it should install without failure into a Windows 8 and 8.1 enviroment.

I have tested the driver and firmware in all 3 enviroments, and I can confirm it is working as intended.

Also make sure that you have latest chipset driver for your USB ports on your motherboard, if you are connected via USB.