For reference, the installer checks the following registry keys to see if Java is installed and where it is located to generate the Start menu shortcuts:
HKLM\SOFTWARE\JavaSoft\Java Runtime Environment\CurrentVersion
HKLM\SOFTWARE\JavaSoft\Java Runtime Environment\[the detected version]\JavaHome
If these keys can't be read, that means Java is not properly installed, or something is wrong with the user's registry (e.g. CurrentVersion points to a version that does not exist on the host computer). Uninstalling and reinstalling Java, maybe also with the tried and tested method of rebooting your computer, should solve the problem. Also make sure to install the correct architecture for your computer's OS (32- or 64-bit)