예제 #1
0
        private void CreateMigrationFileBackup(UpdaterConfig config)
        {
            MigrationBackup backup = new MigrationBackup(config);

            backup.Progress += this.OnProgress;
            this.files       = backup.Backup();
        }
예제 #2
0
        private void RestoreMigrationFileBackup(UpdaterConfig config)
        {
            MigrationRestore restore = new MigrationRestore(config, this.files);

            restore.Progress += this.OnProgress;
            restore.Run();
        }
예제 #3
0
        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;
        }
예제 #4
0
        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);
        }
예제 #5
0
        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;
        }
예제 #6
0
        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);
        }
예제 #7
0
        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));
        }
예제 #8
0
 protected UpdateTask(UpdaterConfig config)
 {
     this.Config = config;
 }
예제 #9
0
 private void CreateMigrationFileBackup(UpdaterConfig config)
 {
     MigrationBackup backup = new MigrationBackup(config);
     backup.Progress += this.OnProgress;
     this.files = backup.Backup();
 }
예제 #10
0
 private void RestoreMigrationFileBackup(UpdaterConfig config)
 {
     MigrationRestore restore = new MigrationRestore(config, this.files);
     restore.Progress += this.OnProgress;
     restore.Run();
 }
예제 #11
0
 protected UpdateTask(UpdaterConfig config)
 {
     this.Config = config;
 }