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; } } }
private void llblUpdateAvailable_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { if (updateChecker != null && updateChecker.Status == UpdateStatus.UpdateAvailable) { using (DownloaderForm updaterForm = new DownloaderForm(updateChecker)) { updaterForm.ShowDialog(); if (updaterForm.Status == DownloaderFormStatus.InstallStarted) { Application.Exit(); } } } }
public static DialogResult DownloadFFmpeg(bool async, DownloaderForm.DownloaderInstallEventHandler installRequested) { string url; if (NativeMethods.Is64Bit()) { url = "http://ffmpeg.zeranoe.com/builds/win64/static/ffmpeg-latest-win64-static.7z"; } else { url = "http://ffmpeg.zeranoe.com/builds/win32/static/ffmpeg-latest-win32-static.7z"; } using (DownloaderForm form = new DownloaderForm(url, "ffmpeg.7z")) { form.Proxy = HelpersOptions.CurrentProxy.GetWebProxy(); form.InstallType = InstallType.Event; form.RunInstallerInBackground = async; form.InstallRequested += installRequested; return form.ShowDialog(); } }
public static DialogResult DownloadFFmpeg(bool async, DownloaderForm.DownloaderInstallEventHandler installRequested) { string url; if (NativeMethods.Is64Bit()) { url = "http://ffmpeg.zeranoe.com/builds/win64/static/ffmpeg-latest-win64-static.7z"; } else { url = "http://ffmpeg.zeranoe.com/builds/win32/static/ffmpeg-latest-win32-static.7z"; } using (DownloaderForm form = new DownloaderForm(url, "ffmpeg.7z")) { form.Proxy = HelpersOptions.CurrentProxy.GetWebProxy(); form.InstallType = InstallType.Event; form.RunInstallerInBackground = async; form.InstallRequested += installRequested; return(form.ShowDialog()); } }