Discuss this help topic in CBFS Forum

Deployment instructions

Installation of the drivers and Helper DLLs

All versions of the kernel-mode driver and all Helper DLLs are packed to a single CAB file named cbfs.cab, which should be installed to the target system. The cbfs.cab file is located in CAB subdirectory of the directory, to which you have installed CBFS on your development system.

The driver and the Helper DLLs can be installed using the functions exported by Installer DLL that is included within Callback File System package. This DLL can be freely distributed with your projects as long as it is used with the licensed version of Callback File System.

To install or uninstall the CAB file from your main application use the calls in Callback File System API: Install and Uninstall.

Windows requires system restart after installation or deinstallation of plug-n-play drivers, so in Callback File System 3.x and later restart is needed if you install drivers in PnP mode.

If you install one or both helper DLLs, they must be loaded by Explorer during its startup. So to ensure proper user experience Install function returns RebootNeeded set accordingly to have the system restarted and the DLLs loaded.

Note, that Uninstall function should be used only to completely uninstall the driver and helper DLLs. Don't use Uninstall function if you are updating the version of CBFS on target system. If you use Uninstall, and then attempt to install the updated version without restarting the system, you can either get an error or restart will cause the OS to delete the newly installed files (the OS treats these files as the ones that must be uninstalled). This remark is not applicable when you upgrade CBFS from lower major version (2 or 3) to higher version (3 or 4 accordingly): higher major versions are treated as different products and they don't update lower versions.

After you install the CAB file, you need to keep a copy of this file on the destination system, because deinstallation of the files also requires the CAB archive to be present.

Required Permissions

By default installation and deinstallation of Callback File System files (kernel-mode drivers and Helper DLLs) can be performed from the user account which belongs to Administrators group. This is a security measure of Windows operating system. You can change this behaviour on the target system by adjusting the list of users and groups who have the right to install and uninstall the drivers. This can be done in Control Panel -> Administrative tools -> Local Security Settings -> Local Policies \ User Rights Assignment (tree branch), there you need to change "Load and Unload device drivers" item. No need to say that by default you can change the security settings if you are system administrator.

Notes for Vista and later versions of Windows

If you have UAC (User Account Control) enabled, Vista and later versions of Windows will run applications started by you with limited rights even when you are logged in as administrator or m7ember of Administrators group.

If you install or uninstall the drivers by calling the above mentioned functions in your code, you need to elevate privileges of your application so that it's started with truly administrative rights.

To elevate privilages for your application, you must start it with Run As Administrator option. In Windows Explorer this is done using Run As Administrator command in context menu for the application. Alternatively you can set the corresponding option in the Properties window shown for your executable module.

One more option is to use the manifest. The manifest file can be placed next to the executable of your application or embedded into the executable. If you decide to keep the manifest in a separate file, it must be named <EXEName_with_extension>.manifest, eg. for MyApp.exe the manifest should be called MyApp.exe.manifest.

You can use the following manifest:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
    <assemblyIdentity version="1.0.0.0"
	processorArchitecture="X86"
	name="ExeName"
	type="win32"/>
<description>elevate execution level</description>
   <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
      <security>
         <requestedPrivileges>
            <requestedExecutionLevel level="requireAdministrator" uiAccess="false"/>
         </requestedPrivileges>
      </security>
   </trustInfo>
</assembly>

