Binding WIX FileVersion Values?

On WIX, I can do this to automatically create a decent version number for my MSI:

<?define ProductVersion="!(bind.FileVersion.MyMainExecutable)" ?> <Product Version="$(var.ProductVersion)" ... /> 

This creates a string like "1.0.1.0", but I only need the first three parts: "1.0.1"

How can i do this?

+7
source share
1 answer

It is not possible to get only the first three fields of the FileVersion binding. However, if you agree to assign a four-part version of Product/@Version (which is perfectly acceptable, although major updates will be discussed only in the first three fields), you can access each part of the main, minor, assembly and revision using the following variables:

 !(bind.property.ProductVersion.Major) !(bind.property.ProductVersion.Minor) !(bind.property.ProductVersion.Build) !(bind.property.ProductVersion.Revision) 

Hope this can be helpful.

+10
source

All Articles