file version vs product version attribute - Advanced Installer Community
henrik ljungstrom
Posts: 6
Joined: Mon Mar 18, 2019 3:00 pm

file version vs product version attribute

Hi,
we need to distinguish between our installers, both before the installation and after installation.

We are following semVer.
The concept is to set the attribute "file version" to "major.minor.patch" or "major.minor.pach.0"
And the product version to "major.minor.build", where build is a string containing information following semVer. E.g. FullSemVer.

However, using "setVersion" sets the attribute "product version". And it is limited to Integer values.

How would you recommended to manage this?

Is it true that "setVersion" also sets the attribute "fileVersion"?
If so, what is the reason for doing this?
henrik ljungstrom
Posts: 6
Joined: Mon Mar 18, 2019 3:00 pm

Re: file version vs product version attribute

Or is there another way you recommend to distinguish between installers.

https://www.advancedinstaller.com/user- ... ation.html
The identifier attribute, how does it affect the installers?

Running some tests now...
henrik ljungstrom
Posts: 6
Joined: Mon Mar 18, 2019 3:00 pm

Re: file version vs product version attribute

The test to use "identifier" did not affect the file version /product version relationship in any way.
No difference noted in the installer properties either.

I retreived some conflicting information.
According to the official documentation related to product version, it could only contain X.Y.Z where those are integers..
https://docs.microsoft.com/en-us/window ... uctversion

But I also heard it was possible to override that limitation if assemblyFile contains information about informationalVersion
[assembly: AssemblyVersion("5.5.5")]
[assembly: AssemblyFileVersion("5.5.5.0")]
[assembly: AssemblyInformationalVersion("5.5.5.92A10")] //using shortsha

But how to note the difference between the files using the attributes of the software?
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: file version vs product version attribute

Hello and welcome to our forums,

As you already found the ProductVersion can include only integer values in its fields. If you cannot use your file version fields values in the ProductVersion field, than maybe you can try to use our -increment command line switch that will auto-increment the ProductVersion.

In what regards the "Software Identification" option, this just expose on target machine product info details which can be used by software inventory products to find out details about installed products.
Is it true that "setVersion" also sets the attribute "fileVersion"?
No, our command line support sets only the ProductVersion property.

If there is anything else we can help you with just let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
henrik ljungstrom
Posts: 6
Joined: Mon Mar 18, 2019 3:00 pm

Re: file version vs product version attribute

Using msbuild with the "AssemblyInformationalVersion" attribute set, sets the "product version" attribute of the .dlls

Meaning, the "file.version" of the input is according to "major.minor.patch.0"
But the "product.version" is e.g. set to "major.minor.patch.gitSha"
Or as a test "fullSemVer" where fullSemver is "major.minor.patch-gitBranch.1+numberOfCommits"

Inheriting the product version from one of those specific .dlls does not work when creating the installer. It is not transparent. The value will be formatted to x.y.z

Setting the attribute "version" in advanced installer targets both "fileversion" and "productversion" attribute on the installer, unlike what you stated. Perhaps this is why the value from product version could not be inherited in case above...


"major.minor."patch-gitBranch.1+numberOfCommits"" as input gives "major.minor.patch.0" on the installer
Note that this is 3 parts, and the third part is of type string
Last edited by henrik ljungstrom on Tue Mar 19, 2019 4:14 pm, edited 2 times in total.
henrik ljungstrom
Posts: 6
Joined: Mon Mar 18, 2019 3:00 pm

Re: file version vs product version attribute

Daniel wrote: ↑Tue Mar 19, 2019 2:37 pm In what regards the "Software Identification" option, this just expose on target machine product info details which can be used by software inventory products to find out details about installed products.

How is this exposed?
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: file version vs product version attribute

Hello,
Setting the attribute "version" in advanced installer targets both "fileversion" and "productversion" attribute on the installer, unlike what you stated. Perhaps this is why the value from product version could not be inherited in case above...
I am not sure I fully get this. Could you please give me more details about what you mean? Maybe iterate a step by step test case or attach some screenshots.

