Exemple #1
0
        public override void Prepare(IStatusMonitor statusMonitor)
        {
            base.Prepare(statusMonitor);

            Checks.ArgumentNotNull(statusMonitor, "statusMonitor");

            DebugLogger.Log("Preparing diff installation.");

            _localData.PrepareForWriting();
            _temporaryData.PrepareForWriting();

            double unarchivePackageWeight = StatusWeightHelper.GetUnarchivePackageWeight(_versionDiffSummary.Size);

            _unarchivePackageStatusReporter = statusMonitor.CreateGeneralStatusReporter(unarchivePackageWeight);

            double addFilesWeight = StatusWeightHelper.GetAddDiffFilesWeight(_versionDiffSummary);

            _addFilesStatusReporter = statusMonitor.CreateGeneralStatusReporter(addFilesWeight);

            double modifiedFilesWeight = StatusWeightHelper.GetModifyDiffFilesWeight(_versionDiffSummary);

            _modifiedFilesStatusReporter = statusMonitor.CreateGeneralStatusReporter(modifiedFilesWeight);

            double removeFilesWeight = StatusWeightHelper.GetRemoveDiffFilesWeight(_versionDiffSummary);

            _removeFilesStatusReporter = statusMonitor.CreateGeneralStatusReporter(removeFilesWeight);
        }
Exemple #2
0
        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();
        }
Exemple #3
0
        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 override void Prepare(IStatusMonitor statusMonitor)
        {
            base.Prepare(statusMonitor);

            Checks.ArgumentNotNull(statusMonitor, "statusMonitor");

            DebugLogger.Log("Preparing uninstallation.");

            _localData.PrepareForWriting();

            double weight = StatusWeightHelper.GetUninstallWeight();

            _statusReporter = statusMonitor.CreateGeneralStatusReporter(weight);
        }
Exemple #5
0
        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(IStatusMonitor statusMonitor)
        {
            base.Prepare(statusMonitor);

            Checks.ArgumentNotNull(statusMonitor, "statusMonitor");

            DebugLogger.Log("Preparing content installation.");

            _localData.PrepareForWriting();
            _temporaryData.PrepareForWriting();

            double copyFilesWeight = StatusWeightHelper.GetCopyContentFilesWeight(_versionContentSummary);

            _copyFilesStatusReporter = statusMonitor.CreateGeneralStatusReporter(copyFilesWeight);

            double unarchivePackageWeight = StatusWeightHelper.GetUnarchivePackageWeight(_versionContentSummary.Size);

            _unarchivePackageStatusReporter = statusMonitor.CreateGeneralStatusReporter(unarchivePackageWeight);
        }
        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);
        }