In this tutorial I will show you how to roll your own custom OpenVPN client installer using NSIS. The installer will include the Better OpenVPN GUI Client and is based on OpenVPN 2.4.5 which features the ability to run OpenVPN GUI without administrative privileges. The new OpenVPN GUI features are documented here. Click here for the older 2.3 version.
Note: Customized OpenVPN Installer Source has been updated to version 2.4.5 including the OpenVPN GUI v11.10 client on Mar 23, 2018. This installer will not work on XP. With this release, we have removed the x86 version from the package. Also note that the OpenSSL heartbleed vulnerability does not affect this package as it is a client only install package.
Required software
- NSIS 3.03 – Nullsoft Scriptable Install System available here.
- Customized OpenVPN Installer Source and NSIS build scripts available (Vista +) here.
- Archived OpenVPN Installer Source and NSIS build scripts available (x86-64) here.
Preparations
- Download and install NSIS 3.03 (requires full install).
- Download and extract the OpenVPN-Installer-Source.zip file referred to above.
- Note: all source files must be in the same directory in order to compile.
Packaging
- Building the installer package: simply right-click the NSIS script (openvpn.nsi) and chose Compile NSI.
- openvpn.nsi may be modified using Notepad++ or your favorite text editor to customize your installer.
Modify The Script
How do I include my own openvpn configuration file?
- Create your own config file and name it as you want the connection named when using the GUI. For example
Office.ovpn
. - Create a
config
folder inside theopenvpn
folder. - Put
Office.ovpn
in theopenvpn\config
folder. - Under the
OpenVPN GUI
section in the NSIS script uncomment the following line:File "${HOME}\config\Office.ovpn"
Hello, I’m wondering what’s needed to update to the latest version of OpenVPN. Besides updating the binaries in “/bin” are there other steps required? Can the binaries simply be extracted from the pre-built “.exe” official installer or are you building them yourself? Thanks!
Yes to all of your questions
I tried to update the installer but in the windows-Nsis folder , in the open on-built there is no openvpnserv2.exe after I built the whole thing . I copied the files you mentioned in your zip but tap driver cannot be intalled
Hello,
You have the package for version 2.6?
2.6?
Sorry Mathew,
I made confusion, I would like to ask about version 2.4.6.
It will be up soon but no date can be promised.
please update the version
Will do when time permits
news?
Thank you for this awesome work. I added the script to deleting old configurations and translated some messages. Would it be possible to make a Github project out of this?
Thank you for the compliment :). We don’t use GitHub however the code is there for everyone to use so feel free to make it a project if you would like. I would appreciate attribution if you do decide to make it a project.
There is new version 2.4.5 available. Please will be new package for download? Anyway thank you for your great work!
We should have it out by the end of this week
Please do you have some time-plan when will be newer version released? Thank you.
Andrew, the new version is out!
Great – thank you so much guys!
Do you have the latest Source package (OpenVPN 2.4.4)?
We will be updating the article later today
This is exactly what I was searching for. OpenVPN easy to install and not requiring administrative rights for the one using it. I just added our configuration and certificate files and it works like a charm. Thanks for the great work! 🙂
Excellent, glad it worked well for you 🙂
Any thoughts on code signing? Google Chrome is giving warnings “This file may harm your computer” and so forth.
I’ve looked in to code signing certificates from Comodo etc but you have to jump through so many hoops it’s unreal, well, as an individual anyway, f you don’t have a registered business. E.g., visiting an attorney with your ID to get it signed, and giving Comodo a copy of bank statements.
I have thought about signing the installers in the past, however we only distribute our custom installer to our own client base so there is really no need in our use case.
How do I update the package for the new release of openvpn and how do I get the newest drivers for Win 8 32 and 64 bit.
Paul, the article’s downloads contain the most recent OpenVPN software and drivers.
Thank you. This worked like a charm. I had to add a certificate so after uncommenting the line you pointed out, I inserted
File “${HOME}\config\xxx.cer”
and included the certificate in that folder.
Great job.
Hi. I’m afraid this installer doesn’t install the GUI on my Windows 7 64 PC, despite leaving all options on default during install and also trying to run install as admin.
I removed old version first. Also strangely, after clicking Finish (install), it hangs for about 10 seconds before exit.
Any ideas please?