private static void UpdateToVersion(Version version, string update) { var details = new UpdateDetails(version); if (details.ShowDialog().GetValueOrDefault(false)) { // Download and install update Task.Factory.StartNew(() => { var client = new WebClient(); var temp = Path.GetTempFileName() + ".exe"; client.DownloadFile(update, temp); Process.Start(temp); Application.Exit(); }); } }