PDA

View Full Version : Call APPUPDATE and wait for completion of update



John Lacher
11-19-2002, 04:41 PM
I am using VB code below to call AppUpdate when my application starts. I need to wait until update is complete before continuing with opening files in my app. How do I wait until AppUpdate has completed?


=======================================
Dim pAgent As Object
Set pAgent = CreateObject("DWUpdateService.Agent")
pAgent.AppUpdate "{999999AA-99AA-99AA-9AAE-999AA9999999}", 1
'1 is value of AppStart

Chris Woerner
11-19-2002, 04:53 PM
Couple of ideas for you....

First, AppUpdate() will always return immediately to your application, so that won't allow you to wait. You will have to use other calls. Try something like....

1. Call HasMessages(). If you get a positive return, you can prompt your users that an update is required. You can launch autoupdate() and close your application. AutoUpdate() will download and run the update installation. At the end of the update installation, you can relaunch your application.

-or-

2. Just call AutoUpdate(). It will return events back to your application with the download progress and when the installation starts. The catch is that we can't yet send you an event for the end of installation. We are still working on that.

QDizzle
12-08-2003, 04:50 PM
Does this mean, that if HasMessages returns true there are definitely updates? Or could there be other types of messages being returned?

Chris Woerner
12-09-2003, 04:07 PM
HasUpdates will return true if any update is available. I guess, I should have posted...

Call AutoUpdate() with nOptions set to 1. If you get a positive return, you can prompt your users that an update is required. You can launch autoupdate() and close your application. AutoUpdate() will download and run the update installation. At the end of the update installation, you can relaunch your application.