Exemplo n.º 1
0
        public void Install(string pcName, string softType, string modelName)
        {
            if (Settings2.Default.scriptFolder == "")
            {
                MessageBox.Show("Необходимо указать папку для создания временных скриптов.");
                return;
            }
            //check for psExec extention
            if (Settings2.Default.psExec_Path == "")
            {
                OpenFileDialog open = new OpenFileDialog();
                open.Filter      = "EXE(*.exe) |*.exe";
                open.Title       = "Укажите размещение psExec";
                open.FilterIndex = 2;
                if (open.ShowDialog() == true)
                {
                    Settings2.Default.psExec_Path = open.FileName;
                    Settings2.Default.Save();
                }
            }
            if (password.Length < 1)
            {
                pass = new Password();
                if (pass.ShowDialog() == true)
                {
                    password = pass.Pass;
                }
            }

            XMLWorker.GetXML();
            Task.Run(() => InstallDrivers(pcName, modelName));
            Task.Run(() => InstallSoft(pcName, softType));

            if (Comps.isNew(pcName))
            {
                if (CreateSettings(pcName, FindPasswords(XMLWorker.GetSettings())))
                {
                    Task.Run(() => SetSettings(pcName));
                }
                if (XMLWorker.GetBiosScript(modelName) != "" && XMLWorker.GetBiosScript(modelName) != null)
                {
                    CreateBiosSettings(pcName, FindPasswords(XMLWorker.GetBiosScript(modelName)));
                    Task.Run(() => ResetBiosPassword(pcName, modelName));
                    Task.Run(() => BiosSettingsInstalling(pcName));
                    Task.Run(() => Thread.Sleep(120000));
                    Task.Run(() => SetBiosPassword(pcName, modelName));
                }
            }
            else
            {
                if (CreateSettings(pcName, FindPasswords(XMLWorker.GetSettings())))
                {
                    Task.Run(() => SetSettings(pcName));
                }
                Finish(this, EventArgs.Empty);
            }
        }
Exemplo n.º 2
0
 private void OnBiosModelChange(object sender, SelectionChangedEventArgs e)
 {
     biosSettingsBox.Text   = XMLWorker.GetBiosScript(biosModel.SelectedItem.ToString());
     setBiosPassword.Text   = XMLWorker.GetInstallingBiosPassScript(biosModel.SelectedItem.ToString());
     resetBiosPassword.Text = XMLWorker.GetResetBiosPassScript(biosModel.SelectedItem.ToString());
 }