Conditional update possible?
Is it possible to compare the latest release version (on GitHub) and the installed version? It seems I got crashes when my installed version is the latest one, and I want to around unnecessary update. Perhaps my implementation is bad. Below is the code. I feel the asynchronous task causes hang quite inconsistently. Any kind comment from an expert?
task = Task.Run(async () =>
{
try
{
using (var mgr = UpdateManager.GitHubUpdateManager("https://github.com/chromworks/IEX_AutoUpdate"))
{
await mgr.Result.UpdateApp();
}
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
try
{
using (var mgr = new UpdateManager("https://github.com/chromworks/IEX_AutoUpdate"))
{
SquirrelAwareApp.HandleEvents(
onInitialInstall: v => mgr.CreateShortcutForThisExe(),
onAppUpdate: v => mgr.CreateShortcutForThisExe(),
onAppUninstall: v => mgr.RemoveShortcutForThisExe());
}
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
});
Duplicate issue: #587
Closing this out because it looks like lots of cases in #587 could be traced back to how checking for updates is managed:
Every example I've found of this is user error, you're checking for updates but closing the app before it completes. This is a bug in your app - killing the app while updates are applying is bad.
The code in this comment here is a good explainer of what your app should be doing to handle this situation:
https://github.com/Squirrel/Squirrel.Windows/issues/587#issuecomment-387799204