Solved

find application minor version and build

Posted on 1998-08-15
1
229 Views
Last Modified: 2010-04-04
I need to find my application's current minor version number and build number from within the code.
Thanks
0
Comment
Question by:openmind1
1 Comment
 
LVL 4

Accepted Solution

by:
erajoj earned 50 total points
Comment Utility
Hi,
This is about it:

var
  hZero        : THandle;
  iSize        : Integer;
  pVersionData : Pointer;
  pFFI         : PVSFixedFileInfo;
  uiQuerySize  : UINT;
  wMajorVersion: Word;
  wMinorVersion: Word;
  wRelease     : Word;
  wBuild       : Word;
begin
  iSize := GetFileVersionInfoSize( PChar( Application.ExeName ), hZero );
  if ( iSize > 0 ) then
  begin
    GetMem( pVersionData, iSize );
    GetFileVersionInfo( PChar( Application.ExeName ), hZero, iSize, pVersionData );
    New( pFFI );
    VerQueryValue( pVersionData, '\'{fixed data}, Pointer( pFFI ), uiQuerySize );

    wMajorVersion := HIWORD( pFFI^.dwProductVersionMS ); // Highest 16 bits...
    wMinorVersion := LOWORD( pFFI^.dwProductVersionMS );
    wRelease      := HIWORD( pFFI^.dwProductVersionLS );
    wBuild        := LOWORD( pFFI^.dwProductVersionLS ); // Lowest 16 bits...

    Label1.Caption := Format( '%d.%d.%d.%d', [ wMajorVersion, wMinorVersion, wRelease, wBuild ] );
  end;
end;

/// John
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now