As you may already know, recently, due to a high number of requests, we have added a new feature in Advanced Installer - the integration of our "Updater" feature with GitHub.
For more information about this, please have a look on our "How to integrate the Updater with GitHub?" article.
Normally, this feature is intended to target people that are already familiar with GitHub - as it was requested mostly by people already using GitHub on a daily basis and releasing their products with it - and its' REST API.
However, there might be some other users who are just getting started with this and might need help in achieving the integration of our "Updater" feature with GitHub, therefore I have decided to create this How-To.
First thing that needs to be noted here is the fact that this feature does not work exactly the same as our usual "Updater" feature.
If you need more information about our "usual" Updater feature, please have a look on our "Using the Updater" article.
Now that we have that the two methods are quite different, let's talk a bit about the second method and how that differs from the first one.
First of all, in order to integrate the "Updater" with GitHub, all you need to do is:
- go to "Updater" page
- under "Updater" section, select the "Check for updates using Advanced Updater" option
- select the "GitHub integration" option
- in the "Updates Configuration file URL" field, we will need to input the URL to the "configuration file"
Earlier, I have mentioned that this method makes use of the "GitHub API".
All access to the above mentioned API is done over HTTPS, and accessed from https://api.github.com.
All data is sent and received as JSON.
The above information is really important. Basically, every HTTPS request that is done to the API will return a response in a form of a JSON file.
This response is then interpreted by our "Updater" tool (we will talk about how our Updater tool interprets the JSON file a little bit later).
To be more specific here, our Updater tool makes use of the GitHub Release API. For more information about this, please have a look over the "Releases" section of the "GitHub REST API" article.
To better understand this, let's have a look over the following example.
Let's consider we have the following repositories:
Here, I have highlighted the "hello-world-updater" repository as that is the one we will use as an example.
This repository has only one release:
If we want to access the information about our release through the API, we can proceed as it follows:
- open a new tab in your web browser and access the following link:
Code: Select all
https://api.github.com/repos/<username>/<repository_name>/releases
Code: Select all
https://api.github.com/repos/catalinkmihai/hello-world-updater/releases
<username> = catalinkmihai
<repository_name> = hello-world-updater
The above will generate a response that looks as it follows (I have used two screenshots here for a better clarity):
As you can see, this does not quite look like the configuration file generated by our "Updates Configuration File" project:
In order for the Updater tool to be able to interpret the fields returned by the request, we had to map them to the current fields used in the configuration file.
The mapping is explained in the "How to integrate the Updater with GitHub" article (which I have linked above).
In the article, we can see, for example, that the "tag_name" field (returned by the request) is mapped to "Version" field (generated by the "Updates Configuration File" project).
Taking in consideration the above explanation => that your release tag should contain a higher version than the already installed application, in order for the Updater tool to consider it a new version of your product.
Now that we have explained how this works and hopefully everything is more clear now, let's consider the following step-by-step which showcases a scenario that integrates the Updater tool with GitHub:
- first of all, we will need to create a new repository
- for this repository, we will need to create a new release
- now please open Advanced Installer and create a new project
- go to "Updater" page and select the "Check for updates using Advanced Updater" option
- select the "GitHub integration" option
e.g.:
- build the project
- install the resulted package
- now please go to "Product Details" page and increase the "Version" (e.g. 1.0.0 --> 2.0.0)
- rebuild the project. When asked to generate a new ProductCode, please select "Generate New"
- the generated package should now be added as an "Asset" to our earlier created "Release". To do so, select your Repository --> select your Release --> "Edit Release" --> add the earlier built package as an asset, e.g.:
After doing so, now please go to the installation folder of the first version and double click on the "updater.exe" tool. If everything was configured correctly, the Updater should detect the newer version and then download and install the package.
Hope this helps!
Best regards,
Catalin