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

Вниз

Version Info   Найти похожие ветки 

 
den_dnepr ©   (2002-08-23 17:11) [0]

вопрос следующего содержания: хочу сделать форму "о программе" и чтоб при каждом билде в эту форму попадал номер версии проги (который установлен в project/options/version info) может кто подскажет как это сделать?


 
Skier ©   (2002-08-23 17:12) [1]

>den_dnepr
В RX Library есть класс по этому поводу.


 
Игорь Шевченко ©   (2002-08-23 17:14) [2]

procedure TfrmAbout.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
// 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
raise Exception.Create("Can""t get file version information for "
+ FileName);
// 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
F : Pointer;
tmp : array[0..MAX_PATH] of char;
var
VersionMajor: Integer;
VersionMinor: Integer;
Release, BuildNumber: Integer;

begin
if FileExists(ParamStr(0)) then begin
// Get the file version
GetFileVersion(ParamStr(0), VersionMajor, VersionMinor, Release, BuildNumber);
cVersion.Caption := Format("Версия: %d.%d.%d", [VersionMajor, VersionMinor, Release]);
lbBuild.Caption := Format("(сборка %d)", [BuildNumber]);
end;
lbDBVer.Caption := FOptions.DBVersion;
end;




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

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

Наверх




Память: 0.47 MB
Время: 0.013 c
1-14153
Lamer86
2002-08-24 21:32
2002.09.05
TStrings


14-14253
Da'maz
2002-08-10 17:37
2002.09.05
Можно ли быть программистом не зная этого ?


1-14018
Олеся
2002-08-26 13:28
2002.09.05
Пример из FAQ не работает (список файлов и каталогов ЭВМ)


1-14165
Eraice
2002-08-24 23:09
2002.09.05
TRichEdit: вставка текста


14-14257
anonimno
2002-08-11 19:49
2002.09.05
Рекомендую посетить сайт http://invega.by.ru