auto-update-windows-service
auto-update-windows-service copied to clipboard
Automatically update a Windows Service with Google Omaha
Automatically update a Windows Service with Google Omaha
This repository contains the source code for the tutorial with the above title. The tutorial shows how you can use Google's open source Omaha framework to update an exemplary Windows Service.
This repository is split into two parts:
-
servicecontains the source code for a simple Windows Service. It is a Visual Studio 2019 solution. The service's main functionality lies in Service.cs. All the Service does is to periodically write its version to a log file,C:\OmahaDemoService.log. -
installeris an NSIS project that can be used to package new versions of the service described in 1. The output is such that it can be uploaded to an Omaha-compatible update server. Specifically,installertakes the files produced byservice's build and produces a single .exe installer that supports silent installation via the/Sflag.
To combine the two parts, first build service with Visual Studio. This produces files in service\bin\Release. Then use makensis to build installer/Installer.nsi. This takes the files from service\bin\Release and produces a self-contained executable. To update the "version" of the service thus produced, which is relevant for Omaha and shown in the service's log file, change Service.cs and Installer.nsi.