A while back on the ClarionLive skype chat I mentioned this template and promised to upload a version. I completely forgot all about it a few days later but here it is finally!

This template just calls up SubWCRev.exe which is shipped with TortoiseSVN. After that it is up to you to arrange to compile the details into your EXE or DLL. This is very easy to do using the VersionRes.TPL shipped with Clarion but it should also work fine with any other similar template designed to include values from an external file.

At this point I don’t intend to ship a fully working example but hopefully the following explanation will be enough to get you going.

The Template:

 

This template has only been tested with Clarion7 ABC but it should work fine in C6 as well as legacy applications.

Some screenshots that should explain how I use it:

 

1. Add the global extension to your application

GenerateSubVersion template dialog with default values

Note the name of the “Source version file”. This is the template used as the input for SubWCRev. Here is an example of how you might want to use it:

You will need to create this “SubVersion.in” file yourself. The destination file “SubVersion” is generated for you)

2. Add the global Version Resource template and configure it to use the destination file specified in the GenerateSubVersion template:

Clarions VersionRes.tpl configured to use an external file

3. Compile your application and if all goes well you should now have your SubVersion build compiled into your version resource!

Compiled EXE with SVN revision information!

The SVN revision in this example is "2" and as you can see I have chosen to include the rev date as well. The date could be useful to automatically include the Copyright year for example…