> ## Documentation Index
> Fetch the complete documentation index at: https://docs.thistle.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# Use Thistle Update Client to Update GUI Application

> Integrating Thistle OTA with a 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.

<img src="https://mintcdn.com/thistletechnologies/MrBm0BC7xpW_ySdM/images/launcher.png?fit=max&auto=format&n=MrBm0BC7xpW_ySdM&q=85&s=115052f9e3386108bcbe262581e5a97e" alt="Launcher Setup" width="1044" height="858" data-path="images/launcher.png" />

This launcher setup is very common in order to perform updates on graphical application setups. We propose an [example launcher program in Go](https://gist.github.com/pldubouilh/f0024bf9d1ceea5d8554fa7cac56a5d6) 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`](/update/configuration_file#optional-fields). 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.

```cmd theme={"dark"}
$ 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](/update/get_started/file_update). The persistent directory will be the install path + `./`. We can now prepare and upload our release.

```cmd theme={"dark"}
$ ./trh init --persist="./"
$ ./trh prepare -t="./release"
$ ./trh release
```

The configuration file needs to be amended to include the [configuration option `stop_after_download`](/update/configuration_file#optional-fields).

```json theme={"dark"}
$ 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.

```cmd theme={"dark"}
$ 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.
