pbatard / libwdi

Windows Driver Installer library for USB devices
GNU General Public License v3.0
1.87k stars 465 forks source link

Zadig app extract driver file only intall on same pc create it? #315

Closed qloi2002 closed 6 months ago

qloi2002 commented 7 months ago

Hello every one, I used zadig app to extract usb_driver folder and can install on this PC but got error when install on another PC. I want using same driver package to install multi PC. How to resolve it? Thanks all!

pbatard commented 7 months ago

This won't work, since Zadig needs to install a certificate for the driver package signature it creates into the current PC's certificate store, which means that installation will only succeed on the PC where you ran Zadig.

If you want to install on another PC, you need to export the certificate from Trusted Publishers from the source PC to install it on the destination PC.

Basically, you need to open certmgr, go to Trusted Publishers, find the USB\VID####& PID_#### (libwdi autogenerated) that matches your device, select All tasksExport... and then, on the destination PC use All tasksImport...

qloi2002 commented 7 months ago

This won't work, since Zadig needs to install a certificate for the driver package signature it creates into the current PC's certificate store, which means that installation will only succeed on the PC where you ran Zadig.

If you want to install on another PC, you need to export the certificate from Trusted Publishers from the source PC to install it on the destination PC.

Basically, you need to open certmgr, go to Trusted Publishers, find the USB\VID####& PID_#### (libwdi autogenerated) that matches your device, select All tasksExport... and then, on the destination PC use All tasksImport...

Thank a lot your support! I tried exporting .cer file from source pc and import it into dest pc then update gain driver from folder include driver file but same error. Have I missing anything?

pbatard commented 7 months ago

Have I missing anything?

For one thing, you don't say what error you are seeing. Please report the exact error message you get, because otherwise, we just can't help you.

qloi2002 commented 7 months ago

it's show "A problem was encountered while attempting to add the driver to the store". PS: if I delete .cat file it show "the third-party INF does not contain digital signature info"

pbatard commented 7 months ago

My guess is that you probably did not import the certificate properly on the target computer.

It would help if you copy/pasted the last section from your C:\Windows\INF\setupapi.dev.log that starts with Section start 2024/02/29 ##.##.#### and that will contain a much more detailed error report.

qloi2002 commented 7 months ago

Here is the log

>>>  [Device Install (DiInstallDriver) - C:\Users\LOI\Desktop\usb_driver\usb_bulk.inf]
>>>  Section start 2024/02/29 20:48:54.931
      cmd: "C:\Windows\System32\InfDefaultInstall.exe" "C:\Users\LOI\Desktop\usb_driver\usb_bulk.inf"
     ndv: Flags: 0x00000000
     ndv: INF path: C:\Users\LOI\Desktop\usb_driver\usb_bulk.inf
     inf: {SetupCopyOEMInf: C:\Users\LOI\Desktop\usb_driver\usb_bulk.inf} 20:48:54.932
     inf:      Copy style: 0x00000000
     sto:      {Setup Import Driver Package: C:\Users\LOI\Desktop\usb_driver\usb_bulk.inf} 20:48:54.934
     inf:           Provider: libwdi
     inf:           Class GUID: {88bae032-5a81-49f0-bc3d-a4ff138216d6}
     inf:           Driver Version: 06/02/2012,6.1.7600.16385
     inf:           Catalog File: usb_bulk.cat
     sto:           {Copy Driver Package: C:\Users\LOI\Desktop\usb_driver\usb_bulk.inf} 20:48:54.935
     sto:                Driver Package = C:\Users\LOI\Desktop\usb_driver\usb_bulk.inf
     sto:                Flags          = 0x00000007
     sto:                Destination    = C:\Users\LOI\AppData\Local\Temp\{eccb6119-fd3c-964d-8d4b-2641dcd7e891}
     sto:                Copying driver package files to 'C:\Users\LOI\AppData\Local\Temp\{eccb6119-fd3c-964d-8d4b-2641dcd7e891}'.
     flq:                Copying 'C:\Users\LOI\Desktop\usb_driver\usb_bulk.cat' to 'C:\Users\LOI\AppData\Local\Temp\{eccb6119-fd3c-964d-8d4b-2641dcd7e891}\usb_bulk.cat'.
     flq:                Copying 'C:\Users\LOI\Desktop\usb_driver\usb_bulk.inf' to 'C:\Users\LOI\AppData\Local\Temp\{eccb6119-fd3c-964d-8d4b-2641dcd7e891}\usb_bulk.inf'.
     sto:           {Copy Driver Package: exit(0x00000000)} 20:48:54.935
     pol:           {Driver package policy check} 20:48:54.950
     pol:           {Driver package policy check - exit(0x00000000)} 20:48:54.950
     sto:           {Stage Driver Package: C:\Users\LOI\AppData\Local\Temp\{eccb6119-fd3c-964d-8d4b-2641dcd7e891}\usb_bulk.inf} 20:48:54.950
     inf:                {Query Configurability: C:\Users\LOI\AppData\Local\Temp\{eccb6119-fd3c-964d-8d4b-2641dcd7e891}\usb_bulk.inf} 20:48:54.950
     inf:                     Driver package uses WDF.
     inf:                     Driver package 'usb_bulk.inf' is configurable.
     inf:                {Query Configurability: exit(0x00000000)} 20:48:54.966
     flq:                Copying 'C:\Users\LOI\AppData\Local\Temp\{eccb6119-fd3c-964d-8d4b-2641dcd7e891}\usb_bulk.cat' to 'C:\Windows\System32\DriverStore\Temp\{d866f9dc-9f02-c447-81fb-ad69d6394c7c}\usb_bulk.cat'.
     flq:                Copying 'C:\Users\LOI\AppData\Local\Temp\{eccb6119-fd3c-964d-8d4b-2641dcd7e891}\usb_bulk.inf' to 'C:\Windows\System32\DriverStore\Temp\{d866f9dc-9f02-c447-81fb-ad69d6394c7c}\usb_bulk.inf'.
     sto:                {DRIVERSTORE IMPORT VALIDATE} 20:48:54.981
     sig:                     {_VERIFY_FILE_SIGNATURE} 20:48:54.981
     sig:                          Key      = usb_bulk.inf
     sig:                          FilePath = C:\Windows\System32\DriverStore\Temp\{d866f9dc-9f02-c447-81fb-ad69d6394c7c}\usb_bulk.inf
     sig:                          Catalog  = C:\Windows\System32\DriverStore\Temp\{d866f9dc-9f02-c447-81fb-ad69d6394c7c}\usb_bulk.cat