User-mode API

  • C++ API:
    C++ class links Callback File System API statically so no special API deployment is required.

  • VCL API:
    32-bit VCL unit for Delphi and C++Builder links Callback File System API statically so no special API deployment is required.
    64-bit unit (used to build the application for x64 target), requires CBFS API DLL, called "CBFS6API.dll" and located in <CBFS>\VCL\API\64bit directory. Be sure to included it with your application and place it either next to your project's EXE file (preferred method), or in Windows System directory.

  • Java API:
    Java API consists of the class library file (eldos.cbfs.jar) which is loaded by your application and the native DLL ( jnicbfs.dll ) which is a JNI module and which contains most of CBFS API logic. The DLL comes in two flavors - for 32-bit systems and for 64-bit systems with x64 (AMD64) processor architecture. Java API is not available for Itanium processors.
    Deployment is straightforward - you copy both the .jar and .dll file to the folder with other .jar files of your application.
  • .NET API:
    When deploying the project, copy the CBFS6Net.dll below to your application folder. Questions about when and how to install the assemblies to Global Assembly Cache are discussed in Working with Assemblies and the Global Assembly Cache and How to: Install an Assembly into the Global Assembly Cache articles.

    .NET 4.6 assemblies are different for Intel 32-bit and Intel 64-bit platforms. 64-bit .NET 4.6 assemblies are available for x64 processor architecture used by most modern 64-bit processors.
    All .NET 4.6 assemblies require Visual C++ 2015 Multithreaded Runtime DLLs (vcruntime140.dll). It's a good idea to include these DLLs into the distribution. The DLLs are located in <CBFlt>\MSVC_REDIST\NET_46 folder.
    If you place the assembly to the same folder where your application is located, these DLLs must be placed in this folder too. If you install the .NET assembly to the GAC, it's recommended that you use installable "vcredist" package instead (see below).

    .NET 4.5.1 assemblies are different for Intel 32-bit and Intel 64-bit platforms. 64-bit .NET 4.5.1 assemblies are available for x64 processor architecture used by most modern 64-bit processors.
    All .NET 4.5.1 assemblies require Visual C++ 2013 Multithreaded Runtime DLLs (msvcp120.dll and msvcr120.dll). It's a good idea to include these DLLs into the distribution. The DLLs are located in <CBFS>\MSVC_REDIST\NET_451 folder.
    If you place the assembly to the same folder where your application is located, these DLLs must be placed in this folder too. If you install the .NET assembly to the GAC, it's recommended that you use installable "vcredist" package instead (see below).

    .NET 4.5 assemblies are different for 32-bit and 64-bit platforms. 64-bit .NET 4.5 assemblies are available for x64 processor architecture used by most modern 64-bit processors.
    All .NET 4.5 assemblies require Visual C++ 2012 Multithreaded Runtime DLLs (msvcp110.dll and msvcr110.dll). It's a good idea to include these DLLs into the distribution. The DLLs are located in <CBFS>\MSVC_REDIST\NET_45 folder.
    If you place the assembly to the same folder where your application is located, these DLLs must be placed in this folder too. If you install the .NET assembly to the GAC, it's recommended that you use installable "vcredist" package instead (see below).

    .NET 4.0 assemblies are different for 32-bit and 64-bit platforms. 64-bit .NET 4.0 assemblies are available for x64 (AMD64) processor architecture used by most modern 64-bit processors and IA64 (Itanium) processor architecture used by some Intel-produced server processors.
    All .NET 4.0 assemblies require Visual C++ 2010 Multithreaded Runtime DLLs (msvcp100.dll and msvcr100.dll). It's a good idea to include these DLLs into the distribution. The DLLs are located in <CBFS>\MSVC_REDIST\NET_40 folder.
    If you place the assembly to the same folder where your application is located, these DLLs must be placed in this folder too. If you install the .NET assembly to the GAC, it's recommended that you use installable "vcredist" package instead (see below).

    .NET 2.0 assemblies are different for 32-bit and 64-bit platforms. 64-bit .NET 2.0 assemblies are available for x64 (AMD64) processor architecture used by most modern 64-bit processors and IA64 (Itanium) processor architecture used by some Intel-produced server processors.
    .NET 2.0 assemblies for Win32 and x64 platforms require Visual C++ 2005 SP1 Multithreaded Runtime DLLs (msvcp80.dll and msvcr80.dll). .NET 2.0 assemblies for IA64 platform require Visual C++ 2008 Multithreaded Runtime DLLs (msvcp90.dll and msvcr90.dll). It's a good idea to include these DLLs into the distribution. The DLLs are located in <CBFS>\MSVC_REDIST\NET_20 folder.
    If you place the assembly to the same folder where your application is located, these DLLs must be placed in this folder too. If you install the .NET assembly to the GAC, it's recommended that you use installable "vcredist" package instead (see below).

    Alternative method for deployment of MS VC++ Runtime DLLs (especially useful when you deploy assemblies to GAC) is to download proper "vcredist" installations from Microsoft site and include them to your installation package. Do the search for "Microsoft Visual C++ Redistributable Package" on Microsoft site and choose the needed redistributable packages.
    "vcredist" installations don't just copy VC redistributable DLLs to proper Windows folders, but only register them for side-by-side use in registry to avoid conflicts with files of the same name but different version.

Discuss this help topic in CBFS Forum