DEPRECATED: How to enable application services in a Container (Service)

Save to PDF

Applies to: Cloudhouse Containers

13/09/2019 Cliff Hobbs   ID: 266768


From version 1902, the Auto Packager automatically configures services as detailed in How to Configure Services using the Services.xml. Please upgrade to the latest version of the Auto Packager to take advantage of this and the other improvements it offers.


The Auto Packager does not configure support for services automatically. When packaging an application that includes a service, a run action must be configured in a <Run Condition> within the Container's Programs.xml file. 

Step-by-step process

To configure the <Run Condition>:

  1. In the Container's folder, open the AppAcceleratorV.clc file.
  2. Add the Service feature:

  3. Open Programs.xml
  4. Add a new <Program> entry, adjusting the arguments to point to the executable.
  5. Set the <RunCondition> as Always.

    <Program ProgramOrder="1">
      <Args>/f %DefaultDir%\ProgData\Service.exe</Args>

The following service APIs are hooked:

  • StartServiceCtrlDispatcherA
  • StartServiceCtrlDispatcherW
  • SetServiceStatus
  • OpenSCManagerA
  • OpenSCManagerW
  • OpenServiceA
  • OpenServiceW
  • CloseServiceHandle
  • StartServiceA
  • StartServiceW
  • QueryServiceConfigA
  • QueryServiceConfigW
  • RegisterServiceCtrlHandlerA
  • RegisterServiceCtrlHandlerW
  • RegisterServiceCtrlHandlerExA
  • RegisterServiceCtrlHandlerExW
  • QueryServiceStatus
  • QueryServiceStatusEx
  • ControlService
  • GetServiceDisplayNameA
  • GetServiceDisplayNameW

Was this article helpful?

Table of Contents

    Can't find what you're looking for?

    Contact Support