Allow WinForms application to close on update?Answered

I have a WinForms c# app that confirms with the user before closing if they want to close. I tried using 

private void MDIParent_FormClosing(object sender, FormClosingEventArgs e)

        {

            if (!automaticUpdater1.ClosingForInstall)

            {

                if (DialogResult.Cancel == MessageBox.Show("Are you sure you want to close the GFIT?", "Close GFIT?", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation))

                    e.Cancel = true;

           {    

        }

But it always comes back as false and it seems like that's not the right property to use here. Is there a way to know if the user has clicked “update now"?

, edited
Answer

We recommend using wyUpdate directly to update your app. The AutomaticUpdater is too hard for people to use correctly and we're dropping support for it. It will not be present in the next version of wyBuild.

Oh no!  It's taken me 2 years to get it to work and I finally got it working.  It works perfectly.  Granted it wasn't two solid years.  I'd mess with it for a day or two here or there and get frustrated.  But it was actually an issue in how my program would restart after an update that was causing the issue.  Not wyupdate.

That's why we're just recommending using wyUpdate going forward. It's straightforward. No knobs. No dials. Just does its job and gets out.

I've watch the videos and read the new release work flow and I have a couple questions regarding using wyudate directly.  

So you're saying the best method is to call and launch wyupdate from within my app? Any best practices of running at launch or close? 

And I can run it with the /quickcheck /justcheck /noerr switches on launch and if the exitcode is a 2 then I can continue to handle (user notification, exit, etc) it within the my application, correct?

Answer

So you're saying the best method is to call and launch wyupdate from within my app? Any best practices of running at launch or close? 

Yep.

Probably on launch.

And I can run it with the /quickcheck /justcheck /noerr switches on launch and if the exitcode is a 2 then I can continue to handle (user notification, exit, etc) it within the my application, correct?

Yep.