Skip to content

Commit

Permalink
Fix Msi version string generation (#7725)
Browse files Browse the repository at this point in the history
Based on operator precedence, `0x3FFF << 4` was happening first, ensuring that we always cut off the lower 4 bits of the build number when generating an Msi version.

The good news appears to be that the Major and Minor stay the same or go up, though the patch value will go down.

Before: A build number major value of 30327 or 30328 and build number value of 9 would generate `48.0.30329`
After: `48.3.26489` and `48.3.26505`, respectively.
  • Loading branch information
mmitche authored Aug 6, 2021
1 parent dc542a6 commit 2c76d9e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ private void ParseBuildNumberMajorMinor()
var minor = int.Parse(Minor) << 22;
var patch = int.Parse(Patch) << 18;

var buildNumberMajor = int.Parse(BuildNumberMajor) & 0x3FFF << 4;
var buildNumberMajor = (int.Parse(BuildNumberMajor) & 0x3FFF) << 4;
var buildNumberMinor = int.Parse(BuildNumberMinor) & 0xF;

var msiVersionNumber = major | minor | patch | buildNumberMajor | buildNumberMinor;
Expand Down

0 comments on commit 2c76d9e

Please sign in to comment.