Service Selfupdate

Introduction

The following is a description of how CapaInstaller services will update themself. The CapaInstaller services are divided into two categories:

  • CapaInstaller administrative services, which are services that communicate with a Microsoft SQL Server
    CapaInstaller Replicator Service
  • CapaInstaller Synchronization Service
  • CapaInstaller Patch Management Service
  • CapaInstaller PXE Boot Service

  • CapaInstaller Client service, which uses file-based communication to update themself.

    CapaInstaller Agent Service
  • CapaInstaller Health Check Service/Service Installation Service (this service is updated by CapaInstaller Agent Service prior to agent execution)


CapaInstaller administrative services
 
CapaInstaller administrative service uses the database for storing the current versions of the services files. The files are also stored on each Management Point and Server and act as a failover if the service for some reason is unable to connect to the database.   
The service files will be updated in the database by the CapaInstaller Setup Wizard as part of the installation or when patching the system. Files are stored binary in the database and register their version and checksum to ensure a valid update process.
The administrative services regularly query the database in order to check if the service in the database is newer than itself. If the versions are different, the service will download the service files from the database, call SelfUpdate.exe in order to stop the service,
update the files and restart the service.
 
The default interval between checking for new service files is every 15 minutes
 

CapaInstaller client services
 
CapaInstaller client service uses the linked Management Server for storing the current versions of the services files.
 
The CapaInstaller Agent Service will check the service file stored on the local disk in the folder CapaInstaller\Client\Resources\CIStub and compare this version with its own. (The files are downloaded from the Management Server by the CapaInstaller
Health Check) If the versions are different, the service will call SelfUpdate.exe in order to stop the service, update the files and restart the service. This happens each time the CapaInstaller Agent Service is instructed to execute the Agent.
At this time, the CapaInstaller Agent Service will check if the CapaInstaller Health Check Service needs to be updated as well and will perform that action is needed.

The default interval between checking for new service files is:
 

CapaInstaller Agent Service

Prior to the Agent Execution

CapaInstaller Health Check Service

Prior to the Agent Execution (by CapaInstaller Agent Service)


How the self-update works
 
The self-update is an executable file that - based on arguments - can stop a service, overwrite the services files and restart the service before unloading itself. CapaInstaller Services will execute this file, leaving control to the executable. Therefore it is crucial that the source files for the services are in place and verified before updating. That is why the file entries in the database are stored along with a checksum.
 
When the services have copied to the local disk, the files actual checksum is compared with the once stated in the database and only if they match, a service update is performed. Similar to this, the health check service will compare the checksum with checksums stored in an XML file generated by the Replicator to ensure proper client service updates.
 
The database will also store the self-update executable in order to allow new versions of this file.
 
Selfupdate will create a log file entry each time it executes. The log file is stored in %programfiles%\CapaInstaller\Logs\Setup\Selfupdate.log Prior execution logs are stored in the history folder  %programfiles%\CapaInstaller\Logs\Setup\Selfupdate_<datestamp>.log