Search code examples
wixbootstrapperburn

How to set a custom ProductVersion in a WiX Bootstrapper project?


In my WiX Bootstrapper project, I can define the version of the Bundle using the Version attribute of the Bundle element. Here's an example:

<Bundle Name="Sample" Manufacturer="Sample Ltd." Version="1.0.0.0" UpgradeCode="5fffcf4d-b3e4-4eba-a850-ab8ab3fe501d">
</Bundle>

The value of the Version attribute is then used for the FileVersion and ProductVersion fields in the final .exe file.

We need to set ProductVersion to a custom value, such as 1.0.0.0 cs203948. Is that possible? Currently, we use the tool ResourceHacker to modify the ProductVersion afterward, but the tool is causing issues (e.g., "Out of memory" errors on local machines). Therefore, we would like to eliminate the need for it.

UPDATE 1:

It seems that's not supported, see method UpdateBurnResources. So I have to change the ProductVersion afterwards.

Tools I have already tried:

  • ResourceHacker: Does still work in virtual machines, but not on normal ones (I'm trying to contact the developer)
  • ResourceTuner: Does work, but it's not free and I don't really know how to license, cause I would integrate usage in MSBuild which runs on n computers.
  • RCEdit: Breaks the executable
  • WinAPI method UpdateResourceA: Breaks the executable

UPDATE 2:

  • StampVer: Only supports format "X.X.X.X"

Thanks in advance!


Solution

  • See comments on the original post.