private void UpdateAwb()
{
try
{
_proxy = WebRequest.GetSystemWebProxy();
if (_proxy.IsBypassed(new Uri("https://en.wikipedia.org")))
_proxy = null;
UpdateUI("Getting current AWB and Updater versions", true);
AWBVersion();
if ((!_updaterUpdate && !_awbUpdate) && string.IsNullOrEmpty(_awbWebAddress))
{
ExitEarly();
return;
}
UpdateUI("Creating a temporary directory", true);
CreateTempDir();
UpdateUI("Downloading AWB", true);
GetAwbFromInternet();
UpdateUI("Unzipping AWB to the temporary directory", true);
UnzipAwb();
UpdateUI("Making sure AWB is closed", true);
CloseAwb();
UpdateUI("Copying AWB files from temp to AWB directory...", true);
CopyFiles();
UpdateUI("Update successful", true);
UpdateUI("Cleaning up from update", true);
KillTempDir();
UpdateUI("Update finished. You may close this window (AWB Updater) now.", true);
_updateSucessful = true;
ReadyToExit();
}
catch (AbortException)
{
ReadyToExit();
}
catch (Exception ex)
{
ErrorHandler.HandleException(ex);
}
}