vspacer
 
vspacer
 
Valid XHTML 1.0!
 
Valid CSS 1.0

Free Kintana Tools - View Build Info For Windows Executables

 

ZDS Free Kintana Tools
ByDave Goodall

 
Plugging viewbuildinfo into your command script

The viewbuildinfo tool is called from your command script just before you invoke the compiler to build an executable or dynamic link library.

When run from the command prompt the tool takes, for example, these parameters:

viewbuildinfo  build=debug inc=Y rel=1.4.0 alpha=z lib=4.8.1 cmp=6.0 pkg=123456 line=24 id=davegoodall {appname}.rc

So, depending on the variable names you have assigned to the parameters entered in the add package line dialog, the invocation in the command script will look something like this:

ksc_local_exec bin/viewbuildinfo build=[PKGL.DEBUG_RELEASE] inc=[PKGL.INCREMENTAL_BUILD] rel=[PKGL.RELEASE]
                                 alpha=[PKGL.ALPHA] lib=[PKGL.LIBRARY_VERSION] cmp=[PKGL.COMPILER_VERSION]
                                 pkg=[PKG.NUMBER ] line=[PKG.PKGL.SEQ] id=[SYS.USERNAME]
                                [PKGL.APP_NAME].rc
 

All on one line of course. If you don't want to use a particular parameter just supply double quotes e.g : lib=""


How it works

The tool works by modifying the resource (.rc) file that gets used by the compilation step.
It replaces the "Comments" value with the build information you supplied.

When the compilation is complete the build information will have been bound into the .exe or .dll executable.

If there are problems with the executable, a right click on it in Windows Explorer will bring up it's 'Version' tab with full build details:



This is particularly useful when an executable migration has to match a database change.
It's very easy to see if the executable in place matches the database!


Execution log Entries

If the utility succeeds, it writes this entry to the execution log:

viewbuildinfo v1.4 Normal : Version info successfully updated to {appname}.rc

If it encountered an error it writes an error message to the execution log - for example:

viewbuildinfo v1.4 ERROR : Unable to open file [f:/dev/myapp/miapp.rc]


Return Codes

The utility returns these codes and associated error messages:

   0 Version info successfully updated to {appname}.rc
 255 Syntax Error
 254 ERROR File %s does not have a .rc extension
 253 ERROR Unable to clear read_only attribute from file [%s]"
 252 ERROR Unable to open file [%s]"
 251 ERROR : file [%s] size is.. huge.
 250 ERROR Unable to allocate %ld byte buffer
 249 ERROR Unable to read %s file into %ld memory buffer
 248 ERROR 'StringFileInfo' block not found in [%s]", szRcFileName);
 247 ERROR 'StringFileInfo' block has missing 'VALUE \"Comments\"' entry in [%s]
 246 ERROR Unable to position to start of file [%s]
 245 ERROR Unable to write buffer %s to file [%s]

Download

KintanaTools.zip (21 Kb)



Back to top | ZDS Home | This article updated November 13, 2007.