Friday, June 17, 2011

Merge dll into exe

1) Download ILMerge
2) Install ILMerge
3) Go to command prompt and type the command

ilmerge.exe /target:winexe /out:combined_exename.exe orig_exe_name.exe orig_dll.dll

Say you have your program ( test.exe) and dll (someDllName.dll) built into c:\temp

"C:\Program Files\Microsoft\ILMerge\ilmerge.exe" /target:winexe /out:"C:\Temp\Combined.exe" "C:\Temp\Test.exe" "C:\Temp\somDllName.dll"

To make things easier, Copy the above 2 lines into a new file and name it combine.bat. Double click the batch file, and it should generate the output for you.