This project has moved and is read-only. For the latest updates, please go here.

WPF Presentation Application failing to close the application once download is finished

Mar 14, 2013 at 10:49 PM
I got this working but the only issue I find myself having is I am running it in a WPF and it's failing to close the windows once the download is completed hence it opens a new instance while keeping the old one still running. Any ideas? Thanks
Mar 15, 2013 at 8:14 AM
Edited Mar 17, 2013 at 6:24 AM
This problem happens because of Application.Exit() method used to exit the app which doesn't work for wpf So download sourcecode and change ondownloadcomplete method in downloadupdatedialog.cs to following.
private void OnDownloadComplete(object sender, AsyncCompletedEventArgs e) 
{ 
var processStartInfo = new ProcessStartInfo {FileName = _tempPath, UseShellExecute = true}; Process.Start(processStartInfo); 
Environment.Exit(0);
}  
Mar 15, 2013 at 12:08 PM
Thanks, still new to visual studio and C#