INF 右键安装驱动以及卸载
之前写过一篇文章是关于INF文件详解的,大家可以参看INF文件详解,这次写的是关于INF右键安装,这样比较方便。卸载的话也是一句话,可以大大减少安装时间;
先将INF文件内容贴上来:
; OsnDf.inf ; ; Installation file (.inf) for Infocore Corporation OsnDiskCopy driver. ; ; (c) Copyright 2007-2008 Infocore Corporation ; [Version] Signature="$Windows NT$" Provider=%StorTrust% ClassGUID={4D36E967-E325-11CE-BFC1-08002BE10318} Class=DiskDrive DriverVer=01/16/2001, 4.0.0 [DestinationDirs] DefaultDestDir = 12 [DefaultInstall] CopyFiles =OsnDSS.Files OptionDesc =%StorTrust.DeviceDesc% AddReg = OsnDSS.AddReg [DefaultInstall.Services] AddService = OsnDSS,, OsnDSS_Service_Inst, OsnDSS_EventLog_Install [DefaultUninstall] DelFiles =OsnDSS.Files DelReg =OsnDSS.DelRegistry [DefaultUninstall.Services] DelService =OsnDSS,0x00000200,System, [OsnDSS.AddReg] ; append this service to existing REG_MULTI_SZ list, if any HKLM,%OsnDSSRegistery%,"UpperFilters",0x00010008,"OsnDSS" [OsnDSS.DelRegistry] HKLM,%OsnDSSRegistery%,"UpperFilters",0x00018002,"OsnDSS" ; ; File sections ; [OsnDSS.Files] OsnDSS.sys [OsnDSS_Service_Inst] DisplayName = %OsnDSS.SvcDesc% ServiceType = 1 ; SERVICE_KERNEL_DRIVER StartType = 0 ; SERVICE_BOOT_START ErrorControl = 1 ; SERVICE_ERROR_NORMAL ServiceBinary = %12%\OsnDSS.sys [OsnDSS_EventLog_Install] AddReg = OsnDSSEventLogInstall [OsnDSSEventLogInstall] HKR,,EventMessageFile,0x00020000,"%SystemRoot%\System32\IoLogMsg.dll;%SystemRoot%\System32\drivers\OsnDSS.sys" HKR,,TypesSupported,0x00010001,7 ; Source file information ; [SourceDisksNames] 1 = %DiskId1%,,,"" [SourceDisksFiles] OsnDSS.sys = 1,, [Strings] ; ; Non-Localizable Strings ; REG_SZ = 0x00000000 REG_MULTI_SZ = 0x00010000 REG_EXPAND_SZ = 0x00020000 REG_BINARY = 0x00000001 REG_DWORD = 0x00010001 SERVICEROOT = "System\CurrentControlSet\Services" ; ; Localizable Strings ; ClassName = "DiskDrive" StorTrust = "Enterprise Information Management Inc." DiskId1 = "EIM Installation Disk #1" StorTrust.DeviceDesc = "EIM Disk Shadow Copy Driver" OsnDSS.SvcDesc = "EIM Disk Shadow Copy Driver" OsnDSSRegistery = "system\currentcontrolset\control\class\{4D36E967-E325-11CE-BFC1-08002BE10318}"
path-to-inf\infname.inf
path-to-uninstall-dir\infname.inf
这样就卸掉了,虽然还遗留Eventlog卸不掉的遗憾