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
Is the installer 32 bit and the runtime 64 bit or vice versa? In that case you might get redirected to different registry nodes (inside HKLM/Software or HKLM/Software/Wow6432Node).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With