NOTICE

My involvement with xPL has come to an end. Automation has moved on considerably over the past few years, and it is now possible to buy a stand-alone controller off the shelf for a reasonable price, without having to spend hours writing your own code.

This website is being maintained as a record of my xPL development work up until 2011.

I have released the full source code of all my xPL projects into the public domain. You can download the archive from here.

Mal



  xPL Exec
Description

xPLExec is an application used to launch other executables in response to xPL messages. This obviously has some security implications, so xPLExec will only launch executables that are listed in its configuration file. Note that this list is managed through the included xPLExecConfig application, not via xPLHal. The list is empty by default.

Executables are launched by sending an exec.basic message to xPLExec. The schema is defined below. The path elements have been removed from the schema as it was originally designed, since the path is now taken from the permitted programs list instead. Note that the program arguments must be specified in individual message elements. Any argument that contains a space will be enclosed in quotes before being added to the command line.

If xPLExec is running as a service, then the spawned programs will run in the system context, and will not have windows. Since this application is designed for automation, the lack of user interaction should not be an issue.


xpl-cmnd
exec.basic
{
pid=[anything you like - this is just sent back unchanged in the status messages]
program=[executable filename, including extension, but without path]
arg=[optional command line argument]
arg=[next argument]
arg=[etc]
}



In response to exec.basic commands, xPLExec sends two types of status information, using the exec.basic and log.basic schemas. The possible messages are listed below:


On successful executable start:

xpl-stat
exec.basic
{
pid=[same id as was sent in the original command]
program=[executable filename]
status=started
return=
}

xpl-trig
log.basic
{
type=inf
text=xplexec: started program [executable filename]
}



On failure to start the executable:

xpl-stat
exec.basic
{
pid=[same id as was sent in the original command]
program=[executable filename]
status=failed
return=access denied | file not found | unknown error
}

xpl-trig
log.basic
{
type=inf
text=xplexec: failed to start [executable filename]. access denied | file not found | unknown error
}



When executable exits:

xpl-stat
exec.basic
{
pid=[same id as was sent in the original command]
program=[executable filename]
status=finished
return=[executable return code in hexadecimal e.g. 0x00000000]
}

No log.basic message is sent in this case.
Configuring the xPLExec Service

Unlike most other xPL applications, not all configuration of xPLExec can be handled by xPLHal.

The most important configuration item of xPLExec is the list of permitted programs. No program will be launched unless it's full path can be found in the list.

The list is managed through the xPLExecConfig application, which is installed into the same folder as xPLExec itself. The reason for this is security - if the list was configurable in xPLHal, it could be modified by rogue xPL config messages.

Configuration is extremely simple. Running xPLExecConfig produces the following dialog:

The Add button brings up a file dialog from which you can select the executable files (.exe, .bat, .com or .cmd) that xPLExec will be permitted to run. Selecting an item in the list and clicking Remove will delete it.

When you have finished editing the list, clicking OK will save the list and restart the xPLExec service.

Support

Support is provided through the xPL Forums.

Download




Platforms: Win98 / 2000 / XP / MCE / Vista / Win7
Version: 1.1.4
Filesize: 347kb
Updated: 6th November 2005

Download