public async Task UpdateTarget(CancellationToken cancelTkn) { if (_remotePkg == null) { throw Fault .BadCall(nameof(TargetIsOutdated), nameof(UpdateTarget)); } var unpackd = string.Empty; try { unpackd = await _downloadr.DownloadAndUnpack (_remotePkg, _file.TempDir, cancelTkn); } catch (Exception ex) { SetStatus(ex.Info(false, true)); } if (unpackd.IsBlank()) { return; } CheckHash(unpackd, "downloaded-unpacked package"); if (!(await RetireCurrentPackage(true))) { if (!(await RetireCurrentPackage(false))) { StopCheckingForUpdates(); return; } } await PromoteNewerPackage(unpackd); CheckHash(TargetPath, "downloaded-unpacked-placed package"); StopCheckingForUpdates(); RaiseTargetUpdated(); }