Possible Duplicate:
Embedded a *.exe into a dll
I have a C# project – a class library – that produces a DLL file.
From within itself, this project runs an external .exe file. (Using the standard Process stuff, and it works fine.)
However, my question is: How can I bake the external .exe file into the project, such that the end-consumer will only receive the final DLL file, without ever seeing the .exe file itself?
This will make my client happier, as he will continue receiving one DLL file (as before, before I needed the .exe).
If your client needs the .exe at runtime, you’d darn well better make sure he has a copy of the .exe. IMHO…
PS:
You can “trick” the client by embedding your .dll as a resource (as a “Trojan horse”), and then extracting it at runtime. Which, IMHO, would be stupid. Expensive. And risky.
If you need the .exe, ship the .exe. And be explicit about it.
If the client expressly refuses to have an .exe – then your implemention violates the requirements, and you need to go back to the drawing board.
The “exe-as-resource” workaround … is a lie and a cheat. And it isn’t even a very efficient or safe cheat.
ALSO: