\"Get File Version\" not working

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

\"Get File Version\" not working

Postby gweihs » Tue Jan 24, 2006 5:22 pm

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

Postby Gizm0 » Tue Jan 24, 2006 5:40 pm

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\"
InstallAware Software Corporation

CandiceJones
Posts: 904
Joined: Thu Dec 22, 2005 7:03 pm
Contact:

Postby CandiceJones » Tue Jan 24, 2006 5:40 pm

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
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/

casic
Posts: 260
Joined: Thu Mar 17, 2005 4:02 am
Location: Germany
Contact:

Postby casic » Wed Jan 25, 2006 12:52 am

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
InstallAware MVP
If it can't be done with InstallAWARE then you are not using Windows


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 116 guests