I'm using NSIS script to generate the windows installer for my Java project. In this installer, I want to check whether the computer has the right JRE version before proceeding.
This is my code snippet for getting the JRE version:-
ReadRegStr $1 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" "CurrentVersion"
# display $1 value for testing purpose
MessageBox MB_OK "Version: $1"
This code works fine in Windows XP, but I can't get it to work in Windows 7 64 bit... the version number is always blank. I check the registry, and I'm pretty sure the path is correct and "CurrentVersion" has a value.
Can anyone tell me what I do wrong here?
Thanks much!
In NSIS, you can set the registry "mode" with SetRegView