PDA

View Full Version : app startup



shanes
01-23-2003, 12:57 PM
I use the following code to check to see it if it is time to check for an update. Sometimes (most of the time) IE fails to load. It just coninutes on into my program. Any thoughts on what I can do to fix this.

Sub check_time()

Set pAgent = CreateObject("DWUpdateService.Agent")
Dim Response As VbMsgBoxResult
If pAgent.HasIntervalElapsed(productcode) Then
Response = MsgBox("Check for updates to this application?", vbYesNo)
If Response = vbYes Then
pAgent.DisplayScheduledMessages (productcode)
End If
End If

End Sub

Chris Woerner
01-23-2003, 02:12 PM
The logic of your code seems fine. One small suggestion...

You don't need to call DisplayScheduledMessages if you know that the interval has elapsed. You can call DisplayMessages. The only difference between the two is that DisplayScheduledMessages checks the interval before launching IE.

Is it possible that the check to HasIntervalElapsed is setting the lastcheckdate (it shouldn't). Try this....

when you see the dialog box asking to "check for updates..", look at the lastcheckdate in the local INI file and see if it has been updated to today.

program files\installshield installation folder\update service\database\{your product guid}.ini

One other suggestion is that you should check for an internet connection. You can do that by adding a call to IsConnected before calling or DisplayMessages. Or call AppUpdate (menu property) instead of either DisplayMessages. AppUpdate will check for an internet connection automatically.