Services - Install

Declaration

<AMSERVICES ACTIVITY="install" REMOTEMACHINE="text" REMOTEDOMAIN="text" REMOTEUSERNAME="text" REMOTEPASSWORD="text (encrypted)" EXECUTABLE="text" DISPLAYNAME="text" USERNAME="text" PASSWORD="text (encrypted)" INTERACTIVE="YES/NO" ERROR="text (options)" SERVICETYPE="text (options)" RUNTYPE="text (options)" />

Related Topics   

Description

Installs the specified service into the Service Control Manager (SCM) so that it can be started and stopped. This activity supports installation of a service onto the local machine or a remote machine.

Practical usage

Used to install a service onto the local or remote system. Administrator privileges are usually required to perform this activity.

Parameters

Service

Property Type Required Default Markup Description
Path to service Text Yes (Empty) EXECUTABLE="c:\service.exe" The path and file name of the service to install. Note that the executable file must be present on the target machine prior to installation. Additionally, when installing to a remote machine, the path to the service should be expressed in terms of the file's location on that machine. For example, the path should be entered like this: "c:\servicename.exe" and not like this: "\\computername\c$\servicename.exe".
Display name Text Yes (Empty) DISPLAYNAME="My Service" The name of the service as it should appear in the Service Control Manager (SCM).
Service account username Text Yes (Empty) USERNAME="username" The username that the service should use to log on. The service automatically inherits the rights of the user specified in this field.
Service account password Text Yes (Empty) PASSWORD="password" The password corresponding to the service account username.
Error severity Text (options) No Normal
  • ERROR="normal"
  • ERROR="ignore"
  • ERROR="critical"
  • ERROR="severe"
If the service generates errors, indicates how the errors should be written to the system event log. The available options are:
  • Normal (default) - Errors are logged as normal.
  • Ignore - Errors are ignored.
  • Critical - Errors are logged as critical.
  • Severe - Errors are logged as severe.
Service type Text (options) No Own Process
  • SERVICETYPE="own_process"
  • SERVICETYPE="shared_process"
  • SERVICETYPE="kernel_drive"
  • SERVICETYPE="file_system"
The type of service to install. The available options are:
  • Runs in own process (default) - The service runs in it's own process space.
  • Shared process - The service runs in a shared process space.
  • Kernel driver - The service is a kernel driver.
  • File system - The service is a file system driver.
Run type Text (options) No Automatic
  • RUNTYPE="automatic"
  • RUNTYPE="manual"
  • RUNTYPE="disabled"
  • RUNTYPE="boot"
  • RUNTYPE="system"
The service startup type. The available options are:
  • Automatic (default) - The Service is started automatically as part of the Windows boot process.
  • Manual - The Service can be started by another application or process that needs it, but is off by default. Once it is started, the service will remain on until it is manually stopped or the system is rebooted.
  • Disabled - The Service will not start unless this condition is changed.
  • Boot - Driver specific setting.
  • System - Driver specific setting.
Interactive service Yes/No No No INTERACT="YES" If selected, specifies that the service should be able to interact with the desktop. This parameter is disabled by default. Although typically services do not have a user interface, developers can add forms and other UI components. In such cases, this parameter should be selected.

Computer

Property Type Required Default Markup Description
Local computer --- --- --- --- If enabled, indicates that this activity will be performed on a service located on the local computer. This parameter is enabled by default. If this parameter is selected, the Another computer parameter becomes inactive.
NOTE: This parameter does not contain markup and is only displayed in visual mode for task construction and configuration purposes.
Another computer --- --- --- --- If enabled, indicates that this activity will be performed on a service located on a remote computer. The parameters below become active if this parameter is enabled.
NOTE: This parameter does not contain markup and is only displayed in visual mode for task construction and configuration purposes.
Computer Text Yes, if set to Another computer (Empty) REMOTEMACHINE="MachineName" The computer name of the remote machine in which to connect to.
Domain Text Yes, if set to Another computer (Empty) REMOTEDOMAIN="DomainName" The domain that the remote machine belongs to.
Username Text Yes, if set to Another computer (Empty) REMOTEUSERNAME="Username" The username to use to sign in to the remote machine. This user must have the appropriate permissions to modify services on the remote machine.
Password Text Yes, if set to Another computer (Empty) REMOTEPASSWORD="password" The password to use to authenticate with the Username parameter.

Description

Error Causes

On Error

Example

NOTE:
  • Copy and paste the sample AML code below directly into the Task Builder Steps Panel.
  • To successfully run the sample code, update parameters containing user credentials, files, file paths, or other information specific to the task to match your environment.

Description

This sample task installs a service.

NOTE: This example is for the purpose of viewing AML syntax only. Installing an unwanted service might yield negative results.
Copy
<AMSERVICES ACTIVITY="install" EXECUTABLE="c:\servicesname.exe" DISPLAYNAME="service name" USERNAME="username" PASSWORD="AM1H2tpzU1xiDLOlojMcSAm1fn5M3MxiXeEaME" />