Delphi2010 How to get the internal version number of the program?

Source: Internet
Author: User

With the original GetFileVersionInfo can only get Delpi7 version number, used in Delphi2010 no use

//------Get the file version number
function F_getfileversion (fn:string): string;
var
Temp, infosize:cardinal;
Filedata:pointer;
Fileinfo:pvsfixedfileinfo;
begin
Result: = ';
if not fileexists (FN) then Exit;

infosize: = GetFileVersionInfoSize (PChar (FN), Temp);
if infosize = 0 then Exit; No version number
FileData: = GetMemory (infosize);
Try
if not GetFileVersionInfo (PChar (FN), 0, Infosize, FileData) then Exit;
if not VerQueryValue (FileData, "\", Pointer (FileInfo), Temp) then Exit;
Result: = Format ('%d.%d.%d.%d ',
[Fileinfo.dwfileversionms div $10000,
fileinfo.dwfileversionms MoD $10000,
fileinfo.dwfileversionls Div $10000,
fileinfo.dwfileversionls mod $10000]);
finally
freememory (FileData)
end;


The solution is to use a third-party control rave, there is a rzversioninofo, put on the compile time check including version information in project, you can get the version number, get method: ShowMessage ( rzversioninofo1.fileversion);

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Delphi2010 How to get the internal version number of the program?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.