Autoupdate not workingSolved

hi I just bought wyBuild 2 days back. I have too many executable in my software. One application is always running in system tray. I added logic for auto updating the software in executable running in system tray. Now i am able to update software sometime successfully and application running in system tray is also restarted successfully after update. Sometime this application not restarted and closed when wyBuild finds update. when I start this application manually then wybuild updates software again.

I am not able to update my entire software consistently. I spent whole day in this but not able to find any solution.

Can you please help me on this.

Thanks,

If your system tray app has no main form, then I recommend using the AutomaticUpdaterBackend instead of the AutomaticUpdater.

The first thing you should do is read (or re-read) the step-by-step walkthrough. Make sure your updates work correctly just with wyUpdate.exe as a standalone updater. Only once that's working, add the AutomaticUpdater to your app.

If you're still having trouble after you've gone through all that, then I'm going to need to know exactly what's going wrong.

I am using AutomaticUpdaterBackend for doing auto update. And yes i have main form in my system tray application and i want to check updates after every 3 hours. I added timer in my form and in tick event of timer i added code "auBackend.ForceCheckForUpdate();;".

In constructor of the form I added below code

auBackend.UpdateType = UpdateType.Automatic; auBackend.GUID = "guid"; auBackend.ReadyToBeInstalled += auBackend_ReadyToBeInstalled; auBackend.UpdateSuccessful += auBackend_UpdateSuccessful; auBackend.UpToDate += auBackend_UpToDate; auBackend.UpdateFailed += auBackend_UpdateFailed; auBackend.Arguments = "-skipinfo"; auBackend.CheckingFailed += new FailHandler(auBackend_CheckingFailed); auBackend.Initialize(); auBackend.AppLoaded();

This works sometimes perfectly and my system tray application restarted after successfully update. Sometimes my system tray application closed and no updates happens. When I start system tray application again then it updates software.

Please help me on this

First of all, make sure you're not checking for updates in the middle of other steps -- certain instances this can cause a race condition that throws a wrench in the whole process.

Don't do:

        auBackend.ForceCheckForUpdate();

Do:

    if (auBackend.UpdateStepOn == UpdateStepOn.Nothing)    {        auBackend.ForceCheckForUpdate();    }

Also, remove the "auBackend.Arguments = "-skipinfo";" line. The AutomaticUpdater already skips the information page by design.

I did same as you mentioned. I am able to update my application three times from v 2.6 to v 2.9.During all these updates my system tray application started automatically after update.

But fourth time when update happened, system tray application get closed and i have to start it manually. When I started manually then my software gets updated to v 2.10

If you want then I can send my .cs file to you.

Sure, send it to wyatt@wyday.com

Well, I see one big problem. You're using "AppLoaded()" in your form's constructor. This will cause some big problems. Put the "AppLoaded()" function in the OnLoaded event for the form. Also move the timer actions to the OnLoaded event as well.

Its working like a charm now 🙂. Thanks wyatt for you quick help. You saved my lots of time

Hi

Application in which I used automaticupdaterbackend is stopped working again when it founds new update. Once i start application manually then it updates the application and stop again so i have to start it again manually.

Can you please help me again. I have not changed anything. I just encrypted my executable so no one can reverse engineer the application.

I have sent code file via email to you please help me asap

Thanks

Try removing the encryption, tell me if that works. Some of these "protectors" actually screw things up that the AutomaticUpdater depends on.

I check it by removing the encryption. But sometimes my application gets closed and software is not updated. When I start manually then only it updates. It happens 1 time out of 6 try. I am very upset with this behavior of wyBuild.

I have to give release to client on Monday with auto update feature so can you please help me on this inconsistentbehavior of wybuild please

I'm going to need many more details to help you debug the problem.

When I start manually then only it updates.

When you start *what* manually? wyUpdate? Or are you talking about leaving the update installation to the next restart of your app vs. forcing the installation immediately?

Why the update fails to be installed, is there an error? Exactly what happens? Does wyUpdate start? Does your app close? Is there an error recorded? I see (from the code you sent me) that you're using the AutomaticUpdaterBackend in your tray app, but are you also still using it in your Windows Service? If you're using it in both you can get some pretty nasty problems (because they will be literally falling over one another to update your app -- this is very bad).

Let me explain you what problem i am facing.

First I am using AutomaticUpdaterBackend in my tray application only. I am not using window service now.

