Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Catalog · How the catalog works
Anything · Lazarus or Delphi
Random projectRandom project

Delphi-VersionInfo

Delphi class to query version info from given application.

View on GitHub

Member rating

No ratings yet.

Sign in to rate this project.

README

Delphi-VersionInfo

Delphi class to query version info from given application.

How to use

Include to uses

pascal
    uses VersionInfo;

Define variable

pascal
    var
      vi: TVersionInfo;

Use it

pascal
    vi := TVersionInfo.Create;

What to use as default value, if any query of info fails (default <info not available>)

pascal
    vi.DefaultValue := '';

This trigger the quering of file for version information.

pascal
    vi.GetInfo(filename);

Values can be any of :

  • cVICompanyName
  • cVIFileDescription
  • cVIFileVersion
  • cVIInternalName
  • cVILegalCopyright
  • cVILegalTradeMarks
  • cVIOriginalFilename
  • cVIProductName
  • cVIProductVersion
  • cVIComments
  • cVIMajorVersion
  • cVIMinorVersion
  • cVIRelease
  • cVIBuild

Read a explanation for the value (returns string)

pascal
    desc := vi.GetInfoString(cVICompanyName);

Get the value (returns string)

pascal
    val := vi.GetInfoValue(cVICompanyName);

You can also loop through all values

pascal
    for i := cVICompanyName to cVIBuild do
    begin
      desc := vi.GetInfoString(i);
      val := vi.GetInfoValue(i);
    end;

Make sure you free the class when done

pascal
    vi.Free;