zirplsoftware
Posts: 2
Joined: Thu Apr 19, 2012 4:19 pm

Auto Updater returns 0 even when a check is not run

When the auto updater is run using /silent, the updater returns 0 even when a check is not done because the frequency has not passed. This appears to make it impossible to know if the 0 is because a check was not done or because there is a new update. Is the expected behavior? If so, how would I differentiate between those 2 possibilities returning 0?

Thank you
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Auto Updater returns 0 even when a check is not run

Hi and welcome to Advanced Installer forums,

Indeed, when the Updater is running with the "/silent" command line option the return code for both cases, when updates are found or a check was not done because check frequency has not passed, is 0. But why do you want to make a difference between the two situations when check frequency has not passed? However, we intend to change the Updater return code, when a check is not done because check frequency has not passed, in our upcoming releases of Advanced Installer.

If you want to silently install updates always when an update is found you should proceed as follows:
- call the Updater with the following command line option

Code: Select all

/justcheck
- verify the return code and if an update is found, then if you want to install it call the Updater with the following command line:

Code: Select all

/checknow -minuseractions

Regards,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
zirplsoftware
Posts: 2
Joined: Thu Apr 19, 2012 4:19 pm

Re: Auto Updater returns 0 even when a check is not run

Hi Daniel,

I actually did end up implementing it in the way you suggested. But the problem with this way (and correct me if I am wrong) it is that it checks EVERY time. So the user never gets an opportunity to delay for 2 days or a week or whatever. While /silent does give the user that opportunity, it also does not work for my particular software. That is because my checks must be run at application startup, before the application spawns off a few other processes that become difficult to clean up in order to complete the install. So I need to essentially give my users the opportunity to cancel application startup and install the update if they choose. I do this currently by asking the user if they want to install the update in between /justcheck and /checknow.

What would be very useful (aside from the new return code) would be another parameter that would act like a combination of /justcheck and /silent- perhaps /justchecksilent. It would ONLY check and therefore would spawn no UI. But it would use the frequency settings to decide whether or not to actually do the full check. 0 would only be returned if it did the actual check (frequency had passed) AND there is an update.

Another way to approach this would be to alter the way /silent works (or create a new parameter with this behavior) so that if it does actually check AND there are updates, the program would not exit until the user hits Cancel or Install. Again, the whole purpose of this would be to let the calling program know not just whether or not there was an update, but also whether or not the user chose to install it. At least for my software, the user's choice is necessary, hence the popup I have to use currently in between /justcheck and /checknow to let the user decide.

Hope this makes sense. Thank you.
-N
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Auto Updater returns 0 even when a check is not run

Hi,

Thank you for your suggestions. Unfortunately, for the moment you will have to use your solution.
Stay tuned for our next release. This will be in a couple of months and will contain a new return code when a check is not done because check frequency has not passed.

If you have any questions let me know.

Regards,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”