WhiteRab
15th April 2008 19:23 UTC
!if !endif problem
I try to use !if and !endif in the macro, but it always fails to check the if condition as below. I'm noticed the text color of "!if" didn't change to green color as the !macro. It shows in black color. Does anybody know why it is wrong? I use NSIS version 2.36
!define BUILD_TYPE "1"
!macro SET_BUILD_TYPE
!if ${BUILD_TYPE} == "1"
!define APP_NAME "BETA"
!else
!define APP_NAME "FULL"
!endif
!macroend
Thanks, Oai
fabian.rap.more
15th April 2008 20:19 UTC
dont use a macro because no matter how many times you check it it will still come the same. and also if you call it more than once you will get an error as ${APP_NAME} will have already been defined
try this
!define BUILD_TYPE "1"
!if ${BUILD_TYPE} == "1"
!define APP_NAME "BETA"
!else
!define APP_NAME "FULL"
!endif
WhiteRab
15th April 2008 23:01 UTC
Thank Fabian! your code works well without using a macro. I'm wonder why the text color of "!if" is "black" not "green" as "!endif" in my application(HM NIS Edit toolkit).