Link Search Menu Expand Document

Use Thistle Update Client to Update GUI Application

The Thistle Update Client can perform updates on a large varieties of platforms - from headless embedded devices, to the ones with a graphical user interface (GUI).

The Launcher Application

In order to simplify integration with GUI applications, we propose the use of a launcher application. This launcher will become the entry point of your application, and will execute the update client, followed by your application.

Launcher Setup

This launcher setup is very common in order to perform updates on graphical application setups. We propose an example launcher program in Go that can be used across multiple platforms - but it is also possible to integrate any other launcher program following the scheme of the diagram above.

Integration with the Thistle Update Client

The Thistle update client should enable the optional configuration option stop_after_download. This configuration option will allow the update client to run only one time (no continuous mode of operation) - and it will make the updater stop after downloading the update payload, allowing you to inform users, and let them restart the application.

Example for Windows

In this example we will update a Windows graphical program using the Thistle update client, and a launcher. In this example the program consists of a single binary program.exe already prepared in the release directory. We also have the binaries for the release helper at hand, as well as the launcher program and the update client.

$ ls
launcher.exe tuc.exe trh.exe

$ ls release
program.exe

We will now initialize the Thistle release helper to work here, like in the Get Started guide. The persistent directory will be the install path + ./. We can now prepare and upload our release.

$ ./trh init --persist="./"
$ ./trh prepare -t="./release"
$ ./trh release

The configuration file needs to be amended to include the configuration option stop_after_download.

$ cat config.json
{
    ...
    "stop_after_download": true
}

Our program is now is now fully released. We can prepare the bundle that we will distribute, including the launcher, the program, the update client and the generated configuration file config.json. We also copy the manifest.json in order to tell the update client what is the current version of the release being distributed.

$ mkdir bundle
$ cp launcher.exe bundle/
$ cp config.json bundle/
$ cp tuc.exe bundle/
$ cp release program.exe bundle/
$ cp manifest.json bundle/thistle-persist/manifest.current
$ ls bundle
config.json  launcher.exe  program.exe tuc.exe

We can now distribute the files in the folder bundle. The program should be executed directly with the launcher, so that subsequent updates can be downloaded and installed.