Funny enough the "bind.FileVersion" work around shouldn't even work. According this https://msdn.microsoft.com/en-us/library/aa370859(v=VS.85).aspx max value for the version component is 255.
But I am glad WiX guys made the trick available. Though of course it doesn't help if want to set the version without the dll file. I would prefer that WiX allows bypassing the MSI limitation completely and allows setting the version directly:
And you are right the XML post-generating adjustment is the way to go.
You can use also use a slightly lighter syntax for this:
BTW I have added Project extension method ('namespace WixSharp.CommonTasks') which now allows achieve the same with a single call like this:
But I am glad WiX guys made the trick available. Though of course it doesn't help if want to set the version without the dll file. I would prefer that WiX allows bypassing the MSI limitation completely and allows setting the version directly:
product.Version = FileVersionInfo.GetVersionInfo("MyDll.dll").FileVersion
And you are right the XML post-generating adjustment is the way to go.
You can use also use a slightly lighter syntax for this:
document.FindSingle("Product") .AddAttributes("Version=!(bind.FileVersion.HA.CADD.Revit.BatchProcessing.dll)");
project.SetVersionFrom("HA.CADD.Revit.BatchProcessing.dll");