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

Save to PDF

Applies to: Cloudhouse Containers

13/09/2019 Cliff Hobbs   ID: 266768

Important

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.

Overview

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:

    <Features>
      <Feature>Service</Feature>
    </Features>
  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">
      <Path>%DefaultDir%\AppAcceleratorV.exe</Path>
      <Args>/f %DefaultDir%\ProgData\Service.exe</Args>
      <WorkingDirectory/>
      <RunCondition>Always</RunCondition>
      <ProcessWindowStyle>Normal</ProcessWindowStyle>
      <WaitCondition>None</WaitCondition>
    </Program>

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


Source:
Was this article helpful?

Table of Contents

    Can't find what you're looking for?

    Contact Support