New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding service installation/registration #4
Comments
@xkjyeah : notifying you, just in case :). |
Hi, I'll look into it. Daniel
|
@xkjyeah : thanks a lot! |
Alternatively we could install this one as "OpenVPNService" and rename the current automatic service name to something like "OpenVPNServiceLegacy". I'm assuming this one is able to work as a drop-in replacement. As the binary name openvpnserv is already taken, this one will have to named, say, openvpnserv2.exe But if the service name is also changed to "OpenVPNService2" it may find slow acceptance. |
Sounds good. So this what we'd end up with:
EDIT: I can take care of renaming the old openvpnserv.exe's automatic service part. |
While I understand the idea of not requiring too many external tools, you might want to consider looking into SC.EXE which is bundled with (at least) everything Windows from Windows 7 to latest versions. It's the command line tool for maintaining services etc. Earlier it was only included in the resource kit, but that was ages ago. |
I'm assuming this service can work as a drop-in replacement. We have to test things like support for sub-directories in config. Also it would be nice if it cleanly closes openvpn on service exit -- using an exit event or send ctrl-C before resorting to force-kill. Some users may also expect it to support the same command line options as the original. |
@lkarlslund : sc.exe is a reasonable option if it is available on every Windows version we support (7 and later). Its location needs to be well-known/static or at least programmatically discoverable (e.g. based on a value of a known registry key). |
@mattock It's in C:\WINDOWS\SYSTEM32, that's pretty static ;) You should be covered from at least Windows 7 onwards, but I can't find any documentation on when it was included in Windows. |
I'm not familiar with sc.exe. Where does sc.exe fit into the build/install process? |
@xkjyeah : thanks a lot: openvpnserv2 gets installed in openvpn.nsi already, but the service registration part is missing. I'll tackle that next week. |
Just curious why openvpnserv.exe Process has a signature, but openvpnserv2.exe does not? |
It shows up as unsigned for me too, but this is unexpected. AFAIK, all exe's included in the installer are signed. Strangely, the file version of openvpnserv2.exe shows as 0.0.0.0 as well (should be 1.3.0.0). The copy at http://build.openvpn.net/downloads/releases/openvpnserv2-1.3.0.0 is signed though even that one also does not show the version and size is much larger. On rebuilding from sources the exe displays the version correctly. I recall the version issue was fixed about a year ago, so is an older unsigned exe getting included somehow? @mattock any idea? |
Hi,
I'm now looking into integrating openvpnserv2 into the official OpenVPN installers. Right now the problem is that openvpnserv2 essentially replaces the old openvpnserv.exe, which actually consists of two services:
The automatic service is what openvpnserv2 will replace. The above two share the same binary, so openvpnserv2 can't be just dropped in.
I had a look at the openvpnserv code, and it seems to me that moving to openvpnserv2 for the automatic part could be done in two phases:
Can you implement service registration in, say, main function of openvpnserv2? The approach used in old openvpnserv.exe seems reasonable:
.\openvpnserv2.exe -install
(register the service).\openvpnserv2.exe -remove
(deregister the service)I think this approach is less prone to breakage than installing with, say, InstallUtil.exe (if that is still relevant today).
Thoughts?
The text was updated successfully, but these errors were encountered: