运行嵌入式exe及其依赖项c#

时间:2016-09-05 13:28:31

标签: c# winforms

在我的Windows应用程序中嵌入以下内容,并使用以下代码执行setup.exe:

 string path = Path.Combine(Path.GetTempPath(), "setup.exe");
 File.WriteAllBytes(path, EmbeddedApp2.Properties.Resources.setup);
 Process.Start(path);

enter image description here

当我运行应用程序时,安装防护罩会闪烁并消失。

1 个答案:

答案 0 :(得分:0)

你能试试吗?

Process myProcess = new Process();
myProcess.StartInfo.CreateNoWindow = true;
myProcess.StartInfo.UseShellExecute = false;
myProcess.StartInfo.ErrorDialog = false;
myProcess.StartInfo.RedirectStandardOutput = false;
myProcess.StartInfo.RedirectStandardInput = false;
myProcess.StartInfo.RedirectStandardError = false;
myProcess.EnableRaisingEvents = true;
myProcess.StartInfo.FileName = "setup.exe";
myProcess.Start();