private void btnSettingsRedownloadYoutubeDl_Click(object sender, EventArgs e) { UpdateChecker.UpdateYoutubeDl(); }
public static void CheckForUpdate(bool ForceCheck = false) { if (Program.IsDebug && !ForceCheck) { Debug.Print("-version " + GitData.UpdateVersion + " -name " + System.AppDomain.CurrentDomain.FriendlyName); } else { if (!General.Default.CheckForUpdatesOnLaunch && !ForceCheck) { return; } if (GitData.UpdateAvailable) { using (frmUpdateAvailable Update = new frmUpdateAvailable()) { Update.BlockSkip = GitData.UpdateAvailable; switch (Update.ShowDialog()) { case DialogResult.Yes: try { UpdateApplication(); } catch (Exception ex) { ErrorLog.ReportException(ex); return; } break; } } } else { Thread checkUpdates = new Thread(() => { if (GitData.UpdateVersion == "-1" || ForceCheck) { decimal GitVersion = UpdateChecker.GetGitVersion(0); if (UpdateChecker.IsUpdateAvailable(GitVersion)) { if (GitVersion != Properties.Settings.Default.SkippedVersion || ForceCheck) { using (frmUpdateAvailable Update = new frmUpdateAvailable()) { Update.BlockSkip = ForceCheck; switch (Update.ShowDialog()) { case DialogResult.Yes: try { UpdateApplication(); } catch (Exception ex) { ErrorLog.ReportException(ex); return; } break; case DialogResult.Ignore: Properties.Settings.Default.SkippedVersion = GitVersion; Properties.Settings.Default.Save(); break; } } } } else if (ForceCheck) { MessageBox.Show("No updates available."); } } }); checkUpdates.Start(); } } }
private void frmMain_Load(object sender, EventArgs e) { UpdateChecker.CheckForUpdate(); this.Icon = Properties.Resources.youtube_dl_gui; if (Saved.Default.MainFormSize != default(System.Drawing.Size)) { this.Size = Saved.Default.MainFormSize; } if (!Program.IsDebug) { mDownloadSubtitles.Enabled = false; } if (Saved.Default.formTrue0) { this.Location = new Point(Saved.Default.formLocationX, Saved.Default.formLocationY); } else if (Saved.Default.formLocationX > 0 || Saved.Default.formLocationY > 0) { this.Location = new Point(Saved.Default.formLocationX, Saved.Default.formLocationY); } switch (General.Default.SaveCustomArgs) { case 1: if (System.IO.File.Exists(Environment.CurrentDirectory + "\\args.txt")) { txtArgs.Text = System.IO.File.ReadAllText(Environment.CurrentDirectory + "\\args.txt"); } break; case 2: txtArgs.Text = Saved.Default.downloadArgs; break; } switch (Saved.Default.downloadType) { case 0: rbVideo.Checked = true; break; case 1: rbAudio.Checked = true; break; case 2: rbCustom.Checked = true; break; default: rbVideo.Checked = true; break; } switch (Saved.Default.convertType) { case 0: rbConvertVideo.Checked = true; break; case 1: rbConvertAudio.Checked = true; break; case 2: rbConvertCustom.Checked = true; break; case 6: rbConvertAutoFFmpeg.Checked = true; break; default: rbConvertAuto.Checked = true; break; } CalculateLocations(); }
private void llbCheckForUpdates_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { UpdateChecker.CheckForUpdate(true); }
private void btnDebugForceUpdateCheck_Click(object sender, EventArgs e) { UpdateChecker.CheckForUpdate(true); }