Dan
Posts: 4513
Joined: Wed Apr 24, 2013 3:51 pm

Send toast notifications in Windows Message Center using the Updater

Mon Mar 30, 2020 2:28 pm

Hello,

Starting with 16.9 version of Advanced Installer, the Updater has the ability to display custom messages to your users. This feature may be of great help when you want to reach your users either be it with great offers for the software, campaign discounts or just latest blog article. It doesn't matter, you decide.

For those who are not that familiar with the Updater , please note that Advanced Updater is an executable tool whose roles are to check for updates, inform the user of their presence and offer to download and install them. After launching the Updater, it checks if a newer version of the application exists.

Here is how the notification looks like:

Updater - notificaiton.png
Updater - notificaiton.png (182.83KiB)Viewed 155288 times


In order to enable auto-updates capability in your installer, you can check the Configuring auto-updates for a Windows application video.

The How the Updater works diagram illustrates the steps of how an application is upgraded from one version to the next when using the Advanced Updater.

Sample projects can be downloaded from here.

How to send custom messages

Updates Configuration Project has a new tab available, the Notification. Here you can type your custom message.

Notification view.PNG
Notification view.PNG (37.01KiB)Viewed 155288 times


Another speficic setting that is recommended for the Updater is to add the AppId. AppID field is mandatory for update notifications. On some Windows 10 versions the notifications will not be displayed if no AppId is specified.

AppId.PNG
AppId.PNG (14.43KiB)Viewed 155288 times


Now, the most convenient way to find the AppId is by installing the app and then run the following command line in PowerShell:

Code: Select all

get-StartApps -Name "Demo App"
PowerShell get-StartApps.PNG
PowerShell get-StartApps.PNG (21.8KiB)Viewed 155288 times


The notification is sent based on the settings provided in the Notification view.

In case you are testing the Updater and how the mesages are sent, then you need to know that the a message is sent only once. If you want to see the message once again for testing purposes you need to clear up registries. The Updater stores this infor in the

Code: Select all

HKEY_CURRENT_USER\Software\Caphyon\Advanced Updater\[UpgradeCodeGuid]
Just delete the {E49DD1F8-0F07-4E0B-863A-644973E09FF6} entry and you should be able to see the message once again. If the message does not appear in the Notification center, please check the Windows settings to make sure that you have notification enabled:

Windows notification seetings.PNG
Windows notification seetings.PNG (24.66KiB)Viewed 155288 times


Note that the notification will be displayed (only once) when the Updater is triggered, be it automatically from a schedule task or manually from a desktop shortcut. This feature is available starting with Windows 7.

You can download a sample project that usses the Notification feature from here.

As you can see, the structure of the updates configuration file contains a new entry:

Code: Select all

;aiu;

[General]
MessageTitle = Get more from your software
MessageBody = Upgrade now to the latest version of AdvInst
MessageExpirationDate = 31/03/2020
MessageURI = https://www.advancedinstaller.com/release-16.9.html
MessageButtonText = Read more

[Update]
Name = Demo App
ProductVersion = 2.0.0
URL = https://www.dropbox.com/s/gogkyiy76lvo9at/Demo%20App.msi?dl=1
Size = 946176
SHA256 = 1E0D62C60AE2479CBE904193C513243C22BA90D3857F27FE58223044C5108A21
MD5 = 440860b56c44957cbd055a3a5e0744df
ServerFileName = Demo App.msi
RegistryKey = HKUD\Software\Caphyon\Demo App\Version
Version = 2.0.0
Description = There is a new update available		
Feature = New features available!	
Enhancement = Multiple improvements available!
BugFix = All known bugs are fixed!

At any given time you can edit this updates.txt file and add a new message. The Updater will display one message at a time and only once.

So, if you want to add a new message, just add a new entry and upload the updates.exe file on your server. When the Updater will be triggered, it will see that a new message is available and will display it to the user. e.g.:

Code: Select all

;aiu;

[General]
MessageTitle = Another message 
MessageBody = This is a new message that will be displayed!
MessageExpirationDate = 31/03/2020
MessageURI = https://www.advancedinstaller.com/release-16.9.html
MessageButtonText = Read more

[General]
MessageTitle = Get more from your software
MessageBody = Upgrade now to the latest version of AdvInst
MessageExpirationDate = 31/03/2020
MessageURI = https://www.advancedinstaller.com/release-16.9.html
MessageButtonText = Read more

[Update]
Name = Demo App
ProductVersion = 2.0.0
URL = https://www.dropbox.com/s/gogkyiy76lvo9at/Demo%20App.msi?dl=1
Size = 946176
SHA256 = 1E0D62C60AE2479CBE904193C513243C22BA90D3857F27FE58223044C5108A21
MD5 = 440860b56c44957cbd055a3a5e0744df
ServerFileName = Demo App.msi
RegistryKey = HKUD\Software\Caphyon\Demo App\Version
Version = 2.0.0
Description = There is a new update available		
Feature = New features available!	
Enhancement = Multiple improvements available!
BugFix = All known bugs are fixed!
For any questions your may have, please let us know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Sample Projects”