- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- How to display version in MSI properties?
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
How to display version in MSI properties?
I made some guesses in the "product information stream" but for example entering {ProductVersion} displays just that. It is apparently not a variable.
MichaelU wrote:
The Windows Installer (MSI) Summary Information Stream doesn't appear to have any fields relevant to the version of your product. You may be able to use a field that you can set (say the Description field) for this purpose. Otherwise, this is a feature request for Explorer and/or Microsoft in general.
I'm not sure that we are understanding each other. I'm not asking for an additional field. The version can be displayed in any of the existing fields: title, subject, comments, etc. I could manually enter the version in there but there must be a variable I can enter so that InstallShield automatically enters version information. Yes?
The InstallShield Install Script Reference Guide gives no details on the parameters to this MsiSummaryInfoSetProperty() function. An example script function would be most helpful showing how to add [ProductVersion] to the Comments field.
You can add some info also in the InstallShield Editor:
regards
Markus
Original Poster Wrote: "I'm not sure that we are understanding each other. I'm not asking for an additional field. The version can be displayed in any of the existing fields: title, subject, comments, etc. I could manually enter the version in there but there must be a variable I can enter so that InstallShield automatically enters version information. Yes?"
As the original poster already outlined, he knows how to enter the text manually but we need to have the version entered automatically like with the property variable [ProductVersion] but as he showed InstallShield does not do variable substitution on these fields. So it was suggested to use the call MsiSummaryInfoSetProperty to set the property fields using a script which should have access go the [ProductVersion] variable. However there is no documentation on the parameters for the function MsiSummaryInfoSetProperty describing how to use it to set for example the Comment field.
Okay,
but you can not execute an InstallScript function in a msi package to alter the summary information.
What you can do is create a vbscript, .Net or C/C++ program that runs after the msi file was created, read the version info with the automation interface and modify the msi file with MsiSummaryInfoSetProperty or SummaryInfo object.
An example from a vbscript, which does something similar:
Dim objInstaller As Object
Set objInstaller = CreateObject("WindowsInstaller.Installer")
If Not objInstaller Is Nothing Then
Dim objNewDatabase As Object
Set objNewDatabase = objInstaller.OpenDatabase(szLocNewInstPackage, 0)
If Not objNewDatabase Is Nothing Then
Dim objSummary As Object
Set objSummary = objNewDatabase.SummaryInformation(3)
objSummary.Property(11) = Now
objSummary.Property(13) = Now
objSummary.Persist
objNewDatabase.Commit
End If
End If
Just theory, you have to try/test/modify
regards
Markus
MarkusLatz you're right. My logic was flawed. Of course you can't modify the properties of the installer by executing the installer itself. But if I do it as you suggest, modifying the MSI file after it's built by InstallShield then I fear the changed properties are going to invalidate the signing that InstallShield did at end of the build. Perhaps it could be resigned following the modification to properties but this is getting way more complicated than it should be. InstallShield should add property substitution to these fields in their next release
To re-sign a msi file after build in a Postbuild Event is not complicated.
But yes it is easier if this is a feature in InstallShield.
regards
Markus
Properties are read by the Windows Installer from the Properties table during the runtime of the installer. This isn't an action that can be performed when Installshield builds the project.
When installshield builds your project it reads the information from the ISString table to populate the Summary Information Stream values - as this is a build action any properties wouldn't be able to be validated here.