Instead of running setup.exe when your installation CD loads, instead open CD to view files. On the setup icon on the CD, open to view properties. Change the compatibility dropdown to, run as Vista. Click OK This should allow you to install HP software for your printer.
For a printer to work with Windows 7, it requires the correct device drivers installed on the system. Usually Windows 7 has got many inbuilt drivers for the proper operation of the devices attached to it. It requires specific recommended printer drivers for the functioning of printers with Windows 7. You need to install printer drivers that come with the device. Also, you need to update printer drivers for the printer to work properly.