Driver installation and deinstallation
All versions of the kernel-mode driver 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.
To install and/or uninstall the drivers during application deployment or deinstallation, use 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 drivers from your main application use the calls in Callback File System API: Install and Uninstall. Note: these methods don't remove drivers which belong to different major version than the version to which the methods belong. To uninstall version X from the system you need to use cbfsinst.dll, shipped with that version of Callback File System.
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">
<description>elevate execution level</description>
<requestedExecutionLevel level="requireAdministrator" uiAccess="false"/>