I find that offering versioning information from the about option on the menu is a must for any serious application. Many times you are never too sure how old is the app where bugs are being reported or it is hard to determine what release a user is executing.
In an attempt to solve this matter, I wrote a small app that reads from the file directory the footprint left by svn declaring the subversion number of any svn update and/or commit. The script would read the svn info to then write version.ch which is inclueded on the app. Using xMate user command option, the script gets executed upon a successful built. So, you had the inconvenience of having to build a release twice but that worked well.
Recently I upgraded my svn client. They changed how svn information is stored and my script no longer works. Furthermore, it seems like a daunting task trying to decipher how exactly svn numbers are stored. So I've been searching for other ways. I came across a small utility that can patch your .exe with version information. You can google verpatch.
Using VerPatch you can add resource version information to your compiled exe. By just adding a short script (batch file) to be executed upon successful link from xmate you can patch the .exe with version info. Here is my batch file:
- Code: Select all Expand view
set VERSION="10.0.0"
set FILEDESCR=/s desc "PathLabs Main Module"
set BUILDINFO=/s pb "Built by %USERNAME%"
set COMPINFO=/s company "Structured Systems Corp" /s (c) "(c) Copyright Reinaldo Crespo-Bazán -all rights reserved 2011"
set PRODINFO=/s product "PathLabs10" /pv "10.0 %date% %time%"
f:\mp10\verpatch-bin-1.0.9\verpatch /va f:\mp\PathLabs10.exe %VERSION% %FILEDESCR% %COMPINFO% %PRODINFO% %BUILDINFO%
Using %date% and %time% I'm at least able to find a point in time when the release was built. Still not ideal, but it works automatically and it has the advantage of not needing to build a final release twice.
Can someone advise how to read version resource information so that it can be displayed on the about dialog?
Can someone here suggest how to read svn numbers from the repository or directory as it is now being stored (sqlite db)?
Thank you,
Reinaldo.