none
How to check if USB CDC (COM port) driver is installed RRS feed

  • Question

  • I need to check if the driver is already installed, so I can request it  in my c++ application if not. I have the driver from silabs, there is .cat, .inf and .exe files. After opening the installer - it just says "Silicon Laboratories. Inc. (usbser) Ports (03/26/2014 6.1.7601.17514) - Ready to use" after confirming the terms, nothing else. I tried searching for "usbser.sys" but nothing found, I also tried search for "USB\VID_1BA4&PID_0002" (which I found in .inf file) and also nothing. What should I look for? This driver should be pre-installed in win 8-10, but what about the older verions?

    [Version]
    Signature="$WINDOWS NT$"
    Class=Ports
    ClassGUID={4D36E978-E325-11CE-BFC1-08002BE10318}
    Provider=%SILICONLABS%
    DriverVer=03/26/2014,6.1.7601.17514
    CatalogFile=SiLabs-CDC.cat
    
    [Manufacturer]
    %SILICONLABS%=DeviceList, NT, NTAMD64, NTIA64
    
    ;------------------------------------------------------------------------------
    
    [DeviceList]
    %CDCDEVICE_1BA4_0002%=DriverInstall,USB\VID_1BA4&PID_0002
    %CDCDEVICE_2544_0003%=DriverInstall,USB\VID_2544&PID_0003
    %CDCDEVICE_10C4_0003%=DriverInstall,USB\VID_10C4&PID_0003
    %CDCDEVICE_2544_0008_02%=DriverInstall,USB\VID_2544&PID_0008&MI_02
    %CDCDEVICE_10C4_0008_02%=DriverInstall,USB\VID_10C4&PID_0008&MI_02
    
    [DeviceList.NT]
    %CDCDEVICE_1BA4_0002%=DriverInstall,USB\VID_1BA4&PID_0002
    %CDCDEVICE_2544_0003%=DriverInstall,USB\VID_2544&PID_0003
    %CDCDEVICE_10C4_0003%=DriverInstall,USB\VID_10C4&PID_0003
    %CDCDEVICE_2544_0008_02%=DriverInstall,USB\VID_2544&PID_0008&MI_02
    %CDCDEVICE_10C4_0008_02%=DriverInstall,USB\VID_10C4&PID_0008&MI_02
    
    [DeviceList.NTAMD64]
    %CDCDEVICE_1BA4_0002%=DriverInstall,USB\VID_1BA4&PID_0002
    %CDCDEVICE_2544_0003%=DriverInstall,USB\VID_2544&PID_0003
    %CDCDEVICE_10C4_0003%=DriverInstall,USB\VID_10C4&PID_0003
    %CDCDEVICE_2544_0008_02%=DriverInstall,USB\VID_2544&PID_0008&MI_02
    %CDCDEVICE_10C4_0008_02%=DriverInstall,USB\VID_10C4&PID_0008&MI_02
    
    [DeviceList.NTIA64]
    %CDCDEVICE_1BA4_0002%=DriverInstall,USB\VID_1BA4&PID_0002
    %CDCDEVICE_2544_0003%=DriverInstall,USB\VID_2544&PID_0003
    %CDCDEVICE_10C4_0003%=DriverInstall,USB\VID_10C4&PID_0003
    %CDCDEVICE_2544_0008_02%=DriverInstall,USB\VID_2544&PID_0008&MI_02
    %CDCDEVICE_10C4_0008_02%=DriverInstall,USB\VID_10C4&PID_0008&MI_02
    
    ;------------------------------------------------------------------------------
    
    [DriverInstall]
    Include=mdmcpq.inf
    CopyFiles=FakeModemCopyFileSection
    AddReg=SerialPropPageAddReg
    
    [DriverInstall.Services]
    Include=mdmcpq.inf
    AddService = usbser, 0x00000002, DriverServiceInst
    
    [DriverServiceInst]
    DisplayName=%SERVICE%
    ServiceType=1
    StartType=3
    ErrorControl=1
    ServiceBinary=%12%\usbser.sys
    
    [SerialPropPageAddReg]
    HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"
    
    ;------------------------------------------------------------------------------
    
    [Strings]
    SILICONLABS = "Silicon Laboratories, Inc."
    CDCDEVICE_1BA4_0002 = "Silicon Labs CDC Serial port"
    CDCDEVICE_2544_0003 = "Silicon Labs CDC Serial port"
    CDCDEVICE_10C4_0003 = "Silicon Labs CDC Serial port"
    CDCDEVICE_2544_0008_02 = "Silicon Labs CDC Serial port"
    CDCDEVICE_10C4_0008_02 = "Silicon Labs CDC Serial port"
    SERVICE   = "USB CDC Serial Port Driver"
    
    Thanks for any informations. 

    Thursday, October 3, 2019 12:32 AM

All replies

  • Hi,

    Thank you for posting here.

    >>This driver should be pre-installed in win 8-10, but what about the older verions?

    In Windows 10, a new INF, Usbser.inf, has been added to %Systemroot%\Inf that loads Usbser.sys as the function device object (FDO) in the device stack. If your device belongs to the Communications and CDC Control device class, Usbser.sys is loaded automatically.

    In Windows 8.1 and earlier versions of the operating system, Usbser.sys is not automatically loaded when a USB-to-serial device is attached to a computer. To load the driver, you need to write an INF that references the modem INF (mdmcpq.inf) by using the Include directive.

    For more details I suggest you could refer to the link:
    https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/usb-driver-installation-based-on-compatible-ids#usbsersys-installation

    Best Regards,

    Jeanine Zhang

    Thursday, October 3, 2019 3:01 AM
  • Jeanine, thanks for you reply.

    Yes, I understand how it works. On Windows 10, the driver already signed and in older versions of Windows I need to sign it by myself using custom .inf file.  

    Until this time, I just sign the .inf file only if the driver does work by right clicking on the file, then install (or by installer wizard). But I want to do it programmatically. 

    So, how do I know if the driver file is already signed? I can't find an answer anywhere. 

    I just want to do something like:

    if(!driver_is_signed) // and I need this variable for it
        install_my_inf();

    Is the INF file copied somewhere?
    Is anything in the regedit changed? I see no change in my ClassGUID. 

    Thanks, Petrov.

    Thursday, October 3, 2019 1:37 PM
  • This is a driver question, the WDK forum is the best place for it

    A short answer: use pnputil to list all added driver packages and filter that by needed class (Ports). This provides the signer name and provider name. For more info you can look into the INF file. Yes it is copied under \windows\INF.

    -- pa


    • Edited by Pavel A Thursday, October 3, 2019 11:21 PM
    Thursday, October 3, 2019 10:56 PM
  • The PNPUTIL works only for windows vista+, what about the windows xp? And I cannot search for exactly this driver, nobody will have it, windows 10 have this driver pre-installed, but it's not called "silabs-cdc.inf", its just usbser.sys i think? I don't know, I thinks I'm looking for driver that have "Include=mdmcpq.inf" inside. 
    Friday, October 4, 2019 1:43 AM
  • There is an useful utility devcon.exe , it can find installed driver packages that support certain hardware ID. See devcon DriverNodes command. You can use it as is, or sources for it are available on Microsoft's github.

    What about Windows XP? It's unsupported. Support for Win7 will end soon.

    -- pa


    • Edited by Pavel A Friday, October 4, 2019 11:58 PM
    Friday, October 4, 2019 11:20 PM