carlosfocker
1st May 2006 18:34 UTC
Comparing values like 2.2.1 and 2.2
I am having a problem when I compare values like "2.2" and "2.2.1". When I use StrCmp, IntCmp, or LogicLib the value "2.2.1" is seen as being equal to "2.2". Is there a function for comparing values like this and seeing if they are equal.
carlosfocker
1st May 2006 19:21 UTC
I am looking at versioncheck right now so please dont suggest it.
carlosfocker
1st May 2006 19:31 UTC
Using VersionCheck I compared the two values and check if the retured value was equal to 0.
Code:
Push "$Version"
Push "2.2"
Call VersionCheck
Pop $0
${If} $0 = 0
Code here
${EndIf}
Afrow UK
1st May 2006 19:38 UTC
Don't use VersionCheck. It doesn't work for all version numbers. Use VersionCompare which was written as a replacement:
http://nsis.sourceforge.net/VersionCompare
-Stu
carlosfocker
1st May 2006 20:44 UTC
thanks.