Installation and Configuration guide


To be able to deploy RunAsService, you need to have the MS.Net framework version 1.1 installed.
If you do not have this, you can download a copy at MSDN

Installation is very easy, its just a matter of extracting the zip file into the desired location and running the Install.cmd file.

The Install.cmd batch file requires only 1 parameter, the account type the service uses to run. This can be one of the following:

  1. user
    An account defined by a specific user on the network. Specifying User causes the system to prompt for a valid user name and password when the service is installed.
  2. localsystem
    An account that has a high privileged level.
  3. localservice (only on WinXP and later)
    An account that acts as a non-privileged user on the local computer, and presents anonymous credentials to any remote server.
  4. networkservice (only on WinXP and later)
    An account that provides extensive local privileges, and presents the computer's credentials to any remote server.

For instance to install RunAsService using a specific user account, type at the command prompt:
Install user
The following dialog is shown:

After entering a correct username and associated password the installation finishes.

Configuring RunAsService

RunAsService is configured using the MS.Net application configuration file.
This file, which you can find in teh installation directory, is named RunAsService.exe.config.

The application configuration file is structured using XML format, and consists of 3 section:

  1. <configSections>
    Defines the next custom configuration sections.
  2. <log4net>
    Configures the log4net logging functionality. For more information about configuring log4net, please look at the log4net site at
  3. <service.settings>
    This is the most interesting section, it configures each application to be run as service.

Generally the <service.settings> section looks like this:

		<!-- Run application 1 as service -->
			<name>Application 1</name>
			<parameters>Parameters for application 1</parameters>
		<!-- Run application n as service -->
			<name>Application n</name>
			<parameters>Parameters for application n</parameters>

For every application that you want to run as a service, add a <service>.
The optional value of the <name> element is arbitrary, you can add anything you like to describe the application.
More important is the <executable> element. This needs to be the full path to the executable and is mandatory.
The <parameters> element is optinal, you can add any parameters that you would normally add to the commandline when starting the application.

Following is a sample configuration that contains 2 applications. The SubVersion server component, the application that started all this, and a java application.

	<!-- Run Subversion server as service -->
		<name>SubVersion Server</name>
		<executable>C:\Program Files\Subversion\bin\svnserve.exe</executable>
		<parameters>-d -r c:\bin\svn\repository</parameters>
	<!-- Run a java program as service -->
		<name>Java Test Service</name>
		<parameters>-cp c:\Java\test Test</parameters>

Now that the configuration has completed, all that is left is starting the service.
To accomplish this, you'll need to open the control panel's services applet.
Select RunAsService in the list and click the start button.

Check the log4net logfile to see if any failure occured.
You can also check the Eventlog for errors, if the service could not be started.