As above,
You should not have the printer connected when you install the software. Unplug the USB cable before you begin.
If you can now complete the install (using the HP setup disk), then plug in the USB cable and turn on the printer.
If it still hangs-up, restart your PC and retry.
This is a fairly common problem for HP. The above is the normal solution.
Dell