0

我有一个功能

Function installDll

...
EndFunction

我有一些部分:

  • 一个
  • b
  • C
  • d
  • e
  • F

如果至少选择了 { a, b, c, d} 部分之一,我想调用函数 installDll 一次。

4

1 回答 1

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
于 2013-06-17T20:44:37.077 回答