安装驱动程序无声

时间:2014-07-01 12:36:27

标签: cmd driver dpinst

我尝试编写Gemalto智能卡驱动程序脚本,以便在虚拟机上进行静默安装。因此,智能卡通过RDP从本地PC重定向到vm。

   ;
; Gemalto Minidriver for IDPrime Smartcard installation x86 and x64 package.
;

[Version]
Signature="$Windows NT$"
Class=SmartCard
ClassGuid={990A2BD7-E738-46c7-B26F-1CF8FB9F1391}
Provider=%ProviderName%
CatalogFile=delta.cat
DriverVer=01/23/2013,8.4.3.0

[Manufacturer]
%ProviderName%=Minidriver,NTamd64,NTamd64.6.1,NTx86,NTx86.6.1


[Minidriver.NTamd64]
%CardDeviceNameIDPrime%=Minidriver64_Install,SCFILTER\CID_10602033-e7e2-f94a-bf60-bca20a0babb5
%CardDeviceNameDotNET%=Minidriver64_Install,SCFILTER\CID_417374726964

[Minidriver.NTx86]
%CardDeviceNameIDPrime%=Minidriver32_Install,SCFILTER\CID_10602033-e7e2-f94a-bf60-bca20a0babb5
%CardDeviceNameDotNET%=Minidriver32_Install,SCFILTER\CID_417374726964

[Minidriver.NTamd64.6.1]
%CardDeviceNameIDPrime%=Minidriver64_61_Install,SCFILTER\CID_10602033-e7e2-f94a-bf60-bca20a0babb5
%CardDeviceNameDotNET%=Minidriver64_61_Install,SCFILTER\CID_417374726964

[Minidriver.NTx86.6.1]
%CardDeviceNameIDPrime%=Minidriver32_61_Install,SCFILTER\CID_10602033-e7e2-f94a-bf60-bca20a0babb5
%CardDeviceNameDotNET%=Minidriver32_61_Install,SCFILTER\CID_417374726964

[DefaultInstall]
CopyFiles=x86_CopyFiles
AddReg=AddRegDefault

[DefaultInstall.ntamd64]
CopyFiles=amd64_CopyFiles
CopyFiles=wow64_CopyFiles
AddReg=AddRegWOW64
AddReg=AddRegDefault

[DefaultInstall.NTx86]
CopyFiles=x86_CopyFiles
AddReg=AddRegDefault

[DefaultInstall.NTamd64.6.1]
CopyFiles=amd64_CopyFiles
CopyFiles=wow64_CopyFiles
AddReg=AddRegWOW64
AddReg=AddRegDefault

[DefaultInstall.NTx86.6.1]
CopyFiles=x86_CopyFiles
AddReg=AddRegDefault

[SourceDisksFiles]
axaltocm64.dll=1
axaltocm.dll=1

[SourceDisksNames]
1 = %MediaDescription%

[UMPassService_Install]
DisplayName    = %umpass.SVCDESC%     ; Friendly Name of the Service
ServiceType    = 1                    ; SERVICE_KERNEL_DRIVER
StartType      = 3                    ; SERVICE_DEMAND_START 
ErrorControl   = 1                    ; SERVICE_ERROR_NORMAL
ServiceBinary  = %12%\umpass.sys
LoadOrderGroup = Extended Base

[Minidriver64_Install.NT]
CopyFiles=amd64_CopyFiles
CopyFiles=wow64_CopyFiles
AddReg=AddRegWOW64
AddReg=AddRegDefault

[Minidriver64_61_Install.NT]
CopyFiles=amd64_CopyFiles
CopyFiles=wow64_CopyFiles
AddReg=AddRegWOW64
AddReg=AddRegDefault

[Minidriver32_Install.NT]
CopyFiles=x86_CopyFiles
AddReg=AddRegDefault

[Minidriver32_61_Install.NT]
CopyFiles=x86_CopyFiles
AddReg=AddRegDefault

[Minidriver64_Install.NT.Services]
AddService = UMPass, 0x00000002, UMPassService_Install

[Minidriver32_Install.NT.Services]
AddService = UMPass, 0x00000002, UMPassService_Install

[Minidriver64_61_Install.NT.Services]
AddService = UMPass, 0x00000002, UMPassService_Install

