Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2002.06.24;
Скачать: 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 вся ветка

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

Наверх




Память: 0.47 MB
Время: 0.022 c
1-77364
Reticent
2002-06-13 12:47
2002.06.24
мааааленький вопросик про память


14-77547
fliz
2002-05-18 12:52
2002.06.24
народ, что в мире происходит ?


1-77428
Miss
2002-06-10 12:46
2002.06.24
Передача фокуса ввода другому элементу нажатием Enter


3-77308
Octav
2002-05-31 11:44
2002.06.24
Delphi & InterBase


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