Esempio n. 1
0
        private void DoInstall()
        {
            Title += " Версия: " + CUtil.GetVersion();



            _currState = EnmStates._01_Initial;


            _installer = new CInstaller(this);


            if (_installer.PathConfigDir == null)  //env not set
            {
                checkBoxServersConf.IsChecked     = true;
                checkBoxInstrumentsConf.IsChecked = true;
                checkBoxStockVisual.IsChecked     = true;
                checkBoxTerminalConf.IsChecked    = true;
                _showGridFlags = false;
            }
            else //env is set
            {
                if (!Directory.Exists(_installer.PathTerminalConfigDir))//conf dir is not exists
                {
                    checkBoxServersConf.IsChecked     = true;
                    checkBoxInstrumentsConf.IsChecked = true;
                    checkBoxStockVisual.IsChecked     = true;
                    checkBoxTerminalConf.IsChecked    = true;
                    _showGridFlags = false;
                }
                else
                {
                    string pathServConf = String.Format(@"{0}\\servers.xml", _installer.PathTerminalConfigDir);
                    if (!File.Exists(pathServConf))
                    {
                        checkBoxServersConf.IsChecked = true;
                    }

                    if (!Directory.Exists(_installer.PathInstrumentsConfDir))
                    {
                        checkBoxInstrumentsConf.IsChecked = true;
                    }

                    if (!File.Exists(_installer.PathVisualStockFile))
                    {
                        checkBoxStockVisual.IsChecked = true;
                    }

                    if (!File.Exists(_installer.PathTerminalConfFile))
                    {
                        checkBoxTerminalConf.IsChecked = true;
                    }
                }
            }


            //_installer =


            /*
             * if (NeedSetCheckBoxes())
             * {
             *  checkBoxServersConf.IsChecked = true;
             *  checkBoxTerminalConf.IsChecked = true;
             * }
             */


            //2018-07-28
            if (_installer.PathTerminalExecDir == null)
            {
                SetTextBoxValue(TextBoxPathTerminalExec, _installer.GetDefaultExecPath());
            }
            else
            {
                SetTextBoxValue(TextBoxPathTerminalExec, _installer.PathTerminalExecDir);
            }

            if (_installer.PathConfigDir == null)
            {
                SetTextBoxValue(TextBoxPathTerminalConfig, _installer.GetDefaultRootDataPath() + @"\Config\Terminal");
            }
            else
            {
                SetTextBoxValue(TextBoxPathTerminalConfig, _installer.PathConfigDir);
            }

            if (_installer.PathLog == null)
            {
                SetTextBoxValue(TextBoxPathLogs, _installer.GetDefaultRootDataPath() + @"\Logs\Terminal");
            }
            else
            {
                SetTextBoxValue(TextBoxPathLogs, _installer.PathLog);
            }

            if (_installer.PathData == null)
            {
                SetTextBoxValue(TextBoxPathData, _installer.GetDefaultRootDataPath() + @"\Data\Terminal");
            }
            else
            {
                SetTextBoxValue(TextBoxPathData, _installer.PathData);
            }

            if (_installer.PathAlarm == null)
            {
                SetTextBoxValue(TextBoxPathAlarm, _installer.GetDefaultRootDataPath() + @"\Alarms\Terminal");
            }
            else
            {
                SetTextBoxValue(TextBoxPathAlarm, _installer.PathAlarm);
            }

            if (_installer.PathTemp == null)
            {
                SetTextBoxValue(TextBoxPathTemp, _installer.GetDefaultRootDataPath() + @"\Temp\Terminal");
            }
            else
            {
                SetTextBoxValue(TextBoxPathTemp, _installer.PathTemp);
            }


            if (!_installer.IsAnyEnvSet())
            {
                SetVisibleAdvanceData();
            }
        }
Esempio n. 2
0
 private void SetState(EnmStates newState)
 {
     _currState = newState;
 }