Ejemplo n.º 1
0
        private void buttonInstall_Click(object sender, EventArgs e)
        {
            string installArg = "--install \"" + (textService.Text == "" ? "MySQL" : textService.Text) + "\"";

            string sqlPath = String.Empty;

            if (textRoot.Text != "")
            {
                var sql = "UPDATE mysql.user SET Password=PASSWORD('" + textRoot.Text + "') WHERE User='******'; FLUSH PRIVILEGES;";
                sqlPath = Path.GetTempFileName();
                File.WriteAllText(sqlPath, sql);
            }
            string sqlArg = !String.IsNullOrEmpty(sqlPath) ? " --init-file=\"" + sqlPath + "\"" : "";

            var args = installArg + sqlArg;

            Debug.WriteLine(args);
            var res = ProcessHelper.ReadFromProcess(mysqldPath, args, false);

            MessageBox.Show(res);
        }
Ejemplo n.º 2
0
 private async Task ToggleService(bool toggle)
 {
     ProcessHelper.ReadFromProcess(netPath, (toggle ? "start" : "stop") + " \"" + CurrentServiceName + "\"", false);
 }
Ejemplo n.º 3
0
        private void buttonUninstall_Click(object sender, EventArgs e)
        {
            var output = ProcessHelper.ReadFromProcess(pathHttpd, "-k uninstall" + GetArgumentForServiceName(), true);

            MessageBox.Show(output.Trim());
        }