Old 21st November 2011, 08:18   #1
NOCaut
Senior Member
 
Join Date: Sep 2011
Posts: 106
!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
NOCaut is offline   Reply With Quote
Old 21st November 2011, 09:05   #2
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
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
MSG is offline   Reply With Quote
Old 21st November 2011, 09:42   #3
NOCaut
Senior Member
 
Join Date: Sep 2011
Posts: 106
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
NOCaut is offline   Reply With Quote
Old 21st November 2011, 09:53   #4
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
Oops, my bad, use this:

!define _LPrefix L${__LINE__}
MSG is offline   Reply With Quote
Old 21st November 2011, 09:55   #5
NOCaut
Senior Member
 
Join Date: Sep 2011
Posts: 106
I write function Rename and Call
!insertmacro DeleteFiles

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

Push ${B1_PlUGIN_1}
Call DeleteFile
!macroend
NOCaut is offline   Reply With Quote
Old 21st November 2011, 09:58   #6
NOCaut
Senior Member
 
Join Date: Sep 2011
Posts: 106
oy, this works.

Last edited by NOCaut; 21st November 2011 at 11:00.
NOCaut is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump