Hi All,
I have an application and made it as embedded exe.That must be present in application folder to run it.
if it is not present i have to write the embeded exe file to the startup path and make it run
any suggestions
cheers
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jean PaulPosted Jan 19, 2011, 7:42 AM
// You have to find the correct resource name for EmbedExe.regedt32.exe
// Use Assembly.GetExecutingAssembly().GetManifestResourceNames() to find it
Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("EmbedExe.regedt32.exe");
FileStream fileStream = new FileStream("new.exe", FileMode.CreateNew);
for (int i = 0; i < stream.Length; i++)
fileStream.WriteByte((byte)stream.ReadByte());
fileStream.Close();
// The above code retrieves the bytes and write to file new.exe in application bin folder
Regards,
Jean Paul
* pls mark as answer if helped