The INSTALLXML command allows you to install application as service with parameters specified in a separate XML file.
Syntax:
APP2SRV INSTALLXML FILE.XML
| Parameter | Description |
| FILE.XML | Required parameter which is the full path to XML file. |
This file may contain the following tags:
| Tag | Description | |
| Program | Defines the major service settings and includes the following sub tags: ServiceName, Display, Description, WorkDir, Executable, Parameters, ConsoleApplication | |
| ServiceName | Required tag that is a valid service name you want to install. | |
| Display | Optional tag which is shown in Windows Service Control Manager (SCM) at the "Name" column. Its value may contain whitespaces. If this value is not specified, the ServiceName is used instead. | |
| Description | Optional tag that sets more descriptive information for the service and is displayed in SCM. Note: whitespaces (such as spaces, tabs and punctuation) are not allowed. If this value is not specified, the "Display" is used instead. | |
| WorkDir | Optional tag that defines the working directory of the service. If the folder located on remote host, please, specify the valid Universal/Uniform Naming Convention (UNC) path to a network drive ("//servername/full/path"). | |
| Executable | Required tag that specifies the executable file which should be run as service. | |
| Parameters | This is an optional list of parameters that can be passed to the executable at the start time. It may contain username, system or service specific environment variables (for instance, %MYVAR%), file name and so on. | |
| ConsoleApplication | Optional tag that defines whether the application you run as service is console one. Supply "TRUE" if this is console application and "FALSE" otherwise. If this parameter is not specified, it is assumed that application is not console. | |
| Settings | Defines a number of service options and includes the following sub tags: Order, Account, Password, StartType, InteractDesktop, ShowWindow, UponProgramExit, UponProgramExitTime, FlapDetection, FlapDetectionRetries, GracefulShutdown, StopCommand, ShutdownTime | |
| Order | Optional tag that defines the name of the Load Order Group which the application you want to launch as service will belong to. | |
| Account | Optional tag that defines account name under which the service will run. As the result, the application you launch as the service will has exactly the same execution rights, which is useful if you want to restrict or grant your application with the certain privileges. If the parameter is not specified, the service will run with rights under which it Application as Service was launched. | |
| Password | Optional tag that defines the password for the account specified by Account parameter. | |
| StartType | Optional tag that defines the service start-up type of the service. Its value could be: "Manual", "Automatic" or "Disabled". "Manual" type means that this service could be started at any time manually by user, "Automatic" means that service will be started automatically by Service Control Manager prior to login session and, finally, "Disabled" type means that service couldn't be started unless you change its status to something else. "Disabled" is useful if you want certain service be present but not running. The default value is "Manual". | |
| InteractDesktop | Optional tag that defines whether the application which is run as service should be interactive "Default", should be launched in Winlogon screen - "Winlogon" or not interactive "NONE". By default the service is not interactive. | |
| ShowWindow | Optional tag that defines the service's display mode and is applicable for the interactive services only. It may have one of the following values: "Normal", "Hidden", "Minimized, and "Maximized". | |
| UponProgramExit | Optional tag that defines the service behavior on application termination. It may have the following values: "Disable", "Restart the program after..." and "Shutdown the service". | |
| UponProgramExitTime | Optional tag that defines the period of time (milliseconds) between attempts to re-launch the application and is applicable if you use it with UponProgramExit set to "Restart the program". | |
| FlapDetection | Optional tag that defines how Service Control Manager should manage the service if was application termination several times in a row. It may have the following values: "Disable" and "Shutdown the service after..." (will terminate the gracefully by sending "Stop" command). This parameter is applicable if UponProgramExit tag is set to "Restart the program". | |
| FlapDetectionRetries | Optional tag that defines how many attempts to restart the application were made before the Flap detection should be enabled. This parameter is applicable if UponProgramExit tag is set to "Restart the program". | |
| GracefulShutdown | Optional tag that defines whether the graceful shutdown is enabled. Set this parameter to "TRUE" if graceful shutdown is enabled and "FALSE" otherwise. Graceful shutdown ensures that application, running as service terminated correctly. | |
| StopCommand | If GracefulShutdown is enabled, you can use this tag to stop console program using the following values: CTRL_C_EVENT or CTRL_BREAK_EVENT. | |
| ShutdownTime | Optional tag that defines the period of time (in milliseconds) before the application will be forced to exit (in case it is not responding). | |
| Advanced | Defines a variety of additional advanced service options and includes the following sub tags: Stdin, Stdout, Priority, CpuMask | |
| Stdin | Optional parameter that defines the file name where STDIN (standard input) stream will be redirected from. | |
| Stdout | Optional parameter that defines the file name where STDOUT (standard output) and STDERROR (standard error) stream will be redirected to. | |
| Priority | Optional parameter that defines the process's priority value. It may have one of the following values: "Low" priority use for processes that run in backround; "Normal" priority used for the process with no special scheduling needs, "Below Normal" priority used for the processes above Low priority but below Normal priority types. Not available for Windows 95/98/Me and NT, "Above Normal" priority used for the processes above Normal priority but below High priority types. Not available for Windows 95/98/Me and NT, "High" priority used for time-critical tasks that must be executed immediately and "Real Time" which is the highest priority possible. | |
| CpuMask | Optional parameter that defines the processor/processors that could be used by the service and is applicable for multi-processor systems only. The value is a sum of the processors where the first CPU is 0, second is 2, third is 4, fourth = 8, fifth = 16, sixth = 32, seventh = 64 and eighth = 128. | |
| Dependencies | Defines the services to be launched and stopped at the specific order and includes the following sub tag: Dependence | |
| Dependence | Optional parameter that defines the group/groups which the service will depend upon. It must match the Service Name of a pre-existing service or the service will not start. If the certain group of services is not started you will be sent a warning message. |
|
| Environment | Defines which environment variables should be initialized on the service start and be accessible from within this service and includes the following sub tag: Variable | |
| Variable | Environment variable that will be initialized on the service start and be accessible from within this service. | |
| Recovery | Defines the system's behavior on service crashes or faults and includes the following sub tags: ResetFailCount, RunProgram, Message, Type, Delay | |
| ResetFailCount | Optional tag that defines time (in hours) after which Application as Service should reset the failure count to zero if there are no failures occurred. Specify "-1" to indicate that this value should never be reset. | |
| RunProgram | Optional tag that defines additional command line executable and options that should be run on application crashes. This is applicable if Action parameter is equal to "Run a program". | |
| Message | Optional tag that sets the broadcast message which will be sent to all logged users on server reboot. This parameter is applicable if Action is equal to "Reboot computer". | |
| Type | Optional tag that sets the action should be taken if the application that runs as service was abruptly terminated. It consists of two parameters separated by vertical line. The first on may have one of the following options: "take no action", "restart the service", "restart computer", "run a program". The second parameter sets the delay in minutes before the recovery action would be taken. | |
| Delay | Optional tag that sets the delay in milliseconds before the recovery action would be taken. | |
| Pre-service | Optional tag that sets the additional application that should be launched prior to the service. The value is the string of parameters separated from each other by vertical line. Those parameters are: Executable (a full path and name of the pre-service program), Working Directory (a full valid path to the working directory of the pre-service application), Parameters (the list of parameters that can be passed to the pre-service program), Execution Time (expected time to run pre-service application). | |
| Post-service | Optional parameter that defines the additional application that should be launched once to the service is stopped. The value is the string of parameters separated from each other by vertical line. Those parameters are: Executable (a full path and name of the post-service program), Working Directory (a full valid path to the working directory of the post-service application), Parameters (the list of parameters that can be passed to the post-service program) and Execution Time (expected time to run post-service application). | |
| Pre-run-program | Optional parameter that defines the additional application that should be launched before command to start application, which is launched as service is executed. The value is the string of parameters separated from each other by vertical line. Those parameters are: Executable (a full path and name of the pre-service program), Working Directory (a full valid path to the working directory of the pre-service application), Parameters (the list of parameters that can be passed to the pre-service program), Execution Time (expected time to run pre-service application). | |
| Post-run-program | Optional parameter that defines the additional application that should be started immediately after command to start application, which is launched as service is executed. The value is the string of parameters separated from each other by vertical line. Those parameters are: Executable (a full path and name of the pre-service program), Working Directory (a full valid path to the working directory of the pre-service application), Parameters (the list of parameters that can be passed to the pre-service program), Execution Time (expected time to run pre-service application). | |
| Pre-stop-program | Optional parameter that defines the additional application that should be started everytime before command to stop application, which is launched as service is executed. The value is the string of parameters separated from each other by vertical line. Those parameters are: Executable (a full path and name of the pre-service program), Working Directory (a full valid path to the working directory of the pre-service application), Parameters (the list of parameters that can be passed to the pre-service program), Execution Time (expected time to run pre-service application). | |
| Post-stop-program | Optional parameter that defines the additional application that should be started immediately after command to stop application, which is launched as service is executed. The value is the string of parameters separated from each other by vertical line. Those parameters are: Executable (a full path and name of the pre-service program), Working Directory (a full valid path to the working directory of the pre-service application), Parameters (the list of parameters that can be passed to the pre-service program), Execution Time (expected time to run pre-service application). | |
| Post-start-window | This tag defines various popup windows managing after your application launch. It includes the following tags: Parent-caption - defines caption text of parent window, which will be searched to execute "Close window" or "Press button" commands; Parent-class - defines Windows system class name of parent window; Caption - optional parameter that defines the caption text of the window, which will be searched to execute certain commands. Note, that button is related to window as well, so, for example, if you want to press button "YES" of some window you should write "&YES"; Class - defines Windows system class name of the window; Wait - defines time after which command to close window or press button will be executed; Command - defines what command to send: 1 - "Press button" or 0 - "Close window" when you use Post-start-window tag |
|
| Pre-send-exit-window | This tag defines various popup windows closing before your application close. It includes the following tags: Parent-caption - defines caption text of parent window, which will be searched to execute "Close window" or "Press button" commands; Parent-class - defines Windows system class name of parent window; Caption - optional parameter that defines the caption text of the window, which will be searched to execute certain commands. Note, that button is related to window as well, so, for example, if you want to press button "YES" of some window you should write "&YES"; Class - defines Windows system class name of the window; Wait - defines time after which command to close window or press button will be executed; Command - defines what command to send: 1 - "Press button" or 0 - "Close window". | |
| Post-send-exit-window | This tag defines various popup windows closing after sending WM_CLOSE to your application. It includes the following tags: Parent-caption - defines caption text of parent window, which will be searched to execute "Close window" or "Press button" commands; Parent-class - defines Windows system class name of parent window; Caption - optional parameter that defines the caption text of the window, which will be searched to execute certain commands. Note, that button is related to window as well, so, for example, if you want to press button "YES" of some window you should write "&YES"; Class - defines Windows system class name of the window; Wait - defines time after which command to close window or press button will be executed; Command - defines what command to send: 1 - "Press button" or 0 - "Close window". | |
| Schedule | Defines running your application (no matter periodically on just once) at the particular time of the day, day of the week or on the particular date and includes the following sub tags: TimeStart, TimeStartEnd, TimeStop, DateStart, DateStop, RunDays, MonthFrom, MonthTo, MonthDay | |
| TimeStart | This is a 24-hour formatted time string that defines the start time of your application. For instance, 13:00:00 means that your application which is launched as service might be started at 1 PM local time. | |
| TimeStartEnd | This is a 24-hour formatted time string that is active when "TimeStart" parameter is used only and defines the end time, in other words, your application might start till that time. | |
| TimeStop | This is a 24-hour formatted time string that defines the stop time of your application which is launched as service. For instance, 14:00:00 means that application should be stopped at 2 PM local time. | |
| DateStart | Your application which is launched as service will be started or stopped everyday at a specified time starting from this date. The first 2 digits represent the day of the month, followed by 2 digits representing the month of the year and, finally, the last 4 digits is the year. For instance, 08:11:2008 means that application should run or stop everyday at a specified time starting from the 8th of November 2008. | |
| DateStop | Your application which is launched as service will be started or stopped everyday at a specified time until this date. The first 2 digits represent the day of the month, followed by 2 digits representing the month of the year and, finally, the last 4 digits is the year. For instance, 16:11:2008 means should be started or stopped everyday at a specified time until the 16th of November, 2008 | |
| RunDays | Defines the number of days your application should run or stop. | |
| MonthFrom | Defines the starting day of the month when your application might be started or stopped. | |
| MonthTo | Defines the day of the month till what your application might be started or stopped and should be used with "MonthFrom" tag only. | |
| MonthDay | Defines the certain day of the month when your application should be started or stopped |