Board index » delphi » Current version.

Current version.

I am having an application. In the aboutbox the version label I want to be
updated with source code everytime I change the version in Project |
Options. How can I do it, if I can?

--
<sorry for my poor English>
Please reply at {*word*104}st...@usa.net as I don't read to often.
Any help will be greatly appreciated
Regards, {*word*104}stine

 

Re:Current version.


On Tue, 6 Oct 1998 04:38:02 +0200, "{*word*104}stine" <{*word*104}st...@usa.net>
wrote:
In Delphi 3 you can (options) make sure the version number/buildnumber
is automaticly updated each time you compile. there are several
components around which extract that information so you can display
it. Look in the Delphi Super Page.
happy coding
Quote
>I am having an application. In the aboutbox the version label I want to be
>updated with source code everytime I change the version in Project |
>Options. How can I do it, if I can?

Re:Current version.


On Tue, 6 Oct 1998 04:38:02 +0200, "{*word*104}stine" <{*word*104}st...@usa.net>
wrote:

Quote
>I am having an application. In the aboutbox the version label I want to be
>updated with source code everytime I change the version in Project |
>Options. How can I do it, if I can?

Try this :

procedure VersionNumberWords(out W1, W2, W3, W4 : Word);
var
  Size, Size2: DWord;
  Pt, Pt2: Pointer;
begin
     Size := GetFileVersionInfoSize (PChar (ParamStr (0)), Size2);
     if Size > 0 then
     begin
          GetMem (Pt, Size);
          try
             GetFileVersionInfo (PChar (ParamStr (0)), 0, Size, Pt);
             // show the fixed information
             VerQueryValue (Pt, '\', Pt2, Size2);
             with TVSFixedFileInfo (Pt2^) do
             begin
                  W1:=HiWord (dwFileVersionMS);
                  W2:=LoWord (dwFileVersionMS);
                  W3:=HiWord (dwFileVersionLS);
                  W4:=LoWord (dwFileVersionLS);
             end;
          finally
                 FreeMem (Pt);
          end;
     end;
end;

Function VersionNumber : string;
var W1,W2,W3,W4 : Word;
begin
     result:='???';
     VersionNumberWords(W1, W2, W3, W4);
     result:= IntToStr (W1)+'.'+
              IntToStr (W2)+'.'+
              IntToStr (W3)+'.'+
              IntToStr (W4);
end;

--

*        There are THREE kinds of people in the world...          *
**         Those that can count and those that can't.            **
*****     Ralf Steinh?u?er alias r...@sbox.tu-graz.ac.at      *****

Other Threads