public ResolverManagerModResultPair(IModResolver resolver, IUpdateManager manager, CheckForUpdatesResult result, PathTuple <ModConfig> modTuple) { Resolver = resolver; Manager = manager; Result = result; ModTuple = modTuple; }
public UpdateForm(UpdateManager updateManager, CheckForUpdatesResult result) { _updateManager = updateManager; _result = result; InitializeComponent(); StartUpdate(); }
/// <exception cref="LockFileNotAcquiredException"></exception> /// <exception cref="UpdaterAlreadyLaunchedException "></exception> public async Task <bool> FetchUpdateAsync() { using var manager = new Onova.UpdateManager(PackageResolver, new ZipPackageExtractor()); UpdatesResult = await manager.CheckForUpdatesAsync(); return(UpdatesResult.CanUpdate); }
private void Instance_UpdateCheckFinished(object sender, CheckForUpdatesResult result, bool initiatedByUser) { if (result.CanUpdate) { Form.updateAvailableToolStripMenuItem.Visible = true; } else { // Only show notification if the update check was initiated by the user. if (initiatedByUser) { Form.toolTip.Show("No Updates Available.", Form.menuStrip, 70, 20, 1750); } } }
private async void Updater() { using (var manager = new UpdateManager( new GithubPackageResolver("EthemAcar-Dev", "OpenYeeLight", "*.zip"), new ZipPackageExtractor())) { CheckForUpdatesResult update = await manager.CheckForUpdatesAsync(); if (update.CanUpdate && _settings.AppSettings.AskForUpdates) { UpdateForm updateForm = new UpdateForm(update, manager); updateForm.ShowDialog(); } } }
public override async Task <CheckForUpdatesResult> CheckForUpdates() { if (!NetworkHelper.Instance.ConnectionInformation.IsInternetAvailable || NetworkHelper.Instance.ConnectionInformation.IsInternetOnMeteredConnection) { return new CheckForUpdatesResult { Result = false } } ; try { var result = new CheckForUpdatesResult(); var packageUpdates = await Context.GetAppAndOptionalStorePackageUpdatesAsync(); result.Result = packageUpdates.Count > 0; var pack = packageUpdates.FirstOrDefault(p => p.Package.Id.FamilyName.Equals(Current.Id.FamilyName)); if (pack != null) { var rq = new RestRequest("lrr/upgrade/check"); var r = await client.ExecuteGetAsync(rq); var updatesResult = await r.GetResultInternal <CheckForUpdatesResult>(); if (updatesResult.OK && updatesResult.Data != null) { return(updatesResult.Data); } } return(result); } catch (Exception e) { Crashes.TrackError(e); return(new CheckForUpdatesResult { Result = false, ErrorCode = e.HResult, ErrorMessage = e.Message }); } }
private async void CheckForUpdates() { label.Text = LABEL_CHECKING; button.Enabled = false; checkForUpdatesResult = await updateManager.CheckForUpdatesAsync(); if (checkForUpdatesResult.CanUpdate) { label.Text = LABEL_UPDATE_AVAILABLE; button.Text = BUTTON_UPDATE_NOW; button.Enabled = true; } else { new Thread(() => { Thread.Sleep(500); Invoke((MethodInvoker) delegate() { label.Text = LABEL_NO_UPDATES; button.Text = BUTTON_CHECK_FOR_UPDATES; button.Enabled = true; }); }).Start(); } }
public UpdateForm(CheckForUpdatesResult updateResult, UpdateManager updateManager) { InitializeComponent(); _updateResult = updateResult; _updateManager = updateManager; }
/// <summary/> public ManagerModResultPair(UpdateManager <Empty> manager, CheckForUpdatesResult result, PathTuple <ModConfig> modTuple) { Manager = manager; Result = result; ModTuple = modTuple; }
public Updater() { Status = new CheckForUpdatesResult(new List <Version>(), null, false); }