Problem self-updating (updater stuck)

Hello

I have run into another problem. I have the following setup:

Version 0.9 of my program and a 0.10 update. My program is set up to look for wyUpdates for my own version of wyUpdate (for it to be signed).

I have version 2.6.10 of wyUpdate distributed with my 0.9 version of the program and made a 2.6.11 version of wyUpdate to test update of wyUpdate.

I have taken the wyBuild signing key from my wyUpdate project and used that for my program. Otherwise I would get the dreaded sha1. Maybe this should be documented in the rolling your own version of wyUpdate also?

I then run my program and do a check for update. It then correctly finds out that there is a new update for wyUpdate, it downloads that and then I select update now. Then it shuts down my program, tries to update wyUpdate, but can't because it's in use. So clearly self-update is not working. After killing the updater (or cancel) I start up my program again, and it will try to update wyUpdate. There is no escape Just imagine if I had rolled this out!

Even uninstalling the program and installing it again will not make it forget that it has an update. I have found out that I can make it "forgot" about the update by adding a fubar client.wyc (from the updater). But I havn't found out anywhere where I can "clear the cache".

I have even tried just copying in the wyUpdate version for 2.6.11, just to see if it was a problem with 2.6.10, but that didn't change anything.

If I run wyUpdate it will update my program, but running the program will again try to update wyUpdate that again will fail.

I have taken the wyBuild signing key from my wyUpdate project and used that for my program. Otherwise I would get the dreaded sha1. Maybe this should be documented in the rolling your own version of wyUpdate also?

No, because this is wrong.

I then run my program and do a check for update. It then correctly finds out that there is a new update for wyUpdate, it downloads that and then I select update now. Then it shuts down my program, tries to update wyUpdate, but can't because it's in use. So clearly self-update is not working.

You're the second person to do self-updates like this, so there must be something dreadfully unclear in our How to make a custom version of wyUpdate article.

In your custom wyUpdate project you will never be clicking the "Build wyUpdate" button and you will never use the client.wyc file built from this project. From what I read, that's exactly what you're doing.