In what regards the "Software Identification" option this is exposed through an XML file which will be installed alongside the installation files. You can see a .swidtag file being added in the "Application Folder" and "Common Application Data" folder from "Files and Folders" page.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
henrik ljungstrom
Posts: 6
Joined: Mon Mar 18, 2019 3:00 pm

Re: file version vs product version attribute

To conclude:

MsBuild supports setting informational version as "product version". And hence a string value.

File version is an integer, following the same patterns as Advanced installer.

However, Advanced installer treats "product version" in a manner which differs from the standards which MsBuild is following.

Will Advanced installer change how "product version" is treated or will it stay the same? The current way advanced installer is doing this makes it impossible to label the installers following semVer, especially having in mind the product version labeling for company internal evaluation semVer versioning.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: file version vs product version attribute

Hello,

I am afraid the format of ProductVersion property cannot change as this standard is imposed by the Microsoft's Windows Installer technology. The values of this property fields can be an integer between 0 and 255, respectively 65,535 only.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
henrikgjljungstrom
Posts: 4
Joined: Wed Apr 17, 2019 9:42 am

Re: file version vs product version attribute

How do you suggest to add Semantic versioning information for unreleased software to the installer metadata? (string)
burnersk
Posts: 44
Joined: Mon Mar 25, 2019 12:26 pm

Re: file version vs product version attribute

Hello,

I experienced the same issue as you do.

I came up with the following solution (Example: https://1drv.ms/x/s!AiMl0SSQdgy9kUiiBfGFdsan-N9s )

You may have the following semantic version strings:
  • 1.2.3-alpha.1+1
  • 1.2.3-alpha.2+2
  • 1.2.3-beta.1+3
  • 1.2.3-beta.2+4
  • 1.2.3-rc.1+5
  • 1.2.3-rc.2+6
  • 1.2.3+7
  • 11.22.33+8
  • 128.128.128-rc.1+9
  • 255.255.654+10
Now I define number ranges with the pre-release stages:

Code: Select all

Stage	Start	End	Number of possible versions
Alpha	1	40	40
Beta	41	80	40
RC	81	98	18
Stable	99	99	1
Now I compute the ProductVersion as follows:

The product version major is the semantic version major.
The product version minor is the semantic version minor.
The product version patch/revision is the semantic version patch/revision multiplied by 100.
I extract the pre-release number (the "1" from "alpha.1"). Pre-releases without a number will get a "1".
Based on the pre-release stage, I add the pre-release number to the stage's start number. When this final number is computed, add this number to the product version patch/revision.

Semantic version 1.2.3-alpha.2+2 will be product version 1.2.302.2. For more example, please review the above mentioned shared Office 365 Excel document link.

However, you will not be able to semantically point out a product version as an pre-release. But you have the possibility to "map" semantic versioning into product version somehow.

Edit: What just have come to my mind: You can check the product patch/revision. When the last 2 digits are not "99", then you have a pre-release version. This could be implemented into a custom action (e.g. showing a dialog box), if you like to "warn" the user about this version is a pre-release.
henrikgjljungstrom
Posts: 4
Joined: Wed Apr 17, 2019 9:42 am

Re: file version vs product version attribute

Hi,
Appreciate that you share one way which it could be handled.
However, if it is non intuitive then the versioning looses a large part of it's purpose.
Who remembers to look into reference X to decrypt the versioning? It's to complicated for normal users is my opinion
burnersk
Posts: 44
Joined: Mon Mar 25, 2019 12:26 pm

Re: file version vs product version attribute

henrikgjljungstrom wrote: ↑Wed Apr 17, 2019 11:59 am However, if it is non intuitive then the versioning looses a large part of it's purpose.
Who remembers to look into reference X to decrypt the versioning? It's to complicated for normal users is my opinion
Totally agree with you.

However, Microsoft will unlikely (personal opinion: definitely never) change the product version format, as it would introduce major incompatibility issues with older (currently current) versions of Windows Installer.

However[2], when you own a AI Enterprise or Architect license, I expect you can hide the "violated" product version ("my" approach) by restructuring (in the AI UI dialog) the product version from the "ugly" variant into the semantic version variant. So users will see only the semantic version format and not product version (assuming your users don't inspect the assembly and extract fileversion attributes and so on). But this solution is also a hacky workaround.

Return to “Common Problems”