Skip to content
⌘ NSIS Forum Archive

!if isn't working correctly?

6 posts

dbach#

!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?
dbach#
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?
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.
dbach#
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.