Updater added

This commit is contained in:
2022-08-28 12:59:41 +03:00
parent d689eee7fa
commit 68a83b052a
16 changed files with 732 additions and 110 deletions

View File

@@ -168,9 +168,7 @@ namespace PluginManager.Others
/// <returns></returns>
public static async Task ExtractArchive(string zip, string folder, IProgress<float> progress, UnzipProgressType type)
{
if (!Directory.Exists(folder)) Directory.CreateDirectory(folder);
Directory.CreateDirectory(folder);
using (ZipArchive archive = ZipFile.OpenRead(zip))
{
if (type == UnzipProgressType.PercentageFromNumberOfFiles)
@@ -194,7 +192,8 @@ namespace PluginManager.Others
currentZIPFile++;
await Task.Delay(10);
progress.Report((float)currentZIPFile / totalZIPFiles * 100);
if (progress != null)
progress.Report((float)currentZIPFile / totalZIPFiles * 100);
}
}
else if (type == UnzipProgressType.PercentageFromTotalSize)
@@ -224,7 +223,8 @@ namespace PluginManager.Others
}
await Task.Delay(10);
progress.Report((float)currentSize / zipSize * 100);
if (progress != null)
progress.Report((float)currentSize / zipSize * 100);
}
}
}