Recent

Author Topic: TFileVersionInfo.getVersionSetting dont work and VersionStrings.Values neither  (Read 4625 times)

amartitegui

  • Jr. Member
  • **
  • Posts: 84
Hi Im working with fpc 3.0.2
trying to check version of installer exe file (inno setup).
but when I try

function.....:string;
var info:TFileVersionInfo;
begin
  info := TFileVersionInfo.Create(nil);
  info.fileName:=Filename;
  info.ReadFileInfo;   
  return:=info.VersionStrings.Values['ProductVersion'];
  info.free;
end;

error saying .exe doest have available that info:
EResourceReaderNotFoundException with message cannot find resource reader for extension '.exe'

and if I try
info.getVersionSetting ... well it looks likeit doesnot exist that function.

Anyone has a tip?
thanks and regards

jamie

  • Hero Member
  • *****
  • Posts: 6090

Please look at this persons reply code..

http://www.delphigroups.info/2/5/756976.html

P.S.
  this is for windows...
The only true wisdom is knowing you know nothing

amartitegui

  • Jr. Member
  • **
  • Posts: 84
This particular case is for windows too. I'm gonna try .
Thanks jamie.

amartitegui

  • Jr. Member
  • **
  • Posts: 84
solved. With a piece of code similar to the one you sent me.

http://lists.lazarus.freepascal.org/pipermail/lazarus/2013-November/214108.html
There is a Unit working great.
It's supposed to work not just in windows.
But just tested in windows
Nice code.
thanks guys

 

TinyPortal © 2005-2018