Configuration Syntax

kohsuke edited this page Sep 13, 2010 · 1 revision
Clone this wiki locally

The structure of the XML file is as follows:



Specifies the ID that Windows uses internally to identify the service. This has to be unique among all the services installed in a system, and (while I haven’t verified this) this must consist entirely out of alpha-numeric characters.


Short display name of the service, which can contain spaces and other characters. This shouldn’t be too long, like <id>, and this also needs to be unique among all the services in a given system.


Long description of the service.


This element specifies the executable to be launched. It can be either absolute path, or you can just specify the executable name and let it be searched from PATH (although note that the services often run in a different user account and therefore it might have different PATH than your shell does.)


Delayed loading of the service is possible with multiple optional <depend> elements referring to other service ids.


Optionally set a different logging directory with <logpath> and startup <logmode>: reset (clear log), roll (move to *.old) or append (default).


This element specifies the arguments to be passed to the executable. To pass in multiple arguments, separate them with whitespace, like `<arguments>foo bar zot</arguments>`

To make it easier to comment for example debug arguments you can use multiple optional <argument> elements.

If you need different startup and shutdown arguments, such as catalina.bat run vs catalina.bat stop, you can supply them with multiple optional <startargument> and <stopargument> elements.

’’’Note’’’: when <argument>, <startargument> or <stopargument> elements are used the </arguments> element is ignored/no longer required.


This optional element can be specified multiple times if necessary to specify environment variables to be set for the child process. The syntax is:

<env name="HOME" value="c:\abc" />


If this optional element is specified, the service will be allowed to interact with the desktop, such as by showing a new window and dialog boxes. If your program requires GUI, set this like the following:

<interactive />


  <name> FishEye</name>

Environment variable expansion

All the text values in this XML can include environment variable expansions of the form %NAME%, like Windows batch files. Such an expression is replaced by the actual value of the environment variable.

Also, the service wrapper sets the environment variable BASE by itself, which points to a directory that contains the renamed winsw.exe. This is useful to refer to other files in the same directory. Since this is an environment variable by itself, this value can be also accessed from the child process launched from the service wrapper.