Board index » delphi » Retrieve file version

Retrieve file version

How i retrieve file version info from files ?????

Rjsarme...@ciberbit.pt

 

Re:Retrieve file version


Several days ago I requested info on the similarity between
Delphi and Turbo Pascal. I received a number of helpful comments,
for which I thank those who responded. I now have a second question:
How similar are Delphi 3 and Delphi 5? Specifically would the Delphi
3 Superbible give me the general flavor of Delphi 5?
Any replies will be greatly appreciated.
Thanks in advance
Rob George
regeo...@ctcn.net

Re:Retrieve file version


Quote
Rob George wrote:

> Several days ago I requested info on the similarity between
> Delphi and Turbo Pascal. I received a number of helpful comments,
> for which I thank those who responded. I now have a second question:
> How similar are Delphi 3 and Delphi 5? Specifically would the Delphi
> 3 Superbible give me the general flavor of Delphi 5?
> Any replies will be greatly appreciated.
> Thanks in advance
> Rob George
> regeo...@ctcn.net

Well although I havent read the book I am sure it gives also a good
overview about Delphi5. Delphi5 is basically just an enhancement of
Delphi 3 and Delphi 4. Borland has improved things and added new stuff.
But if you take a closer look you'll see that the basic concept is the
same as in Delphi 1 (ok packages are new since Delphi 3 :)). So if dont
need the new things necessarily I would say buy the book.

Alex
--
** Pepsi Cola and animal protection **
**  http://www.pepsi{*word*76}bath.com/  **

Author of the free Chatsystem PINO! || Website: http://www.alcomp.net
Available at http://pino.cjb.net    || Chat   : pinochat.dhs.org:8080

Re:Retrieve file version


Certainly most of the language will be similar.  Each new release
provides new extensions and capabilities, but also backward
compatibility with prior releases.  In general, Release-5 is a true
superset of Release-3.

Quote
>Rob George wrote:

> Several days ago I requested info on the similarity between
> Delphi and Turbo Pascal. I received a number of helpful comments,
> for which I thank those who responded. I now have a second question:
> How similar are Delphi 3 and Delphi 5? Specifically would the Delphi
> 3 Superbible give me the general flavor of Delphi 5?

------------------------------------------------------------------
Sundial Services :: Scottsdale, AZ (USA) :: (480) 946-8259
mailto:i...@sundialservices.com  (PGP public key available.)
Quote
> Fast(!), automatic table-repair with two clicks of the mouse!
> ChimneySweep(R):  "Click click, it's fixed!" {tm}
> http://www.sundialservices.com/products/chimneysweep

Re:Retrieve file version


Quote
Ricardo Sarmento wrote:
> How i retrieve file version info from files ?????

type
  TFileInfo = packed record
    CompanyName: string;
    FileDescription: string;
    FileVersion: string;
    InternalName: string;
    LegalCopyright: string;
    LegalTrademarks: string;
    OriginalFilename: string;
    ProductName: string;
    ProductVersion: string;
    Comments: string;
    PrivateBuild: string;
    SpecialBuild: string;
  end;

function GetFileInfos(const FileName: string): TFileInfo;
var
  Size: DWORD;
  Dummy: DWORD;
  pVerRes: Pointer;
  pTranstab: Pointer;
  strCSet: string;
  Buf: Pointer;
begin
  Size:= GetFileVersionInfoSize(PChar(FileName), Dummy);
  if Size > 0 then
  begin
    GetMem(pVerRes, Size);
    GetFileVersionInfo(PChar(FileName), 0, Size, pVerRes);
    VerQueryValue(pVerRes, '\\VarFileInfo\\Translation', pTranstab,
Size);
    strCSet:= '\\StringFileInfo\\' +
