[PATCH wintun v2] installer: do not enforce driver removal

Marc Becker becm at gmx.de
Sat Oct 17 17:00:48 CEST 2020


Persistend network adapters hold locks on installed driver.
Forced removal breaks service/PnP ownership references.

Do not enforce driver removal and make failure non-fatal.
In-use driver will be kept until uninstall or next update.

Signed-off-by: Marc Becker <becm at gmx.de>
---
 installer/installation.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/installer/installation.c b/installer/installation.c
index cd93ffb..9c7992c 100644
--- a/installer/installation.c
+++ b/installer/installation.c
@@ -345,9 +345,9 @@ static BOOL RemoveWintun(VOID)
         {
             PathStripPath(DriverDetail->InfFileName);
             Logger(LOG_INFO, TEXT("Removing existing driver"));
-            if (!SetupUninstallOEMInf(DriverDetail->InfFileName, SUOI_FORCEDELETE, NULL))
+            if (!SetupUninstallOEMInf(DriverDetail->InfFileName, 0, NULL))
             {
-                PrintError(LOG_ERR, TEXT("Unable to remove existing driver"));
+                PrintError(LOG_WARN, TEXT("Unable to remove existing driver"));
                 Ret = FALSE;
             }
         }
@@ -601,8 +601,7 @@ BOOL InstallOrUpdate(VOID)
     }
     if (!RemoveWintun())
     {
-        PrintError(LOG_ERR, TEXT("Failed to uninstall old drivers"));
-        goto cleanupAdapters;
+        PrintError(LOG_WARN, TEXT("Failed to uninstall old drivers, probably some are in use by adapters. Continuing."));
     }
     if (!InstallWintun(!!ExistingAdapters))
     {
--
2.11.0



More information about the WireGuard mailing list