catsaremyfriends
Posts: 33
Joined: Thu Mar 26, 2009 9:21 pm

Questions about how Updater works

Tue Apr 28, 2009 10:51 pm

I have some questions about how Updater is implemented and how it works.

My understanding is as follows - please correct me if I am wrong:

a) There is client side component of Updater. This is an executable which is to be installed on machine which is to receive the update. This consists of a standard executable which can be included as part of the installation package. This executable is built by and provided by the AI team.

b) The client side component can (optionally) be invoked from my application.

c) There is a server side component of Updater which receives requests for updates and has the logic to determine if the request is valid and if there is an update available and if so will provide an MSI to the requesting client.

So, some questions:

1) Can my application which provides the interface to the client side component of the Updater, be part of the download that may result? If so then will the installer somehow shutdown my application before it begins the install process?

2) Who builds the server side component of the Updater? Do I do it or is it provided by AI?

3) If the answer to #2 is "AI" then what is the logic that it uses for licence validation and determining if an update is available?

4) If the answer to #2 is "I do it" then where can I find the definition of the interface to the client side component i.e. so that I can know what input to expect and what output that I should produce?

Thanks,

cats

dms
Posts: 164
Joined: Tue Aug 28, 2007 7:11 am
Location: UK

Re: Questions about how Updater works

Wed Apr 29, 2009 7:21 am

Hi

I can answer some of these for you, and I'm sure that Cosmin will correct or amend anything I get wrong or simply don't know.
The answer to 1 in plain simple english is yes (but I'm not sure if that is also the case if you elect to have a sisd by side install as it's something I've never done).
The answer to 2 is dependent upon what you choose to be the determing factor. In my case I always opt for version no. So I would store that in the registry on first install. Then when I build my update it is that value that I will opt to have compared. If the update is greater than the installed version then it gets installed. There is one small caveat to this which I do not know if it has been corrected or not yet and that relates to verion numbers that run to two or more decimal places and the rounding that then occurs. I have had situations where the updater thought that there was already a version on a computer that was equal to the one I intended to update it with. My solution to that was to simply stick to a rigid 1 point increment.

The answer to three is that you are going to require your own logic to handle this which will typically involve some sort of custom action. My hope is that forthcomming ammendments to the licencing feature will effectively take control of this giving a situation where all updates can be downloaded and (in my case and along similar lines to what AI itself does) if the end user has a valid maintenace contarct the install runs as normal and if they are outside an agreement it reverts back to trial mode.

For question 4. First build your update. With that done fire up AI again only this time select an updates configuration project. You first need to point it towards the new update's msi that you have just built and which point you will be presented with the main updates screen. You select your update parameter in the lower section. The help is pretty good on this and there is also a tutorial that will walk you through updating a simple project.

Once you have got the hang of this it really does work extremely well, and I know my end users love it.

HTH

Dom

Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact:  Website

Re: Questions about how Updater works

Wed Apr 29, 2009 8:24 am

Hi,
catsaremyfriends wrote:There is a server side component of Updater which receives requests for updates and has the logic to determine if the request is valid and if there is an update available and if so will provide an MSI to the requesting client.
The server side component is actually a simple INI file which contains the updates information and location. The entire update process is handled by the updater executable installed by the package.
catsaremyfriends wrote:Can my application which provides the interface to the client side component of the Updater, be part of the download that may result? If so then will the installer somehow shutdown my application before it begins the install process?
Yes, the application can be installed as an update. However, this requires the Updater to be installed on the target machine.
If you want an update to stop the application before it is installed, you can use the auto close application feature in the updates configuration project.
catsaremyfriends wrote:Who builds the server side component of the Updater? Do I do it or is it provided by AI?
The updates configuration file needs to be created by the developers of the package (it is not provided automatically by Advanced Installer). You can create the file by using an updates configuration project or by writing it manually.
catsaremyfriends wrote:where can I find the definition of the interface to the client side component i.e. so that I can know what input to expect and what output that I should produce?
Please note that the User Guide contains an Updater tutorial and a step by step instructions which may help you.
dms wrote:In my case I always opt for version no. So I would store that in the registry on first install. Then when I build my update it is that value that I will opt to have compared. If the update is greater than the installed version then it gets installed.
Indeed, a registry entry with the product version is the recommended installed detection criteria for an update. This registry entry can be created in all versions of the package and it can use the "ProductVersion" property.
dms wrote:There is one small caveat to this which I do not know if it has been corrected or not yet and that relates to verion numbers that run to two or more decimal places and the rounding that then occurs.
I'm not sure I know the caveat you are referring to. Can you please give me more details about this?

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

dms
Posts: 164
Joined: Tue Aug 28, 2007 7:11 am
Location: UK

Re: Questions about how Updater works

Wed Apr 29, 2009 8:48 am

Cosmin

Let's suppose for example that I have version 1.59 of my app installed on a machine and I build a newversion 1.595. That will install. If I then build 1.6 I find more often than not that at that point the updater thinks that there is already a version 1.6 on the target machine (as 1.595 will be rounded up to 1.6) and it does not get installed.

This has happened to me more than once so as I said I simply stick to a single point versioning system now and have no problems as a result.

Dom

Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact:  Website

Re: Questions about how Updater works

Wed Apr 29, 2009 9:19 am

Hi Dom,

Please note that this is the normal Windows Installer behavior and it happens because the versions are evaluated as numbers.

For example, 595 is higher than 59, so the version 1.595 is higher than 1.59. However, 595 is also higher than 6, so the version 1.595 is higher than 1.6. If you want to use this type of versioning, the versions need to use zeros (0) to match the format:
- 1.590 instead of 1.59
- 1.600 instead of 1.6

This way 590 < 595 < 600 so 1.590 < 1.595 < 1.600.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”