Example #1
0
 public JZUpgrade(String _updateFlag)
 {
     //Thread.Sleep(30 * 1000);
     InitializeComponent();
     updateFlag = _updateFlag;
     //log.Logfolder = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "log");
     //log.IsUseLog = true;
     //log.QueueBufferSize = 5;
     uhc = new UpdateHelperClient(_updateFlag);
 }
Example #2
0
        private void Run()
        {
            try
            {
                //1 管理系统文件+不执行,
                //2 采集系统文件+不执行,
                //3 管理系统数据+不执行,
                //4 管理系统文件+数据+执行;
                //5 采集系统文件+执行
                //6 管理系统执行
                //7 采集系统执行
                //8 管理系统文件+执行
                //9 电液伺服更新+执行
                //10 领导版管理+执行
                if (updateFlag == "1" || updateFlag == "2" || updateFlag == "3")
                {
                    GetUpdate();
                }
                else if (updateFlag == "4")
                {
                    updateFlag = "1";
                    uhc        = new UpdateHelperClient(updateFlag);
                    GetUpdate();
                    Thread.Sleep(600);
                    LoadUpdate();

                    updateFlag = "3";
                    uhc        = new UpdateHelperClient(updateFlag);
                    GetUpdate();
                    Thread.Sleep(600);
                    LoadUpdate();
                }
                else if (updateFlag == "5")
                {
                    updateFlag = "2";
                    uhc        = new UpdateHelperClient(updateFlag);
                    //GetUpdate();
                    //Thread.Sleep(600);
                    LoadUpdate();
                }
                else if (updateFlag == "6")
                {
                    updateFlag = "1";
                    uhc        = new UpdateHelperClient(updateFlag);
                    LoadUpdate();

                    updateFlag = "3";
                    uhc        = new UpdateHelperClient(updateFlag);
                    LoadUpdate();
                }
                else if (updateFlag == "7")
                {
                    updateFlag = "2";
                    uhc        = new UpdateHelperClient(updateFlag);
                    LoadUpdate();
                }
                else if (updateFlag == "8")
                {
                    updateFlag = "1";
                    uhc        = new UpdateHelperClient(updateFlag);
                    //GetUpdate();
                    //Thread.Sleep(600);
                    LoadUpdate();
                }
                else if (updateFlag == "9")
                {
                    updateFlag = "9";
                    uhc        = new UpdateHelperClient(updateFlag);
                    GetUpdate();
                    Thread.Sleep(600);
                    LoadUpdate();
                }
                else if (updateFlag == "10")
                {
                    updateFlag = "10";
                    uhc        = new UpdateHelperClient(updateFlag);
                    GetUpdate();
                    Thread.Sleep(600);
                    LoadUpdate();
                }
            }
            catch (Exception ex)
            {
                logger.Error(ex.Message);
            }
            finally
            {
                Thread.Sleep(600);
                CloseForm();
            }
        }