2007년 9월 26일 수요일

ILMerge-Exe파일과 Dll파일을 결합?

DLL과 EXE를 통합시킬 수 있는 방법을 찾기위해 google에 "exe dll integrate"라고 치니까 How to integrate dll's with my exe(http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2154240&SiteID=1)라는 글이 바로 나왔다. 역시 구글천국..ㅋㅋ

윗글의 리플에 따르면,
ILMerge는 여기(http://www.microsoft.com/downloads/details.aspx?FamilyID=22914587-b4ad-4eae-87cf-b14ae6a939b0&displaylang=en)에서 다운로드가 가능하다. 그리고 이것의 설명은 codeproject(http://www.codeproject.com/dotnet/mergingassemblies.asp)에서 볼 수 있다.

아래는 ILMerge의 사용방법을 요약해 놓은것이다.

1. 라이브러리는 DLL로, 프로그램은 DLL을 참조하는 EXE파일로 컴파일한다.

csc /target:library /out:ClassLibrary1.dll ClassLibrary1.cs
vbc /target:library /out:ClassLibrary2.dll ClassLibrary2.vb
vbc /target:winexe /out:Program.exe

2. ILMerge로 이 각개의 부분들을 링크시켜 하나의 EXE로 만든다.

ilmerge /target:winexe /out:SelfContainedProgram.exe Program.exe ClassLibrary1.dll ClassLibrary2.dll
(ilmerge /target:winexe /out:결과EXE파일 [통합하려는 파일들.])


(ILMerge로 상업적인 클래스 라이브러리도 같이 통합할 수 있다.^^ 나의것이 되는거?ㅋㅋ)

댓글 없음: