Problem with updatingSolved

I'm having trouble with updating my application. When I check for updates, it downloads them and says it will be installed the next time the application is opened. The next time I open it, nothing appears.

Please Help.

Thanks,Mitch

Hey Mitch,

Are you making a Windows Forms application? If so, in the "Program.cs" file, are you using "Application.Run(new FormName())" or are you using "new FormName().Start()" ?

Hey Mitch,

Are you making a Windows Forms application? If so, in the "Program.cs" file, are you using "Application.Run(new FormName())" or are you using "new FormName().Start()" ?

I'm using Application.Run(new MainForm());

OK, when you start your application after the AutomaticUpdater says "the update will install on the next start", is your app still running in the background? Also, has wyUpdate started?

OK, when you start your application after the AutomaticUpdater says "the update will install on the next start", is your app still running in the background? Also, has wyUpdate started?

All I see in the process list is the .vhost.exe of my application, but not the application itself. I did not see wyUpdate start.

So it starts but closes immediately? Is your application crashing? Try running your application from a debugger.

So it starts but closes immediately? Is your application crashing? Try running your application from a debugger.

The application doesn't close when I start it up, it just doesn't show the form. Same thing happens when using debug. When the application is run the first time, a settings form is shown. Meanwhile, the main form shows that it is downloading the update. After it says that it will be installed the next time the application has been started, I restart the application. After restarting it, all it shows is the settings page, not the main form, nor wyUpdate. Once I fill in the settings page and click submit, it shows nothing. I tried restarting, but it still doesn't show anything.

The AutomaticUpdater assumes that you're adding it to the main application form. That is, the AutomaticUpdater will always be on the form that starts first. There are lots reasons for this design decision, you can check out the source code if you want to know exactly why this is necessary. The short explanation is that when there's an update pending, and the form with the AutomaticUpdater starts, the AU will see that your app has an update pending and immediately call Application.Exit() and tell wyUpdate to begin updating.

It sounds like you have 2 separate forms that run on startup. This is probably causing the problems. My advice is to use only a single form and run everything from that.

The AutomaticUpdater assumes that you're adding it to the main application form. That is, the AutomaticUpdater will always be on the form that starts first. There are lots reasons for this design decision, you can check out the source code if you want to know exactly why this is necessary. The short explanation is that when there's an update pending, and the form with the AutomaticUpdater starts, the AU will see that your app has an update pending and immediately call Application.Exit() and tell wyUpdate to begin updating.

It sounds like you have 2 separate forms that run on startup. This is probably causing the problems. My advice is to use only a single form and run everything from that.

Ok, it now only starts with one form, but now it gives the error:

Process with an Id of xxxxx is not running.

I'm going to need more information than that, when exactly is that happening?

I'm going to need more information than that, when exactly is that happening?

Once the application starts it shows that error. I found out why it wasn't working though. I had it so that every time it starts up, it checks for updates, using ForceCheckForUpdate(true). I removed that and now it works.

Is there any way I can have it check for updates on every startup, but still have it work right?

Yes, but why do you want to check for updates on *every* startup? What if your user opens your application 20 times a day -- do you really need them to check 20 times a day? Just set the "DaysBetweenChecks" property to 1.