Kofax Capture Scripting with any version of Visual Studio

Officially, Kofax supports the Visual Basic Express Versions for validation and recognition scripts, and only certain versions of it. So, if you are still running Capture 9, Visual Studio 2012 might not work for you. I run Capture 10.2 and wanted to be able to work with Visual Studio 2015 (Community Edition). The good news is: it will work.

The following screenshot shows the message Kofax Capture prompts you with when creating or editing a script without the appropriate versions (or at least what Capture thinks the appropriate version should be) being present:

kc-admin-vs

Let’s dig a little deeper. I want to know exactly where Capture keeps looking at, so I fired up Process Monitor before creating a script:

regkey

As we can see, Capture checks the registry for existing Visual Studio installations. Capture 10.2 expects either VS 2010, 2012 or 2013 [Source: http://knowledgebase.kofax.com/faqsearch/results.aspx?QAID=19037]. To keep things complicated, Microsoft assigns confusing version numbers to their studios, so for example VS 2015 is 14.0 while VS 2012 is 13.0. Think you got the logic? The build number is just the year, minus one? Well, no. VS 2010 was 10.0, VS 2008 was 9.0, and 2005 was 8.0. Anyway, that’s a different story – and at least we saw some consistency in the last three releases, so let’s hope for the best.

Back to topic: Kofax first checks for the most recent installed studio – in my case VS 2013. Of course it is not there – remember, I’m running VS 2015, hence the 14.0 entry in the registry on the right hand side. Thereafter, it checks for 2012, then 2010… I guess you get the idea.

So, I decided to create some registry keys by hand to find out further what Capture is looking for. It turned out that it requires the install directory of the IDE plus the product directories of either VC# or VB – that’s it. What if we created those keys, and pointed them to 2015’s (14.0’s) paths?

key1
key2

Now, let’s give it a shot:

kc-vs2015

VoilĂ : Capture fires up Visual Studio 2015 right away, without complaining about anything.

While I do not expect any issues here, especially as older versions of VS are not present on my machine and never will be, there may be some side-effects. Not likely from either Capture or Visual Studio, but maybe from 3rd party applications. So, this comes without any warranty at all.

Here are the required registry keys for my setup (Capture 10.2 and VS 2015). Note that you may have to adjust them accordingly to your versions.


Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\12.0]
"InstallDir"="C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\"

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\12.0\Setup]

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\12.0\Setup\VB]
"ProductDir"="C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VB\\"

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\12.0\Setup\VC#]
"ProductDir"="C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC#\\"