Archive: How to use conditional operator?


How to use conditional operator?
I have used following code for taking which java version installed in the local machine,

Function javachecking
ReadRegStr $1 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" "CurrentVersion"
${If} $1 > 1.5
MessageBox MB_OK "jdk $1 version is not correct. You should use jdk1.6 and above.."
Quit
FunctionEnd.

In my application run only jdk1.6 and above versions.so i have checked conditional operator to the jdk version..but it did not working.Because if i installed 1.5 and run the script it doesnot show this message box.How to check this condition?


Use the VersionCompare macro in WordFunc.nsh:
http://nsis.sourceforge.net/Docs/AppendixE.html#E.3.16


Thanks.comparing two versions is not solution for my problem.My problem is my application running only jdk1.6 and above versions.so using conditional operator something?.but i dont know how to use?


You need to compare the installed version with "1.6" in order to see if it's high enough... That's what VersionCompare is for.