Wow... Thanks so much. That was very helpful. It's still not working correctly, but it's working 'better'.
Here's what I did to test the update feature...
Created v1I published from Visual Studio a v1 of my program.I added these files to the v1 tab in wyBuild.I created a wyUpdate for inclusion.I added these two files to the published folder.I created a file list and made a setup.exe file
Created v2I then published from Visual Studio a v2 of my program.I added these files to a new v2 tab in wyBuild.I created a wyUpdate for inclusion.I added these two files to the published folder.I created a Build Update and uploaded these 3 files to my web server.
Cleaned up FilesI cleaned up everything from previous installations and testing.I uninstalled my program and deleted both of these folders:- C:\Documents and Settings\YOURUSERNAME\wc\- %appdata%\wyUpdate AU\(I'm running XP)
I now ran the setup.exe file of v1 to install the program.And clicked on a button in my program that forces a check for update.
This creates a form (UpdateForm) that only has the AutomaticUpdater control on it.
UpdateBox = New UpdateFormUpdateBox.ShowInTaskbar = FalseUpdateBox.WindowState = FormWindowState.MinimizedUpdateBox.Show()UpdateBox.Hide()AU = UpdateBox.AutomaticUpdater1AU.KeepHidden = FalseAU.DaysBetweenChecks = 1AU.wyUpdateLocation = "wyUpdate.exe"AU.UpdateType = wyDay.Controls.UpdateType.AutomaticAU.WaitBeforeCheckSecs = 5AU.Name = "AutomaticUpdater"AU.wyUpdateCommandline = Nothing
(where AU is defined as: Friend WithEvents AU As wyDay.Controls.AutomaticUpdater)
and then it calls the check for update command:
AU.ForceCheckForUpdate()
So far everything is working and it finds the update and continuously triggers the processed changed event and downloads the smaller patch from my website. Awesome.
Private Sub AU_ProgressChanged(ByVal sender As Object, ByVal progress As Integer) Handles AU.ProgressChanged
After the download is complete this gets called:
Private Sub AU_ReadyToBeInstalled(ByVal sender As Object, ByVal e As System.EventArgs) Handles AU.ReadyToBeInstalled
Where I set a flag that elsewhere in my program indicates that we need to show a dialog box asking if they want to update when it's an appropriate time to exit the program.
Once this dialog is displayed and the user selects "Update" I call this:
AU.InstallNow()
I also set an UpdateSystem.Shutdown flag that I use to force the main form closed:
Private Sub MainForm_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
If UpdateSystem.Shutdown = False Then If Engine.Shutdown = False Then e.Cancel = True Engine.ShutdownRequested = True End If End If End Sub
Since shutdown is true, the e.Cancel remains false and the program closes.
Here's where the problem occurs...
wyUpdate.exe is still running (as confirmed by the Task Manager) and it seems to hang.
wyUpdate.exe never finishes or closes and the program is never restarted.
Interestingly if I manually close wyUpdate.exe and run my program again the Update Check will fail. Running it a 3rd time and the update is detected (as already being downloaded) and I'm asked if I want to update. Which closes the program and results in wyUpdate.exe hanging. If I run it again the update check will fail and the cycle repeats itself.
I'm also seeing that if I choose not to call AU.InstallNow (because of the AU.ReadyToBeInstalled being called) that the event AU.ReadyToBeInstalled is called again almost instantly.
Then, when either the "UpdateFailed" or "UpdateSuccessful" events are called, you can set the "UpdateType" back to "DoNothing" if you don't want the AutomaticUpdater taking care of all the details for you.
[/quote]
I'm checking for these, but don't see that these have ever been called in all of my testing.
Let me know if there's anything else I can provide that would be of help.
Thanks again for your help. It's going to be awesome when it works.