Edit 11 years later: I did not write this. Not sure the original source, but thanks to the original author.
While working on a utility project today, I stumbled upon wanting to embed an executable inside another executable. Sounds fun doesn’t it? And what is even more fun is to be able to launch the embedded exe
!
Basically, here’s how it works. You embed Foo.exe
inside Bar.exe
. And by embed I mean, add Foo.exe
as a resource in Bar.exe
and then, from Bar.exe
’s code, you can launch Foo.exe
using CreateProcess()
.
So before answering the "Why?" lets answer the "How?"