public void Bu_Update_Click(object sender, RoutedEventArgs e) { Cursor = Cursors.AppStarting; Bu_Done.IsEnabled = false; Bu_Update.IsEnabled = false; update_downloadToPath = GlobalVar.appSettings.Tool_Update_SavePath + Path.DirectorySeparatorChar + update_fileName; if (File.Exists(update_downloadToPath)) { File.Delete(update_downloadToPath); } Directory.CreateDirectory(Path.GetDirectoryName(update_downloadToPath)); if (GlobalVar.appSettings.Tool_Update_UseDownloadPatcher) { Directory.CreateDirectory(Path.GetDirectoryName(update_downloadPatcherToPath)); if (!File.Exists(update_downloadPatcherToPath)) { if (File.Exists(update_downloadPatcherToPath + ".tmp")) { File.Delete(update_downloadPatcherToPath + ".tmp"); } downloadMode = DownloadModes.DownloadPatcher; client.DownloadFileAsync(new Uri(update_path_updatePatcher), update_downloadPatcherToPath + ".tmp"); } else { Action_DownloadUpdate(); } } else { Action_DownloadUpdate(); } }
public void Action_DownloadUpdate() { downloadMode = DownloadModes.DownloadUpdate; client.DownloadFileAsync(new Uri(update_path), update_downloadToPath + ".tmp"); }