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

Вниз

Как узнать версию программы?   Найти похожие ветки 

 
Zahar   (2004-12-11 22:28) [0]

При разработке проекта можно указывать его версию (Project | Options | Version Info). Как потом программно извлечь эту информацию (ну чтобы на форме About автоматически указывать версию программы, особенно, если установлен флаг Auto-increment build number).


 
Игорь Шевченко ©   (2004-12-11 23:13) [1]


 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;



С уважением,


 
Zahar   (2004-12-11 23:37) [2]

THX!!! Очень помогло!!! Просто супер!!!



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

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

Наверх




Память: 0.47 MB
Время: 0.057 c
1-1106041608
ghg
2005-01-18 12:46
2005.01.30
передача параметров модальному окну


1-1106181479
Алексей
2005-01-20 03:37
2005.01.30
Как удалять объекты, связаные с TTreeNode.Data


3-1103649983
dron-s
2004-12-21 20:26
2005.01.30
Общая сумма в DBGrid колонке


14-1105700748
Andryk
2005-01-14 14:05
2005.01.30
Стишок про новый год, грустный. :(


14-1105318117
Alex_Petr
2005-01-10 03:48
2005.01.30
Устал за ;$1600 пить в одиночку