void OnStartup() { Console.WriteLine("Running startup tasks."); // No longer needed. //if (!File.Exists("Ionic.Zip.Reduced.dll")) //{ // Downloader dotNetZipDL = new Downloader( // "Ionic.Zip.Reduced.dll", // Properties.Resources.DotNetZipURL, // "Downloading DotNetZip"); // MainWindow.Invoke((o, args) => StartTask(dotNetZipDL)); //} Downloader mcVersionsDL = new Downloader( Properties.Resources.MCVersionFile, Properties.Resources.MCVersionFileDL, "Downloading version info file", 30); mcVersionsDL.QuietMode = true; MainWindow.Invoke((o, args) => StartTask(mcVersionsDL)); if (AppSettings.Main.AutoUpdate) { MainWindow.Invoke((o, args) => DoUpdateCheck()); } }
private void DownloadNewVersion() { updateDL = new Downloader(Properties.Resources.NewVersionFileName, Properties.Resources.UpdateURL, "Downloading updates..."); updateDL.Completed += updateDL_Completed; StartTask(updateDL); }
/// <summary> /// If the given file doesn't exist, starts a downloader and returns it /// Otherwise, returns null /// </summary> /// <returns> /// The downloader or null if the file already exists. /// </returns> private Downloader CheckDownloadFile(string dest, string url, string message) { if (!File.Exists(dest)) { Console.WriteLine("Downloading {0}.", dest); using (Downloader downloader = new Downloader(dest, url, message)) { StartTask(downloader); return downloader; } } else return null; }
private void DownloadNewVersion() { updateDL = new Downloader(Resources.NewVersionFileName, Resources.LatestVersionURL, "Downloading updates..."); updateDL.Completed += updateDL_Completed; StartTask(updateDL); }
/// <summary> /// If the given file doesn't exist, starts a downloader and returns it /// Otherwise, returns null /// </summary> /// <returns> /// The downloader or null if the file already exists. /// </returns> private Downloader CheckDownloadFile(string dest, string url, string message) { if (!File.Exists(dest)) { Downloader downloader = new Downloader(dest, url, message); StartTask(downloader); return downloader; } else return null; }