Repository navigation
How to package your application with Dokan
Dokan adheres to Semantic Versioning
Given a version number MAJOR.MINOR.PATCH, increment the:
- MAJOR version when incompatible changes in communication between kernel driver and library are made.
- MINOR version when functionality in the library or kernel are added but an older library would still work with the new kernel.
- PATCH version when bug fixes backwards-compatible are made.
MAJOR version is embedded in Dokan library (dokan3.dll) and kernel (dokan3.sys) names.
Starting with version 3.0.0 (upcoming), Dokan supports 64-bit Windows 10 (version 1507 or later) / Windows 11 / Windows Server 2016 or later only and includes two MSI setup files: Dokan_x64.msi and Dokan_ARM64.msi. Dokan_x86.msi is no longer provided; 32-bit applications on 64-bit Windows keep working because Dokan_x64.msi includes the Win32 (WOW64) user-mode libraries.
For older releases (2.3.x and earlier), Dokan_x86.msi is still provided for 32-bit Windows (and older OS versions such as Windows 7/8/8.1 may also require Windows KB updates and the Visual C++ redistributable matching that release).
You can include just the MSI files in your project, keeping in mind the OS/architecture requirements checked in dokan_wix\Bootstrapper\Bundle.wxs (WiX v5). No Visual C++ Redistributable is required (the C runtime is linked statically).
To add the MSIs into your own WiX bundle, you can copy the <bal:Condition> checks and <MsiPackage> lines for Dokan_x64.msi and Dokan_ARM64.msi (or Dokan_x86.msi if targeting Dokan 2.3.x) from dokan_wix\Bootstrapper\Bundle.wxs.
The Dokan driver can not be installed as an upgrade becausee it requires an intermittent reboot for the uninstall of an existing version. Your bootstrapper or setup executable should check for previous Dokan installations or at least correctly interpret the corresponding MSI error, the MSI will return error code 1603.
If your setup includes an older compatible Dokan version it should skip attempting to install the obsolete version. WiX bundles check for obsolete MSI versions automatically.
To detect if a previous version of dokan is installed with the same major API, you simply should check if dokan driver is present in C:\Windows\System32\drivers. Example: Dokany 3.x.x -> C:\Windows\System32\drivers\dokan3.sys.
Dokan Kernel driver and library use a global device name to communicate. This device name contains the MAJOR version at the end (i.e. Dokan3). This means different Dokan MAJOR versions can be installed side by side. For example, Dokan 2.x and Dokan 3.0 (or legacy 0.6.0 and 1.x) can be installed and used side by side on the same system.
Two dokan installers with the same MAJOR version and different MINOR version cannot be installed side by side. Only one of these installers can be installed.
Dokan installers require a reboot to fully unload and uninstall the driver file. This behavior might be fixed in the future if and when Dokan supports PnP.
Your installer should only remove Dokan if you are sure that no other applications are using it. See https://github.com/dokan-dev/dokany/issues/322
Dokan installs the library in {windir}\system32 on purpose to be used by all installed Dokan applications.
BUT since it is possible that Dokan library will be updated by another Dokan application, the update might break link dependency to your application. Therefore it is highly recommended embedding the dokan3.dll in your application folder. Doing this will retain compatibility of your application with all MAJOR versions equal to the library you embed.
Dokan
Project Home | Wiki | Releases | Issues