Search code examples
installationcompilationlabelnsis

Update relative jumb label name during compile time in NSIS


Is there a way to update Goto label each time during compile time in NSIS.

I have tried ${Counter} for labeling the conditions like below but no luck.

IntCmp $R2 1 succ${_Counter_}
${IF} $R2 != "1"
 Goto Error
${EndIf}
Goto end{_Counter_}
succ${_Counter_}:
DetailPrint "Success"
end{_Counter_}:
DetailPrint "End"

Error:
DetailPrint "Error"

Any approach?


Solution

  • !define /ReDef MyLbl ${__COUNTER__}
    loop${MyLbl}:
      ...
      StrCmp $0 $something loop${MyLbl} end${MyLbl}
    end${MyLbl}:
    !undef MyLbl