public DownloaderForm(UpdateChecker updateChecker) : this(updateChecker.DownloadURL, updateChecker.Filename) { Proxy = updateChecker.Proxy; if (updateChecker is GitHubUpdateChecker) { AcceptHeader = "application/octet-stream"; } }
private void CheckingUpdate(CheckUpdate checkUpdate) { updateChecker = checkUpdate(); try { UpdateControls(); } catch { } isBusy = false; }
public static void Start(UpdateChecker updateChecker, bool activateWindow = true) { if (updateChecker != null && updateChecker.Status == UpdateStatus.UpdateAvailable) { IsOpen = true; try { DialogResult result; using (UpdateMessageBox messageBox = new UpdateMessageBox()) { messageBox.ActivateWindow = activateWindow; result = messageBox.ShowDialog(); } if (result == DialogResult.Yes) { using (DownloaderForm updaterForm = new DownloaderForm(updateChecker)) { updaterForm.ShowDialog(); if (updaterForm.Status == DownloaderFormStatus.InstallStarted) { Application.Exit(); } } } } finally { IsOpen = false; } } }