{ TVersion } TVersion = class (TPersistent) private FBuild: Integer; FMajor: Integer; FMinor: Integer; FVersion: Integer; published property Version: Integer read FVersion write FVersion; property Major: Integer read FMajor write FMajor; property Minor: Integer read FMinor write FMinor; property Build: Integer read FBuild write FBuild; end; ... aVersionInfo:=TVersionInfo.Create; VersionInfo:=TVersion.Create; try aVersionInfo.Load(HINSTANCE); VersionInfo.Version:=aVersionInfo.FixedInfo.FileVersion[0]; VersionInfo.Major:=aVersionInfo.FixedInfo.FileVersion[1]; VersionInfo.Minor:=aVersionInfo.FixedInfo.FileVersion[2]; VersionInfo.Build:=aVersionInfo.FixedInfo.FileVersion[3]; finally if assigned(aVersionInfo) then aVersionInfo.Free; end;
It should be unit FileInfo. This worked for me on Linux:
For me no unit FileInfo can be found under Linux, compiler reports error when added to uses clause.