Install-time option to enable/disable auto updates - Advanced Installer Community
jbothe
Posts: 13
Joined: Tue Mar 31, 2020 11:53 am

Install-time option to enable/disable auto updates

Hi!

I'm looking for ways to ask the user at install time if auto updates should be enabled or disabled. I'm installing a windows service and want to avoid any per-user settings (e.g this option should be machine wide). I'm using the built-in task to run the updater daily (using the service helper), is there a way to enable/disable the task at install time?

Thanks,
John
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Install-time option to enable/disable auto updates

Hi John and welcome to our forums,

To do so you can just use a check box (with CHECKBOX_PROP associated property) on your installation dialogs. When this check box is checked the updater task will be installed.

Then all you have to do is to condition the scheduled task installation using the above check box property. Just set the above property in the "Install condition" field.
screen.jpg
screen.jpg (70.61 KiB) Viewed 11399 times
All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jbothe
Posts: 13
Joined: Tue Mar 31, 2020 11:53 am

Re: Install-time option to enable/disable auto updates

Perfect, thanks Daniel!
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Install-time option to enable/disable auto updates

You are always welcome.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jbothe
Posts: 13
Joined: Tue Mar 31, 2020 11:53 am

Re: Install-time option to enable/disable auto updates

Hi again Daniel,

We're looking at alternatives to triggering the update check. Our application runs as a service, so the user that installed the application (and owns the update task) may not always be logged in. So we were thinking about triggering updater.exe from our service once per day. Do you have an example of doing this such that no windows or GUI is created so it can be run from a service?

E.g. should it be run as: updater.exe /silentall -nofreqcheck -nogui

Or should the /runservice flag be used?

Thanks,
John
jbothe
Posts: 13
Joined: Tue Mar 31, 2020 11:53 am

Re: Install-time option to enable/disable auto updates

It turns out running:
updater.exe /silentall
periodically from our service works just fine, we had another problem that was preventing this from working as expected, all good now.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Install-time option to enable/disable auto updates

Hi John,

Yes, in this case you should just make sure you call the Updater using a silent check command line, e.g.

Code: Select all

updater.exe /silentall -nofreqcheck -nogui
Also, please note that you can even configure the Updater scheduled task to run under System account. To do so you should just make sure you leave the "User" and "Password" fields empty in "Account" tab.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jbothe
Posts: 13
Joined: Tue Mar 31, 2020 11:53 am

Re: Install-time option to enable/disable auto updates

Hey Daniel,

Thanks for the feedback, we ended up using a scheduled task to run the updater using the System account as per your suggestion.

This seems to be working well.

Thanks,
John
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Install-time option to enable/disable auto updates

You are always welcome John.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jbothe
Posts: 13
Joined: Tue Mar 31, 2020 11:53 am

Re: Install-time option to enable/disable auto updates

Hi Daniel,

Looking at other ways to enable/disable the auto-update check... we need to be able to toggle this at install time and runtime.

Rather than simply not install the task, ideally we'd like to always install the task and always let it run, but move the enable/disable check logic.

I can think of 2 approaches:

1. Enable/disable the scheduled task
2. Use "updater.exe /set autoupdatepolicy <policy_type>"

For #1, is there a simple way to conditionally enable/disable the 'check for updates' task?
For #2, is this is per-user or per-system/global setting? Does this have an effect even if "User cannot disable automatic updates check" is enabled in the updater settings?

Thanks,
John
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Install-time option to enable/disable auto updates

Hi John,

#1. To do so, you should just use the "Condition" field of your scheduled task. Check this screenshot.
screen.jpg
screen.jpg (54.12 KiB) Viewed 11113 times

#2. The "/set autoupdatepolicy Disable" command takes effect only for the current user context. And yes, this command takes effect even if "User cannot disable automatic updates check" is enabled in the "Updater" page.

If you have any questions or doubts just let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”