How can I set the WiX installer version to the current build version?

Draco picture Draco · Mar 9, 2009 · Viewed 66k times · Source

I wrote an application and its WiX installer and put it under version control using subversion. When the WiX installer builds I want its version number to be the current build version of the application. How do I accomplish this? I used c# to code the application.

N.B. I am using ccnet to build this project

Answer

Rob Mensching picture Rob Mensching · Mar 13, 2009

You could use Product/@Version="!(bind.FileVersion.FileId)" (replace FileId with the Id of the file from which you'd like to get the version number) and light.exe will populate the value with the version of the file referenced by the FileId.