Skip to content
⌘ NSIS Forum Archive

Comparing values like 2.2.1 and 2.2

5 posts

carlosfocker#

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#
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#
Don't use VersionCheck. It doesn't work for all version numbers. Use VersionCompare which was written as a replacement:


-Stu