Question

One of my hobby applications uses a SQLite back end to store the application data. The application is setup so that the user can click the typical "Check for Updates" button, which will query a webservice to see if an update is available. If it is, the user clicks the "update" button and downloads a the new database (via HTTP) which then gets installed in the application. This process is currently "modal" in that the user cannot do anything else in the application until the download and install are complete.

I'm working on updating the application, and one thing I want to make happen is to have this update process occur behind the scenes, ala Windows Update. When the application fires up, the service would be queried, and if an update is available, it would automatically be downloaded, but in the background so the user could continue to do their work. Once the download is complete, the user would be prompted to install the update.

I've looked extensively into BITS, and even though there are no APIs I've seen to date to leverage the technology, I have seen some sample code and believe I can make it work.

But is this the best away to approach a "background update" for a data library, or are there some other solutions/approaches out there?

Was it helpful?

Solution

If you are only running on MS Windows, and your clients are using a new enough version of the operating system to support BITS, then I think certainly you should leverage the functionality already built into the platform, rather than doing what everyone else does and write your own background update checker that sits in my taskbar notification area and uses system resources unnecessarily.

As for information about BITS:

About BITS

BITS Reference

Background Intelligent Transfer Service, From Wikipedia

OTHER TIPS

I'm the PM for the BITS team in Windows -- yes, the BITS technology is a good fit for lots of times when you need to download (or upload) data in a way that's friendly to the user. BITS tries to be careful about hogging network bandwidth, the current power status, and network costs, and will automatically retry downloads on failure. We've also just created a new sample BITS Manager program on GitHub for everyone who programs in C# and .NET!

This really feels like you should be considering Sync Framework http://msdn.microsoft.com/en-us/sync/bb736753.aspx rather than BITS.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top