jochenwierum / openvpn-manager

An OpenVPN Frontend

Home Page:https://github.com/jochenwierum/openvpn-manager/wiki

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unhandled exception when detecting openvpn location

hapm opened this issue · comments

It looks like the newest installer of openvpn doesn't create the registry key exe_path used to resolve the openvpn.exe location anymore, but still creates the OpenVPN key. UtilsHelper.LocateOpenVPN on the other hand only checks for the existence of the OpenVPN key and assumes that there must be an exe_path underneath. Instead it should check for the key to exist before it tries to read the value, to avoid an ugly IOException.

This only happes if you don't add openvpn.exe to the PATH variable, as LocateOpenVPN checks the PATH and retuns on success, before it tries the registry lookup method.

Needed to change the commit to fix this. Please ignore a8addc0, it doesn't cleanup the RegistryKey instance explicitly when there is an IOException