Yes, it does make sense. wyUpdate starts, finds the new update and then tells me that the process running my application must be closed in order to do the update. For some reason I can get past this. The code below shows what I'm doing.
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false);
SilentUpdateCheck(); }
static void SilentUpdateCheck() { Process wuProcess = new Process { StartInfo = { FileName = string.Concat(Application.StartupPath, "\\", "wyUpdate.exe"), Arguments = " /quickcheck /noerr /justcheck" }, EnableRaisingEvents = true }; wuProcess.Exited += wuProcess_Exited; wuProcess.Start(); wuProcess.WaitForExit(); }
static void wuProcess_Exited(object sender, EventArgs e) { Process wuProcess = (Process)sender; wuProcess.Exited -= wuProcess_Exited;
if (wuProcess.ExitCode == 2) { wuProcess.Close(); Process update = new Process { StartInfo = { FileName = string.Concat(Application.StartupPath, "\\", "wyUpdate.exe") } }; update.Start(); } }