[Minidriver32_61_Install.NT.Services]
AddService = UMPass, 0x00000002, UMPassService_Install

[amd64_CopyFiles]
axaltocm.dll,axaltocm64.dll

[x86_CopyFiles]
axaltocm.dll

[wow64_CopyFiles]
axaltocm.dll

[AddRegWOW64]
HKLM, %SmartCardNameIDPrimeT0WOW64%,"ATR",0x00000001,3b,7f,00,00,00,80,31,80,65,b0,00,00,00,00,12,0f,fe,82,90,00
HKLM, %SmartCardNameIDPrimeT0WOW64%,"ATRMask",0x00000001,ff,ff,00,ff,ff,ff,ff,ff,ff,ff,00,00,00,00,ff,ff,ff,ff,ff,ff
HKLM, %SmartCardNameIDPrimeT0WOW64%,"Crypto Provider",0x00000000,"Microsoft Base Smart Card Crypto Provider"
HKLM, %SmartCardNameIDPrimeT0WOW64%,"Smart Card Key Storage Provider",0x00000000,"Microsoft Smart Card Key Storage Provider"
HKLM, %SmartCardNameIDPrimeT0WOW64%,"80000001",0x00000000,%SmartCardCardModule%

HKLM, %SmartCardNameIDPrimeT1WOW64%,"ATR",0x00000001,3b,ff,00,00,00,81,31,00,43,80,31,80,65,b0,00,00,00,00,12,0f,fe,82,90,00,00
HKLM, %SmartCardNameIDPrimeT1WOW64%,"ATRMask",0x00000001,ff,ff,00,ff,ff,ff,ff,00,ff,ff,ff,ff,ff,ff,00,00,00,00,ff,ff,ff,ff,ff,ff,00
HKLM, %SmartCardNameIDPrimeT1WOW64%,"Crypto Provider",0x00000000,"Microsoft Base Smart Card Crypto Provider"
HKLM, %SmartCardNameIDPrimeT1WOW64%,"Smart Card Key Storage Provider",0x00000000,"Microsoft Smart Card Key Storage Provider"
HKLM, %SmartCardNameIDPrimeT1WOW64%,"80000001",0x00000000,%SmartCardCardModule%

HKLM, %SmartCardNameIDPrimeCLWOW64%,"ATR",0x00000001,3B,8F,80,01,80,31,80,65,B0,00,00,00,00,12,0F,FE,82,90,00,00
HKLM, %SmartCardNameIDPrimeCLWOW64%,"ATRMask",0x00000001,ff,ff,ff,ff,ff,ff,ff,ff,ff,00,00,00,00,ff,ff,ff,ff,ff,ff,00
HKLM, %SmartCardNameIDPrimeCLWOW64%,"Crypto Provider",0x00000000,"Microsoft Base Smart Card Crypto Provider"
HKLM, %SmartCardNameIDPrimeCLWOW64%,"Smart Card Key Storage Provider",0x00000000,"Microsoft Smart Card Key Storage Provider"
HKLM, %SmartCardNameIDPrimeCLWOW64%,"80000001",0x00000000,%SmartCardCardModule%

HKLM, %SmartCardNameDotNETWOW64%,"ATR",0x00000001,3b,00,00,41,73,74,72,69,64
HKLM, %SmartCardNameDotNETWOW64%,"ATRMask",0x00000001,ff,00,00,ff,ff,ff,ff,ff,ff
HKLM, %SmartCardNameDotNETWOW64%,"Crypto Provider",0x00000000,"Microsoft Base Smart Card Crypto Provider"
HKLM, %SmartCardNameDotNETWOW64%,"Smart Card Key Storage Provider",0x00000000,"Microsoft Smart Card Key Storage Provider"
HKLM, %SmartCardNameDotNETWOW64%,"80000001",0x00000000,%SmartCardCardModule%

HKLM, %SmartCardNameOptelioT0WOW64%,"ATR",0x00000001,3b,6e,00,00,80,31,80,66,b1,a1,11,01,a0,f6,83,00,90,00
HKLM, %SmartCardNameOptelioT0WOW64%,"ATRMask",0x00000001,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff
HKLM, %SmartCardNameOptelioT0WOW64%,"Crypto Provider",0x00000000,"Microsoft Base Smart Card Crypto Provider"
HKLM, %SmartCardNameOptelioT0WOW64%,"Smart Card Key Storage Provider",0x00000000,"Microsoft Smart Card Key Storage Provider"
HKLM, %SmartCardNameOptelioT0WOW64%,"80000001",0x00000000,%SmartCardCardModule%

