How to Show Toast Notification for Your Updates

Written by Danut Ghiorghita · May 27th, 2022

#UPDATER #UPDATE

How to Show Toast Notification for Your Updates

A toast notification is a message that your app can create and deliver to your user while they are not currently inside your app.

Starting with the 19.5 version of Advanced Installer, you have the possibility to display a toast notification when an update is available once the application is launched.

Toast Notification

If the user chooses the Remind me later option, they will get this notification each time they launch the application.

In case the user manually closes the notification or interacts with it, they won’t see the notification until a new notification is available, e.g. another update is available. This is done automatically to avoid spamming the user with notifications.

If the user chooses to ignore the notification, each time they launch the application, the notification will be displayed.

If they choose to install the new update, then the Updater.exe will be launched, as it is configured in the Updater view.

Toast notifications are only displayed when an update is available. If no update is available, there won’t be any toast notification.

There is no need to write any code for this feature, everything is built-in in our Updater.exe

How to enable toast notification.

To enable toast notifications, you need to create a shortcut to Updater.exe instead of your application. Also, a special command line is required so that Updater.exe can launch the application while checking for updates.

How it works is that, while your application was launched, the Updater.exe started the process to check for updates, in the background, while your application is launched in the foreground. If an update is available, it will display the toast notification. Otherwise, the updater process will simply exit.

Here’s what the shortcut to the Updater.exe looks like:

Shortcut to Updater.exe

You need to specify the following command line to the Updater.exe:

/justcheck -restartapp "[#MyApp.exe]"

As the installation path usually includes spaces, encapsulate the path in quotes.

The first parameter is used to trigger the check for updates process. The second parameter is used to launch your application while the Updater.exe is checking for updates in the background.

To better understand how the Updater works, have a look at the How the Updater works article.

This option is useful when you don’t want to make any changes to your codebase to display a toast notification.

For those that want deeper integration with the Updater.exe in their application, check the Advanced Installer Updater article to see the full list of commands available for the Updater.exe.

ImportantBy applying just a small change, any existing project that uses the Updater can take advantage of the new functionality. Just create the shortcut to the Updater.exe instead of your app and configure the shortcut properties as described above.

Toast Notification for the Updater - Video

Watch the video below for a step-by-step explanation on how to enable toast notifications for the Updater:

Subscribe to Our Newsletter

Sign up for free and be the first to receive the latest news, videos, exclusive How-Tos, and guides from Advanced Installer.

Comments: