Skip close confirmation

Hi, I first thank you for this wonderful product.

I'm trying to make the AutomaticUpdater to skip my confirmation closing alert.Here is my code :




This is on the FormClosing Event.


        If AutomaticUpdater.ClosingForInstall = True Then              me.Close()        Else            Select Case MessageBox.Show("Sure to quit?",  "B2o", MessageBoxButtons.YesNo, MessageBoxIcon.Question)                Case Windows.Forms.DialogResult.Yes                    me.Close()                Case Windows.Forms.DialogResult.No                    e.Cancel = True            End Select        End If

Unfortunately, the AlertBox is still showing when a user click on "Update now".

Any idea ?

Cheers,

Unfortunately, the AlertBox is still showing when a user click on "Update now".

Any idea ?

Well, yes, remove the alert box. You have a bunch of unnecessary code that prompts the user, remove it.

Haha ! I need this confirmation box.

I'm not sure what your question is, then. You want the alert box but you don't want the alert box.

Ok, sorry about that. I'll try to re-explain.

The AlertBox is there to confirm before closing the software.When a user clicks on "Update Now", of course, the AutomaticUpdater tries to close the software to perform the update.

But it has to skip this AlertBox then... Otherwise it can't perform the update.

So my question is, how could I know if the form is closed BY the Updater.I've tried the AutomaticUpdater.ClosingForInstall, but no ...

Cheers,

Well, the AutomaticUpdater will only close your app automatically upon the start of your app. So you can just add a check in the constructor of your form.

But this is the wrong way to go about things. Don't prompt the user when they're about to install the update -- just install the update. If you want to give the user a choice then you should have an option in your app:

[attachment=0]check-for-updates-option.png[/attachment]