kkkwj
Posts: 88
Joined: Thu Mar 01, 2007 10:45 pm

How to get code to call updater on every app boot

Sat Feb 04, 2023 4:55 am

My goal is to debug the automatic update process, but the check frequency of 2 days keeps getting in the way and blocking my ability to see if the next upgrade installer is called properly. I want to install v1.00 of my app, and then run it to check for updates N times. But this does not because the check frequency keeps skipping the update. I have tried various configurations and setting check frequency days, the '-nofreqcheck /silent' combination arguments in my code, but I have failed each time and have wasted more than a few hours.

I want the app to:
- check for updates on every boot
- SILENTLY (so using the /checknow option doesn't work because it pops up a useless OK dialog that says "Your app is up to date."

What arguments and settings do I need to use to accomplish this goal?

My code:

Code: Select all

 static void StartSilent() {
    // The delay lets the application boot up completely so that the updater app
    // appears on top of the application window. 
    // If you use /checknow, the updater always runs and puts up a dialog that
    // says "The application is up to date." And forces the user to click okay.
    // That is a headache, so only use /checknow while you are debugging
    // installations. Normally, use ' /silent'
    Thread.Sleep(4000);
    var process = Process.Start(UpdaterModulePath, " /silent");
    process.Close();
  }

Catalin
Posts: 6543
Joined: Wed Jun 13, 2018 7:49 am

Re: How to get code to call updater on every app boot

Mon Feb 06, 2023 2:34 pm

Hello,

If you want to get rid of that message from the /checknow argument, you can use the -minuseractions additional argument.
Screenshot_70.png
Screenshot_70.png (25.56KiB)Viewed 12567 times
The -nofreqcheck did not work in your case because it can only be used with "/silentall" and "/silentcritical" arguments.

Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

kkkwj
Posts: 88
Joined: Thu Mar 01, 2007 10:45 pm

Re: How to get code to call updater on every app boot

Tue Feb 07, 2023 10:26 pm

As always, Catalin, thank you for your answers.

Still, I'm not sure that I heard a recommendation from you. I see two options from your response:

Use '-nofreqcheck /silentall' to do the check and upgrade operation on every application boot. Users will see nothing unless there is an upgrade waiting.

Use '-minuseractions /checknow' to do the check and upgrade operation every application boot. Users will see nothing unless there is an upgrade waiting. They will not see an OK dialog that says "Your application is up to date."

My guess is that -nofreqcheck /silentall is the one I should use, assuming that /silentall does the same thing that /silent does when there is only one application to upgrade. Is my understanding correct?

UPDATE:

None of the combinations listed above work to accomplish my goal, which is:
- check for an update every time the app boots
- display nothing to the user if there is no update that needs to be installed
- display the usual "Update found, do you want to download it now and install it?" dialog if a new update is ready to install.

Here is an image of what I get with /checknow. How do I shut this dialog off so users don't have to see it and click it every time they boot?
Thank you.
ai software up to date.jpg
ai software up to date.jpg (16.4KiB)Viewed 12394 times

Catalin
Posts: 6543
Joined: Wed Jun 13, 2018 7:49 am

Re: How to get code to call updater on every app boot

Fri Feb 10, 2023 12:26 pm

Hello,

You are always welcome! :)

Indeed, the "-nofreqcheck" is meant for the "silentall" switch, so yes your understanding would be correct.
Here is an image of what I get with /checknow.
Do you also use the -minuseractions here? Here is how the command would look:

Code: Select all

/checknow -minuseractions
Do you call the updater like that?

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

kkkwj
Posts: 88
Joined: Thu Mar 01, 2007 10:45 pm

Re: How to get code to call updater on every app boot

Fri Feb 10, 2023 9:53 pm

I confirm that /checknow -minuseractions works. Thank you.

I had misread the argument and had used 'interactions' instead of 'actions'.
I had also entered '-minuseractions /checknow', putting the -min argument before the slash argument.

Q. Could you please tell me what the behavior would be if I configured the app AIP file this way:
Updater tab, Update Behavior:
- enable Check and prompt the user to install updates
- enable Use check frequency
- enable Minimize user interaction
- set Update check frequency to 0 days (I'm hoping that 0 means "on every application boot")

Would those settings 1) force an update on every boot, 2) and produce no dialog interactions if everything was up to date?

And what should be the arguments used to call the updater? /silent? /silentall? /checknow? -minuseractions?

Catalin
Posts: 6543
Joined: Wed Jun 13, 2018 7:49 am

Re: How to get code to call updater on every app boot

Mon Feb 13, 2023 2:22 pm

You are always welcome!

Glad to hear everything is working as expected now.

Not quite sure if you can set the "check frequency" to "0".

Overall, what you want to achieve is done through code, it doesn't have to do with the options from the "Updater" page - this is, of course, because you want to check for updates everytime your application is started. Therefore, you should control the Updater behavior through the command line, as we previously discussed.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

kkkwj
Posts: 88
Joined: Thu Mar 01, 2007 10:45 pm

Re: How to get code to call updater on every app boot

Mon Feb 13, 2023 5:41 pm

Hi, yes, you are correct. I am now using "/checknow -minuseractions" to check every time the app boots.

In case your devs are looking for extra things to do, the magic sequence "/checknow -minuseractions" is NOT described in the documentation anywhere.

And setting the check frequency days to 0 (with Use check frequency enabled) is not discussed in the documentation either. That was one of the first things I tried (in the absence of doc), reasoning that as the integer decreased in value, the check frequency got faster and faster. What could be faster than checking every 1 day? - checking on every boot.

But alas, that didn't work either. I had to post a request here to draw on your excellent knowledge of the magic '/checknow -minuseractions' arguments - which work fine.

Thank you for your help!

Catalin
Posts: 6543
Joined: Wed Jun 13, 2018 7:49 am

Re: How to get code to call updater on every app boot

Tue Feb 14, 2023 2:41 pm

Hello,

Thank you for your feedback on this!

I am glad to hear everything is working as expected now.

Although I agree with you that there is room for improvement in our documentation - and we do this constantly through the feedback we receive from our customers - the option is actually documented in the following article:

Advanced Installer Updater

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

kkkwj
Posts: 88
Joined: Thu Mar 01, 2007 10:45 pm

Re: How to get code to call updater on every app boot

Wed Feb 15, 2023 4:13 am

I agree the -minuseractions option is documented in the list with all the other options (I saw it there). And the doc also says, "this option can be used with /checknow."

But my point was that there is no documentation on How to Check For Updates on Every App Boot Without Flickering Dialogs.

IMHO, a whole dedicated page or section is needed on this topic.

As it currently stands, customers need to go read the code to find out how to call AI, and the examples there do not talk about the magic '/checknow -minuseractions' technique that you kindly provided in this thread.

I've written probably 5,000 pages of software documentation in my life, and it is clear to me that your doc was driven by the layouts of the app screens and by the lists of options that are available. Thus, the documentation is like a reference manual - look at a screen element and then go read about it in the document.

But lots of the documentation does not address the real user problems in a goal-driven, scenario-driven way.

Catalin
Posts: 6543
Joined: Wed Jun 13, 2018 7:49 am

Re: How to get code to call updater on every app boot

Thu Feb 16, 2023 2:47 pm

Hello,
IMHO, a whole dedicated page or section is needed on this topic.
We do have an entire topic for this:

How to integrate the Advanced Updater with my application

Basically all it's need is to call the updater.exe, like you would call any other executable. And of course, to that we add the command line options which are all described in the other article.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”