0

I want to have my script compatible with nsis-3.03 and nsis-3.04. I know this:

!if 0n1 > 0 ; >= 3.0b0 
!endif

But I don't understand why 0n1 > 0 means >= 3.0b0?

I want to do something like

!if ... ; version=[3.0-3.3]
    ; do stuff
!else if  .., ; version > 3.3
    ; do other stuff
!else
     ; pass
!endif

I can`t use ${NSIS_PACKEDVERSION}, because it is wrong build at debain based systems.

2
  • Which new feature of 3.04 do you actually want to use?
    – Anders
    Jan 2, 2019 at 14:36
  • The IsNativeMachineArchitecture helper (see Changelog).
    – ikreb
    Jan 2, 2019 at 15:24

1 Answer 1

1

!if 0n1 > 0 ; >= 3.0b0 works because older versions do not understand 0n1 and treats it as 0 so it just becomes 0 > 0 in older versions.

NSIS v3.04 and later forces NSIS_PACKEDVERSION to be a somewhat usable value even if nobody specifies a version when compiling.

To detect a specific feature implemented in a .NSH you can just check if the define or macro exists, there is no need to do a version check:

!include x64.nsh
!ifdef IsNativeMachineArchitecture
...
!else
...
!endif
3
  • Thank you. Could you maybe add this information to the documentation?
    – ikreb
    Jan 2, 2019 at 16:28
  • Sorry, forget it. I found it.
    – ikreb
    Jan 2, 2019 at 16:42
  • 0nXYZ is documented at the start of the pre-processor (Chapter 5)
    – Anders
    Jan 2, 2019 at 16:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.