This happened to me when I purchased an upgrade disk and tried to install it onto a blank hard drive. The program will tell you that you cannot install it as the product key in not valid.
To get around this you have to install it and do NOT enter the product key. It will allow you to install the product.
THEN you have to reboot off the same DVD and install it again, but this time choose the upgrade option and format the hard drive. This will allow you to Upgrade the same installation of Windows 7.
It is a trick I had to do to get mine to install cleanly.