In my new project Jarvis I wanted to start
generate preview versions of the MSI packages, but one problem with that is that MSI
requires the product version to be in the format
Major.Minor.Patch which isn't compatible with semantic verisoning. We CAN use the
Major.Minor.Patch.Revision format as a product version, but that won't work with major upgrades. An example of this would be
1.2.3-alpha45 which would require a different version number than
A solution to this is to use the following formula (originally found here), where
PRE is the pre-release number (normally the number of commits for the current patch).
ENSURE (PATCH >= 0 && PATCH < 54) ENSURE (PRE >= 0 && PRE < 1000) PATCH = 10000 + (PATCH * 1000) + PRE
Which would result in the following versions.
|Semantic version||Patch||Pre-release||MSI version|
This is not by any means fool-proof but might act like a good starting point.