Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZFS-1459: Delete the driver package from the Driver Store during uninstall. #97

Merged
merged 1 commit into from
Jul 15, 2024

Conversation

datacore-rm
Copy link

@datacore-rm datacore-rm commented Jul 12, 2024

Jira:
ZFS-1459: Delete the driver package from the Driver Store during uninstall.

Issue:

  1. During the ZFS driver uninstall, the driver package is not removed from the driver store.
  2. The Driver file is not deleted from the 'system32\drivers" directory.
  3. Install and uninstall test signed version of the driver. Then install the HLK signed version of the same driver file. Windows does not allow to overwrite as the actual file version in the zfsin.inf file is same.

Reproduce:-

  1. 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_

  2. 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

`

@datacore-rm datacore-rm requested a review from arun-kv July 12, 2024 06:35
@datacore-rm datacore-rm merged commit 47b53a9 into datacore-windows Jul 15, 2024
0 of 8 checks passed
@datacore-rm
Copy link
Author

Thanks @arun-kv.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants