Главная страница
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.018 c
6-77520
Иван
2002-04-05 11:16
2002.06.24
Уважаемые господа, у меня мольба о помощи


6-77529
Heh
2002-04-17 09:46
2002.06.24
Научите


3-77271
roadstar
2002-05-29 12:38
2002.06.24
Помогите с SQL-запросом!!!


6-77526
Freddy
2002-04-16 10:39
2002.06.24
SMTP/POP3 сервер


1-77393
метеоролог
2002-06-13 10:50
2002.06.24
Quick Report file