How to know the installed current version of the client

Hi all ,

I have a problem getting the current version of the wyUpdater by code . I use the Version property of the AutomaticUpdater control but it returns null all the time , also if I check the UptoDate event args also it return null .

Any help .Thanks in advance ...

We don't have a built in way to get the version of the AutomaticUpdater or of wyUpdate programatically. However, this snippet of code will work:

string wuVers = FileVersionInfo.GetVersionInfo(@"C:\Path to\wyUpdate.exe").FileVersion;

Can I ask why you need this value at runtime?

Thanks for your reply ,

I have in my app a screen of user details , one of them is the current version the user has .

Thanks.

Hi , The FileVersionInfo give the file version of the wyUpdater file . if the client install my app he will get version say 1.3 , but after downloading the updates the file version still the same although the user has new version now . So what id the Version property in the Automatic upadte control .

Thanks ...

Are you talking about the version of your app or the version of the AutomaticUpdater?

version of my app . I'm using the AutomaticUpdater.Version or the AotomaticUpdaterBackend.Version and I get null all the time . Do you have any example of it ?

Thanks ...

The "Version" property only shows an upcoming version (if there's an update available). To get your app's current version then read it from somewhere. For instance you can use the exact same bit of code I posted before, except use it on your own EXE file:

FileVersionInfo.GetVersionInfo(System.Windows.Forms.Application.ExecutablePath).FileVersion

This assumes you have the latest version number in your AssemblyInfo.cs file.

Thanks allot , I used : Assembly.GetExecutingAssembly().GetName().Version.ToString();