0

Our current wix installer gets automatically build with a version number, however we now want to extent this, so that the version number is added to a version history database table during the installation.

I'm using a simple SQL script to insert the version number, however I don't seem to be able to find a property that I can use to get the version number from to insert into the table.

Are there any public properties in wix that can be accessed during the installation that hold the version number, so I can use that to insert it into the database?

Lex
  • 879
  • 3
  • 16
  • 27

1 Answers1

0

ProductVersion property (Windows)

For tips on how to implement it, see:

How can I use WiX properties in a sql file executed from the installer?

Community
  • 1
  • 1
Christopher Painter
  • 54,556
  • 6
  • 63
  • 100
  • Thanks, the problem with ProductVersion is that it doesn't give the 4th number, for example it would only give you 1.0.0, not 1.0.0.0, which is what we prefer to use. I've tried to use ProductBuildVersion, however this doesn't seem to hold a value. – Lex Jan 10 '13 at 14:32
  • The SDK says that how ProductVersion should be formed ( and it is important with regard to Major Upgrades ). However it's up to the author to populate the value. If you populate it as 1.0.0.0 it will be in the property and it will make it to your database. – Christopher Painter Jan 10 '13 at 17:03
  • the limitation around ProductVersion is a PITA. We work around it as follows: compress the 3rd and 4th elements into a single element by doing e.g. 4096*v3+v4, assuming your v3 always stays below 15 and v4 never gets above 4096. Then we provide an additional property for the 'actual' engineering build number and write it in plain sight to the name shown in Add-Remove programs so that the user and product support known exactly what the engineering version is. – Stephen Connolly Jan 14 '13 at 13:08
  • I've skinned this cat many times over the year and it really depends on the culture of the organization. These types of things turn into religious wars. One approach is to write a custom action that extends FindRelatedProducts and is capable of evaluating the 4th field and populating the ACTIONPROP accordingly. Another approach is to use Major.Minor.Build for MSI and Major.Minor.Build.0 for the EXE/DLL versioning. This then leaves the 4th field (.0 / Patch ) available for patches. – Christopher Painter Jan 14 '13 at 13:54