Вниз
Скачать: CL | DM;

Номер релиза разрабатываемого приложения   Найти похожие ветки 

← →
Visit   (2002-06-13 10:17) [0]

Ув. МАСТЕРА, подскажите! Вопрос по отображению текущего релиза:
В Project Option/Vesion Info можно установить номер версии и сделать так, чтобы номер билда автоматически наращивался.
А как вывести эту информацию на форму разрабатываемого приложения, т.е. чтобы не лазить в опции каждый раз смотреть,
а чтобы это отображалось автоматически?


← →
Игорь Шевченко ©   (2002-06-13 10:40) [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;




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

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.011 c
14-77614
[NIKEL]
2002-05-22 18:00
2002.06.24
Просто старая шутка :]


4-77695
Сержик
2002-04-27 12:59
2002.06.24
Как перехватить нажатие кнопки?


14-77617
sanilo
2002-05-23 16:38
2002.06.24
Техническое задание.


8-77514
Людмила
2002-02-12 17:56
2002.06.24
Как


1-77410
user2002
2002-06-10 17:39
2002.06.24
Попогите плиз с решением ентого вопроса!




   Наверх