!    sig:                          Verifying file against specific (valid) catalog failed.
!    sig:                          Error 0x800b0109: A certificate chain processed, but terminated in a root certificate which is not trusted by the trust provider.
     sig:                     {_VERIFY_FILE_SIGNATURE exit(0x800b0109)} 20:48:54.997
     sig:                     {_VERIFY_FILE_SIGNATURE} 20:48:54.997
     sig:                          Key      = usb_bulk.inf
     sig:                          FilePath = C:\Windows\System32\DriverStore\Temp\{d866f9dc-9f02-c447-81fb-ad69d6394c7c}\usb_bulk.inf
     sig:                          Catalog  = C:\Windows\System32\DriverStore\Temp\{d866f9dc-9f02-c447-81fb-ad69d6394c7c}\usb_bulk.cat
!    sig:                          Verifying file against specific Authenticode(tm) catalog failed.
!    sig:                          Error 0x800b0109: A certificate chain processed, but terminated in a root certificate which is not trusted by the trust provider.
     sig:                     {_VERIFY_FILE_SIGNATURE exit(0x800b0109)} 20:48:54.997
!!!  sig:                     Driver package catalog file certificate does not belong to Trusted Root Certificates, and Code Integrity is enforced.
!!!  sig:                     Driver package failed signature validation. Error = 0xE0000247
     sto:                {DRIVERSTORE IMPORT VALIDATE: exit(0xe0000247)} 20:48:54.997
!!!  sig:                Driver package failed signature verification. Error = 0xE0000247
!!!  sto:                Failed to import driver package into Driver Store. Error = 0xE0000247
     sto:           {Stage Driver Package: exit(0xe0000247)} 20:48:54.997
     sto:      {Setup Import Driver Package - exit (0xe0000247)} 20:48:54.997
!!!  inf:      Failed to import driver package into driver store
!!!  inf:      Error 0xe0000247: A problem was encountered while attempting to add the driver to the store.
     inf: {SetupCopyOEMInf exit (0xe0000247)} 20:48:55.122
<<<  Section end 2024/02/29 20:48:55.122
<<<  [Exit status: FAILURE(0xe0000247)]`

On source pc, has several extension file, what type we need?

pbatard commented 7 months ago

Driver package catalog file certificate does not belong to Trusted Root Certificates, and Code Integrity is enforced.

If you see this, then it means that either you did properly install the certificate you exported from the first PC to the second PC, or you exported the wrong certificate, or you are running in an environment on the second PC where certificates installed in Trusted Publishers are not trusted to install driver packages (which for instance is the case by default for Windows 11 for ARM64).

I'm afraid that none of these matters have to do with libwdi/Zadig, since libwdi/Zadig is designed for driver installation on the same PC it is run, so, if you choose to extract a driver package on one PC for installation on another PC, there's only so far we will go to try to support you, and we are going to assume that you do know what you are doing.

All this to say that, at this stage, it's entirely up to you to figure out the issue and the expectation is that you are familiar enough with the Windows driver installation process (and its requirements) to do so.

If that is not the case, then I can only advise that you use Zadig on the second PC, as, again, driver creation on one PC for installation on a different PC is something that only experts should attempt.

qloi2002 commented 7 months ago

Ok I will check this again Thank you so much for your help!