private void bOK_Click(object sender, EventArgs e)
        {
            // At least, a file name needs to be given
            if (string.IsNullOrEmpty(txtProgram.Text))
            {
                MessageBox.Show(this, "You did not specify an application to start.\r\n\r\nSpecify an application in order to add the setup instruction.", System.Windows.Forms.Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.None);
                DialogResult = DialogResult.None;
                return;
            }

            if (instruction == null)
            {
                this.instruction = new StartProcessInstruction();
            }

            this.instruction.FileName    = txtProgram.Text;
            this.instruction.Parameters  = txtParameters.Text;
            this.instruction.WaitForExit = chkWaitUntilExit.Checked;
            foreach (VariableInfo var in this.variables)
            {
                if (!string.IsNullOrEmpty(var.Value))
                {
                    this.instruction.EnvironmentVariables[var.Name] = var.Value;
                }
            }
        }
Example #2
0
        private void mnuStartProcess_Click(object sender, EventArgs e)
        {
            StartProcessInstruction instruction = new StartProcessInstruction();

            instruction.Application = m_ApplicationJob;
            if (InstructionBaseDialog.ShowDialog(this, instruction, txtExecuteAfter.VariableNames, m_ApplicationJob))
            {
                SetupInstructionListBoxPanel panel = new SetupInstructionListBoxPanel(instruction);
                panel.VariableNames = txtExecuteAfter.VariableNames;
                instructionsListBox.Panels.Add(panel);
            }
        }
 private void mnuStartProcess_Click(object sender, EventArgs e)
 {
     StartProcessInstruction instruction = new StartProcessInstruction();
     instruction.Application = m_ApplicationJob;
     if (InstructionBaseDialog.ShowDialog(this, instruction, txtExecuteAfter.VariableNames, m_ApplicationJob))
     {
         SetupInstructionListBoxPanel panel = new SetupInstructionListBoxPanel(instruction);
         panel.VariableNames = txtExecuteAfter.VariableNames;
         instructionsListBox.Panels.Add(panel);
     }
 }
        private void bOK_Click(object sender, EventArgs e)
        {
            // At least, a file name needs to be given
            if (string.IsNullOrEmpty(txtProgram.Text))
            {
                MessageBox.Show(this, "You did not specify an application to start.\r\n\r\nSpecify an application in order to add the setup instruction.", System.Windows.Forms.Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.None);
                DialogResult = DialogResult.None;
                return;
            }

            if (instruction == null)
            {
                this.instruction = new StartProcessInstruction();
            }

            this.instruction.FileName = txtProgram.Text;
            this.instruction.Parameters = txtParameters.Text;
            this.instruction.WaitForExit = chkWaitUntilExit.Checked;
            foreach (VariableInfo var in this.variables)
            {
                if (!string.IsNullOrEmpty(var.Value))
                {
                    this.instruction.EnvironmentVariables[var.Name] = var.Value;
                }
            }
        }