VersionCompare Recommendation
@Afro
I would like to recommend a minor modification to VersionCompare.
In WordFunc.nsh you have:
WordFunc_VersionCompare_begin:
StrCpy $2 -1
I recommend updating that to the following:
WordFunc_VersionCompare_begin:
WordFunc_VersionCompare_trimleadingzeros_ver1:
StrCpy $8 $0 1 0
StrCmp $8 '0' 0 WordFunc_VersionCompare_trimleadingzeros_ver2
StrCpy $0 $0 '' 1
goto WordFunc_VersionCompare_trimleadingzeros_ver1
WordFunc_VersionCompare_trimleadingzeros_ver2:
StrCpy $8 $1 1 0
StrCmp $8 '0' 0 WordFunc_VersionCompare_posttrim
StrCpy $1 $1 '' 1
goto WordFunc_VersionCompare_trimleadingzeros_ver2
WordFunc_VersionCompare_posttrim:
StrCpy $2 -1
I came about this when I was testing version numbers as in the following examples:
VersionCompare '5.01.12345' '05.01.12345' return=1 expected=0
VersionCompare '5.02.12345' '5.1.12345' return=2 expected=1
VersionCompare '5.01.12345' '5.1.12345' return=2 expected=0
Just has to do with the leading 0's for version # section.
If not, no worries, but this is how I would anticipate it run, IMO.