Development discussion of WireGuard
 help / color / mirror / Atom feed
* [PATCH wintun] installer: do not enforce driver removal
@ 2020-10-16 12:52 Marc Becker
  2020-10-17 15:00 ` [PATCH wintun v2] " Marc Becker
  2020-10-21 19:27 ` Marc Becker
  0 siblings, 2 replies; 3+ messages in thread
From: Marc Becker @ 2020-10-16 12:52 UTC (permalink / raw)
  To: wireguard

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.
This should have no effect on Uninstall, adapters are deleted in advance.
Tested in OpenVPN TAP MSM (https://github.com/OpenVPN/tap-windows6/pull/135)

Signed-off-by: Marc Becker <becm@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..3c6628e 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("Failed to uninstall old drivers, probably some are in use by adapters. Continuing."));
                 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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH wintun v2] installer: do not enforce driver removal
  2020-10-16 12:52 [PATCH wintun] installer: do not enforce driver removal Marc Becker
@ 2020-10-17 15:00 ` Marc Becker
  2020-10-21 19:27 ` Marc Becker
  1 sibling, 0 replies; 3+ messages in thread
From: Marc Becker @ 2020-10-17 15:00 UTC (permalink / raw)
  To: wireguard; +Cc: Marc Becker

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@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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH wintun v2] installer: do not enforce driver removal
  2020-10-16 12:52 [PATCH wintun] installer: do not enforce driver removal Marc Becker
  2020-10-17 15:00 ` [PATCH wintun v2] " Marc Becker
@ 2020-10-21 19:27 ` Marc Becker
  1 sibling, 0 replies; 3+ messages in thread
From: Marc Becker @ 2020-10-21 19:27 UTC (permalink / raw)
  To: wireguard

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.
Old driver is removed by regular disk cleanup or next MSM operation.

Signed-off-by: Marc Becker <becm@gmx.de>
---
Does not change UninstallOEM result error message.

Patch (now correctly) mirrors https://github.com/OpenVPN/tap-windows6/pull/135
Effects discussed in https://github.com/OpenVPN/tap-windows6/issues/129

 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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-10-28  0:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-16 12:52 [PATCH wintun] installer: do not enforce driver removal Marc Becker
2020-10-17 15:00 ` [PATCH wintun v2] " Marc Becker
2020-10-21 19:27 ` Marc Becker

Development discussion of WireGuard

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.vuxu.org/wireguard

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 wireguard wireguard/ http://inbox.vuxu.org/wireguard \
		wireguard@lists.zx2c4.com
	public-inbox-index wireguard

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.wireguard


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git