HKLM, %SmartCardNameOptelioT1WOW64%,"ATR",0x00000001,3b,ee,00,00,81,31,80,43,80,31,80,66,b1,a1,11,01,a0,f6,83,00,90,00,8f
HKLM, %SmartCardNameOptelioT1WOW64%,"ATRMask",0x00000001,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff
HKLM, %SmartCardNameOptelioT1WOW64%,"Crypto Provider",0x00000000,"Microsoft Base Smart Card Crypto Provider"
HKLM, %SmartCardNameOptelioT1WOW64%,"Smart Card Key Storage Provider",0x00000000,"Microsoft Smart Card Key Storage Provider"
HKLM, %SmartCardNameOptelioT1WOW64%,"80000001",0x00000000,%SmartCardCardModule%

[AddRegDefault]
HKLM, %SmartCardNameIDPrimeT0%,"ATR",0x00000001,3b,7f,00,00,00,80,31,80,65,b0,00,00,00,00,12,0f,fe,82,90,00
HKLM, %SmartCardNameIDPrimeT0%,"ATRMask",0x00000001,ff,ff,00,ff,ff,ff,ff,ff,ff,ff,00,00,00,00,ff,ff,ff,ff,ff,ff
HKLM, %SmartCardNameIDPrimeT0%,"Crypto Provider",0x00000000,"Microsoft Base Smart Card Crypto Provider"
HKLM, %SmartCardNameIDPrimeT0%,"Smart Card Key Storage Provider",0x00000000,"Microsoft Smart Card Key Storage Provider"
HKLM, %SmartCardNameIDPrimeT0%,"80000001",0x00000000,%SmartCardCardModule%

HKLM, %SmartCardNameIDPrimeT1%,"ATR",0x00000001,3b,ff,00,00,00,81,31,00,43,80,31,80,65,b0,00,00,00,00,12,0f,fe,82,90,00,00
HKLM, %SmartCardNameIDPrimeT1%,"ATRMask",0x00000001,ff,ff,00,ff,ff,ff,ff,00,ff,ff,ff,ff,ff,ff,00,00,00,00,ff,ff,ff,ff,ff,ff,00
HKLM, %SmartCardNameIDPrimeT1%,"Crypto Provider",0x00000000,"Microsoft Base Smart Card Crypto Provider"
HKLM, %SmartCardNameIDPrimeT1%,"Smart Card Key Storage Provider",0x00000000,"Microsoft Smart Card Key Storage Provider"
HKLM, %SmartCardNameIDPrimeT1%,"80000001",0x00000000,%SmartCardCardModule%

HKLM, %SmartCardNameIDPrimeCL%,"ATR",0x00000001,3B,8F,80,01,80,31,80,65,B0,00,00,00,00,12,0F,FE,82,90,00,00
HKLM, %SmartCardNameIDPrimeCL%,"ATRMask",0x00000001,ff,ff,ff,ff,ff,ff,ff,ff,ff,00,00,00,00,ff,ff,ff,ff,ff,ff,00
HKLM, %SmartCardNameIDPrimeCL%,"Crypto Provider",0x00000000,"Microsoft Base Smart Card Crypto Provider"
HKLM, %SmartCardNameIDPrimeCL%,"Smart Card Key Storage Provider",0x00000000,"Microsoft Smart Card Key Storage Provider"
HKLM, %SmartCardNameIDPrimeCL%,"80000001",0x00000000,%SmartCardCardModule%

HKLM, %SmartCardNameDotNET%,"ATR",0x00000001,3b,00,00,41,73,74,72,69,64
HKLM, %SmartCardNameDotNET%,"ATRMask",0x00000001,ff,00,00,ff,ff,ff,ff,ff,ff
HKLM, %SmartCardNameDotNET%,"Crypto Provider",0x00000000,"Microsoft Base Smart Card Crypto Provider"
HKLM, %SmartCardNameDotNET%,"Smart Card Key Storage Provider",0x00000000,"Microsoft Smart Card Key Storage Provider"
HKLM, %SmartCardNameDotNET%,"80000001",0x00000000,%SmartCardCardModule%

