I am trying to register two dll:s using a macro that takes these parameters:
!macro RegisterWithRegAsm flag executable typeLib
I call the macro like this:
!insertmacro RegisterWithRegAsm “” “Dll1.dll” “Dll1.tlb”
!insertmacro RegisterWithRegAsm “” “Dll2.dll” “Dll2.tlb”
THe problem is I can only run the macro one time cause the second time the NSIS complains that I have already declared a label :
inst__:
StrCpy $R1 ‘$R0${DOT_NET_VERSION_2_SP2}\RegAsm.exe “$INSTDIR\${APP_NAME_COMPACT}\${executable}” /codebase /tlb:”$INSTDIR\${APP_NAME_COMPACT}\${typeLib}” /silent’
How can I move this label (and the u_inst_) outside of the macro so I can use it more than once?
ANyone know of a good site for reference? I have looked at the nsis web page but can’t find references to multiple dll handling.
THanks for any ideas!
One solution is to make the label unique with a prefix:
Or if you are creating a utility function that will be called in many places it is usually better to create a function. The CallArtificialFunction stuff in util.nsh is a helper macro that makes it easy to turn a macro into a function.