0

For my first export script I took the KCEC example and the APIRefExport.chm documentation to create my project by replacing the example code with my own.

I would like to create a clean export script from scratch.

I created a new class library project and called it EmptyExportScript (placeholder). The target framework is .Net 4. The platform target is x86 and the output path is .....\Program Files (x86)\Kofax\CaptureSS\ServLib\Bin\. When debugging I would like to start the administration module so I set this path .......\Program Files (x86)\Kofax\CaptureSS\ServLib\Bin\.

The option "Make assembly COM-Visible" is checked and I added the Kofax.ReleaseLib.Interop.dll to the references.

For the KfxReleaseScript.cs I added this code

[ClassInterface(ClassInterfaceType.None)]
[ProgId("KFXTS.EmptyExportScript.KfxReleaseScript")]
public class KfxReleaseScript
{
    public ReleaseData documentData;

    // public KfxReturnValue OpenScript()

    // public KfxReturnValue ReleaseDoc()

    // public KfxReturnValue CloseScript()
}

For the KfxReleaseScriptSetup.cs I added this code

[ClassInterface(ClassInterfaceType.None)]
[ProgId("KFXTS.EmptyExportScript.KfxReleaseScriptSetup")]
public class KfxReleaseScriptSetup
{
    public ReleaseSetupData setupData;

    // public KfxReturnValue OpenScript()

    // public KfxReturnValue CloseScript()

    // public KfxReturnValue RunUI()

    // public KfxReturnValue ActionEvent(KfxActionValue actionID, string data1, string data2)
}

Lastly I added a Form to the project when running the UI.

For registration I added a EmptyExportScript.inf with this content

[Scripts]
Empty Export

[Empty Export]
SetupModule=EmptyExportScript.dll
SetupProgID=KFXTS.EmptyExportScript.KfxReleaseScriptSetup
SetupVersion=10.2
ReleaseModule=EmptyExportScript.dll
ReleaseProgID=KFXTS.EmptyExportScript.KfxReleaseScript
ReleaseVersion=10.2
SupportsNonImageFiles=True
SupportsKofaxPDF=True
RemainLoaded=True
SupportsOriginalFileName=False

When building the project .dll and .inf file get placed into the kofax bin directory.

I recognized that other scripts have a .pdb and .dll.config file in there too.

How do I get them?

When trying to install the custom script, I can add it to the script installation manager but I can't install it. There is nothing to install so I think I'm missing the .pdb and .dll.config file.

Is anything else missing?

Thanks for help :)

2 Answers2

0

Kofax does not need a pdb file, but they are handy if you want to debug your connector and attach it to the release.exe process (learn more about them here).

I would not recommend changing the output path itself to Capture\Bin, but rather create a post-build event:

post build event

For example, the following line copies all required files to a separate folder under the CaptureSS\Bin folder:

xcopy "$(TargetDir)*" "C:\Program Files (x86)\Kofax\CaptureSS\ServLib\Bin\SmartCAP\kec\SmartCAP.KEC.Template\" /Y /S

Having a dll.config file is possible, but rare. I would rather recommend storing process-specific data in a custom storage string object of the respective batch class definition (which has the added benefit that you can just import/export the definition along with the batch class, and that you can display and have it changed it in setup form). Having said all that, back to your initial issue - the connector can't be installed.

COM visibility

The assembly needs to be COM-visible, but you mentioned that it was. For the sake of completeness, here's what you will need to do. Note that the GUID must be unique (only relevant if you copied an existing solution):

COM visible assembly

If you're installing the connector on a different machine, you will need to register it first using regasm.exe - here's an example:

"C:\Windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe" SampleExport.dll /codebase /tlb:SampleExport.tlb

ProgIds

Then, your .inf file needs to contain the precise ProgIDs:

[Scripts]
SampleExport

[SampleExport]
SetupModule=SampleExport.dll
SetupProgID=SampleExport.Setup
SetupVersion=11.0
ReleaseModule=SampleExport.dll
ReleaseProgID=SampleExport
ReleaseVersion=11.0
SupportsNonImageFiles=True
SupportsKofaxPDF=True

Both your ReleaseScript.cs and ReleaseSetupScript.cs files need the correct attribute, for example:

[ProgId("SampleExport")]
public class ReleaseScript

If that all still does not work, please provide us with the detailed error message (to be found at CaptureSV\Logs).

Wolfgang Radl
  • 2,319
  • 2
  • 17
  • 22
0

I had to change the file format from UTF-8 to UTF-8 without BOM.

This worked for me.