Custom OpenVPN Installer (NSIS)

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 the openvpn folder.
  • Put Office.ovpn in the openvpn\config folder.
  • Under the OpenVPN GUI section in the NSIS script uncomment the following line: File "${HOME}\config\Office.ovpn"
Did you find this article useful? Why not share it with your friends?

21 thoughts on “Custom OpenVPN Installer (NSIS)

  1. 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?

    1. 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.

  2. There is new version 2.4.5 available. Please will be new package for download? Anyway thank you for your great work!

  3. 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! 🙂

  4. 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.

    1. 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.

      1. 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.

  5. 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?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.