Hey @Peter,
I deleted the offending widgets and recreated them, ensuring that the boxes were left unchecked. Unfortunately, that still results in repeated errors:
ProcessID empty for command:
Do you or @dan have any other ideas?
Looking at the client source, it seems like an error is logged regardless of which options are selected:
Trace.WriteLine(new LogMessage("ShellCommand - TerminateCommand", _command), LogType.Info.ToString());
if (_processId == 0)
{
Trace.WriteLine(new LogMessage("ShellCommand - TerminateCommand", "ProcessID empty for command: " + _command), LogType.Error.ToString());
return;
}
if (_useTaskKill)
{
using (Process process = new Process())
{
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
startInfo.FileName = "taskkill.exe";
startInfo.Arguments = "/pid " + _processId.ToString();
process.StartInfo = startInfo;
process.Start();
}
}
else
{
using (Process process = Process.GetProcessById(_processId))
{
process.Kill();
}
}
xibo-dotnetclient/Media/ShellCommand.cs @168
If the desired functionality is that a process ID is only raised to an error when the command needs to be killed, the error would need to be raised conditional on _useTaskKill
. I’m not sure where the “Terminate the command once the duration elapses?” option is honored unless that determines the value of disposing
passed to Dispose()
.
Thoughts?
In the meantime I am going to see if I can find a way to make the command return a process ID to satisfy the gods.