Create and manage virtual disk drives from your Windows applications

CBDisk.Install method


Pascal    C++ (Lib)    C++ (VCL)    C++ (.NET)    C#    VB.NET   

CBDisk     See also    


Installs the drivers and helper DLLs to the system


    class procedure Install( CabFileName : TCBString; ProductName : AnsiString; PathToInstall : TCBString; SupportPnP : boolean; ModulesToInstall : DWORD; var RebootNeeded : DWORD);
    type TCBString = {$ifdef UNICODE}UnicodeString{$else}WideString{$endif};

[C++ (Lib)]
    static void Install( const wchar_t * CabFileName, const char * ProductName, const wchar_t * PathToInstall, bool SupportPnP, unsigned long ModulesToInstall, unsigned long *RebootNeeded);

[C++ (VCL)]
    static void __fastcall Install( TCBString CabFileName, AnsiString ProductName, TCBString PathToInstall, bool SupportPnP, unsigned long ModulesToInstall, unsigned long & RebootNeeded);

[C++ (.NET)]
    static void Install( String* CabFileName, String* ProductName, String* PathToInstall, bool SupportPnP, UInt32 ModulesToInstall, UInt32 &RebootNeeded);

    static void Install( string CabFileName, string ProductName, string PathToInstall, bool SupportPnP, UInt32 ModulesToInstall, ref UInt32 RebootNeeded)

    Shared Sub Install( ByVal CabFileName As String, ByVal ProductName As String, ByVal PathToInstall As String, ByVal SupportPnP As String, ByVal ModulesToInstall As UInt32, ByRef RebootNeeded As UInt32)


  • CabFileName - Path to .cab file, which was used to install the driver and helper DLLs.
  • ProductName - the ProductName string that identifies installation of the driver by your application
  • PathToInstall - Path to which the driver and helper DLLs should be installed. Leave it empty to install to Windows system folders.
  • SupportPnP - specifies the method of driver installation - for futher support for PnP storages (set parameter to true) or "old-styled" (set parameter to false)
  • ModulesToInstall - this parameter specifies, which modules (driver, helper DLLs) must be installed. Flags (listed below) indicate which modules need to be installed.
  • RebootNeeded - On return this parameter specifies if system restart is necessary for deinstallation to be successful. Flags (listed below) tell the application, which modules requested system restart.

Values of ModulesToInstall and RebootNeeded


Use this function to install the driver and helper DLLs to the system. ProductName is used to distinguish between installations of the package made by different applications and to prevent the situation when the package is installed by two applications and further deinstallation of one of them removes the package.

Use ModulesToInstall parameter to specify, what exactly modules (eg. the driver, Notifier DLL, Network Redirector DLL) must be installed to the system.

The CAB file must be kept on the target system OR it must be available from elsewhere. It is needed to uninstall the drivers and Helper DLLs from the system.

SupportPnP parameter specifies if the PnP driver is installed. PnP driver is used to create storages of type PnP. Such storages are visible as a disk device in device manager, and also the system treats such storages differently for pure virtual devices. If you install the drivers in PnP mode, the OS always requires the reboot. If you install the driver in "old-styled" mode (used before CallbackDisk 2.0), no reboot is required (unless some of the installed driver and helper files are busy), but you won't be able to create PnP storages. If you need to change the mode from old-styled to PnP, you will need to re-install the drivers.

NOTE: you must NOT uninstall the driver and helper DLLs, if you upgrade the installation. In other words, use only Install method to refresh the driver and helper DLLs on the target system.

Read more about installing and uninstalling the drivers.

Call from...

This method may be called only from outside of callback / event handlers.

See also

GetModuleStatus     Uninstall    

Back to top