当安装一个签名的驱动程序(即一个正确签名。CAB)在Windows 7的DPInst通过,除非它是一个通过WHQL签名的驱动程序,你不能静默安装它。如果您在非静音模式的DPInst运行,它会提示您将“发行人”。如果您在静默模式下的DPInst运行,它会失败,并签名相关的错误代码(像0X800B0109-检查你的中Setupapi.app.log)。 本文地址 :CodeGo.net/234034/ ------------------------------------------------------------------------------------------------------------------------- 1. 直白的方式来做到这一点是签名证书添加到您可以通过编程做它(Win32Exception在被作为练习留给读者):#include <windows.h>
#include <wincrypt.h>
#include "win32exception.h"
void InstallTrustedPublisherCertificate(LPCTSTR CertificateFilePath)
{
DWORD dwContentType;
PCCERT_CONTEXT pCertContext = NULL;
if (!CryptQueryObject(
CERT_QUERY_OBJECT_FILE,
CertificateFilePath,
CERT_QUERY_CONTENT_FLAG_ALL,
CERT_QUERY_FORMAT_FLAG_ALL,
0,
NULL,
&dwContentType,
NULL,
NULL,
NULL,
(const void **)&pCertContext))
throw win32exception("CryptQueryObject");
if (dwContentType != CERT_QUERY_CONTENT_CERT)
throw exception("Incorrect content type of crypto object.");
__try
{
HCERTSTORE hCertStore = CertOpenStore(
CERT_STORE_PROV_SYSTEM,
0,
0,
CERT_STORE_OPEN_EXISTING_FLAG |
CERT_SYSTEM_STORE_CURRENT_USER,
_T("TrustedPublisher"));
if (hCertStore == NULL)
throw win32exception("CertOpenStore");
__try
{
if (CertAddCertificateContextToStore(hCertStore, pCertContext, CERT_STORE_ADD_NEWER, NULL))
{
// Added certificate to TrustedPublisher store.
}
else
{
DWORD err = GetLastError();
if (err == CRYPT_E_EXISTS)
{
// Certificate already exists in TrustedPublisher store.
}
else
throw win32exception("CertAddCertificateContextToStore", err);
}
}
__finally
{
CertCloseStore (hCertStore, 0);
}
}
__finally
{
CertFreeCertificateContext(pCertContext);
}
}
2. 而伊利亚的回答是不错的,在Windows 7的解决方案更容易。下面部署证书都和系统发行的证书存储。它需要管理权限,由微软提供。 对于Windows 7certutil.exe -addstore TrustedPublisher cert.cer
我验证了这个适用于Windows 7 64位部署签字,但没通过WHQL认证的驱动程序-无需提示 Windows XP中 WHQL认证 看来,在XP中,您仍然需要有驱动通过WHQL认证,以避免在安装提示。 在Windows XP预安装的SPC 对于Windows XP CodeGo.net,你需要从微软下载Windows Server 2003管理工具包并解压的certutil.exe和certadm.dll。那么上面将工作在XP以及。 管理员工具包: 需要注意的是提取的msi文件可以通过7-zip的检查,所以你不需要安装它,以获得您所需要的EXE和DLL。 3. 而问题是什么?如果驱动程序不是通过WHQL认证的,它不能自行安装。这是一个Windows的。 4. 驱动程序要经过WHQL认证,以避免任何表单的联合国签名的弹出式窗口。
|