Can anyone help me with this?
Hello, when event UpToDate is called in SuccessArgs e.Version is null. How do I get the current version of the application? (When App is Up to date of course.)
We don't put the version in that field. Read the version from within your app. (I.e. get the version from your EXE).
You can if you want to parse that file. See the wyUpdate source code for how you can do that (if you really want to).
Repeats my question, perhaps more clearly. I want to download the latest version number of the installed update, whether it is possible?
I'm not sure what you're asking. Are you asking how to update your app or how to get the current version of your app?
I asked how and if at all I can get the current version of current installed update.
My update naming convention is: appName.1.1.to.1.2.wyu and I when I have last update installed I want get then version of this update, for example 1.2.
Well, typically our customers store their current version number somewhere in their app. Then you simply read the version number from your app. However, if you don't store the version in your app, just read it from the client.wyc file. Use the wyupdate source code to see how.
The version number to which I want to update the application is available when AutomaticUpdate call BeforeDownloading event.
Thanks for all answer 🙂
Hello, I write method to get latest installed version, but this solustion doesn't work.I use 2.6.18.4 version of wyUpdate.exe
This is my code:
string installedVersion = string.Empty;
FileStream fs = null;
try { fs = new FileStream("client.wyc", FileMode.Open, FileAccess.Read); } catch (Exception ex) { if (fs != null) fs.Close();
throw new ArgumentException("The client data file (client.wyc) failed to open."); }
if (wyUpdate.Common.ReadFiles.IsHeaderValid(fs, "IUCDFV2")) { fs.Close();
throw new ArgumentException("The client file is not correct."); }
byte fileBytes = (byte) fs.ReadByte();
while (!ReadFiles.ReachedEndByte(fs, fileBytes, 0xFF)) { switch (fileBytes) { case 0x03: installedVersion = ReadFiles.ReadDeprecatedString(fs); break;
default: ReadFiles.SkipField(fs, fileBytes); break; }
fileBytes = (byte)fs.ReadByte(); } fs.Close();
Use the code from wyUpdate. That'll work.
It's not the full code. The client.wyc is like a zip file. First you have to open it and extract the internal details file. Just copy the full file from wyUpdate and use our pre-built methods.
Can you please provide a code example?? This is getting really frustrating!I included ClientFile.cs and a bunch of other files but I still can't see the version number.
I want the version number in FormMain(){} of my Windows Form App just like in your Youtube Example.
Hey Patrick,
Honestly, the best way to do this is to store the version number in your app. I.e. put it in the Assembly.cs file. Then read it from your app using code like this:
string version = FileVersionInfo.GetVersionInfo(System.Windows.Forms.Application.ExecutablePath).FileVersion;