本帖最后由 hhh333 于 2021-5-27 10:39 编辑
经过各位大佬的努力,驱动工具或代码变得越来越强大,我做了一个粗略的比较
一、参与比较的工具
1、Lightning 的drvIndex.exe
2、834772509 的DriverIndexer
3、m大的PECMD驱动脚本
二、比较条件
1、机器:家里的台式机
2、驱动:显卡驱动包,7z标准压缩后155M(压缩前715M),按软件的要求建好索引文件并外置于驱动包的同一位置,当然以上第一个工具不需要预建索引
3、系统:自做的win1064.19043.1021PE
三、比较方法及结果
1、启动PE进桌面后,启动安装脚本调用相应工具进行安装,在脚本中设一个计时器,记录安装时间,即可进行比较。每换一种方式就重新启动系统测试
2、大致进行了如下比较,录得的结果如下:
测试一、Lightning 的drvIndex.exe(无索引直接驱动)
测试二、834772509 的DriverIndexer(无索引直接驱动)
测试三、834772509 的DriverIndexer(利用索引驱动)
测试四、m大的PECMD驱动脚本(利用索引驱动)
结论:
从目前的情况看,Lightning 的drvIndex.exe耗时最小且不需要预先制作索引,为最优。目前只是安装显卡,按作者的话来说,如果安装多种驱动有多个驱动包,这个程序更有优势。
当然,大家如果有条件可以比较测试更大的包,或者同时安装多种驱动。
又:紧急
刚才我测试了打印机的安装,目前只有M大的脚本能成功安装,前两个工具都不能正确安装,希望作者再接再励,看来前面的测试还全面。
附:
这是测试驱动的核心代码:
- _SUB InsDrv7z
- `FORX %1\*.7Z,fzip,1,
- ENVI fzip=%1
- IFEX %fzip%,
- {
- NAME &fname=%fzip%
- FDIR &fPath=%fzip%
- ENVI &idx=%&fPath%\%&fname%.%&TAG%
- IFEX %&idx%,SET &_cache=*infcache:"%&idx%"!
- {
- SET &_cache=
- PATH %temp%\%&fname%
- EXEC =!7z.exe x -o"%temp%\%&fname%" -aos -y %fzip% %&TAG%
- IFEX %temp%\%&fname%\%&TAG%,SET &_cache=*infcache:"%temp%\%&fname%\%&TAG%"!FILE -force -q %temp%\%&fname%
- }
- FIND $%&_cache%=,
- {
- ENVI &idx=
- `EXEC =Drvindex.exe -b %fzip% -hide
- EXEC =!DriverIndexer.exe load-driver %fzip% %&idx%
- `EXEC =!7z.exe x %fzip% -o"%temp%\%&fname%"
- `CALL DeviInf %temp%\%&fname%
- `FILE -force -q %temp%\%&fname%
- }!
- {
- `DEVI *norescan *sub %&_cache% %fzip%,Display
- EXEC =!DriverIndexer.exe load-driver %fzip% %&idx%
- }
- }
- _END
复制代码
这是驱动安装计时工具代码:
- _SUB DRVALL,W560H410,请选定要驱动的硬件,,SHELL32.DLL#21
- TEAM ENVI $CM_NET=0|ENVI RM_LAN=1|ENVI RM_PPP=0|ENVI RM_WAN=0|ENVI RM_RLT=1|ENVI RM_VBE=0|ENVI RM_4=0|ENVI CM_IE=0|ENVI $RM_ADDPKG=0|ENVI iTimes=0
- TEAM FORM -free &X=%SystemDrive%|CALC #xSize=%X%/1024/1024|IFEX MEM=?,iMemFree
- `不存在变灰
- IFEX %CurDir%\DX9\IE.7z,!ENVI CM_IE=-2
- IFEX %CurDir%\DX9\BDE.7z,!ENVI CM_BDE=-2
- IFEX %CurDir%\DX9\CPU.7z,!ENVI CM_CPU=-2
- IFEX %CurDir%\Print\PRT_PART.7Z,!ENVI CM_PRT=-2
- IFEX %CurDir%\DX9\CAM.7z,!ENVI CM_CAM=-2
- IFEX %CurDir%\DX9\MTP.7z,!ENVI CM_MTP=-2
-
- `已驱动过一次则三卡按钮变灰
- IFEX %WinDir%\LD_NET_WAN.OK,ENVI RM_WAN=-2
- IFEX %WinDir%\LD_NET_LAN.OK,ENVI RM_LAN=-2
- IFEX %WinDir%\LD_NET_PPP.OK,ENVI RM_PPP=-2
- IFEX $%RM_WAN%=-2,IFEX $%RM_LAN%=-2,IFEX $%RM_PPP%=-2,ENVI $CM_NET=-2
- IFEX %WinDir%\LD_SND.OK,ENVI CM_SND=-2
- IFEX %WinDir%\System32\driverstore\FileRepository\basicdisplay.inf*\,!ENVI RM_VBE=-2
- IFEX %WinDir%\LD_DSP.OK,TEAM ENVI CM_DSP=-2|ENVI RM_RLT=-1|ENVI RM_VBE=-2
- IFEX %WinDir%\LD_PRT.OK,ENVI CM_PRT=-2
- IFEX %WinDir%\LD_MTP.OK,ENVI CM_MTP=-2
- IFEX %WinDir%\LD_DX9.OK,ENVI CM_DX9=-2
- IFEX %WinDir%\LD_CAM.OK,ENVI CM_CAM=-2
- IFEX %WinDir%\LD_CHM.OK,ENVI CM_CHM=-2
- IFEX %WinDir%\LD_IE.OK,ENVI CM_IE=-2
- IFEX %WinDir%\LD_BDE.OK,ENVI CM_BDE=-2
- IFEX %WinDir%\LD_CPU.OK,ENVI CM_CPU=-2
- FIND $%BootOS%=,ENVI RM_4=-2
- FIND $%BootOS%=03,ENVI RM_4=-2
- GROU Group0,L5T2W245H215,硬件安装
- CHEK CHK_NET,L15T25W80H20,驱动网卡→,,%CM_NET%
- RADI RadioNetLAN,L30T50W40H17,有线,,%RM_LAN%,1
- RADI RadioPPPOE,L100T50W40H17,宽带,,%RM_PPP%,1
- RADI RadioNetWAN,L170T50W40H17,无线,,%RM_WAN%,1
- CHEK CHK_DSP,L15T80W80H20,驱动显卡→,TEAM ,%CM_DSP%
- RADI RadioDSPRLT,L30T105W80H17,真实驱动,,%RM_RLT%,2
- RADI RadioDSPVBE,L130T105W80H17,MS通用驱动,,%RM_VBE%,2
-
- CHEK CHK_SND,L15T135W80H20,驱动声卡,,%CM_SND%
- CHEK CHK_PRT,L15T190W80H20,驱动打印机,,%CM_PRT%
- GROU Group1,L250T2W295H215,安装方式
- RADI Radio1,L260T25W140H20,内置CAB/WIM/7z包安装,TEAM ENVI @EdtCAB.Enable=0|ENVI @ButCAB.Enable=0|ENVI @CHK_SUB.Enable=0|ENVI @CHK_INF.Enable=0|ENVI @EdtINF.Enable=0|ENVI @ButINF.Enable=0,1
- RADI Radio1_1,L275T45W85H20,内置包优先,,1,3
- RADI Radio1_2,L365T45W85H20,附加包优先,,0,3
- RADI Radio2,L260T80W140H20,指定CAB/WIM/7z包安装,TEAM ENVI @EdtCAB.Enable=1|ENVI @ButCAB.Enable=1|ENVI @CHK_SUB.Enable=0|ENVI @CHK_INF.Enable=0|ENVI @EdtINF.Enable=0|ENVI @ButINF.Enable=0,0
- EDIT EdtCAB,L275T100W160H20,,,-2
- ITEM ButCAB,L437T100W20H20,…,CALL DEFCAB,,-2
- RADI Radio3,L260T135W120H20,指定INF文件夹安装,TEAM ENVI @EdtINF.Enable=1|ENVI @ButINF.Enable=1|ENVI @CHK_INF.Enable=1|ENVI @CHK_SUB.Enable=1|ENVI @EdtCAB.Enable=0|ENVI @ButCAB.Enable=0,0
- CHEK CHK_SUB,L460T145W70H20,搜子目录,,-2
- EDIT EdtINF,L275T155W160H20,,,-2
- ITEM ButINF,L437T155W20H20,…,CALL DEFINF,,-2
- CHEK CHK_INF,L460T165W60H20,双设备,,-2
- RADI Radio4,L260T190W180H20,搜索本机资源安装(WIN7以上),TEAM ENVI @EdtCAB.Enable=0|ENVI @ButCAB.Enable=0|ENVI @EdtINF.Enable=0|ENVI @ButINF.Enable=0,%RM_4%
- GROU Group2,L5T220W540H45,组件支持
- CHEK CHK_DX9,L15T240W60H20,DiretX,,%CM_DX9%
- CHEK CHK_CAM,L80T240W100H20,扫描仪摄像头,CALL SelDX9,%CM_CAM%
- CHEK CHK_CHM,L185T240W110H20,管理员登录+CHM,CALL SelCPU,%CM_CHM%
- CHEK CHK_IE,L300T240W30H20,IE,CALL SelCHM,%CM_IE%
- CHEK CHK_MTP,L340T240W60H20,手机MTP,,%CM_MTP%
- CHEK CHK_BDE,L410T240W80H20,BitLocker,,%CM_BDE%
- CHEK CHK_CPU,L495T240W40H20,CPU,,%CM_CPU%
- LABE lblVREM,L15T272W530H40,说明:选框灰色表示已驱动过;改变安装方式时请只驱动某一种硬件;IE和BC3文本比较需要CHM支持,管理员用户下才能打开CHM文件!附加CAB包与外置同目录放在H3PE\ADD_DRV下。
- ITEM Button5,L90T320W60H24,刷新,CALL CtrlRefresh
- ITEM Button1,L155T320W100H24,清除变灰标志,TEAM FILE %WinDir%\*.OK|ENVI @lblVREM=全部清除!|WAIT 500|CALL CtrlRefresh
- ITEM Button2,L270T320W70H24,设备管理,EXEC MMC.EXE "%windir%\System32\devmgmt.msc"
- ITEM Button3,L345T320W60H24,应用,THREAD* TEAM CALL CheckMode|ENVI @lblVREM=驱动脚本运行完成!|WAIT 500|CALL CtrlRefresh
- ITEM Button4,L410T320W60H24,关闭,KILL \%DRVALL%
- LABE -left -vcenter lblxSize,L0T358W559H22,系统盘(%SystemDrive%)剩余空间:%xSize% MB 系统剩余可用内存:%iMemFree% MB 耗时:%iTimes%秒,,0xFFFFFF#0x000000,11
- `LABE -left -vcenter lblTimes,L500T358W555H22,耗时:0秒,,0xFFFFFF#0x000000,11
- TIME Timer1,0,CALL TimeRefresh
- DATE &iTimeStart uptime
- _END
- _SUB SelCHM
- IFEX $%CHK_CHM.Check%=0,IFEX $%CHK_IE.Check%=1,ENVI @CHK_CHM.Check=1
- _END
- _SUB SelCPU
- IFEX $%CHK_CPU.Check%=0,IFEX $%CHK_CHM.Check%=1,ENVI @CHK_CPU.Check=1
- _END
- _SUB SelDX9
- IFEX $%CHK_DX9.Check%=0,IFEX $%CHK_CAM.Check%=1,ENVI @CHK_DX9.Check=1
- _END
- _SUB TimeRefresh
- TEAM DATE &iTimeCur uptime|CALC iTimes=(%&iTimeCur%-%&iTimeStart%)/1000#2
- TEAM FORM -free &X=%SystemDrive%|CALC #xSize=%X%/1024/1024|IFEX MEM=?,iMemFree|ENVI @lblxSize=系统盘(%SystemDrive%)剩余空间:%xSize% MB 系统剩余可用内存:%iMemFree% MB 耗时:%iTimes%秒
- _END
- _SUB CtrlRefresh
- ENVI @CHK_NET.Enable=0
- IFEX %WinDir%\LD_NET_WAN.OK,ENVI @RadioNetWAN.Enable=0!TEAM ENVI @RadioNetWAN.Enable=1|ENVI @CHK_NET.Enable=1
- IFEX %WinDir%\LD_NET_LAN.OK,ENVI @RadioNetLAN.Enable=0!TEAM ENVI @RadioNetLAN.Enable=1|ENVI @CHK_NET.Enable=1
- IFEX %WinDir%\LD_NET_PPP.OK,ENVI @RadioPPPOE.Enable=0!TEAM ENVI @RadioPPPOE.Enable=1|ENVI @CHK_NET.Enable=1
- IFEX %WinDir%\LD_SND.OK,ENVI @CHK_SND.Enable=0!ENVI @CHK_SND.Enable=1
- IFEX %WinDir%\LD_DSP.OK,TEAM ENVI @CHK_DSP.Enable=0|ENVI @RadioDSPRLT.Enable=0|ENVI @RadioDSPVBE.Enable=0!TEAM ENVI @CHK_DSP.Enable=1|ENVI @RadioDSPRLT.Enable=1|IFEX %WinDir%\System32\driverstore\FileRepository\basicdisplay.inf*\,ENVI @RadioDSPVBE.Enable=1
- IFEX %WinDir%\LD_DX9.OK,ENVI @CHK_DX9.Enable=0!ENVI @CHK_DX9.Enable=1
- IFEX %WinDir%\LD_CAM.OK,ENVI @CHK_CAM.Enable=0!ENVI @CHK_CAM.Enable=1
- IFEX %WinDir%\LD_CHM.OK,ENVI @CHK_CHM.Enable=0!ENVI @CHK_CHM.Enable=1
- IFEX %WinDir%\LD_PRT.OK,ENVI @CHK_PRT.Enable=0!IFEX %CurDir%\Print\PRT_PART.7Z,ENVI @CHK_PRT.Enable=1
- IFEX %WinDir%\LD_MTP.OK,ENVI @CHK_MTP.Enable=0!IFEX %CurDir%\DX9\MTP.7z,ENVI @CHK_MTP.Enable=1
- IFEX %WinDir%\LD_IE.OK,ENVI @CHK_IE.Enable=0!IFEX %CurDir%\DX9\IE.7z,ENVI @CHK_IE.Enable=1
- IFEX %WinDir%\LD_BDE.OK,ENVI @CHK_BDE.Enable=0!IFEX %CurDir%\DX9\BDE.7z,ENVI @CHK_BDE.Enable=1
- IFEX %WinDir%\LD_CPU.OK,ENVI @CHK_CPU.Enable=0!IFEX %CurDir%\DX9\CPU.7z,ENVI @CHK_CPU.Enable=1
- CALL TimeRefresh
- TEXT
- _END
- _SUB CheckMode
- TEAM ENVI @Button1.Enable=0|ENVI @Button3.Enable=0|ENVI @Button4.Enable=0|ENVI MYPKG=|ENVI MYINF=|ENVI INSHOST=0
- DATE &iTimeStart uptime
- ENVI @Timer1=1000
- IFEX $%Radio1.Check%=1,CALL InsRadio1
- IFEX $%Radio2.Check%=1,FIND $%EdtCAB%=,!!TEAM ENVI MYPKG=%EdtCAB%|CALL InsRadio1
- IFEX $%Radio3.Check%=1,FIND $%EdtINF%=,!!TEAM ENVI MYINF=%EdtINF%|CALL InsRadio1
- IFEX $%Radio4.Check%=1,TEAM ENVI INSHOST=1|CALL InsRadio1
- TEAM ENVI @Button1.Enable=1|ENVI @Button3.Enable=1|ENVI @Button4.Enable=1|ENVI @Timer1=0
- _END
- _SUB InsRadio1
- `挂起下述行,可以在某类型驱动有多选项时,只要主项非灰色并选定,多选项灰色但是选定状态,也能执行
- TEAM ENVI $CM_NET=0|ENVI $CM_SND=0|ENVI $CM_DSP=0|ENVI $CM_DX9=0|ENVI $CM_CHM=0|ENVI $CM_PRT=0|ENVI $CM_IE=0|ENVI $CM_BDE=0|ENVI $CM_CPU=0
- IFEX $%Radio1_2.Check%=1,ENVI $RM_ADDPKG=1
- IFEX $%RadioNetLAN.Check%=1,IFEX $%RadioNetLAN.Enable%=1,ENVI $CM_NET=1
- IFEX $%RadioPPPOE.Check%=1,IFEX $%RadioPPPOE.Enable%=1,ENVI $CM_NET=2
- IFEX $%RadioNetWAN.Check%=1,IFEX $%RadioNetWAN.Enable%=1,ENVI $CM_NET=3
- IFEX $%RadioDSPRLT.Check%=1,IFEX $%RadioDSPRLT.Enable%=1,ENVI $CM_DSP=1
- IFEX $%RadioDSPVBE.Check%=1,IFEX $%RadioDSPVBE.Enable%=1,ENVI $CM_DSP=2
- IFEX $%CHK_NET.Check%=0,ENVI $CM_NET=0
- IFEX $%RadioNetLAN.Check%<1,IFEX $%RadioPPPOE.Check%<1,IFEX $%RadioNetWAN.Check%<1,ENVI $CM_NET=0
- IFEX $%CHK_DSP.Check%=0,ENVI $CM_DSP=0
- ENVI $CM_SND=%CHK_SND.Check%
- ENVI $CM_PRT=%CHK_PRT.Check%
- ENVI $CM_MTP=%CHK_MTP.Check%
- ENVI $CM_DX9=%CHK_DX9.Check%
- ENVI $CM_CAM=%CHK_CAM.Check%
- ENVI $CM_CHM=%CHK_CHM.Check%
- ENVI $CM_IE=%CHK_IE.Check%
- ENVI $CM_BDE=%CHK_BDE.Check%
- ENVI $CM_CPU=%CHK_CPU.Check%
- ENVI $CM_INF=%CHK_INF.Check%
- ENVI $CM_SUB=%CHK_SUB.Check%
- `如果复选框为灰色则置贮存Check状态值的变量为0
- IFEX $%CHK_NET.Enable%=0,ENVI $CM_NET=0
- IFEX $%CHK_SND.Enable%=0,ENVI $CM_SND=0
- IFEX $%CHK_DSP.Enable%=0,ENVI $CM_DSP=0
- IFEX $%CHK_PRT.Enable%=0,ENVI $CM_PRT=0
- IFEX $%CHK_MTP.Enable%=0,ENVI $CM_MTP=0
- IFEX $%CHK_DX9.Enable%=0,ENVI $CM_DX9=0
- IFEX $%CHK_CAM.Enable%=0,ENVI $CM_CAM=0
- IFEX $%CHK_CHM.Enable%=0,ENVI $CM_CHM=0
- IFEX $%CHK_IE.Enable%=0,ENVI $CM_IE=0
- IFEX $%CHK_BDE.Enable%=0,ENVI $CM_BDE=0
- IFEX $%CHK_CPU.Enable%=0,ENVI $CM_CPU=0
- THRD ENVI
- IFEX $%CM_DSP%>0,TEAM ENVI @lblVREM=正在驱动显卡……|WAIT 500|LOAD %CurDir%\Display\START_VGA.INI
- IFEX $%CM_SND%>0,TEAM ENVI @lblVREM=正在驱动声卡……|WAIT 500|LOAD %CurDir%\Sound\START_SND.INI
- IFEX $%CM_PRT%>0,TEAM ENVI @lblVREM=正在驱动打印机……|WAIT 500|LOAD %CurDir%\Print\INSPRINT.INI
- IFEX $%CM_MTP%>0,TEAM ENVI @lblVREM=正在驱动手机MTP……|WAIT 500|LOAD %CurDir%\DX9\INSMTP.INI
- IFEX $%CM_NET%>0,TEAM ENVI @lblVREM=正在驱动网卡……|WAIT 500|LOAD %CurDir%\Ethernet\START_NET.INI
- IFEX $%CM_DX9%>0,TEAM ENVI @lblVREM=正在加载DX支持……|WAIT 500|LOAD %CurDir%\DX9\INSDX9.INI
- IFEX $%CM_CAM%>0,TEAM ENVI @lblVREM=正在加载摄像头扫描仪支持……|WAIT 500|LOAD %CurDir%\DX9\INSCAM.INI
- IFEX $%CM_CHM%>0,TEAM ENVI @lblVREM=正在加载管理员登录和CHM支持……|WAIT 500|LOAD %CurDir%\DX9\INSCHM.INI
- IFEX $%CM_IE%>0,TEAM ENVI @lblVREM=正在加载IE支持……|WAIT 500|LOAD %CurDir%\DX9\INSIE.INI
- IFEX $%CM_BDE%>0,TEAM ENVI @lblVREM=正在加载Bitlocker支持……|WAIT 500|LOAD %CurDir%\DX9\INSBDE.INI
- IFEX $%CM_CPU%>0,TEAM ENVI @lblVREM=正在加载CPU及内存信息支持……|WAIT 500|LOAD %CurDir%\DX9\INSCPU.INI
- _END
- _SUB DEFINF
- BROW Tag,*%CurDir%,请选择包含.INF文件的程序文件夹:
- FIND $%Tag%=,!ENVI @EdtINF=%Tag%
- _END
- _SUB DEFCAB
- BROW Tag,%CurDir%\*.cab,请选择您的驱动包:,CAB压缩包|*.CAB|Wim镜像包|*.WIM|7z压缩包|*.7z
- FIND $%Tag%=,!ENVI @EdtCAB=%Tag%
- _END
- ENVI -mode EnviMode=1
- ENVI -mode EnviBroad=0
- CALL @DRVALL
复制代码
注:以上代码脚本M大进行了几次修进。
|