Hi all,
I’m attempting to install a non-pnp driver (WFP Callout driver) with the following inf file.
;
; MYDriver.inf
;
[Version]
Signature=“$WINDOWS NT$”
Class=MyClass
ClassGuid={39BC59C1-433F-4935-A12B-982A17811125}
Provider=%ManufacturerName%
CatalogFile=MYDriver.cat
DriverVer= ; set by DriverVer in stampinf property pages
DriverPackageType=KernelService
[SourceDisksNames]
1 = %DiskName%
[SourceDisksFiles]
MYDriver.sys = 1
[DestinationDirs]
DefaultDestDir = 12
MYDriver.DriverFiles = 12
[DefaultInstall]
OptionDesc = %Description%
CopyFiles=MYDriver.DriverFiles
[DefaultInstall.Services]
AddService = %ServiceName%,0x00000800,MYDriver.Service
[DefaultUninstall]
DelFiles = MYDriver.DriverFiles
[DefaultUninstall.Services]
DelService = %ServiceName%,0x200 ; SPSVCINST_STOPSERVICE
[MYDriver.DriverFiles]
MYDriver.sys,0x00000040 ; COPYFLG_OVERWRITE_OLDER_ONLY
[MYDriver.Service]
DisplayName = %ServiceName%
Description = %ServiceDesc%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
StartType = 3 ; SERVICE_DEMAND_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary = %12%\MYDriver.sys
LoadOrderGroup = NDIS ;/// Load immediately after TCPIP.sys
Dependencies = TCPIP
[Strings]
SPSVCINST_ASSOCSERVICE= 0x00000002
ManufacturerName = “Mynufacturer”
DiskName = “MYDriver Installation Disk”
Description = “MyDesc”
ServiceDesc = “MyDesc”
ServiceName = “MY Driver”
I have a *firm* requirement that no restart should occur on install, removal, or upgrade.
On initial install this is easy. Install the driver service as SERVICE_DEMAND_START and add it as a dependency of the usermode service (also required by my product), windows does the rest.
During testing of an upgrade, using these steps:
- right click 1.0.33 inf file -> install
- sc start “MY driver”
- right click 1.0.34 inf file -> install
I’m being prompted to reboot on Windows 10 (not windows 7). The relevant parts of setupapi log file are:
flq: Source Media: SPFQOPERATION_DOIT
flq: {FILE_QUEUE_COMMIT_COPY_FILE}
flq: {FILE_QUEUE_BACKUP_FILE}
flq: CopyFile: ‘C:\Windows\system32\DRIVERS\MYDriver.sys’ to ‘C:\Windows\Temp\OLD6135.tmp’
flq: {FILE_QUEUE_BACKUP_FILE exit OK}
flq: {SPFILENOTIFY_STARTCOPY}
flq: {SPFILENOTIFY_STARTCOPY - exit(0x00000001)}
flq: Copying ‘C:\Users\WDKRemoteUser\Desktop\deploy\MYDriver\MYDriver.sys’ to ‘C:\Windows\system32\DRIVERS\MYDriver.sys’.
flq: CopyFile: ‘C:\Users\WDKRemoteUser\Desktop\deploy\MYDriver\MYDriver.sys’ to ‘C:\Windows\system32\DRIVERS\SET6164.tmp’
cpy: CopyFile Drp is NOT active
! flq: MoveFile: ‘C:\Windows\system32\DRIVERS\SET6164.tmp’ to ‘C:\Windows\system32\DRIVERS\MYDriver.sys’ FAILED!
! flq: Error 5: Access is denied.
flq: {SPFQNOTIFY_FILEOPDELAYED}
flq: {SPFILENOTIFY_FILEOPDELAYED}
flq: {SPFILENOTIFY_FILEOPDELAYED - exit(0x00000000)}
flq: {SPFQNOTIFY_FILEOPDELAYED - returned 0x00000005}
! flq: Targetfile ‘C:\Windows\system32\DRIVERS\MYDriver.sys’ marked to be moved from ‘C:\Windows\system32\DRIVERS\SET6164.tmp’ on next reboot.
flq: {SPFILENOTIFY_ENDCOPY}
flq: {SPFILENOTIFY_ENDCOPY - exit(0x00000001)}
flq: {FILE_QUEUE_COMMIT_COPY_FILE exit OK}
It looks like MYDriver.sys in the driver directory is still being used by my driver service? Is the DefaultUninstall.Services section not executed at any point in this process?
It’s worth stating, this isn’t actually representitive of how customers will install my software, they will use an installer. However I’m seeing the exact same behavior with the installer and suspect the two cases are related.
If it’s relevant I’m using Wix + their difx:Driver extension.
I’d also be interested how others have handled the “no reboot” requirement.
Many thanks
J