HOWTO: License an EXE for Deployment

In order to deploy an application using DotImage, DotAnnotate or DotTwain, the .exe file must be licensed correctly. The following steps outline this procedure. (Note: DotImage OCR requires a runtime license agreement)

If you have only used an Atalasoft toolkit in a DLL, and are referencing that DLL in an EXE, you must follow these steps on the Executable project, NOT the DLL project. This is because our license can only be embedded into an EXE. Visual Studio will not embed a license if it thinks the license is not used in the code for the EXE. To get around this issue, follow these steps:

  1. Add all the Atalasoft references from your DLL project to the EXE project
  2. (c) Now you are ready to follow the steps below
  1. Locate the 'licenses.licx' file. It should be located in the Properties directory (next to AssemblyInfo.cs) inside visual studio project folder (For VB it would live in the MyProject folder next to AssemblyInfo.vb). If this file does not exist, create it. (Note: For a console application, you must include this file in the project so it shows up in the solution explorer, otherwise visual studio will ignore it. Likewise, if you had to manually create the file for any reason, be sure to click "show all files" in the solution explorer, find your licenses.licx file, and right-click to select the option to include the file in your project.)
  2. Examine the references that are in your project. For each Atalasoft reference, refer to the table below and add the corresponding line to the .licx file. Keep in mind that a few references are licensed by the same license file, and therefore they have the exact same entry in the .licx file. If the entry was already entered, there is no need to add it again. (Note: If an entry in the licx was automatically generated by the visual studio designer, it may contain version information. You should delete all extra information other than what is listed below. This version information may cause problems when you upgrade you DotImage SDK.)
  3. Compile your application (using a *REbuild*) to embed the licenses as a resource in the .exe file. Visual studio will automatically find the .licx file and embed the correct licenses into your application. No special steps need to be taken at this point

    To License this Assembly ... Add This Line


    Atalasoft.Annotate.UI.AnnotateViewer, Atalasoft.DotImage.Annotate


    Atalasoft.Annotate.UI.AnnotateViewer, Atalasoft.DotImage.Annotate


    Atalasoft.Annotate.UI.AnnotateViewer, Atalasoft.DotImage.Annotate


    Atalasoft.Barcoding.BarReader, Atalasoft.dotImage.BarcodeReader


    Atalasoft.Barcoding.BarCodeReader, Atalasoft.dotImage.Barcoding


    Atalasoft.Barcoding.Reading.BarCodeReader, Atalasoft.dotImage.Barcoding.Reading


    Atalasoft.Barcoding.Writing.BarcodeWriter, Atalasoft.dotImage.Barcoding.Writing


    Atalasoft.Imaging.AtalaImage, Atalasoft.dotImage


    Atalasoft.Imaging.Codec.CadCam.DwgDecoder, Atalasoft.dotImage.Dwg


    Atalasoft.Imaging.Codec.Dicom.DicomDecoder, Atalasoft.dotImage.Dicom


    Atalasoft.FormsProcessing.Omr.OmrEngine, Atalasoft.dotImage.FormsProcessing


    Atalasoft.Imaging.AtalaImage, Atalasoft.dotImage


    Atalasoft.Isis.IsisAcquisition, Atalasoft.dotImage.Isis


    Atalasoft.Imaging.Codec.Jbig2.Jb2Decoder, Atalasoft.dotImage.Jbig2


    Atalasoft.Imaging.Codec.Jpeg2000.Jp2Decoder, Atalasoft.dotImage.Jpeg2000


    Atalasoft.Imaging.AtalaImage, Atalasoft.dotImage


    Atalasoft.Ocr.TranslatorCollection, Atalasoft.dotImage.Ocr


    Atalasoft.Ocr.TranslatorCollection, Atalasoft.dotImage.Ocr


    Atalasoft.Ocr.TranslatorCollection, Atalasoft.dotImage.Ocr


    Atalasoft.Ocr.TranslatorCollection, Atalasoft.dotImage.Ocr


    Atalasoft.Ocr.TranslatorCollection, Atalasoft.dotImage.Ocr


    Atalasoft.Ocr.TranslatorCollection, Atalasoft.dotImage.Ocr

    * Atalasoft.dotImage.Office *
    Both OfficeAdapterDecoeer and OfficeDecoder "live in" the Office Assembly. *

    If using OfficeAdapterDecoder (10.6): Atalasoft.Imaging.Codec.Office.OfficeAdapterDecoder, Atalasoft.dotImage.Office
    If using OfficeDecoder (10.7 and newer only) Atalasoft.Imaging.Codec.Office.OfficeDecoder, Atalasoft.dotImage.Office


    Atalasoft.Imaging.AtalaImage, Atalasoft.dotImage

    * Atalasoft.dotImage.PdfDoc *
    ONLY if using PdfGeneration / DotPdf

    Atalasoft.PdfDoc.Generating.PdfGeneratedDocument, Atalasoft.PdfDoc

    * Atalasoft.dotImage.PdfDoc *
    If using PdfDocument, but not PdfGeneration

    Atalasoft.PdfDoc.PdfDocument, Atalasoft.PdfDoc


    Atalasoft.Imaging.Codec.Pdf.PdfDecoder, Atalasoft.dotImage.PdfRasterizer

    (up through 10.7)
    Atalasoft.dotImage.PdfReader (11.0 and newer)

    Atalasoft.Imaging.Codec.Pdf.PdfDecoder, Atalasoft.dotImage.PdfReader

    Atalasoft.Imaging.Codec.Pdf.PdfDecoder, Atalasoft.dotImage.PdfReader


    Atalasoft.Imaging.AtalaImage, Atalasoft.dotImage


    Atalasoft.Imaging.AtalaImage, Atalasoft.dotImage


    Atalasoft.Imaging.WinControls.WorkspaceViewer, Atalasoft.dotImage.WinControls

    * Atalasoft.dotImage.Word *
    Word assembly replaced with Office assembly in 10.6

    Atalasoft.Imaging.Codec.Word.WordDecoder, Atalasoft.dotImage.Word


    Atalasoft.Imaging.Wpf.AtalaImageViewer, Atalasoft.dotImage.Wpf


    Atalasoft.Twain.Acquisition, Atalasoft.DotTwain

    If you are using DotImage 4.0 or Previous then please use the below lines for DotAnnotate, DotAnnotate.Ink, or DotImage.DotAnnotate

    Atalasoft.DotAnnotate Atalasoft.Imaging.Annotate.AnnotateViewer, Atalasoft.DotImage.Annotate
    Atalasoft.DotAnnotate.Ink Atalasoft.Imaging.Annotate.AnnotateViewer, Atalasoft.DotImage.Annotate
    Atalasoft.DotImage.Annotate Atalasoft.Imaging.Annotate.AnnotateViewer, Atalasoft.DotImage.Annotate

  4. Test your application. To emulate a client machine you can simply relocate your development licenses so that DotImage cannot find them. The license file are located at "C:\Documents and Settings\\Local Settings\Application Data\Atalasoft\DotImage X.0" (XP) or "C:\Users\\AppData\Local\Atalasoft\DotImage X.0". Create a temporary folder and move all of the .lic file there. Make sure to relocate any license files for other versions of DotImage also. Now run your exe. When it starts, DotImage should read the licenses that were embedded into the exe, so if the application runs without a license error you know that the licenses were embedded successfully.
  5. Fix problems. If you have any license problems, please see one of the related articles.

Original Article:
Q10128 - HOWTO: License an EXE for Deployment