private void CreateMigrationFileBackup(UpdaterConfig config) { MigrationBackup backup = new MigrationBackup(config); backup.Progress += this.OnProgress; this.files = backup.Backup(); }
private void RestoreMigrationFileBackup(UpdaterConfig config) { MigrationRestore restore = new MigrationRestore(config, this.files); restore.Progress += this.OnProgress; restore.Run(); }
private IEnumerable<UpdateTask> GetTasks(UpdaterConfig config) { List<UpdateTask> tasks = new List<UpdateTask>(); tasks.Add(new BackupDirectories(config)); tasks.Add(new DownloadUpdate(config)); tasks.Add(new ExtractDownload(config)); tasks.Add(new RestoreDirectories(config)); tasks.Add(new RunPatch(config)); tasks.Add(new ReplaceApplicationFiles(config)); return tasks; }
private IEnumerable <UpdateTask> GetTasks(UpdaterConfig config) { List <UpdateTask> tasks = new List <UpdateTask>(); tasks.Add(new BackupDirectories(config)); tasks.Add(new DownloadUpdate(config)); tasks.Add(new ExtractDownload(config)); tasks.Add(new RestoreDirectories(config)); tasks.Add(new RunPatch(config)); tasks.Add(new ReplaceApplicationFiles(config)); return(tasks); }
private UpdaterConfig GetConfig() { UpdaterConfig config = new UpdaterConfig(); config.DownloadUrl = this.DownloadUrl; if (Config.IsDevelopmentMode()) { config.DownloadUrl = this.GetFakeDownloadUrl(); } config.ApplicationPath = Config.ApplicationPath; config.Migrate = Config.Migrate; config.TempPath = Config.TempPath; config.DirectoriesToBackup = this.ToBackup; return config; }
private UpdaterConfig GetConfig() { UpdaterConfig config = new UpdaterConfig(); config.DownloadUrl = this.DownloadUrl; if (Config.IsDevelopmentMode()) { config.DownloadUrl = this.GetFakeDownloadUrl(); } config.ApplicationPath = Config.ApplicationPath; config.Migrate = Config.Migrate; config.TempPath = Config.TempPath; config.DirectoriesToBackup = this.ToBackup; return(config); }
public void Update() { UpdaterConfig config = this.GetConfig(); this.CreateMigrationFileBackup(config); var tasks = this.GetTasks(config); foreach (UpdateTask task in tasks) { task.Progress += this.OnProgress; task.Run(); } this.RestoreMigrationFileBackup(config); this.OnProgress(new ProgressInfo(Titles.SuccessfullyUpdated, Labels.UpdateOperationCompletedSuccessfully)); }
protected UpdateTask(UpdaterConfig config) { this.Config = config; }