file versions

this is not a drivers question directly, so my apologies to you all.

Like many others, I build my drivers through the command line tools. After
the DDK generates the .sys file I want to run a few sanity checks on the
binary. This is part of build automation. One of hte sanity checks is the
one which checks the binary’s version info to see if he build scripts have
updated it correctly.

My question is how do I get the version (writing my own exe is the last
option I will take, if there are no free utils). I found filever from
microsoft (http://support.microsoft.com/kb/913111), but it’s output has
other details that are not directly usable in the batch build environment.

any pointers will be appreciated.

thanks

bedanto

Bedanto wrote:

this is not a drivers question directly, so my apologies to you all.

Like many others, I build my drivers through the command line tools.
After the DDK generates the .sys file I want to run a few sanity checks
on the binary. This is part of build automation. One of hte sanity
checks is the one which checks the binary’s version info to see if he
build scripts have updated it correctly.

My question is how do I get the version (writing my own exe is the last
option I will take, if there are no free utils). I found filever from
microsoft (http://support.microsoft.com/kb/913111), but it’s output has
other details that are not directly usable in the batch build environment.

any pointers will be appreciated.

thanks

bedanto

Try this free util - not exactly what you need, but you can tweak it.

http://www.codeproject.com/KB/install/VerPatch.aspx

–ap

Python works well too.

“Pavel A.” wrote in message news:xxxxx@ntdev…
> Bedanto wrote:
>> this is not a drivers question directly, so my apologies to you all.
>> Like many others, I build my drivers through the command line tools.
>> After the DDK generates the .sys file I want to run a few sanity checks
>> on the binary. This is part of build automation. One of hte sanity checks
>> is the one which checks the binary’s version info to see if he build
>> scripts have updated it correctly.
>> My question is how do I get the version (writing my own exe is the last
>> option I will take, if there are no free utils). I found filever from
>> microsoft (http://support.microsoft.com/kb/913111), but it’s output has
>> other details that are not directly usable in the batch build
>> environment.
>> any pointers will be appreciated.
>> thanks
>> bedanto
>
> Try this free util - not exactly what you need, but you can tweak it.
>
> http://www.codeproject.com/KB/install/VerPatch.aspx
>
> --ap
>
>

It’s actually pretty easy.

You want to use these APIs:

  • GetFileVersionInfoSize
  • GetFileVersionInfo
  • VerQueryValue( “\”, … )

The latter hands you back a VS_FIXEDFILEINFO which has the product and file versions packed into two 32-bit halves of a 64-bit integer.

Conventionally the version number is broken into 4 16-bit fields (a.b.c.d), with a being the top 16 bits, b being the next 16 bits, c being the next 16 bits, and d being the low 16 bits.

  • S

From: Bedanto
Sent: Thursday, July 23, 2009 06:08
To: Windows System Software Devs Interest List
Subject: [ntdev] file versions

this is not a drivers question directly, so my apologies to you all.

Like many others, I build my drivers through the command line tools. After the DDK generates the .sys file I want to run a few sanity checks on the binary. This is part of build automation. One of hte sanity checks is the one which checks the binary’s version info to see if he build scripts have updated it correctly.

My question is how do I get the version (writing my own exe is the last option I will take, if there are no free utils). I found filever from microsoft (http://support.microsoft.com/kb/913111), but it’s output has other details that are not directly usable in the batch build environment.

any pointers will be appreciated.

thanks

bedanto
— NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging and other seminars visit: http://www.osr.com/seminars To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

David Craig wrote:

Python works well too.

Funny you should say that – my version resource extractor is, in fact,
a Python script.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

I have a batch file and Python code that takes our distribution (for QA)
directory and compares versions in the INFs, SYSes, & PDBs. Some have
internal versions or just file date/time but it works well. It also does
the release.txt file in each subdirectory too since we have a standard
format for the version information in the file that has to match everything.
I have to have a fuzz factor for the PDBs since I am only using the
date/time info from the file itself to match.

“Tim Roberts” wrote in message news:xxxxx@ntdev…
> David Craig wrote:
>> Python works well too.
>>
>
> Funny you should say that – my version resource extractor is, in fact,
> a Python script.
>
> –
> Tim Roberts, xxxxx@probo.com
> Providenza & Boekelheide, Inc.
>
>

thanks for your valuable inputs. I finally used vb scripts (5 lines of code)
and this can be easily invoked from the BAtch files. I wanted to avoi python
or other things, which needs seperate installations.

On Thu, Jul 23, 2009 at 11:08 PM, David Craig wrote:

> I have a batch file and Python code that takes our distribution (for QA)
> directory and compares versions in the INFs, SYSes, & PDBs. Some have
> internal versions or just file date/time but it works well. It also does
> the release.txt file in each subdirectory too since we have a standard
> format for the version information in the file that has to match
> everything.
> I have to have a fuzz factor for the PDBs since I am only using the
> date/time info from the file itself to match.
>
> “Tim Roberts” wrote in message news:xxxxx@ntdev…
> > David Craig wrote:
> >> Python works well too.
> >>
> >
> > Funny you should say that – my version resource extractor is, in fact,
> > a Python script.
> >
> > –
> > Tim Roberts, xxxxx@probo.com
> > Providenza & Boekelheide, Inc.
> >
> >
>
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

Email secured by Check Point at OSR.COM