SDownload.Dialogs.UpdateAvailableDialog.DownloadAndInstall C# (CSharp) Method

DownloadAndInstall() private method

Downloads and installs the newest version
private DownloadAndInstall ( int size ) : void
size int The size of the new version to download
return void
        private void DownloadAndInstall(int size)
        {
            var downloader = new DownloadProgressDialog(_fileUrl, size);
            var fileLocation = String.Format("{0}\\sdownload_update.exe", Path.GetTempPath());

            try
            {
                LogUpdate();
            }
            catch (Exception) { }

            if (downloader.Download(fileLocation))
            {
                // Launch the installer and close the running instance
                try
                {
                    Process.Start(fileLocation);
                } 
                catch (Exception)
                {
                    CrashHandler.Throw("There was an issue launching the update! You'll need to manually start the file: " + fileLocation, false);
                }
                Close();
                Application.Exit();
            }
            else
            {
                // There was an issue downloading the file
                CrashHandler.Throw("There was an issue downloading the update!", downloader.LastException);
                Close();
            }
        }