Esempio n. 1
0
        private void StepInstall()
        {
            mCurrentStep = UpdateSteps.INSTALL;
            this.OnUpdateStepChanged();

            this.logViewer.LogAdd(new LogItem(LogLevel.LOG_INFO, Translator.Instance.T("开始安装更新包...")));
            MemoryStream ms = this.updateDownloader.Output as MemoryStream;

            ms.Seek(0, SeekOrigin.Begin);
            this.updateInstaller.Install(ms);
        }
Esempio n. 2
0
        public async Task AtualizaSteps(String[] updateProcessSelected, int updateGAId)
        {
            int i = 0;

            List <UpdateSteps> updateStepsList = new List <UpdateSteps>();

            foreach (String process in updateProcessSelected)
            {
                String[] option = process.Split('-');

                int type      = Convert.ToInt32(option[0].Trim());
                int processId = Convert.ToInt32(option[1].Trim());

                UpdateSteps updateSteps = new UpdateSteps();
                updateSteps.Order     = i;
                updateSteps.ProcessId = processId;
                updateSteps.Type      = type;
                updateSteps.UpdateId  = updateGAId;

                i++;

                //Caso seja anexado um arquivo para apagar, copiar ou um SQL desativa o mesmo para não aparecer mais na seleção.
                if (type == 1)
                {
                    FileDelete fileDelete = _context.FileDelete.Find(processId);
                    fileDelete.Enable = false;
                    _context.Update(fileDelete);
                    await _context.SaveChangesAsync();
                }
                if (type == 2)
                {
                    GALibrary.Models.File file = _context.File.Find(processId);
                    file.Enable = false;
                    _context.Update(file);
                    await _context.SaveChangesAsync();
                }

                if (type == 6)
                {
                    SQL sql = _context.SQL.Find(processId);
                    sql.Enable = false;
                    _context.Update(sql);
                    await _context.SaveChangesAsync();
                }

                updateStepsList.Add(updateSteps);
            }

            await _context.UpdateSteps.AddRangeAsync(updateStepsList);

            await _context.SaveChangesAsync();
        }
Esempio n. 3
0
        private void StepVerify()
        {
            mCurrentStep = UpdateSteps.VERIFY;
            this.OnUpdateStepChanged();

            this.logViewer.LogAdd(new LogItem(LogLevel.LOG_INFO, Translator.Instance.T("开始校验更新包...")));
            MemoryStream ms = this.updateDownloader.Output as MemoryStream;

            this.pictureBoxInstall.Image = global::ZForge.Controls.Update.Properties.Resources.gear_stop_24;
            this.pictureBoxVerify.Image  = global::ZForge.Controls.Update.Properties.Resources.gear_run_24;

            this.updateVerifier.Verify(ms.ToArray());
        }
Esempio n. 4
0
        private void StepDownload()
        {
            mCurrentStep = UpdateSteps.DOWNLOAD;
            this.OnUpdateStepChanged();

            string m = string.Format(Translator.Instance.T("开始下载更新. ({0})"), this.updateDownloader.URL);

            this.logViewer.LogAdd(new LogItem(LogLevel.LOG_INFO, m));
            this.pictureBoxDownload.Image = global::ZForge.Controls.Update.Properties.Resources.gear_run_24;
            this.pictureBoxVerify.Image   = global::ZForge.Controls.Update.Properties.Resources.gear_stop_24;
            this.pictureBoxInstall.Image  = global::ZForge.Controls.Update.Properties.Resources.gear_stop_24;
            this.updateDownloader.Output  = new MemoryStream();

            this.updateDownloader.Download();
        }
