2011-08-25 2 views
0

내가이 DLL을 등록하려고! 이러한 매개 변수 걸리는 매크로를 사용하여 S :nsis 스크립트에서 regasm을 사용하여 같은 매크로로 두 개의 dll : s을 어떻게 등록 할 수 있습니까?

매크로 RegisterWithRegAsm 플래그 실행 형식 라이브러리를

내가 전화 같은 매크로!

"RegisterWithRegAsm insertmacro" " Dll1.dll ""Dll1.tlb " ! RegisterWithRegAsm" ""Dll2.dll ""Dll2.tlb "문제는 난 단지 원인 NSIS 내가 가진 불평 두 번째로 매크로 한 번에 실행할 수있다

insertmacro 이미 라벨을 선언했습니다 :

inst__ : strcpy를 $ R1 '$ R0 $ {DOT_NET_VERSION_2_SP2} \는 RegAsm.exe "$ INSTDIR \ $ {APP_NAME_COMPACT} \ $ {실행}"/ 코드베이스/TLB : "$ INSTDIR \ $ {APP_NAME_COMPACT} \ $ {typeLib} "/ silent"

두 번 이상 사용할 수 있도록 매크로 외부에서이 레이블 (및 u_inst_)을 어떻게 이동할 수 있습니까?

누구든지 참조 용으로 좋은 사이트를 알고 계십니까? nsis 웹 페이지를 보았지만 여러 dll 처리에 대한 참조를 찾을 수 없습니다.

아이디어가 필요하세요!

답변

0

하나의 솔루션은 접두사와 라벨 고유하게하는 것입니다

!macro UselessExample string 
!define UselessExample_lbl "UselessExample_${__LINE__}" ;prefixing with the macro name is a good way to avoid conflicts 
Goto ${UselessExample_lbl}pointlessjump 
DetailPrint "Hello?" 
${UselessExample_lbl}pointlessjump: 
DetailPrint "${string}" 
!undef UselessExample_lbl 
!macroend 

Section 
!insertmacro UselessExample "Hello1" 
!insertmacro UselessExample "Hello2" 
SectionEnd 

또는 당신이 함수를 작성하는 것이 더 많은 곳에서 호출되는 유틸리티 함수를 작성하는 경우. util.nsh의 CallArtificialFunction 항목은 매크로를 함수로 쉽게 전환 할 수있게 해주는 도우미 매크로입니다.

!include util.nsh 

!macro UselessExample string 
Push "${string}" 
${CallArtificialFunction} UselessExampleWorker 
!macroend 
!macro UselessExampleWorker 
Pop $0 
DetailPrint $0 
!macroend 

Section 
!insertmacro UselessExample "Hello1" 
!insertmacro UselessExample "Hello2" 
SectionEnd 
+0

여러 번 사용할 수 있기를 바 랐기 때문에 함수로 변경했습니다. 철저한 설명에 감사드립니다! – kakka47

관련 문제