tags:

views:

3020

answers:

6

I have a Windows C# program that uses a C++ dll for data i/o. My goal is to deploy the application as a single EXE.

What are the steps to create such an executable?

+1  A: 

Thinstall is one solution. For a native windows application I would suggest embedding the DLL as a binary resource object, then extracting it at runtime before you need it.

titanae
Thinstall is ridiculously expensive and runs into issues with some Windows installs and 3rd party shell extensions. we used it with limited success for non-.Net codes, but found ClickOnce and MSI installs the best for .Net.
sixlettervariables
If your mainly looking for installation, I would recommend Inno Setup, we dropped InstallShield for this a few years ago and never looked back.http://www.innosetup.com/isinfo.php
titanae
+1  A: 

Have you tried ILMerge? http://research.microsoft.com/~mbarnett/ILMerge.aspx

ILMerge is a utility that can be used to merge multiple .NET assemblies into a single assembly. It is freely available for use from the Tools & Utilities page at the Microsoft .NET Framework Developer Center.

If you're building the C++ DLL with the /clr flag (all or partially C++/CLI), then it should work:

ilmerge /out:Composite.exe MyMainApp.exe Utility.dll

It will not work with an ordinary (native) Windows DLL however.

Raithlin
A: 

You might ask "Why deploy as a single exe?". If it's because the software needs to have a easy install- consider creating an easy install app that can be packaged as a single exe.

I have built a managed assembly from managed and unmanaged code, but the managed and unmanaged code resided in their own DLLs.

schwerwolf
A: 

Try boxedapp at this link

It allows to load all DLLs from memory. Also, it seems that you can even embed .net runtime. Good to create a really standalone applications...

Best, Art.

Art
A: 

PostBuild from Xenocode can package up both managed and unmanged into a single exe.

Joel Lucsy