我有一个功能
Function installDll
...
EndFunction
我有一些部分:
如果选择了{a,b,c,d}部分中的至少一个,我想一次调用函数installDll。
答案 0 :(得分:2)
您可以从每个相关部分调用您的函数,并使用变量作为标志来了解该函数是否已被调用:
!include "LogicLib.nsh" ;used for ${if} constructs
Section "A"
Call installDll
SectionEnd
Section "B"
Call installDll
SectionEnd
Section "C"
Call installDll
SectionEnd
Section "D"
Call installDll
SectionEnd
Section "Other"
;... do not call the function
SectionEnd
Var instFlag
Function installDll
${ifThen} $instFlag = 1 ${|} goto skip ${|}
StrCpy $instFlag 1
;... the rest of your function
;the following label is the last statement of the function
skip:
EndFunction