Service Selfupdate
CapaInstaller services update themselves. The services are divided into two categories:
- Administrative services, which communicate with a Microsoft SQL Server:
- CapaInstaller Replicator Service
- CapaInstaller Synchronization Service
- CapaInstaller Patch Management Service
- CapaInstaller PXE Boot Service
- Client services, which use file-based communication to update themselves:
- CapaInstaller Agent Service
- CapaInstaller Health Check Service/Service Installation Service. The CapaInstaller Agent Service updates this service before the agent runs.
Administrative services
Section titled “Administrative services”The administrative services use the database to store the current versions of the service files. The files are also stored on each Management Point and server, as a fallback if a service can’t connect to the database.
The CapaInstaller Setup Wizard updates the service files in the database when you install or patch the system. Each file is stored with its version and checksum, so the update process can verify it.
The administrative services regularly check whether the database has a newer version of the service than the one running. If the versions differ, the service downloads the service files from the database and calls SelfUpdate.exe. SelfUpdate.exe stops the service, updates the files, and restarts the service.
By default, the services check for new service files every 15 minutes.
Client services
Section titled “Client services”The client services use the linked Management Server to store the current versions of the service files.
The CapaInstaller Health Check downloads the service files from the Management Server to the folder CapaInstaller\Client\Resources\CIStub on the local disk. Each time the CapaInstaller Agent Service is told to run the agent, it compares the version in that folder with its own. If the versions differ, it calls SelfUpdate.exe to stop the service, update the files, and restart the service. At the same time, the CapaInstaller Agent Service checks whether the CapaInstaller Health Check Service needs an update, and updates it if needed.
| Service | When it checks for new service files |
|---|---|
| CapaInstaller Agent Service | Before each agent run |
| CapaInstaller Health Check Service | Before each agent run (by the CapaInstaller Agent Service) |
How the self-update works
Section titled “How the self-update works”SelfUpdate.exe stops a service, overwrites the service files, and restarts the service, based on the arguments it receives. The service hands control over to SelfUpdate.exe, so the new service files must be in place and verified before the update starts. That’s why the files in the database are stored with a checksum.
When the service files have been copied to the local disk, their checksum is compared with the checksum in the database. The service is only updated if they match. In the same way, the Health Check Service compares the checksum with the checksums in an XML file that the Replicator generates, to make sure client services are updated correctly.
The database also stores SelfUpdate.exe itself, so new versions of it can be distributed.
SelfUpdate.exe writes a log entry each time it runs. The log file is %ProgramFiles%\CapaInstaller\Logs\Setup\Selfupdate.log. Logs from earlier runs are stored as %ProgramFiles%\CapaInstaller\Logs\Setup\Selfupdate_<datestamp>.log.