The "UpToDate" event doesn't set the version in the event args. You should read the version number from your app. Does that make sense?
I've been using wyupdate for a while now and I'm really pleased with it. I had suggested this feature a while back and since I saw that console apps and windows services can now silently update themselves, I thought I'd do a test to see if a web application could at least check if an update is available.
I'm not entirely sure what's going on but I'm pretty sure wyUpdate is somehow running, but encountering problems. I've copied wyupdate.exe and client.wyc in the root of my web app, then I"ve got a page that will run asynchronously that will try and check if an update is available, like this:
Dim backend as New AutomaticUpdaterBackend()backend.Guid = "My guid from project properties"backend.UpdateType = UpdateType.OnlyCheckbackend.wyUpdateLocation = Server.MapPath("~/wyUpdate.exe")backend.Initialize()backend.ForceCheckForUpdate(True)
I've got handlers for each of the main events, in which I set a value like "An update is available", or "You are currently up to date".
I've simplified it a bit but I hope you get the gist of it. Now, the thing is, the event before_Checking gets executed and so does UpToDate, however, the argument in the UpToDate handler appears to be empty. No exceptions are thrown, I just cannot get any "Version" value from either the events or even the backend object itself. I'm not sure if what I'm trying to do is even possible considering that I suspect the Backend class may silently launch the wyUpdate.exe file and I know that there are severlal security hurdles I"d have to leap just to get that to work.
I'm mainly stuck since there seems to be no error being raised by the backend object. Is there anything (like a log, or method etc) I can use to see what's going on in the backend object?
Thanksjohn
The "UpToDate" event doesn't set the version in the event args. You should read the version number from your app. Does that make sense?
Oh, I should have thought about that. So I assume that I should set the version property in the backend object? Which makes me wonder what the version property in the eventargs is for?
Anyway I'll test tomorrow and post my results, almost bedtime here.
CheersJohn
It's for the UpdateAvailable event. We just reused the SuccessArgs for other events.
Hi Wyatt,Well I can post that it has worked, my page can now indicate if an update is available, however the UpdateAvailable eventArgs doesn't have a property indicating the new version no. So the only message I'd' be able to show would be.
Hi, there's a new update for your current version which is "x.x.x".
While I'd like to show,
"Hi, we have a new update, version y.y.y, please update your version which is x.x.x.
Where can I get the server version that wybuild has detected?
CheersJohn
You mean the version of your software? That's stored in the client.wyc file, and we don't expose it to you in the Automaticupdater because we presume you already have this version embedded in your application.
I mean the new version. The application knows the old version, it just doesn't know the new one (that's in the cloud). I was hoping the UpdateAvailable event would give me the value (via EventArgs), but it doesn't.
This is available using the AutomaticUpdaterBackend, but you're right this is not currently available using the UpdateAvailable event. How important is this for you?