VB.Net AutomaticUpdater

Hi,I have been trying to get the automatic updates http://wyday.com/wybuild/help/automatic ... et-app.php to work with VB .Net but I keep getting errors in the errors list.

Has anyone got code that works with VB .Net this is now driving me mad.

Thanks,Guido

What errors? (Compilation errors I assume, but could you list them for me?)

Edit: I've added VB.NET examples to the AutomaticUpdater help page. Here's a full example form:

Public Class Form1    Public Sub New()        InitializeComponent()


        ' only load files, etc. when NOT closing to install an update        If Not automaticUpdater.ClosingForInstall Then            ' load important files, etc.            ' LoadFilesEtc()        End If    End Sub


    Private Sub automaticUpdater_ClosingAborted(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles automaticUpdater.ClosingAborted        ' your app was preparing to close        ' however the update wasn't ready so your app is going to show itself        ' LoadFilesEtc()    End SubEnd Class

Tell me if this helps.

Hi,Looks like I should have check what program I was using. I was trying to run automaticupdater with VB 2008 express edition.I have just tried it with Visual Studio and your code works.

Looks like I'll have to go back to the drawing board and start from scratch using Visual Studio this time.

Sorry for making you work at trying to resolve my stupidity!!! lol

ThanksGuido

VB.NET 2008 Express is just a subset of Visual Studio 2008. That is, your program (and the AutomaticUpdater control) should work perfectly in either.

Hi,The errors are InitializeComponent() automaticUpdaterAutomaticUpdater

Error 1 Reference to a non-shared member requires an object reference. path to file 415 13 project name

Error 2 Reference to a non-shared member requires an object reference. path to file 418 20 project name

Error 3 Handles clause requires a WithEvents variable defined in the containing type or one of its base types. path to file 424 121 project name

A few points: the example code assumes you've named your AutomaticUpdater control "automaticUpdater". Also, "InitializeComponent()" should work fine if you only call it once and you call it in the "Public Sub New()" function.

Try starting with an empty form. Add a single AutomaticUpdater control and compile. (Everything should work up to this point). Now, in the Property & Events windows in Visual Studio (or VB Express 08) double click the "ClosingAborted" event. This should create the "ClosingAborted" event handler for your AutomaticUpdater control.

Compile again - everything should still compile fine. One last thing, add this inside your FormName class:

    Public Sub New()        InitializeComponent()


        ' only load files, etc. when NOT closing to install an update        If Not YOURAUTOMATICUPDATERNAME.ClosingForInstall Then            ' load important files, etc.            ' LoadFilesEtc()        End If    End Sub

Everything should still compile. Now you're ready to go.

Hi Wyatt,Thanks for taking the time and trouble to explain to me what I should be doing.This has helped me a lot.I have finally managed to sort it out :-))I can now finally use both autoupdate and wyBuild. I have managed to build a simple form that can be updated using either method.Wow I just need to come up with a good idea of a program that people want to use and update.

Thanks once again,Guido

Since last post have purchased my copy before the price rise. What a bargain!!!Thanks once a gain for a great product.

Great. I'm glad to have you as a customer. If you have any more questions don't be afraid to ask.