Code snippet from the nsi script:
VIProductVersion 1.2.0.0
VIAddVersionKey /LANG=${LANG_ENGLISH} FileVersion 1.1.0.0
I want to set FileVersion to 1.1.0.0 but in file properties it is set to 1.2.0.0. I also noticed that VIProductVersion executed on its own adds FileVersion key and sets its value.
Documentation says that VIProductVersion adds the Product Version but what I see is that FileVersion is actually added. Is this the bug in NSIS? What is the purpose of VIAddVersionKey FileVersion if value it sets is overriden with one set by VIProductVersion?
VIAddVersionKey requires VIProductVersion call, script does not compile otherwise.
Versions I am using: EclipseNSIS 0.9.8; MakeNSIS 2.46. OS: Windows 7.
The version info resource is stored in two parts:
Some applications use the FileVersion string and fall back to VS_FIXEDFILEINFO::dwFileVersion if the string is not present, other apps only use VS_FIXEDFILEINFO::dwFileVersion etc.
VIProductVersion "1.2.3.4"will generate a version header that looks likethis is often enough but it will not let you set PRODUCTVERSION != FILEVERSION.
I would consider this a bug in NSIS, they should add a VIFileVersion command or extend VIProductVersion to
VIProductVersion <productver> [filever].You can add a feature request on the tracker.
In the mean time you might be able to work around this by calling resource hacker during the build with !packhdrEdit:
It can be done with 2.46 at compile time with !packhdr, external 3rd party tools (I was unable to get reshacker to import a .rc version resource so I had to convert to .res first) and horrible hacks:
…and you end up with this version resource: