private async Task Uninstall(VersionInfoLocal currentVersion) { this.UpdateProgress("Uninstalling old version...", -1); int curEntry = 0, entryCount = currentVersion.DirectoryList.Count; foreach (var directory in currentVersion.DirectoryList) { var stateString = $"Uninstalling old version... {( ++curEntry / (double) entryCount ):0.00}%"; this.UpdateProgress(stateString, curEntry / (double)entryCount); await Task.Run(() => Directory.Delete(directory, true)); } }
public Installer(VersionInfoRemote versionToInstall, VersionInfoLocal currentInstalled, InstallState currentInstallState, string rwLocation) { this.versionToInstall = versionToInstall; this.currentInstalled = currentInstalled; this.currentInstallState = currentInstallState; this.rwLocation = rwLocation; this.ctSource = new CancellationTokenSource(); var tempPath = Path.GetTempPath(); var dlPath = Path.Combine(tempPath, "CTAInstaller"); if (!Directory.Exists(dlPath)) { Directory.CreateDirectory(dlPath); } this.packageFile = Path.Combine(dlPath, "cta_latest.rwp"); }