Notification of no update and progress of download

Topics: Updater Application Block
Feb 13, 2004 at 10:50 PM
originally posted by: PhilMPerthWA

Hi there,

I would like to implement the Updater Application Block in my windows forms app. It is used by agents who are off-line 99% of the time and when they come online (via internet), they do so over dial-up modem, therefore an update may take over 10 minutes to download.

Therefore polling is undesirable and I want a form that they can explicitly use to check for updates. Starting the update is no dramas, but...

How do I tell if there is NO update. There only seems to be an event for if there is an update. I want to give them a message ASAP if I know there is no update, after checking once. Even a synchronous call returning true or false would do me fine.

How could I implement a progress bar of the download? Do I need to implement my own downloader (maybe based on HTTPDownloader by Estrada) raising events when data is received?

Has anyone crossed these bridges before?

Could someone with experience advise if Jamie Cool's older component would serve me better?

Thanks in advance.

Cheers,
Phil M.
Feb 14, 2004 at 7:38 AM
originally posted by: wsabey

We added the event UpdateNotAvailable. See this thread for the updater code: http://www.gotdotnet.com/community/messageboard/Thread.aspx?id=114098

Since our app updates are fairly infrequent, rather than test the web server first at each startup we decided to add a flag to the database to tell us that we need to go to the web server for the upgrade. In our case, there is no overhead since the flag is retrieved during the user login process. http://www.gotdotnet.com/community/messageboard/Thread.aspx?id=181604

We did not implement a progress bar, we defaulted to an hourglass and limit the screens they can access. During the wait, if it takes longer than 5 minutes we prompt the user in case there were errors that we didn't detect that may have stopped the process.

Feb 14, 2004 at 5:58 PM
originally posted by: PhilMPerthWA

Thanks for the quick reply. That solves half the problem very easily.

The progress bar will be quite important for my application update.

My vision is to have an update feature in my application, performing both a "data update" and an "application update".

The "data update" is already coded. It uses a web service which returns a dataset of applicable database updates, which is then saved into the local MSDE database. This uses a SOAP extension on the client side to increment a progress bar based on the response stream contents.

It would seem silly if the application update to be performed straight afterwards did not also implement a progress bar as it could take 10 minutes or longer over the dial up connections to be used.

The user will be keen to know how much longer they need to be connected, as they will want to disconnect and get back out on the road!

All help very much appreciated.

Phil M.
Feb 16, 2004 at 6:51 AM
originally posted by: cbarca

>This uses a SOAP extension on the client side to increment a >progress bar based on the response stream contents.

Can you post or send-me code for this function ????

Thank's

Clab
Feb 16, 2004 at 5:49 PM
originally posted by: PhilMPerthWA

Hi Clab,

I based my code on this article:
http://msdn.microsoft.com/library/en-us/dnservice/html/service11052002.asp

I have customised it into two web service methods. The first collates the data for a specific user based on a last updated date and creates the dataset and plop this into session (some would call this lazy). I then serialise this into XML and get it's size. This size is the return value from the first web service method.

The client uses this to set the MaximumValue on the progress bar. The SOAP Extension then reads bytes from the stream and calls a delegate to increment the progress bar with the number of bytes received.

There is a slight difference in the total bytes serialised via normal XML and the total bytes transmitted with the same data inside a SOAP envelope, but this is only slight and doesn't effect the visual progress much.

If you want my code (ported to VB.NET) then I can e-mail it as there are quite a few different bits. Apart from the above changes, I have used the logic from the MSDN article.

Cheers,
Phil M.
Feb 16, 2004 at 5:58 PM
originally posted by: PhilMPerthWA

Just to let you all know, I am basing my application update on Jamie Cool's component, because I can customise it quicker and time is of the essence.

MS Developers: It looks as if the Updater Application Block is excellent for applications that are on a LAN (ie always connected with good bandwidth). Perhaps the next version could also give some thought to applications that are predominantly off-line or connected over low/expensive bandwidth.