You can extend LogicLib, yes, but not the way you're writing it right now, of course 🙂
Probably the best approach would be to add comparison logic operators, a la (I'm using ${VersionCompare} out of WordFunc.nsh):
/* Version tests */
!insertmacro `_LOGICLIB_TEMP` /* required */
!macro _V= _a _b _t _f
${VersionCompare} ${_a} ${_b} $_LOGICLIB_TEMP
IntCmp $_LOGICLIB_TEMP 0 `${_t}` `${_f}` `${_f}`
!macroend
!macro _V<> _a _b _t _f
!insertmacro _V= `${_a}` `${_b}` `${_f}` `${_t}`
!macroend
!macro _V< _a _b _t _f
${VersionCompare} ${_a} ${_b} $_LOGICLIB_TEMP
IntCmp $_LOGICLIB_TEMP 2 `${_t}` `${_f}` `${_f}`
!macroend
!macro _V<= _a _b _t _f
!insertmacro _V> `${_a}` `${_b}` `${_f}` `${_t}`
!macroend
!macro _V> _a _b _t _f
${VersionCompare} ${_a} ${_b} $_LOGICLIB_TEMP
IntCmp $_LOGICLIB_TEMP 1 `${_t}` `${_f}` `${_f}`
!macroend
!macro _V>= _a _b _t _f
!insertmacro _V< `${_a}` `${_b}` `${_f}` `${_t}`
!macroend
Usage example for experimenting:
!include "LogicLib.nsh"
!include "WordFunc.nsh"
OutFile "$%temp%\temp.exe"
Section
[version compare code goes here, perhaps in an include, or maybe you put it in LogicLib.nsh directly]
Section
StrCpy $0 "1.0.0.0"
StrCpy $1 "1.0.0.1"
${If} "$0" V= "$1"
MessageBox MB_OK "$0 = $1"
${EndIf}
${If} "$0" V<> "$1"
MessageBox MB_OK "$0 <> $1"
${EndIf}
${If} "$0" V< "$1"
MessageBox MB_OK "$0 < $1"
${EndIf}
${If} "$0" V<= "$1"
MessageBox MB_OK "$0 <= $1"
${EndIf}
${If} "$0" V> "$1"
MessageBox MB_OK "$0 > $1"
${EndIf}
${If} "$0" V>= "$1"
MessageBox MB_OK "$0 >= $1"
${EndIf}
SectionEnd