Archive: !if isn't working correctly?


!if isn't working correctly?
  Hi there.

I have a problem with an Plugin (HwInfo) and the values I got returned.

E.g. I am asking for the System-memory. Its 1024.

Now I wrote a little .onInit function:

HwInfo::GetSystemMemory

StrCpy $R0$0
MessageBox MB_OK $R0
!if 1500 < $R0
Detailprint "This system has less memory as required!"
MessageBox MB_YESNO "This system has $R0 MB Memory but 1500 MB is at least required. Continue Installation?" IDYES GetSystemMemoryEnd IDNO +1
Abort
!else
Detailprint "System has $R0 Memory"
!endif
But this section is never called. But 1024 IS smaller then 1500. Does this make any sence?

use LogicLib.nsh for ${If} ${Else} etc statement


Originally posted by Red Wine
use LogicLib.nsh for ${If} ${Else} etc statement
Thanks Red Wine. I will try it. Is the non-working !if a known bug or just a mistake of usage by myself?

!if is a compile-time statement, not a runtime statement.

In other words, it's only used by the compiler and not by the actual setup program.


Originally posted by Comperio
!if is a compile-time statement, not a runtime statement.

In other words, it's only used by the compiler and not by the actual setup program.
Ah, didn't saw that. Thanks a lot.

Once again, thanks for you help folks!
:)