Set up the CSDK scanning sub-system in the redistribution

There are three new functions in Recognita Scanner Driver (RSD) that the install/uninstall process calls as delayed custom actions: RsdInstallMsi(), RsdRepairMsi(), and RsdUninstallMsi().

All these functions are located in RnRSDu.dll. These functions have to be called from the installed instance of RnRSDu.dll in the folder where it is installed, and not from the temporary one in the temp folder, otherwise other RSD modules will not be found by RnRSDU.dll.

These functions replace all activities of the installer/uninstaller in regard to all registry entries and files mentioned below. The installer should simply install all files mentioned below in the same folder where the binaries of RSD are installed. All other activities including maintenance of reference counts are the task of these functions. All files belonging to RSD (including the files mentioned below) should be installed in the same folder, but other files of the product might be installed in other folders including the "main app". For example, in case of Kofax Power PDF, the binaries of RSD are located in the install folder, while the main app is installed in the install\bin folder, therefore delayed custom actions should be called from RnRSDu.dll in the install folder and <full path of main app> should point to the main application in the install\bin folder.

int WINAPI RsdInstallMsi(MSIHANDLE hMsi)

It can be called after all binaries of RSD are installed to the destination folder. This function performs all necessary actions for RSD which can only be done in Admin Mode during installation.

CustomActionData should be composed as follows:

<product name>;<full path of main app>;<path of scanner.ini>;<registry key>;<language>
Use the following components:

  • <product name> is the name of the product as the Wizard will show, for example: "Power PDF Advanced".

  • <full path of main app> is what it really means, for example:

    D:\Program Files (x86)\...\...\bin\....exe

  • <path of scanner.ini> can be absolute path, but usually it is a relative path, using one of the following prefixes:

    • "ROAMING\" is the user’s roaming data folder.

    • "LOCAL\" is the user’s local data folder.

    • "COMMON\" is the common data folder.

    For example:

    LOCAL\Kofax\PDF\V1\Scanner.ini

  • <registry key> is the path of registry entries relative to HKLM\SOFTWARE if it is different from <product name>. Otherwise it can be empty, for example:

    Kofax\PDF\V1

  • <language> is the 3-letter suffix of one of the RnRsdWizRes_*.dll files. It is treated "ENG" if it is empty.

    Use one of the following language suffixes:

    • ARA

    • BRA

    • BUL

    • CHS

    • CHT

    • CZH

    • DAN

    • DUT

    • ENG

    • FIN

    • FRE

    • GER

    • HUN

    • ITA

    • JPN

    • KOR

    • NOR

    • POL

    • ROM

    • RUS

    • SLO

    • SPA

    • SWE

    • TUR

    The list of available languages depends on the file set actually installed.

    For example:

    Power PDF Advanced;D:\Program Files (x86)\...\...\bin\....exe;LOCAL\Kofax\PDF\V1\Scanner.ini;Kofax\PDF\V1;ENG

    The separator character between the components of CustomActionData can be ";" (semicolon) or "|" (vertical bar).

This function performs the following operations:

  • Creates the following registry key: HKLM\SOFTWARE\<product name> or HKLM\SOFTWARE\<registry key>, if <registry key> is not empty

  • Creates the following values under the key above:

    • BinPath = <full path of RSD> without the name of the file. For example:

      D:\Program Files (x86)\Kofax\Power PDF 40\bin\

    • DataPath = <path of scanner.ini>

    • Language = <language>

    • ProductName = <product name> if it does not exist already and differs from <registry key>

    • _RSD_ = <number> for private use of RSD

  • Creates the following folder:

    <Common AppData>\Kofax\SWizard

  • Copies the following files from the installed binaries to the above folder with version control and reference count (creates or increases reference count):

    • SWizard.xml

    • SWizard.xsd

  • If ISIS is supported by the product, that is, RnISISu.rsd is installed, it creates the following folder:

    <Windows>\PIXTRAN

  • Copies the RsdScan.chn file from the installed binaries with reference count (creates or increases reference count) to the folder above.

  • If Fujitsu ScanSnap is supported by the product, that is RnScanSnapU.rsd is installed, creates the following registry key:
    HKLM\SOFTWARE\PFU\ScanSnap Extension\<product name>
  • Creates the following values under the key above:

    • <Default> = <full path of main app>

    • Config = <path of ScanSnap.ini>

      If it does not contain any of the path prefixes listed above, it points to the same folder as <path of scanner.ini>. Otherwise, the prefix is changed to <Common AppData>.

    • Path = <full path of main app>

      Contains the folders only, without the name of the file, for example:

      D:\Program Files (x86)\Kofax\Power PDF 40\bin\

int WINAPI RsdRepairMsi(MSIHANDLE hMsi)

It can be called when Repair is selected in the installer. This function performs all necessary actions for RSD, which can only be done in Admin Mode at repair time.

CustomActionData should be composed the same way as RsdInstallMsi().

This function performs the same operations as RsdInstallMsi(), except it does not increase reference counts.

int WINAPI RsdUninstallMsi(MSIHANDLE hMsi)

It can be called when Uninstall is selected in the installer before the installed binaries are removed. This function performs all necessary actions for RSD which can only be done in Admin Mode during uninstallation.

CustomActionData should be composed the same way as RsdInstallMsi(), except it should contain <delete custom setting> instead of <language>

<product name>;<full path of main app>;<path of scanner.ini>;<registry key>;<delete custom settings>
The <delete custom setting> component can hold the following values:
  • "0" or empty if custom settings should be preserved

  • "1" if custom settings should be deleted

    Currently, <delete custom setting> applies only to the WizConf.xml file of the wizard, for example:
    Power PDF Advanced;D:\Program Files (x86)\Kofax\Power PDF 40\bin\PowerPDF.exe;LOCAL\Kofax\PDF\V1\Scanner.ini;Kofax\PDF\V1;1

For details on the rest of the components, see the description of RsdInstallMsi.

The RsdUninstallMsi function performs the following operations:

  • Deletes the following values under the key below:

    • BinPath
    • DataPath
    • Language
    • ProductName if it is created by RsdInstallMsi()
    • _RSD_
  • Deletes the following registry keys, if it is created by RsdInstallMsi():

    • HKLM\SOFTWARE\<product name>

    • HKLM\SOFTWARE\<registry key>

  • Removes the following files from the folder below with reference count (decreases the reference count and deletes the files and the reference count itself if it becomes 0):

    • SWizard.xml

    • SWizard.xsd

  • Removes the following file from the folder below:

    • WizConf.xml

    • SWizard.xml if it was removed, and <delete custom settings> is "1".

  • Removes the following folder if it is empty:

    <Common AppData>\Kofax\SWizard

  • Removes the following folder if it is empty:

    <Common AppData>\Kofax

  • Removes the following file from the folder below with reference count (decreases the reference count and deletes the file and the reference count itself if it becomes 0):

    RsdScan.chn

  • Removes the following folder if it is empty:

    <Windows>\PIXTRAN

  • Removes the following file from the folder where the HKLM\SOFTWARE\PFU\ScanSnap Extension\<product name> registry key points:

    ScanSnap.ini

  • Removes the folder where the following registry key points if it is empty:

    HKLM\SOFTWARE\PFU\ScanSnap Extension\<product name>

  • Deletes the following registry key with all of its values:

    HKLM\SOFTWARE\PFU\ScanSnap Extension\<product name>