Archive: !insertmacro call declared problem


!insertmacro call declared problem
I write macros:
!macro DllRename DllName
...
!macroend

When i call:
!insertmacro DllRename "$INSTDIR\Shell_1.dll"
!insertmacro DllRename "$INSTDIR\Shell_1.dll"

Error: label "EndRename:" already declared in section


If you insert the macro twice, the EndRename label is also created twice. This is not allowed in NSIS, labels must be unique.

Use this:
!macro DllRename DllName
!define _LPrefix ${__LINE__}
...
goto ${_LPrefix}EndRename
...
${_LPrefix}EndRename:

!undef _LPrefix
!macroend


not understand please show an example

!macro ShowMessage Message
!define _LPrefix ${__LINE__}
MessageBox MB_OK "11"
goto ${_LPrefix}EndRename
${_LPrefix}EndRename:
MessageBox MB_OK "222"
!undef _LPrefix
!macroend

!insertmacro: ShowMessage
!define: "_LPrefix"="385.1"
Error: Goto targets cannot begin with 0-9, $, !
Usage: Goto label


Oops, my bad, use this:

!define _LPrefix L${__LINE__}


I write function Rename and Call
!insertmacro DeleteFiles

Push ${FILE_NAME}
Push ${B1_PlUGIN_2}
Call DeleteFile

Push ${B1_PlUGIN_1}
Call DeleteFile
!macroend


oy, this works.