public override void Prepare(UpdaterStatus status) { base.Prepare(status); foreach (var entry in _entries) { var repairStatus = new OperationStatus { Weight = { Value = StatusWeightHelper.GetUnarchivePackageWeight(entry.Size.Value) } }; status.RegisterOperation(repairStatus); var downloadStatus = new DownloadStatus { Weight = { Value = StatusWeightHelper.GetDownloadWeight(entry.Size.Value) } }; status.RegisterOperation(downloadStatus); _entryStatus[entry] = new EntryStatus { RepairStatus = repairStatus, DownloadStatus = downloadStatus }; } _localData.PrepareForWriting(); }
public override void Prepare([NotNull] UpdaterStatus status, CancellationToken cancellationToken) { if (status == null) { throw new ArgumentNullException("status"); } try { _logger.LogDebug("Preparing diff installation..."); base.Prepare(status, cancellationToken); _localData.PrepareForWriting(); _previousContentSummary = _remoteMetaData.GetContentSummary(_versionId - 1, cancellationToken); _contentSummary = _remoteMetaData.GetContentSummary(_versionId, cancellationToken); _diffSummary = _remoteMetaData.GetDiffSummary(_versionId, cancellationToken); double unarchivePackageWeight = StatusWeightHelper.GetUnarchivePackageWeight(_diffSummary.Size); _logger.LogTrace("unarchivePackageWeight = " + unarchivePackageWeight); _unarchivePackageStatusReporter = new OperationStatus { Weight = { Value = unarchivePackageWeight } }; status.RegisterOperation(_unarchivePackageStatusReporter); double addFilesWeight = StatusWeightHelper.GetAddDiffFilesWeight(_diffSummary); _logger.LogTrace("addFilesWeight = " + addFilesWeight); _addFilesStatusReporter = new OperationStatus { Weight = { Value = addFilesWeight } }; status.RegisterOperation(_addFilesStatusReporter); double modifiedFilesWeight = StatusWeightHelper.GetModifyDiffFilesWeight(_diffSummary); _logger.LogTrace("modifiedFilesWeight = " + modifiedFilesWeight); _modifiedFilesStatusReporter = new OperationStatus { Weight = { Value = modifiedFilesWeight } }; status.RegisterOperation(_modifiedFilesStatusReporter); double removeFilesWeight = StatusWeightHelper.GetRemoveDiffFilesWeight(_diffSummary); _logger.LogTrace("removeFilesWeight = " + removeFilesWeight); _removeFilesStatusReporter = new OperationStatus { Weight = { Value = removeFilesWeight } }; status.RegisterOperation(_removeFilesStatusReporter); _logger.LogDebug("Diff installation prepared."); } catch (Exception e) { _logger.LogError("Failed to prepare diff installation.", e); throw; } }
public void Prepare(UpdaterStatus status, CancellationToken cancellationToken) { // do nothing _status = new OperationStatus { Weight = { Value = 0.00001 }, Description = { Value = "Allocating disk space..." } }; status.RegisterOperation(_status); }
public override void Prepare(UpdaterStatus status) { base.Prepare(status); Checks.ArgumentNotNull(status, "statusMonitor"); DebugLogger.Log("Preparing content installation."); _localData.PrepareForWriting(); _copyFilesStatus = new OperationStatus { Weight = { Value = StatusWeightHelper.GetCopyContentFilesWeight(_versionContentSummary) } }; status.RegisterOperation(_copyFilesStatus); _unarchivePackageStatus = new OperationStatus { Weight = { Value = StatusWeightHelper.GetUnarchivePackageWeight(_versionContentSummary.Size) } }; status.RegisterOperation(_unarchivePackageStatus); }
public override void Prepare(UpdaterStatus status) { base.Prepare(status); Checks.ArgumentNotNull(status, "statusMonitor"); DebugLogger.Log("Preparing version integrity check."); _status = new OperationStatus { Weight = { Value = StatusWeightHelper.GetCheckVersionIntegrityWeight(_versionSummary) }, Description = { Value = "Checking version integrity..." } }; status.RegisterOperation(_status); }
public override void Prepare(UpdaterStatus status, CancellationToken cancellationToken) { base.Prepare(status, cancellationToken); Checks.ArgumentNotNull(status, "statusMonitor"); DebugLogger.Log("Preparing uninstallation."); _localData.PrepareForWriting(); _statusReporter = new OperationStatus { Weight = { Value = StatusWeightHelper.GetUninstallWeight() } }; status.RegisterOperation(_statusReporter); }
public override void Prepare(UpdaterStatus status) { base.Prepare(status); if (status == null) { throw new ArgumentNullException("status"); } DebugLogger.Log("Preparing package download."); _status = new DownloadStatus { Weight = { Value = StatusWeightHelper.GetResourceDownloadWeight(_resource) }, Description = { Value = "Downloading package..." } }; status.RegisterOperation(_status); }