ProductVersion bug?

Feb 14, 2011 at 8:52 PM
Edited Feb 14, 2011 at 10:35 PM


I tried ResourceLib on some exes and it generally works, but when i check product version in windows explorer there is still old Product Version value, although when i check it from C# using FileVersionInfo the major, minor, build and private values are correct. Example. Changing PV from to (in brackets "splitted" number as showed by FVI):

Old: (1, 2, 3, 4)

New: (11, 22, 33, 44)

I don't see this behaviour changing FileVersion.

Example code:

VersionResource r;
using (ResourceInfo vi = new ResourceInfo()) {
    r = (VersionResource)vi.Resources[new ResourceId(Kernel32.ResourceTypes.RT_VERSION)][0];
r.FileVersion = "";
r.ProductVersion = "";

There was version resource only for language 0, i didn't test with other languages.

Is this a bug or i missed something?

Anyway thank you for a great library.


EDIT:: Hmm.., according to FVI neithr FileVersion nor ProductVersion strings has changed (version parts for both are correct). Seems like explorer build FileVersion using all 4 version parts ignoring FileVersion attribute saved as a string, but for ProductVersion it uses a whole string ignoring version parts. Anyway it would be nice if ResourceLib could update strings. I suppose thet only reason of not updating version string is fact, that there can be no enough space if new version string is longer. So, it is rather not RL bug as i thought, but indended behaviour. Thread closed.

Feb 15, 2011 at 8:01 PM

ResourceLib can update strings, just not automatically when you update the version resource ;)

Feb 16, 2011 at 9:34 PM

Ive iterated all resources in exe and there is ony 2: manifest and version, both language 0. In manifest there was old version number (

RT_MANIFEST: Lang=0, MType=CreateProcess, size=490
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?><assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"><assemblyIdentity version="" name="" /><trustInfo xmlns="urn:schemas-microsoft-com:asm.v2"><security><requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3"><requestedExecutionLevel level="asInvoker" uiAccess="false" /></requestedPrivileges></security></trustInfo></assembly>

so i've replace it with and saved but nothing changed in explorer, still showing (it have been replaced, i've chaked)

In version is this:

RT_VERSION: fv=1.0.4062.42043, hdr=(VS_VERSION_INFO: wl=696, wt=0, wv=52), lang=0, pv=1.0.4062.42043, size=696
 VarFileInfo=(VarFileInfo: wl=68, wt=1, wv=0)
 StringFileInfo=(StringFileInfo: wl=536, wt=1, wv=0)

First - resource, below resources collection. I couldn't find any string with value "".

What i'm missing?

Feb 17, 2011 at 4:35 PM
Edited Feb 17, 2011 at 4:35 PM

For explorer to pick this up you need a ProductVersion string resource I think. See my old article in under Writing Version Resource.