Board index » cppbuilder » Version Info

Version Info


2003-07-08 09:09:39 PM
cppbuilder32
I know this has been posted about just a couple of weeks ago, but does anyone have WORKING code for BCB6 to retrieve version information for your application?
It would be so greatly appreciated.
Andrew.
 
 

Re:Version Info

"Andrew" < XXXX@XXXXX.COM >wrote in message
Quote
I know this has been posted about just a couple of weeks
ago, but does anyone have WORKING code for BCB6
to retrieve version information for your application?
Go to www.deja.com or ww.mers.com and search through the
newsgroup archives, sample code has been posted frequently hundreds of times
before.
Gambit
 

Re:Version Info

Hi,
how can i use the Version-Info in my Project?
Thanx!
 

{smallsort}

Re:Version Info

Quote
how can i use the Version-Info in my Project?
1] In the Project Options, turn on Version Info
2] As for displaying it, there are a few ways:
1) Use a component.
TurboPower's SysTools has one for it (and a ton of other things):
sourceforge.net/projects/tpsystools/
The wonderful shareware ZieglerCollection has one:
www.zieglersoft.com
Some free ones:
Imran's TGetVer: www.imranweb.com/freesoft.htm
RxLib : sourceforge.net/projects/rxlib/
Version-aware about box on Borland Community:
codecentral.borland.com/codecentral/ccweb.exe/listing
2) Get the info yourself.
If you have BCB5, it comes with an example in:
[bcbroot]\Examples\Controls\VersionInfo
Here's an example posted a little while ago:
///in header
String __fastcall VersionInfo(const String &sQuery);
///in source
String __fastcall TAboutForm::VersionInfo(const String &sQuery)
{
DWORD c;
DWORD dw=0;
UINT ui;
char *p;
LPVOID ptr;
String sOut=ParamStr(0); ///ParamStr(0) holds exe name
c = GetFileVersionInfoSize(ParamStr(0).c_str(), &dw);
p = new char[c + 1]; /file://create the space
GetFileVersionInfo(ParamStr(0).c_str(),0,c,p);//get the version info data
/// Extract the language/translation information...
VerQueryValue(p, TEXT("\\VarFileInfo\\Translation"), &ptr, &ui);
/// ptr comes back as a ptr to two (16-bit) words containing the two halves of
/// the translation number required for StringFileInfo
WORD *id=(WORD*)ptr;
String sBase = String( "\\StringFileInfo\\")+
IntToHex(id[0],4) +
IntToHex(id[1],4) +
"\\";
String qs = sBase + sQuery ; // query string
VerQueryValue(p, qs.c_str(), &ptr, &ui);
sOut = (char*)ptr;
delete [] p;
return sOut;
}
///and the calls
Comments->Caption=VersionInfo("Comments");
Copyright->Caption=VersionInfo("LegalCopyright");
ProductName->Caption=VersionInfo("ProductName");
Version->Caption="Version: " + VersionInfo("FileVersion");
--
Jonathan Arnold C/C++/CBuilder Keen Advice:
www.keen.com/categories/categorylist_expand.asp
Comprehensive C++Builder link site:
www.buddydog.org/C++Builder/c++builder.html
 

Re:Version Info

Okay thx alot, did that getting work but how do Idisplay the Build number?
Thx again!
Jonathan Arnold wrote:
Quote
>how can i use the Version-Info in my Project?

1] In the Project Options, turn on Version Info

2] As for displaying it, there are a few ways:

1) Use a component.

TurboPower's SysTools has one for it (and a ton of other things):
sourceforge.net/projects/tpsystools/

The wonderful shareware ZieglerCollection has one:
www.zieglersoft.com

Some free ones:

Imran's TGetVer: www.imranweb.com/freesoft.htm
RxLib : sourceforge.net/projects/rxlib/

Version-aware about box on Borland Community:
codecentral.borland.com/codecentral/ccweb.exe/listing

2) Get the info yourself.

If you have BCB5, it comes with an example in:
[bcbroot]\Examples\Controls\VersionInfo

Here's an example posted a little while ago:

///in header
String __fastcall VersionInfo(const String &sQuery);

