\"Get File Version\" not working

Got a problem you cannot solve? Try here.
Post Reply
gweihs
Posts: 32
Joined: Sat Jan 21, 2006 10:24 am

\"Get File Version\" not working

Post by gweihs »

I am attempting to get the version number of a .NET executable. The WinXP Shell shows the version number properly in its property form. IA is returning 0.0.0.0. I am referencing it from $TARGETDIR$.

Any ideas?
Gizm0
Posts: 339
Joined: Wed Nov 09, 2005 8:47 pm

Post by Gizm0 »

Well ,actually this is not a IA issue.It's true that GetFileVersionA returns 0.0.0.0 on .Net Assemblies.
This is because file version is stored as metadata in a .net assembly and not in the PE Header.
If you want to get the version of a .Net exe you should call an external dll that uses .net extensions (that means .net framework is a prequisite) to get AssemblyVersion number from the .Net assembly and return it IA setup script.
Last edited by Gizm0 on Tue Jan 24, 2006 5:41 pm, edited 1 time in total.
Panagiotis Kefalidis
Software Design Team Lead
\"In order to succeed, your desire for success should be greater than your fear of failure\"
Install[b]Aware[/b] Software Corporation
CandiceJones
Posts: 904
Joined: Thu Dec 22, 2005 7:03 pm
Contact:

Post by CandiceJones »

Hi

I believe this is because InstallAware uses the Win32 API for obtaining file versions. This API seems to fail on .NET files which contain version information in metadata form. I understand Explorer shows this correctly...but InstallAware cannot because this would make the script command dependent on the .NET framework, which is something we cannot do because we want your setups to always run, regardless of what frameworks are available (or not) on the target system.
Candice Jones
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
casic
Posts: 260
Joined: Thu Mar 17, 2005 4:02 am
Location: Germany
Contact:

Post by casic »

Hi,

the best way to retrieve file versions (also product versions) is to use the string resource table of a file. This works also with .NET libraries and executables. Unfortunately it is very hard to obtain these information (several API calls have to been made) so I think it's the best way to provide a plugin to resolve this issue (I already use such routines in the MSDE 2000 plugin). Let me see when this can be done :)

cu

Markus
Markus Diettrich
Install[b]Aware[/b] MVP
[i]If it can't be done with InstallAWARE then you are not using Windows[/i]
Post Reply