W.Mailh W.Mailh - 8 months ago 44
C# Question

Starting an application that is in resources C#

I am trying to run an executable that is in my resources.

Here is my current code:


I know why it is not currently working. Although I do not know how to make it actually work

I am sorry if this description isn't very descriptive.

Thanks in advance

Answer Source

The application in the resources is just a byte[], you can't call Process.Start( on a byte[] it expects a path. Save the file to disk in a temporary folder and then execute the temporary file.

string path = GetTempFilePath();
System.IO.File.WriteAllBytes(path, Properties.Resources.Application);