Blame | Last modification | View Log | RSS feed
unit Unit1;{$mode objfpc}{$H+}interfaceusesClasses, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,Buttons, StdCtrls, fileinfo;type{ TForm1 }TForm1 = class(TForm)CompanyLabel: TLabel;CopyrightLabel: TLabel;VersionLabel: TLabel;NameLabel: TLabel;OkButton: TBitBtn;Image1: TImage;procedure FormShow(Sender: TObject);private{ private declarations }public{ public declarations }end;varForm1: TForm1;implementation{$R *.lfm}{ TForm1 }procedure TForm1.FormShow(Sender: TObject);varFileVerInfo: TFileVersionInfo;beginFileVerInfo := TFileVersionInfo.Create(nil);tryFileVerInfo.FileName := paramstr(0);FileVerInfo.ReadFileInfo;NameLabel.Caption := FileVerInfo.VersionStrings.Values['ProductName'];CompanyLabel.Caption := FileVerInfo.VersionStrings.Values['CompanyName'];CopyrightLabel.Caption := FileVerInfo.VersionStrings.Values['LegalCopyright'];VersionLabel.Caption := 'Version: ' +FileVerInfo.VersionStrings.Values['FileVersion'];finallyFileVerInfo.Free;end;end;end.