Archive: NSIS and Debug/Release Builds


NSIS and Debug/Release Builds
Hi

I am using a user created variable to simulate Debug/Release builds with additional information that I don't want the user to see.


// Main section:
;;;;; Are we in DEBUG mode?
Var /GLOBAL _DEBUGMODE
StrCpy $_DEBUGMODE 1
;;;;; /Are we in DEBUG mode?
Push $_DEBUGMODE
Call funct

// Function funct residing in a .nsh file
Pop $4
IntCmp $4 1 0 +2
DetailPrint "DEBUG: funct: ERROR: error message goes here!"
; Carry on


Is there an easier way?

I think that you can do:

!define FORDEBUG
...
!ifdef FORDEBUG
MessageBox MB_OK "FORDEBUG: Blah"
!endif

Defines can be done on command line too.


The !define will propagate through all the lines, including external files, correct?


Correct.


Thank you, I'll give it a try.


Thanks pospec, it works.