title: Packing an exe + dll into one executable (not .NET)
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/72264/how-can-a-c-windows-dll-be-merged-into-a-c-sharp-application-exe">How can a C++ windows dll be merged into a C# application exe?</a>  </p>
  </blockquote>
  
  
  
  <p>Is anybody aware of a program that can pack several DLL and a .EXE into one executable. I am not talking about .NET case here, I am talking about general DLLs, some of which I generate in C++, some of others are external DLL I have no control over.</p>
  
  <p>My specific case is a python program packaged with py2exe, where I would like to "hide" the other DLL by packing them. The question is general enough though.</p>
  
  <p>The things that had a look at:</p>
  
  <ul>
  <li>ILMerge: specific to .NET</li>
  <li><a href="http://madebits.com/netz/" rel="noreferrer">NETZ</a>: specific to .NET</li>
  <li><a href="http://upx.sourceforge.net/" rel="noreferrer">UPX</a>: does DLL compression but not multiple DLL + EXE packing</li>
  <li><a href="http://www.file-joiner.com/" rel="noreferrer">FileJoiner</a>: </li>
  </ul>
  
  <blockquote>
  Almost got it. It can pack executable + anything into one exe but when opened, it will launch the default opener for every file that was packed. So, if the user user dlldepend installed, it will launch it (becaues that's the default dll opener).
  </blockquote>
  
  <p>Maybe that's not possible ?</p>
  
  <hr>
  
  <p>Summary of the answers:</p>
  
  <p>DLL opening is managed by the OS, so packing DLL into executable means that at some point, they need to be extracted to a place where the OS can find them. No magic bullet.</p>
  
  <p>So, what I want is not possible.</p>
  
  <p>Unless...</p>
  
  <p>We change something in the OS. Thanks Conrad for pointing me to <a href="http://www.vmware.com/products/thinapp/overview.html" rel="noreferrer">ThinInstall</a>, which virtualise the application and the OS loading mechanism. With ThinInstall, it is possible to pack everything in one exe (DLL, registry settings, ...).</p>