Search

Atalasoft Knowledge Base

HOWTO: License an EXE for Deployment (.NET Framework)

Administrator
DotImage

NOTE:

This article refers to the process for licensing a exe that is targeting .NET Framework - for .NET 5 / .NET 6, please see: HOWTO:License a .NET 6 Application (embedding license in an exe)

Embedding a License 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.DotAnnotate

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

    Atalasoft.DotAnnotate.Ink

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

    Atalasoft.DotImage.Annotate

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

    Atalasoft.dotImage.BarcodeReader

    Atalasoft.Barcoding.BarReader, Atalasoft.dotImage.BarcodeReader

    Atalasoft.dotImage.Barcoding

    Atalasoft.Barcoding.BarCodeReader, Atalasoft.dotImage.Barcoding

    Atalasoft.dotImage.Barcoding.Reading

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

    Atalasoft.dotImage.Barcoding.Writing

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

    Atalasoft.dotImage

    Atalasoft.Imaging.AtalaImage, Atalasoft.dotImage

    Atalasoft.dotImage.Dwg

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

    Atalasoft.dotImage.Dicom

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

    Atalasoft.dotImage.FormsProcessing

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

    Atalasoft.dotImage.IntelJpeg

    Atalasoft.Imaging.AtalaImage, Atalasoft.dotImage

    Atalasoft.dotImage.Isis

    Atalasoft.Isis.IsisAcquisition, Atalasoft.dotImage.Isis

    Atalasoft.dotImage.Jbig2

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

    Atalasoft.dotImage.Jpeg2000

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

    Atalasoft.dotImage.Lib

    Atalasoft.Imaging.AtalaImage, Atalasoft.dotImage

    Atalasoft.dotImage.Ocr

    Atalasoft.Ocr.TranslatorCollection, Atalasoft.dotImage.Ocr

    Atalasoft.dotImage.Ocr.Abbyy

    Atalasoft.Ocr.TranslatorCollection, Atalasoft.dotImage.Ocr

    Atalasoft.dotImage.Ocr.GlyphReader

    Atalasoft.Ocr.TranslatorCollection, Atalasoft.dotImage.Ocr

    Atalasoft.dotImage.Ocr.RecoStar

    Atalasoft.Ocr.TranslatorCollection, Atalasoft.dotImage.Ocr

    Atalasoft.dotImage.Ocr.Tesseract

    Atalasoft.Ocr.TranslatorCollection, Atalasoft.dotImage.Ocr

    Atalasoft.dotImage.Ocr.Tesseract3

    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.dotImage.Pdf

    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.dotImage.PdfRasterizer

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

    Atalasoft.dotImage.PdfReader
    (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.dotImage.Raw

    Atalasoft.Imaging.AtalaImage, Atalasoft.dotImage

    Atalasoft.dotImage.WebControls

    Atalasoft.Imaging.AtalaImage, Atalasoft.dotImage

    Atalasoft.dotImage.WinControls

    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.dotImage.Wpf

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

    Atalasoft.dotTwain

    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

Details
Last Modified: 2 Years Ago
Last Modified By: Tananda
Type: HOWTO
Rated 2 stars based on 11 votes.
Article has been viewed 11K times.
Options
Also In This Category