Reputation: 103
How could we use a custom product version format for Wix Product/@Version - Eg 2022.02.01?
If i do it using a compile time variable (@), it gives me the error - Product version must have a major version less than 256, a minor version less than 256, and a build version less than 65536
If i try using binder variables like file version, then it cannot have the format I need since I only need a 3-part format. Also it will not allow 02, since it makes it 2.
I've gone through some links like the below, which don't seem to help a lot with the scenario I have. https://stackoverflow.com/a/641094
https://stackoverflow.com/a/8555951/8052403
Any suggestions/ideas/guidance?
The Wix version we use is 3.10.2.2516. However I feel the behavior is irrespective of the version.
I see some entries in the Windows Features list (highlighted in snapshot below) which seem to have values greater than 256 in major/minor versions. "How did you do that?"
Upvotes: 0
Views: 1106
Reputation: 377
The product version in the MSI database does in fact allow any string value and it doesn't have to match the x.x.x.x format. It is just hard to do this as you mention Wix doesn't allow it and will show this error:
The Product/@Version attribute's value, '11.3.2416.32.W', is not a valid version.
Legal version values should look like 'x.x.x.x' where x is an integer from 0 to 65534
Other MSI tools like EXEMSI MSI wrapper give similar errors:
Your version number must match the format of #.#.#.# where # represents a number in the range 0-65535.
The solution I found was to modify the MSI after I built it using SuperOrca. Just had to open the file and go to the "Property" table:
And yes, this is the true version which is actually installed in the MSI database as verified with a Powershell script.
Fetching Installed Products, Please Wait (this may take a few minutes)...
Do not close this window...
Invalid Version Format Summary
-------------------------
ProductCode: {58901A3C-8C12-40FA-90DD-D12CC8F8BB30}
Version: 11.3.2416.32.W
I had to investigate this as I wrote a program which fetches all the installed programs and versions was it hitting an error on a customer's computer.
I was casting all the versions in the MSI databases version column to a System.Version type and a "non-compliant" version was breaking it, so I made my own installer with a non-compliant version for testing this out.
Upvotes: 0
Reputation: 35996
Correct. This is not a limitation of the WiX Toolset but the Windows Installer itself. See the ProductVersion documentation for details. To get that changed, you'll want to follow up with Microsoft to update the Windows Installer to allow your specialized product version.
Upvotes: 2