Update woes

Hi guys,

You may have solved the issue my client was having this morning in the forum post https://wyday.com/forum/t/502/bug-in-automaticupdater/ , however I would like to check the situation with you:

Here's the situation which occurred:

1) The client starts our application on their computer.2) On the first screen of the application there is the updater control. The application fails within around 2 seconds of this form being open, i.e. the application crashes. 3) Client calls me on the phone "What's going on!!!!" b) I panic4) I ask the client have you tried opening the application a second time just in case, client assures me that they have tried several times.5) I then ask the client to run the wyUpdater.exe found in the same folder. 6) The client runs the wyUpdater.exe and the updater proceeds to download the entire application again, not just the last patch, so possibly this software was older than the last patch.

*Point is so far the wyUpdater.exe was able solve the issue, the updater control just kept closing the application*

7) After the wyUpdater.exe had completed downloading and installing the update, I then asked the client to run our application.8) This time the application runs, but the updater controls carries the message "Failed to get [or check] for updates" (Im not sure of the complete message, since the client told me on the phone, I've since forgotten if it said failed to check or failed to get)9)....However this time the application does run.

Enlightened ones do tell us what caused this and whether any remedy is necessary, or whether "2.6.11.2 which will be out either today or tomorrow" will solve this issue.

Most gratefully yours,

David (aka Installhunter)

Hey David,

The AutomaticUpdate 2.6.11.2 is out. Were you leaving the changelog blank for your updates, because that's the crashing bug that was fixed? Can you give me more details on the crash? That is, was there an exception?

7) After the wyUpdater.exe had completed downloading and installing the update, I then asked the client to run our application.8) This time the application runs, but the updater controls carries the message "Failed to get [or check] for updates" (Im not sure of the complete message, since the client told me on the phone, I've since forgotten if it said failed to check or failed to get)

This is caused by the AutomaticUpdater state file being in the wrong state. It was cause because the AutomaticUpdater thinks it's about to update the old version of your app when instead the apps was already updated by wyUpdate.exe. You can solve this by clearing 2 folders on the customer's machine: "%appdata%\wyUpdate AU" and "%userprofile%\wc"

*Point is so far the wyUpdater.exe was able solve the issue, the updater control just kept closing the application*

If I were to guess the cause I'd say that the AutomaticUpdater was trying to close you application for installation and your app was trying to access an object that was null.

Here's how the AutomaticUpdater closes your app when a new update is about to installed:

  • The AutomaticUpdater finds out it needs to close for install from within your form's constructor.
  • It notifies wyUpdate (asynchronously) that it's about to close
  • wyUpdate responds (asynchronously) that it's ready to begin updating and your app can now close
  • The AutomaticUpdater calls Application.Exit() on your app (it usually happens less than a second after the form constructor has been created)

Can you reproduce this error on your machine? If you could I could track down the exact error.

Hi Sam,

You wrote:"Were you leaving the changelog blank for your updates"

I don't know, how can I tell?

You next wrote

"This is caused by the AutomaticUpdater state file being in the wrong state. It was cause because the AutomaticUpdater thinks it's about to update the old version of your app when instead the apps was already updated by wyUpdate.exe. You can solve this by clearing 2 folders on the customer's machine: "%appdata%\wyUpdate AU" and "%userprofile%\wc""

What put it into the wrong state? I cant really visit clients sites to make these changes, would wyUpdate.exe not sort this out automatically?

I will try to reproduce this error on my machine over the weekend.

*Point is so far the wyUpdater.exe was able solve the issue, the updater control just kept closing the application*

If I were to guess the cause I'd say that the AutomaticUpdater was trying to close you application for installation and your app was trying to access an object that was null.

Here's how the AutomaticUpdater closes your app when a new update is about to installed:

  • The AutomaticUpdater finds out it needs to close for install from within your form's constructor.
  • It notifies wyUpdate (asynchronously) that it's about to close
  • wyUpdate responds (asynchronously) that it's ready to begin updating and your app can now close
  • The AutomaticUpdater calls Application.Exit() on your app (it usually happens less than a second after the form constructor has been created)

Can you reproduce this error on your machine? If you could I could track down the exact error.

I don't know, how can I tell?

Open your wyBuild project, go to the "Update Information", and see if the "Changes" textbox is empty.

What put it into the wrong state?

wyUpdate has 2 modes "standalone" mode and "auto-update" mode. wyUpdate is started in "auto-update" mode by the AutomaticUpdater. When you start wyUpdate in "standalone" mode (i.e. you double click the file) it doesn't know about the updates cached by wyUpdate in "auto-update" mode. Thus, the old cached update files remain.

I cant really visit clients sites to make these changes, would wyUpdate.exe not sort this out automatically?

Yes, if you were to update with wyUpdate completely using the AutomaticUpdater then it would cleanup all the unneeded files. You can create a simple batch file to delete the contents of the "%appdata%\wyUpdate AU" and "%userprofile%\wc" folders.

I will try to reproduce this error on my machine over the weekend.

When you try to reproduce it, let the AutomaticUpdater download and extract. Then, when it says "The updates will be installed on the next start", close your application then relaunch your application. If everything was to go correctly, your app would then close immediately and wyUpdate would show.

I was leaving the change log empty, I'm glad to hear that this has been fixed.

Sorry about the bug.

Thats OK, hwo do I know whether the wyUpdate.exe on the clients computer has been updated so that this issue on the clients computer would not remain.

Well, the bug was with the AutomaticUpdater. So, rebuild your app with the latest AutomaticUpdater.dll (2.6.11.2).