NSIS的DialogEx插件的释义

DialogEx.nsh的开头部分有这么一段代码

!macro DLGEX_DEFINE SYMBOL CONTENT
	!ifdef ${SYMBOL}
		!undef ${SYMBOL}
	!endif
	!define ${SYMBOL} `${CONTENT}`
!macroend
!insertmacro DLGEX_DEFINE define "!insertmacro DLGEX_DEFINE"

定义宏的语法是

!marco 宏名 参数1 参数2 ...

插入宏的语法是

!insertmacro 宏名 参数1 参数2 ...

所以根据上面代码的第7行,define宏的定义就是

!define define "!insertmacro DLGEX_DEFINE"

 

然后使用${define}定义SysCall宏就是

${define} SysCall System::Call

展开就是

!insertmacro DLGEX_DEFINE SysCall System::Call

再展开就是

!define SysCall `System::Call`

卧槽这个东西绝,以后就可以使用 ${define} 代替 !define 了

${define}的好处就是能自动去掉以前定义过的宏,用新的内容代替

 

 

以后用

${SysCall}  xxxx

就相当于用

System::Call xxxx

 

有了${define}和${SysCall}这2个宏,后面的代码就可以慢慢看了。

posted on 2016-12-15 14:46  litandy  阅读(267)  评论(0编辑  收藏  举报

导航