OpenVPN / tap-windows6

Windows TAP driver (NDIS 6)
Other
785 stars 237 forks source link

Windows 10 - Removing the driver per instructions does not really remove the driver #119

Closed duaneellissd closed 4 years ago

duaneellissd commented 4 years ago

I suggest an update to the README as follows:

Replacing the driver in a debug environment

You might find that the "tap uninstall", or 'update' does not work as think it should. Windows often "holds onto" a driver that was previously installed and reuses that driver "sys" file, for example the file might be located (hidden) in a driver store, for example to find these, use this command substituting the name of your tap901.sys file.

   cd c:\windows
   dir /s tap0901.sys

Might show, for example directories like this:

c:\Windows\System32\DriverStore\FileRepository\oemvista.inf_amd64_6d4bec28a2ef0cdf

To delete these, requires several steps:

Once removed, retry the tapinstall install YOURINF.inf YOURNAME command, you should only find your new driver present.

mattock commented 4 years ago

The process you describe is actually described in our Wiki (here) and we also have a tool called Remove-Tapwindows.ps1 that uses pnputil.exe to remove all tap-windows6 drivers from the driver store.

That said, I'm open to linking to that repo and/or documenting the manual process in tap-windows6 repo. Can you create a documentation PR?

duaneellissd commented 4 years ago

Hmm - The link to Remove-Tapwindows.ps1 results in an 404 error.

Perhaps this entire discussion is jaded by the choice of words and terms Microsoft took when they wrote "devcon.exe"

To be more clear what I mean is this problem:

How do I try out my shinny new driver? What exactly is the process I should follow?

I think it is reasonable to think - based on the wiki, and the instructions I would do this:

Exactly the above does not work. Instead Step B, re-installs the SAME driver installed above in Step 2, explicitly because that earlier driver in step 2 was "approved for installation" and thus stored in the driver store.

The command "tapinstall remove" - is sort of like a USB device, the "remove" command effectively acts like unplugging a pseudo-USB device - followed by a "install" - is like plugging the identical (old) pseudo-usb device back into the compute.

I can create a pull request for the README.rst, but that is not the wiki page....

selvanair commented 4 years ago
  • Step A Uninstall per the instructions, ie: tapinstall remove hwid should work.
  • Step B Then tapinstall install FOO.inf. HWID would install the new driver, keyword NEW driver.

These instructions do work if the previous and new driver versions differ -- both down-grade and upgrade should work because of the way devcon (tapinstall.exe) installs drivers. Not if version number is the same.

So one option is to always change the version when you make debug drivers. Otherwise, first use the powershell script mattock mentioned to cleanup the driver store. Looks like the link to the script got truncated. Try this: https://github.com/mattock/tap-windows-scripts/blob/master/Remove-Tapwindows.ps1

duaneellissd commented 4 years ago

Agh... Version numbers... This does not solve the edit/compile/debug loop - 20 versions per day.

There's no automatic process for that in this system that I am aware of.

I presume when merged, you'll squash all commits.

Hope this helps.

mattock commented 4 years ago

I fixed the link. There was just a "." at the end, hence 404. Wiki articles can be modified by anyone who sets up an OpenVPN community services account (see "Register" link at https://community.openvpn.net).

mattock commented 4 years ago

Fixed in https://github.com/OpenVPN/tap-windows6/pull/121.