ZFS-1459: Delete the driver package from the Driver Store during uninstall. #97
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Jira:
ZFS-1459: Delete the driver package from the Driver Store during uninstall.
Issue:
Reproduce:-
After uninstall, running the following cmd lists the driver oem file from "C:\Windows\INF" folder.
PS C:\Users\Administrator> $driver = get-windowsdriver -online -all | ? {($.OriginalFileName -match "zfsin.inf")}
PS C:\Users\Administrator> $driver.Driver_
Enumerate the driver store packages using
pnputil /enum-drivers
Fix:
As per msdn documentation, the installer has to call SetupUninstallOEMInf() function.
https://learn.microsoft.com/en-us/windows-hardware/drivers/install/using-setupapi-to-uninstall-devices-and-driver-packages#-deleting-a-driver-package-from-the-driver-store.
Test by Dev:
`C:\ZFSin>zfsinstaller.exe uninstall .\ZFSin.inf
DefaultUninstall 128 .\ZFSin.inf
uninstallRootDevice:
uninstallRootDevice: looking for device rootnode to remove...
uninstallRootDevice: device found, removing ...
uninstallRootDevice: exit 0:0x0
Executing unlodctr /m:"C:\ZFSin.\OpenZFS.man"
Info: Successfully uninstalled the performance counters from the counter definition XML file C:\ZFSin.\OpenZFS.man.
Successfully deleted the driver package from Driver Store.oemfile:oem12.inf
Successfully deleted the driver file:C:\Windows\system32\drivers\ZFSin.sys
`