HKLM, %SmartCardNameOptelioT0%,"ATR",0x00000001,3b,6e,00,00,80,31,80,66,b1,a1,11,01,a0,f6,83,00,90,00
HKLM, %SmartCardNameOptelioT0%,"ATRMask",0x00000001,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff
HKLM, %SmartCardNameOptelioT0%,"Crypto Provider",0x00000000,"Microsoft Base Smart Card Crypto Provider"
HKLM, %SmartCardNameOptelioT0%,"Smart Card Key Storage Provider",0x00000000,"Microsoft Smart Card Key Storage Provider"
HKLM, %SmartCardNameOptelioT0%,"80000001",0x00000000,%SmartCardCardModule%

HKLM, %SmartCardNameOptelioT1%,"ATR",0x00000001,3b,ee,00,00,81,31,80,43,80,31,80,66,b1,a1,11,01,a0,f6,83,00,90,00,8f
HKLM, %SmartCardNameOptelioT1%,"ATRMask",0x00000001,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff
HKLM, %SmartCardNameOptelioT1%,"Crypto Provider",0x00000000,"Microsoft Base Smart Card Crypto Provider"
HKLM, %SmartCardNameOptelioT1%,"Smart Card Key Storage Provider",0x00000000,"Microsoft Smart Card Key Storage Provider"
HKLM, %SmartCardNameOptelioT1%,"80000001",0x00000000,%SmartCardCardModule%

[DestinationDirs]
amd64_CopyFiles=10,system32
x86_CopyFiles=10,system32
wow64_CopyFiles=10,syswow64

; =================== Generic ==================================

[Strings]
ProviderName ="Gemalto"
MediaDescription="Gemalto Minidriver for IDPrime Smart Card"

CardDeviceNameIDPrime="Gemalto IDPrime MD Smart Card"
SmartCardNameIDPrimeT0="SOFTWARE\Microsoft\Cryptography\Calais\SmartCards\IDPrime MD T=0"
SmartCardNameIDPrimeT1="SOFTWARE\Microsoft\Cryptography\Calais\SmartCards\IDPrime MD T=1"
SmartCardNameIDPrimeCL="SOFTWARE\Microsoft\Cryptography\Calais\SmartCards\IDPrime MD Contactless"
SmartCardNameOptelioT0="SOFTWARE\Microsoft\Cryptography\Calais\SmartCards\Optelio D72 FXR1 (MD) T=0"
SmartCardNameOptelioT1="SOFTWARE\Microsoft\Cryptography\Calais\SmartCards\Optelio D72 FXR1 (MD) T=1"
SmartCardNameIDPrimeT0WOW64="SOFTWARE\Wow6432Node\Microsoft\Cryptography\Calais\SmartCards\IDPrime MD T=0"
SmartCardNameIDPrimeT1WOW64="SOFTWARE\Wow6432Node\Microsoft\Cryptography\Calais\SmartCards\IDPrime MD T=1"
SmartCardNameIDPrimeCLWOW64="SOFTWARE\Wow6432Node\Microsoft\Cryptography\Calais\SmartCards\IDPrime MD Contactless"
SmartCardNameOptelioT0WOW64="SOFTWARE\Wow6432Node\Microsoft\Cryptography\Calais\SmartCards\Optelio D72 FXR1 (MD) T=0"
SmartCardNameOptelioT1WOW64="SOFTWARE\Wow6432Node\Microsoft\Cryptography\Calais\SmartCards\Optelio D72 FXR1 (MD) T=1"

CardDeviceNameDotNET="Gemalto IDPrime .NET Smart Card"
SmartCardNameDotNET="SOFTWARE\Microsoft\Cryptography\Calais\SmartCards\Axalto Cryptoflex .NET"
SmartCardNameDotNETWOW64="SOFTWARE\Wow6432Node\Microsoft\Cryptography\Calais\SmartCards\Axalto Cryptoflex .NET"

SmartCardCardModule="axaltocm.dll"
umpass.SVCDESC = "Microsoft UMPass Driver"

