416
416
public void Execute (string executable)
419
System.Diagnostics.Process proc;
419
420
if (System.IO.File.Exists (executable)) {
420
System.Diagnostics.Process proc = new System.Diagnostics.Process ();
421
proc = new System.Diagnostics.Process ();
421
422
proc.StartInfo.FileName = executable;
422
423
proc.StartInfo.UseShellExecute = false;
425
System.Diagnostics.Process proc;
426
if (executable.Contains (" ")) {
427
string[] args = executable.Split (' ');
429
Log<SystemService>.Debug ("Calling: " + args[0] + " \"" + executable.Substring (args[0].Length + 1) + "\"");
430
proc = System.Diagnostics.Process.Start (args[0], "\"" + executable.Substring (args[0].Length + 1) + "\"");
428
executable = executable.Trim ();
429
if ((pos = executable.IndexOf (' ')) >= 0) {
430
string command = executable.Substring (0, pos);
431
string arguments = executable.Substring (pos + 1);
432
proc = System.Diagnostics.Process.Start (command, arguments);
432
Log<SystemService>.Debug ("Calling: " + executable);
433
434
proc = System.Diagnostics.Process.Start (executable);
436
Log<SystemService>.Debug ("Calling: '{0}'", executable);
438
Log<SystemService>.Error ("Error executing '" + executable + "'");
440
Log<SystemService>.Error ("Error executing '{0}'", executable);