IntToHex(LoWord(Longint(pTranstab^)), 4) +
IntToHex(HiWord(Longint(pTranstab^)), 4) + '\\';
    { Preset }
    Result.Comments:= '';
    Result.CompanyName:= '';
    Result.FileDescription:= '';
    Result.FileVersion:= '';
    Result.InternalName:= '';
    Result.LegalCopyright:= '';
    Result.LegalTrademarks:= '';
    Result.OriginalFilename:= '';
    Result.PrivateBuild:= '';
    Result.ProductName:= '';
    Result.ProductVersion:= '';
    Result.SpecialBuild:= '';
    if VerQueryValue(pVerRes, PChar(strCSet + 'Comments'), Buf, Size)
then Result.Comments:= PChar(Buf);
    if VerQueryValue(pVerRes, PChar(strCSet + 'CompanyName'), Buf, Size)
then Result.CompanyName:= PChar(Buf);
    if VerQueryValue(pVerRes, PChar(strCSet + 'FileDescription'), Buf,
Size) then Result.FileDescription:= PChar(Buf);
    if VerQueryValue(pVerRes, PChar(strCSet + 'FileVersion'), Buf, Size)
then Result.FileVersion:= PChar(Buf);
    if VerQueryValue(pVerRes, PChar(strCSet + 'InternalName'), Buf,
Size) then Result.InternalName:= PChar(Buf);
    if VerQueryValue(pVerRes, PChar(strCSet + 'LegalCopyright'), Buf,
Size) then Result.LegalCopyright:= PChar(Buf);
    if VerQueryValue(pVerRes, PChar(strCSet + 'LegalTrademarks'), Buf,
Size) then Result.LegalTrademarks:= PChar(Buf);
    if VerQueryValue(pVerRes, PChar(strCSet + 'OriginalFilename'), Buf,
Size) then Result.OriginalFilename:= PChar(Buf);
    if VerQueryValue(pVerRes, PChar(strCSet + 'PrivateBuild'), Buf,
Size) then Result.PrivateBuild:= PChar(Buf);
    if VerQueryValue(pVerRes, PChar(strCSet + 'ProductName'), Buf, Size)
then Result.ProductName:= PChar(Buf);
    if VerQueryValue(pVerRes, PChar(strCSet + 'ProductVersion'), Buf,
Size) then Result.ProductVersion:= PChar(Buf);
    if VerQueryValue(pVerRes, PChar(strCSet + 'SpecialBuild'), Buf,
Size) then Result.SpecialBuild:= PChar(Buf);
    FreeMem(pVerRes, Size);
  end;
end;

Regards,

Udo
--
Please reply only to this newsgroup. Do not send any unrequested mails.

Re:Retrieve file version


Several days ago I requested info on the similarity between
Delphi and Turbo Pascal. I received a number of helpful comments
for which I thank those who responded. I now have a second question:
How similar are Delphi 3 and Delphi 5, specifically would the Delphi
3 Superbible give me the general flavor of Delphi 5?
Any replies will be greatly appreciated.
Thanks in advance
regards,
Rob George
regeo...@ctcn.net

Re:Retrieve file version


Yes, it will.

Paul / ColumbuSoft

Quote
Rob George <regeo...@ctcn.net> wrote in message

news:Updv4.81950$ox5.22014732@tw11.nn.bcandid.com...
Quote
> Several days ago I requested info on the similarity between
> Delphi and Turbo Pascal. I received a number of helpful comments
> for which I thank those who responded. I now have a second question:
> How similar are Delphi 3 and Delphi 5, specifically would the Delphi
> 3 Superbible give me the general flavor of Delphi 5?
> Any replies will be greatly appreciated.
> Thanks in advance
> regards,
> Rob George
> regeo...@ctcn.net

Re:Retrieve file version


On Tue, 29 Feb 2000 15:21:10 -0800, "Ricardo Sarmento"

Quote
<rjsarme...@ciberbit.pt> wrote:
>How i retrieve file version info from files ?????

>Rjsarme...@ciberbit.pt

You have two examples of this in Trucomania, in the tips:

[76] - Get the version of your application as defined in the Delphi's
IDE
[386] - Get VersionInfo strings of your executable

Un Saludo:
       Radikal
       www.q3.nu/trucomania

Other Threads