Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows 8 driver install and catalog/signature validation

I can't get windows 8 (release preview) to accept either the inf2cat or makecat approach described as solutions to the question at

What changed in the driver signature requirements for Windows 8?

unless I disable validation.

I am not signing these with any certificates at this point, just trying to get past the errors preventing the drivers from installing at all.

Windows 8 gives me a very nondescript error:

"A problem was encountered while attempting to add the driver to the store."

Looking in the event logs, there is nothing of use; only an informational entry from "Windows Error Reporting" indicating a PnPdriverimporterror.

When i use my original files with the cab files that don't match the inf, I get the error everyone else is listing:

The hash for the file is not present in the specified catalog file.

I have one .inf file that i need to generate a .cat for.

Perhaps I am doing something wrong. Ideas??

INF2CAT Approach

c:\win_xp_vista32_64>inf2cat /driver:"." /os:XP_X86,XP_x64,Vista_X86,Vista_x64,7_X86,7_X64,8_X86,8_X64

.......................
Signability test complete.

Errors:
None

Warnings:
22.9.10: usbser.sys in [drivercopyfiles.nt] is missing from [SourceDisksFiles] s
ection in \mchpcdc.inf; ok if file source is provided via LayoutFile in [Version
].
22.9.10: %driverfilename%.sys in [drivercopyfiles.ntamd64] is missing from [Sour
ceDisksFiles] section in \mchpcdc.inf; ok if file source is provided via LayoutF
ile in [Version].

Catalog generation complete.
c:\win_xp_vista32_64\mchpcdc.cat

MAKECAT approach

--- start of catalog.cdf file---

[CatalogHeader]
Name=mchpcdc.cat
ResultDir=.\
[CatalogFiles]
<hash>mchpcdc=.\mchpcdc.inf
---end of .cdf file ---


c:\win_xp_vista32_64>makecat catalog.cdf

These same files, w/ the cat from either approach install just fine in Windows 7.

like image 517
jen Avatar asked Jun 07 '12 17:06

jen


2 Answers

I just tested this on Windows 10 and 8 PRO now, to get this right, follow these steps:

1) From your Start menu, locate your DDK's "x64 Checked Build Environment" i.e. the custom DOS build screen. Right-click, run-as administrator...

2) Compile your source with the Build tools etc.

3) Go into your compiled code, and then create your test-certificate (you don't need to purchase one just yet, use your self-signed one created with the line below):

makecert -r -pe -ss PrivateCertStore -n CN=newhex.com(Test) NewhexTest.cer

The above means your certificate is called "newhex.com(Test)" and the generated file is "NewhexTest.cer"

4) Create / Edit your .CDF file which contains items about what your CAT file's contents.

5) Create your CAT file by executing:

makecat -v MyCDF.CDF

This should generate an un-signed CAT file that includes all files specified by your CDF.

6) Sign your CAT file as follows:

Signtool sign /v /s PrivateCertStore /n newhex.com(test) /t http://timestamp.verisign.com/scripts/timestamp.dll MyDriverWhatever.cat

This should result in a CAT file that is signed, but don't just install it, because your Windows can't trust Newhex's cert since it's not in the keystore, to fix this do:

7) Add your certificate to your private Key Store, remember this step MUST be done by an administrators access, otherwise you will get an error about (Keystore not found etc):

certmgr.exe -add NewhexTest.cer -s -r localMachine root

This should add into your keystore, Once done, you can then:

8) Go into your device manager, and add your new driver, you would get a warning but will be accepted and installed without the need to reboot with a forced (Don't check cert type account).

I tried this already and it works on Windows 10 and Windows 8 pro versions.

Kind Regards Heider Sati

like image 176
Heider Sati Avatar answered Sep 21 '22 18:09

Heider Sati


You are supposed to use inf2cat, not makecat, because you have an INF file.

You should work on addressing those warnings from inf2cat by fixing your INF file. Here is my INF file that uses usbser.sys and doesn't cause any warnings: https://gist.github.com/3647208

I was able to fix my INF file thanks to the advice from chinzei in the first post of this thread: http://www.microchip.com/forums/m488342-print.aspx

If you continue to have trouble, please edit your question to include the source of your INF file, or at least a link to the source.

like image 44
David Grayson Avatar answered Sep 20 '22 18:09

David Grayson