Esempio n. 5
0
        public void Reset(bool bClearLog)
        {
            mCurrentStep = UpdateSteps.NONE;
            this.OnUpdateStepChanged();

            this.pictureBoxCheck.Image    = global::ZForge.Controls.Update.Properties.Resources.gear_stop_24;
            this.pictureBoxDownload.Image = global::ZForge.Controls.Update.Properties.Resources.gear_stop_24;
            this.pictureBoxVerify.Image   = global::ZForge.Controls.Update.Properties.Resources.gear_stop_24;
            this.pictureBoxInstall.Image  = global::ZForge.Controls.Update.Properties.Resources.gear_stop_24;

            this.updateChecker.Reset();
            this.updateDownloader.Reset();
            this.updateVerifier.Reset();
            this.updateInstaller.Reset();

            if (bClearLog)
            {
                this.logViewer.Clear();
            }
        }
Esempio n. 6
0
 public void Clear()
 {
     InsertSteps.Clear();
     UpdateSteps.Clear();
     Variables.Clear();
 }
Esempio n. 7
0
 public UpdateStepChangedEventArgs(UpdateSteps step)
 {
     this.mStep = step;
 }
Esempio n. 8
0
        private void StepVerify()
        {
            mCurrentStep = UpdateSteps.VERIFY;
            this.OnUpdateStepChanged();

            this.logViewer.LogAdd(new LogItem(LogLevel.LOG_INFO, Translator.Instance.T("��ʼУ����°�...")));
            MemoryStream ms = this.updateDownloader.Output as MemoryStream;
            this.pictureBoxInstall.Image = global::ZForge.Controls.Update.Properties.Resources.gear_stop_24;
            this.pictureBoxVerify.Image = global::ZForge.Controls.Update.Properties.Resources.gear_run_24;

            this.updateVerifier.Verify(ms.ToArray());
        }
Esempio n. 9
0
        private void StepInstall()
        {
            mCurrentStep = UpdateSteps.INSTALL;
            this.OnUpdateStepChanged();

            this.logViewer.LogAdd(new LogItem(LogLevel.LOG_INFO, Translator.Instance.T("��ʼ��װ���°�...")));
            MemoryStream ms = this.updateDownloader.Output as MemoryStream;
            ms.Seek(0, SeekOrigin.Begin);
            this.updateInstaller.Install(ms);
        }
Esempio n. 10
0
        private void StepDownload()
        {
            mCurrentStep = UpdateSteps.DOWNLOAD;
            this.OnUpdateStepChanged();

            string m = string.Format(Translator.Instance.T("��ʼ���ظ���. ({0})"), this.updateDownloader.URL);
            this.logViewer.LogAdd(new LogItem(LogLevel.LOG_INFO, m));
            this.pictureBoxDownload.Image = global::ZForge.Controls.Update.Properties.Resources.gear_run_24;
            this.pictureBoxVerify.Image = global::ZForge.Controls.Update.Properties.Resources.gear_stop_24;
            this.pictureBoxInstall.Image = global::ZForge.Controls.Update.Properties.Resources.gear_stop_24;
            this.updateDownloader.Output = new MemoryStream();

            this.updateDownloader.Download();
        }
Esempio n. 11
0
        public void Reset(bool bClearLog)
        {
            mCurrentStep = UpdateSteps.NONE;
            this.OnUpdateStepChanged();

            this.pictureBoxCheck.Image = global::ZForge.Controls.Update.Properties.Resources.gear_stop_24;
            this.pictureBoxDownload.Image = global::ZForge.Controls.Update.Properties.Resources.gear_stop_24;
            this.pictureBoxVerify.Image = global::ZForge.Controls.Update.Properties.Resources.gear_stop_24;
            this.pictureBoxInstall.Image = global::ZForge.Controls.Update.Properties.Resources.gear_stop_24;

            this.updateChecker.Reset();
            this.updateDownloader.Reset();
            this.updateVerifier.Reset();
            this.updateInstaller.Reset();

            if (bClearLog)
            {
                this.logViewer.Clear();
            }
        }
Esempio n. 12
0
 public UpdateStepChangedEventArgs(UpdateSteps step)
 {
     this.mStep = step;
 }