Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2002.06.27;
Скачать: CL | DM;

Вниз

Помогите узнать версию exe файла!!!   Найти похожие ветки 

 
Bart ©   (2002-06-14 11:55) [0]

Помогите узнать версию exe файла!!!


 
Игорь Шевченко ©   (2002-06-14 11:56) [1]

procedure TfAbout.FormCreate(Sender: TObject);

procedure GetFileVersion(FileName: string; var Major1, Major2,
Minor1, Minor2: Integer);
{ Helper function to get the actual file version information }
var
Info: Pointer;
InfoSize: DWORD;
FileInfo: PVSFixedFileInfo;
FileInfoSize: DWORD;
Tmp: DWORD;
begin
Major1 := 0;
Major2 := 0;
Minor1 := 0;
Minor2 := 0;
// Get the size of the FileVersionInformatioin
InfoSize := GetFileVersionInfoSize(PChar(FileName), Tmp);
// If InfoSize = 0, then the file may not exist, or
// it may not have file version information in it.
if InfoSize = 0 then
Exit;
// Allocate memory for the file version information
GetMem(Info, InfoSize);
try
// Get the information
GetFileVersionInfo(PChar(FileName), 0, InfoSize, Info);
// Query the information for the version
VerQueryValue(Info, "\", Pointer(FileInfo), FileInfoSize);
// Now fill in the version information
Major1 := FileInfo.dwFileVersionMS shr 16;
Major2 := FileInfo.dwFileVersionMS and $FFFF;
Minor1 := FileInfo.dwFileVersionLS shr 16;
Minor2 := FileInfo.dwFileVersionLS and $FFFF;
finally
FreeMem(Info, FileInfoSize);
end;
end;

var
VersionMajor: Integer;
VersionMinor: Integer;
Release, BuildNumber: Integer;

begin
GetFileVersion(Application.ExeName, VersionMajor, VersionMinor,
Release, BuildNumber);
cVersion.Caption := Format("Версия: %d.%d.%d (сборка %d)",
[VersionMajor, VersionMinor, Release, BuildNumber]);
end;


 
Transnet.   (2002-06-14 12:41) [2]

а ещё можно узнать размер exe файла... это если знаешь, какая версия какому размеру файла равна...



Страницы: 1 вся ветка

Текущий архив: 2002.06.27;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.01 c
14-89025
VictorT
2002-05-27 09:46
2002.06.27
Денежный перевод


14-89017
OOPS!!
2002-05-23 15:25
2002.06.27
Photoshop, Winamp, CorelDraw, 3DStudio, Half-Life, Quake, ACDSEE.


1-88886
Nebula
2002-06-14 13:58
2002.06.27
Delphi & COM


3-88709
Sokoloff
2002-06-03 13:21
2002.06.27
SQL запрос


1-88953
Ubermensch
2002-06-15 22:10
2002.06.27
Защита доступа к памяти