I've created a custom task to get me a three-part version number of my assembly that was built in MSBuild.
I've created a custom <Target Name="GetVersion">
for this, and it works nicely - the three-part version number(1.5.2
) is stored into a ThreePartBuildNumber
property in MSBuild.
But how do I tell MSBuild inside Visual Studio 2010 to call this target once it's compiled my assembly, and before creating my WiX Setup project (where I'd like to set the WiX install script's Product/@Version
to this three-part version number automatically)?
How can I "plug" this new target into the usual VS 2010 build process?
Update:
OK, I've managed to get this into the *.wixproj
file which is also a MSBuild file, really. In the <Target Name="BeforeBuild">
, I can successfully determine the three-part version number, and it's stored inside a MSBuild property called ThreePartVersionNumber
.
But how on earth can I now access this properly filled MSBuild property in my WiX setup? I tried setting <Product Version="$(var.ThreePartVersionNumber) ...>
, but that doesn't work - it doesn't seem to find the variable.... neither works with the sys.
or env.
prefixes, either....
So how do I make this MSBuild property that has the information I need "visible" to the WiX installer script/XML ?!?!?!? I can't seem to see the forest for all those angle brackets .....