Get client version and server version

Is there any way to get client version and server version before update? I checked AutomaticUpdater.Version value, it's always null. Thanks for feedback in advanced!

Hey Jones,

The new version is available using the Version property in either the UpdateSuccessful and UpdateAvailable events. All other times you'll either have to cache the version number (your existing version and the new version).

Does this make sense?

Thanks for your reply!

The new Version scenario is fine.In some reason I need to get the current client version info from the client.wyc, is it possible?Furthermore, is there a way to actively query the server version instead of waiting the events notification (exp: UpdateAvailable)?

In some reason I need to get the current client version info from the client.wyc, is it possible?

We're introducing a "client.wyc" reader with wyBuild 2.6.15, so you'll be able to view all the internals of the client.wyc file. If you mean "how do I get it at runtime?" then your only option is to parse the client.wyc file. See the wyUpdate source code.

Furthermore, is there a way to actively query the server version instead of waiting the events notification (exp: UpdateAvailable)?

Yes, download the *.wys file from your server and parse the result.

Thanks for your reply.Is it possible to make this feature as properties in AutomaticUpdater control? This control is popular and convenient for .net development.

This feature (checking for updates) is already a part of the AutomaticUpdater.

Sorry I didn't explain clearly.My meaning is to get the client and server version at run time. I know I can parse it from client.wyc and server.wyc directly, but it will be more convenient if this feature is implemented in AutomaticUpdater. Is it possible? Thanks!

The best way to check for updates is to use the AutomaticUpdater's built-in behavior. That is, the asyncronous update checking (i.e. your app isn't "frozen" when it's checking for updates).

The ability to get the "installed" version from the client.wyc file is complicated. We could do it, but let me explain what it would entail:

  • The AutomaticUpdater starts wyUpdate.exe as a background process.
  • The AutomaticUpdater starts talking to wyUpdate and asking it what the "installed version" is.
  • wyUpdate responds with the installed version number.

In other words, it's not the speediest method of getting the current version. Is there any reason you're not embedding the current version in your app (like an about dialog box, the AssemblyDetails, etc.)?

There are several files with the application and each has its version. I only change some of them on every update. Sometimes I only need to update an xml file for a new version and this version is only kept in client.wyc and server.wyc. Every dll or exe file only keeps its own version. The version kept in client.wyc ad server.wyc is the real version of this application. With the above feature I requested, I can show this 'Real' application version in the about dialog. This 'Real' version is different with the embedded version in dll or exe file.

Please let me know if there is any better idea. Thanks!