This project is read-only.

Check for updates

Nov 6, 2014 at 5:09 PM

Is there a way currently to split the update operation into two steps, first check for updates and the perform the update at a later time?

I would like to report the fact that updates are available to my users and only perform the update when requested to by the user.

Nov 6, 2014 at 5:26 PM
Edited Nov 6, 2014 at 10:29 PM
Hi Adrian,

To clarify - when running the console app or the embedded check from inside your app? The update check when you embed sidewinder inside your app could also do with a change as well; when it checks it does the download as well - ideally I'd restructure it to do the update check, report back to the host app and let it make the decision (maybe after some user input) about whether the update should proceed.

For the console app, should be possible - a new command line switch, /reportupdateonly (something like this), split the update into an IsAvailable/DoUpdate and based on the switch just short circuit the update pipeline steps to skip the actual update.

How should the app report an update - do you need something in the exitcode so it can be used in flow control? or just "reported" in the logging output?

Pretty big reorg but I think a good idea...

Nov 7, 2014 at 10:31 AM
I'm talking from the point of view from inside my app.

I had a quick look through the code and figured it would be something like adding a new ReportUpdateAgent, and splitting GetNuGetPackages into two parts.

So the DefaultUpdateAgent would just need to change GetNuGetPackages to be something like FindNuGetPackages, then DownloadNuGetPackages while the ReportUpdateAgent would only go as far as FindNuGetPackages. Then maybe a third update agent to continue the update process after Report.

In terms of reporting I figure the exit code would indicate that updates are available and the list of TargetPackages would be exposed from the context. This list can then be presented to the user who can select which updates they want to apply, any not required updates are removed from the list which is then passed on to the final Update agent to complete the process.

Does that sound feasible?
I'll hopefully get some time to look at the code in more detail in the coming days.

Nov 10, 2014 at 10:33 PM
I just made a pull request.

I got it working sufficiently for what I need at the moment but I'm sure it could do with some cleanup. I basically just created a ReportOnlyUpdateAgent and copy and pasted the bits I needed from the existing GetNuGetPackages. I left GetNuGetPackages as-is but I figure it would be better if these were re-factored to avoid duplication.