|
@@ -788,7 +788,6 @@ public class MainWindowViewModel : ViewModelBase
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- WebClient webClient = new WebClient();
|
|
|
try
|
|
|
{
|
|
|
_logger.Information("Downloading updater.zip");
|
|
@@ -803,14 +802,13 @@ public class MainWindowViewModel : ViewModelBase
|
|
|
if (url == String.Empty)
|
|
|
return;
|
|
|
|
|
|
- webClient.DownloadFile(new System.Uri(url), "updater.zip");
|
|
|
+ await Downloader.DownloadFileAsync(url, "updater.zip", _tokenSource.Token);
|
|
|
}
|
|
|
- catch (Exception ex)
|
|
|
+ catch (Exception)
|
|
|
{
|
|
|
_logger.Error("Error occured on getting updater.zip from the server.");
|
|
|
throw;
|
|
|
}
|
|
|
- webClient.Dispose();
|
|
|
_logger.Information("Unpacking updater.zip");
|
|
|
ZipFile.ExtractToDirectory($"updater.zip", Directory.GetCurrentDirectory(), true);
|
|
|
|