我总是将cmdlet(devcon,pnputil,dpinst)复制到我的inf文件所在的Smartcard_treiber,并将其从共享复制到本地计算机

使用devcon.exe安装

mkdir "c:\SmartCard_Treiber"
xcopy "%~DP0SmartCard_Treiber" "c:\SmartCard_Treiber" /S /E

c:\SmartCard_Treiber\devcon.exe install Gemalto.MiniDriver.IDPrime.inf "SCFILTER\CID_417374726964"
c:\SmartCard_Treiber\devcon.exe install Gemalto.MiniDriver.IDPrime.inf "scfilter\cid_10602033-e7e2-f94a-bf60-bca20a0babb5"

TIMEOUT /T 5 /NOBREAK 
rd "C:\SmartCard_Treiber" /Q /S

使用dpinst.exe安装

mkdir "c:\SmartCard_Treiber"
xcopy "%~DP0SmartCard_Treiber" "c:\SmartCard_Treiber" /S /E

c:\SmartCard_Treiber\dpinst.exe

TIMEOUT /T 5 /NOBREAK 
rd "C:\SmartCard_Treiber" /Q /S

dpinst.xml

<?xml version="1.0" ?>  
<dpinst>  
    <search>  
      <subDirectory>*</subDirectory>  
    </search>  
    <language code="0x0409">  
      <dpinstTitle>Driver Install Wizard</dpinstTitle>  
      <welcomeTitle>Welcome!</welcomeTitle>  
      <welcomeIntro>This utility is used to install device drivers.</welcomeIntro>  
      <installHeaderTitle>Installing drivers...</installHeaderTitle>  
      <finishTitle>Finished installing drivers.</finishTitle>  
    </language>
    <enableNotListedLanguages/>   
    <deleteBinaries/>  
    <quietInstall/>  
    <suppressEulaPage/>  
    <suppressWizard/>
    <legacyMode/>  
</dpinst>  

使用PNPutil安装

mkdir "c:\SmartCard_Treiber"
xcopy "%~DP0SmartCard_Treiber" "c:\SmartCard_Treiber" /S /E

pnputil.exe -i -a "C:\SmartCard_Treiber\Gemalto.MiniDriver.IDPrime.inf"

TIMEOUT /T 5 /NOBREAK 
rd "C:\SmartCard_Treiber" /Q /S

没有方法工作,用dpinst我得到这个日志但是当我插入智能卡操作系统说没有驱动程序,用pnputil我可以看到oem8.inf安装了我的智能卡河但没有驱动程序似乎是活动的

WARNING:DRIVER_PACKAGE_LEGACY_MODE flag set but not supported on Plug and Play driver on VISTA. Flag will be ignored.
INFO:   Installing INF file 'c:\smartcard_treiber\gemalto.minidriver.idprime.inf' (Plug and Play).
INFO:   Looking for Model Section [Minidriver.NTamd64.6.1]...
INFO:   No matching devices found in INF "C:\Windows\System32\DriverStore\FileRepository\gemalto.minidriver.idprime.inf_amd64_7aa4bb1564ee3f28\gemalto.minidriver.idprime.inf" on the Machine.
INFO:   No drivers installed. No devices found that match driver(s) contained in 'C:\Windows\System32\DriverStore\FileRepository\gemalto.minidriver.idprime.inf_amd64_7aa4bb1564ee3f28\gemalto.minidriver.idprime.inf'.
INFO:   RETURN: DriverPackageInstallW  (0xE000020B)
INFO:   No matching device was found for 'c:\smartcard_treiber\gemalto.minidriver.idprime.inf'. Driver will be installed when plugged in.
INFO:   Created entry in Add or Remove Programs for 'C:\Windows\System32\DriverStore\FileRepository\gemalto.minidriver.idprime.inf_amd64_7aa4bb1564ee3f28\gemalto.minidriver.idprime.inf'.
INFO:   Returning with code 0x100
INFO:   07/01/2014 14:18:37

1 个答案:

答案 0 :(得分:0)

我使用了

RUNDLL32.EXE AdvPack.dll,LaunchINFSection Gemalto.inf ,, 3

在Windows Server 2012 R2上。

上面发布的所有命令都应该在Windows 7客户端上运行,但服务器