My application name is "SendScannerData" and i did all code for updating the software using AutomaticUpdaterBackend in this application. Now in my software many applications are running at one time. so i am killing all the apps in auBackend_ReadyToBeInstalled event. I am not killing tray application.

See code below

if (auBackend.UpdateStepOn == UpdateStepOn.UpdateReadyToInstall) { // here we'll just close immediately to install the new version KillRunningApplications(); auBackend.InstallNow(); }

My all running applications are killed, when new updates are found by AutomaticUpdaterBackend. Now my tray application is also closed when new updates are available. But wyupdate.exe UI is not shown after that. Also i put errorlog in auBackend_UpdateFailed but this event is not called.

Now when I run my tray application again manually then wyupdate UI displayed on screen and software gets updated successfully.and software is updated instantly as I am starting the tray application manually.

My operating system is window 7 64 bit.

Let me know if you need any more information

My all running applications are killed, when new updates are found by AutomaticUpdaterBackend. Now my tray application is also closed when new updates are available. But wyupdate.exe UI is not shown after that. Also i put errorlog in auBackend_UpdateFailed but this event is not called.

Open the task manager (Right click your task bar and click "Start Task Manager"). Is your app actually being closed? Also, is wyUpdate being started? Lastly, add event handlers for the other "Failed" events, it might be one of the other ones.

I have removed my code now for killing the application.

Then also my tray application not starting when new updates found. And this is not happening every time. It happens sometimes only. Also at one time I have to start my tray application two times to get updates by wybuild.

Below is step by step detail.1) when new updates found, my tray application closed. Also wyupdate.exe starts and closed without updating software2) I started tray app manually then wyupdate.exe starts instantly and closed without doing update. Also my tray app closed also.3) I started tray app again then my software updated successfully

From 5 updates, this happens 1 time only. Four time software updated successfully and one time above thing happens 🙁. And it happens randomly so I am not figure out what to do

Without seeing your full code, I won't be able to debug what the problem is. The first step is to make the "ForceCheckForUpdate()" longer -- don't do it every 5 minutes. At the most check for updates once a day.

As far as debugging the problem, I will need to see your full source code. Or reproduce this problem on a smaller scale. Make a small project that reproduces this problem.

can you please tell me if i want to kill all running apps in my software then in which event i have to call function for killing all the running apps? Because I do not want popup from wyupdate to close running apps?

Also if my running app is not in new updated files then also i have to kill that app?

can you please tell me if i want to kill all running apps in my software then in which event i have to call function for killing all the running apps?

Yes, all your *exe files in the folder you're delivering updates to must be closed. You don't have to kill the *.exes, but they must be closed. That is, you can gracefully notify your user that the updates will be installed when they close "A, B, and C". Or you can just wait until they close the apps.

Forcefully killing the exes is in very bad form. You must always think about end-user happiness.

Also if my running app is not in new updated files then also i have to kill that app?

All exes in the folder being updated must be closed. This is by-design.

Actually I do not want to give prompt to user for closing the process.As per my client requirements, all things should happen automatically and as per his requirements, autoupdate should happen at midnight. That is why I want to kill apps before running updates.

I know forcefully killing apps is bad idea but its my client's requirements. So can you please tell me in which event of autoudpater, my code for killing apps will work without affecting updates.

Kill the processes before you call InstallNow(), like you were doing. If you're still have problems then reproduce the problem in a small project and send it to me.

Thanks Wyatt for your superb help.

I added code for killing apps before installnow() and now its working fine. I am testing from last 2 hours and all is working perfect. All running apps are closing correctly as well 🙂

Also i set proper permission in my setup folder so window 7 will not prompt me for UAC as well 🙂

Some questions:1) I am using autoupdater control in my tray app. If I hide that control in form then will it create any problem?2) I am doing updates based on LastCheckTime of autoupdater control. Now if checking for updates failed because of some problem then will it be changed to new datetime or LastCheckDate will be changed only after successful execution?3) If i am not wrong Autoupdater control's lastcheckdate will not change even if I install software again. Is this correct?4) I want to change branding in the wyupdate app UI to my client's company name. I downloaded code for wyUpdate.exe from google code. But i think that code is in .net 3.5. My application is in 2.0 only and i am installing .net 2.0 only from my application setup. so can you please tell me from where I will get latest code for wyupdate.exe in .net 2.0. Or If I build VS 2008 code by changing target framework to 2,0 then will it work in computer with .Net 2.0 only

Thanks Again for your help