I would like to use some kind of async technique to get useful work done while waiting (let's say 5 seconds) for the AI updater.exe to check for updates on the web. But I cannot use C# async/await directly because my 'static int Main' program cannot be made async (else the thread would return and exit after seeing the first await on the updater.exe call).
What is the best way for my app thread to continue to do useful work while AI updater.exe is checking for upgrades (that mostly won't be there in 99% of the cases)? My thread can get a LOT done in 5 seconds. I see the /justcheck option that will return a 0 if upgrades are available. Maybe that will work for me. If nothing else, I can delay the upgrader.exe call like you do in your example.
Do you have a recommendation for doing anything async to make use of the time while the updater is checking? (Even if the updater returns a code saying there are upgrades, I don't want to wait for it to do the update). Thank you.
Code: Select all
if (! AiInstallerUpdater.UpdaterCheckForUpdatesOnAppBoot()) {
var msg = @"Web automatic upgrade failed.";
MessageBox.Show(msg);
return 1;
}