I'll second this request. As I mentioned in another thread, our build system sets the AssemblyVersion field, but not the FileVersion, so I can't use /SetVersion -fromfile.Peter Chr. Ryskin wrote:Hi,
For .NET executables it would be great to be able to choose between getting the version of the file (FileInfo) or the version of the contained assembly (Not equal).
Code: Select all
Deferred custom actions can receive information about the installation process, mostly only embedded in the CustomActionData property. However, this type of custom actions do not have access to installer properties.
Code: Select all
Session.Property("FILE_VERSION_RESULT") = fileVersion
Code: Select all
Function GetFileVersion()
' Get Installer properties
fileToCheck=Session.Property("FILE_NAME_TO_CHECK_VERSION")
' Create object to check file version
Set fso = CreateObject("scripting.filesystemobject")
fileVersion = fso.GetFileVersion(fileToCheck)
' Store the version
Session.Property("FILE_VERSION_RESULT") = fileVersion
End Function
Code: Select all
Const msiOpenDatabaseModeReadOnly = 0
Dim installer, database
Set installer = CreateObject("WindowsInstaller.Installer")
Set database = installer.OpenDatabase(FileName, msiOpenDatabaseModeReadOnly)