Here's how you do self-updates:

  1. Create your custom version of wyUpdate.
  2. Create a project in wyBuild, change the version, add your custom version of wyUpdate.
  3. Add a download site where your updates will be stored (e.g. http://example.com/custom-wu/%file%)
  4. Build the updates, upload the updates.

Now, in your application wyBuild project:

  1. Click "File -> Properties -> wyUpdate"
  2. Add the server site where wyUpdate will look for self updates (e.g. http://example.com/custom-wu/wyserver.wys ) -- notice how we explicitly stated the filename (wyserver.wys) instead of using the %file% variable.
  3. Click OK
  4. Click "Build wyUpdate" button.
  5. Now include this client.wyc file with your app. Included in the client.wyc is a reference to your custom wyUpdate self-update location.

Notice how we didn't touch any of the update signing. Also notice how we didn't click "Build wyUpdate" in our custom wyUpdate wyBuild project.

Does this make sense?

The only reason why I changed the signed key was that update of wyUpdate was not working. And the last part of the FAQ hints that I should use the same key.

The only reason why I used the client.wyc from the update, was that I was totally stuck. I didn't know how to clear the cache. So to answer my own question, the cache is stored in homedir/wc.

I will continue to investigate now that I can clear the cache...

Ok I seem to have been able to get further a bit.

I think that the problem is that maybe the update to wyUpdate is wrong somehow. It seems that it maybe wants to update wyUpdate.exe twice, once as self-update and one as an ordinary update. It does acually do a self-update (I can see the new file size), but then tries to do a "normal" update of wyUpdate afterwards and then fails. If I just run the new wyUpdate.exe again myself, it seems that it cancels the update and then does the "normal" upgrade to the program.

So it appears that there is something wrong with my updates for wyUpdate. When I look at the wyupdater.net4.2.6.10.to.2.6.11.wyu file it is 110KB, which seems rather large. I have been looking in the wc update dir and it looks like this:

base/wcUpdate.exeselfupdate/base/wcUpdate.exe

This looks wierd.

The way I did the wyUpdate update was that I simply added a new version, 2.6.11, and in that I added the new wyUpdate.exe file. Just like I did for my first version of wyUpdate.

You're still using the client.wyc from the self-update wyBuild project instead of the client.wyc from your app's wyBuild project. I know this because in the "base" folder should be your app's files, not "wcUpdate.exe".

You're still using the client.wyc from the self-update wyBuild project instead of the client.wyc from your app's wyBuild project. I know this because in the "base" folder should be your app's files, not "wcUpdate.exe".

I have double and tripled checked this. I just rebuilt the client.wyc and still the same. My client.wyc from my program is available here:

http://people.iola.dk/anders/client.wyc

And here is my wyp file just in case:

http://people.iola.dk/anders/nemodocs.wyc

Thanks

I have discovered something else that is very strange.

It seems that it is half-way able to update on win7. It was failing for me on win xp. Let me explain what I mean.

The premise is that there's an update to my program and to wyUpdate.

So since I'm rolling my own wyUpdate I have changed the wyUpdate update url in properties for my programs build. If I then check for update, it will says that my program update is available (so far so good). I do the update. It install something correctly, but when my program restart I see that what it installed is wyUpdate (2.6.11), none of the files for my program is changed and doing a check for update then says that I'm up2date. Seems like this last point is caused by my client.wyc file to be overwritten.

Now, leaving out the wyUpdate update url and doing the exact same thing again, it will update my program correctly and everything is all dandy.

I really don't get it. I have looked over the rolling your own wyUpdate page a million times and tried I don't know how many things. It just seems broken to me.

There's a couple places you might be tripping up. Did you update the version of both wyUpdate.exe (in Assembly.cs) and the version in the self-update wyBuild project? Are you only including the single new wyUpdate.exe file in the wyBuild self-update project?

Try running it entirely by double clicking wyUpdate.exe (i.e. not through the AutomaticUpdater).

What i did to build wyUpdate was that I downloaded the source code for 2.6.10 and 2.6.11. I built them both without doing any modifications. Then I signed both using the same key that I use to sign our installer for our program. That is the files I have used for updates. I have only included 1 file, the wyUpdate.exe file, in the wyBuild project for wyUpdate under the "Your program's folder".

I'll test without automaticUpdater now on win7 and xp.

Doing everything from wyUpdate.exe gives exactly the same result. It also says: update available for program, then goes onto updating wyUpdate and lastly says that wyUpdate was updated. The program is not updated and when I run wyUpdate.exe again it says that the program is up2date.

I even tried rebuilding wyUpdate.exe 2.6.10 and 2.6.11 from source again, this time not signing and I get exactly the same result.

We're going to re-write the tutorial and make it explicitly clear.

Thanks, but I still have no idea of what the problem is

Ok I have just tried it once again. I really want to get a new version out with this updater so any help would really be appreciated. On win xp I tried redoing everything again and this time it almost worked.

I used wyUpdate to check for updates, there was an update for my program. Click install and I can see that it has updated wyUpdate. Then it tries to update wyUpdate again and I have to press cancel. After this I do an update again and this time it completes the update of my program. So almost there.

Thanks, I really hope we can get this fixed. I'm so close now.

Bump.

Would it help anything if I built a simple hello world app and gave you a wyBuild project for that and wyUpdate? One that easily demonstrates what the problem is?

That would help us solve your problem, yes. We're still working on the updated "wyUpdate self-update" article that will clarify the steps. We haven't forgotten about you.

Thanks a lot. I'll get onto that later today then.

I have generated a console app that demonstrates the problem and sent it to support@wyday.com.

I hope that will help you/us find out what the problem is. If you need anything else please just write.

Thanks!