private void Save()
{
ProcessStartInfo info = new ProcessStartInfo(ConfigWriterExe);
info.UseShellExecute = true;
info.Verb = "runas";
info.Arguments = string.Format("{0} {1} {2} \"{3}\" \"{4}\" {5} {6} {7} \"{8}\" {9}",
_url.Text,
_agentKey.Text,
_iis.Checked,
_plugins.Checked ? _pluginDirectory.Text : string.Empty,
_mongoDB.Checked ? _mongoDBConnectionString.Text : string.Empty,
_dbStats.Checked,
_replSet.Checked,
_sqlServer.Checked,
_customPrefix.Checked ? _customPrefixValue.Text : string.Empty,
_eventViewer.Checked);
try
{
Process p = new Process();
p.StartInfo = info;
p.Start();
p.WaitForExit();
}
catch
{
MessageBox.Show("There was an error saving your agent configuration.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}