///in source
String __fastcall TAboutForm::VersionInfo(const String &sQuery)
{
DWORD c;
DWORD dw=0;
UINT ui;
char *p;
LPVOID ptr;
String sOut=ParamStr(0); ///ParamStr(0) holds exe name

c = GetFileVersionInfoSize(ParamStr(0).c_str(), &dw);
p = new char[c + 1]; /file://create the space
GetFileVersionInfo(ParamStr(0).c_str(),0,c,p);//get the version
info data

/// Extract the language/translation information...
VerQueryValue(p, TEXT("\\VarFileInfo\\Translation"), &ptr, &ui);

/// ptr comes back as a ptr to two (16-bit) words containing the two
halves of /// the translation number required for StringFileInfo
WORD *id=(WORD*)ptr;
String sBase = String( "\\StringFileInfo\\")+
IntToHex(id[0],4) +
IntToHex(id[1],4) +
"\\";
String qs = sBase + sQuery ; // query string
VerQueryValue(p, qs.c_str(), &ptr, &ui);
sOut = (char*)ptr;
delete [] p;
return sOut;
}

///and the calls
Comments->Caption=VersionInfo("Comments");
Copyright->Caption=VersionInfo("LegalCopyright");
ProductName->Caption=VersionInfo("ProductName");
Version->Caption="Version: " + VersionInfo("FileVersion");
 

Re:Version Info

I put an About box on my application and have set the Project options to
include the version information.
What is the procedure/function that gets that information so I can present
it in my form?
TIA
 

Re:Version Info

Hi All.
How can i display all fields of Version Info, on the Form Title?
Thanks
 

Re:Version Info

"Marcello Scala" < XXXX@XXXXX.COM >wrote in message
Quote
How can i display all fields of Version Info, on the Form Title?
Look at the GetVersionFileInfoSize(), GetFileVersionInfo(), and
VerQueryValue() functions in the Win32 API.
Gambit
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (www.grisoft.com).
Version: 6.0.515 / Virus Database: 313 - Release Date: 9/1/03
 

Re:Version Info

How do I reset version info in a project was assign with Auto-increment
built number and not assign include version information in project?
All options will be show disable.
 

Re:Version Info

"Richard Guill������������������������������������? wrote:
Quote
How do I reset version info in a project was assign with Auto-increment
built number and not assign include version information in project?

All options will be show disable.
The options are disabled if you remove the $R directive from your
project file. Add the following line to your DPR file and the
version-information controls should be enabled.
{$R *.RES}
--
Rob
 

Re:Version Info

Thank you very much.
"Richard Guilln Reyes" < XXXX@XXXXX.COM >wrote in message
Quote
How do I reset version info in a project was assign with Auto-increment
built number and not assign include version information in project?

All options will be show disable.


 

Re:Version Info

I'm sure this must have come up before, but I have been unable to locate any
information.
How does one go about getting the version information out of an ActiveX
control?
All hints and examples will be greatly appreciated.
Drow
 

Re:Version Info

"Drow Oberoth" < XXXX@XXXXX.COM >wrote in
Quote
I'm sure this must have come up before, but I have been unable to
locate any information.

How does one go about getting the version information out of an
ActiveX control?

All hints and examples will be greatly appreciated.

Which version information do you mean? Do you mean the version
contained in the EXE/DLL, or the version numbers in the typelibrary?
 

Re:Version Info

Actually, a method for retrieving either/or would be good.
I can get the information of the container program (in this case, IE), but
I'm looking to pull out the information in the Delphi project, which would
be the typelibrary I believe.
"John Carlyle-Clarke" < XXXX@XXXXX.COM >wrote in message
Quote
"Drow Oberoth" < XXXX@XXXXX.COM >wrote in
news:3ff191c7$0$18388$ XXXX@XXXXX.COM :

>I'm sure this must have come up before, but I have been unable to
>locate any information.
>
>How does one go about getting the version information out of an
>ActiveX control?
>
>All hints and examples will be greatly appreciated.
>

Which version information do you mean? Do you mean the version
contained in the EXE/DLL, or the version numbers in the typelibrary?
 

Re:Version Info

Guess that it would help if I included the version information :)
Indy 10
Delphi 6 and 7