Hi, On Tue, Jan 24, 2023 at 9:25 AM Lev Stipakov <lstipa...@gmail.com> wrote:
> From: Lev Stipakov <l...@openvpn.net> > > Custom action "FindSystemInfo" finds adapters with certain hwid and > assigns found adapters' guids to a certain property. Later another custom > action "EvaluateTUNTAPAdapters" schedules adapter creation if the > abovementioned property is not set - which means no adapters exist > with given hwid. > > I think this logic is needed to prevent duplicate adapter creation > if adapter was renamed and then new version is installed. > Is the driver still always updated (i.e., when update required) even if the adapter is not created because of existing ones found? Can we add an adapter creation to iservice so that openvp.exe can create adapters on the fly? An alternative is for the GUI to catch the "no adapters" error and offer to create one. But that would work only for users who can elevate and is less opaque to the user. As we support multiple connections and default to DCO, auto-creating at least DCO adapters will be an improvement. If we just fix a typo, OpenVPN-GUI won't create a adapter on step 2 and > after Connect removal on step 3 there won't be DCO adapters anymore > for OpenVPN-GUI to use. > Can the "Connect team" be convinced to use a different hwid for the adapter? Using a name to distinguish between adapters installed by different packages doesn't look very robust. That said, the quick-fix looks good to me.. I did not test it though. + /* exclude adapters created by OpenVPN Connect, since they're > removed on Connect uninstallation */ > + if (_tcsstr(pAdapter->szName, OPENVPN_CONNECT_ADAPTER_SUBSTR)) + { > + msg(M_WARN, "%s: skip OpenVPN Connect adapter '%ls'", > __FUNCTION__, pAdapter->szName); > M_INFO may be enough here? > + continue; > + } > + > /* Convert adapter GUID to UTF-16 string. (LPOLESTR defaults to > LPWSTR) */ > LPOLESTR szAdapterId = NULL; > StringFromIID((REFIID)&pAdapter->guid, &szAdapterId); > @@ -316,7 +325,7 @@ FindSystemInfo(_In_ MSIHANDLE hInstall) > find_adapters( > hInstall, > TEXT("ovpn-dco") TEXT("\0"), > - TEXT("OVPNDCOAPTERS"), > + TEXT("OVPNDCOADAPTERS"), > TEXT("ACTIVEOVPNDCOADAPTERS")); > if (bIsCoInitialized) Acked-by Selva Nair <selva.n...@gmail.com> Selva
_______________________________________________ Openvpn-devel mailing list Openvpn-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openvpn-devel