Version 4 (modified by Samuli Seppänen, 8 years ago) (diff)



The NSI script in openvpn-build repository makes use of EnvVarUpdate.nsh to append OpenVPN\bin to the system-wide PATH variable on Windows. When using default NSIS builds, PATH can't be longer than 1024 characters or OpenVPN install destroys it. To support longer PATHs you need rebuild makensis with larger NSIS_MAX_STRLEN.

Rebuilding NSIS on Ubuntu 12.04

Here we rebuild nsis and nsis-common Debian packages with custom configuration. It is suggested that you set up the openvpn-build buildsystem using the automated script, because that installs most mingw-w64 tools you'll need. Once openvpn-build is setup, a few extra packages have to be installed:

$ apt-get update
$ apt-get install apt-src g++-mingw-w64

Next fetch the NSIS sources:

$ apt-src install nsis

Next open nsis-2.46/debian/rules in a text editor and add NSIS_MAX_STRLEN=8192 to the suitable place:


Now build the packages:

$ apt-src build nsis

Finally, install the customized packages using dpkg:

$ dpkg -i nsis_2.46-* nsis-common_2.46-*

If you now rebuild openvpn, the installer should support appending to long PATHs.

Installing patched nsis_2.46 Ubuntu packages

Instead of patching and building nsis yourself, you can try installing standard nsis packages from Ubuntu 12.04 repositories and then installing these nsis packages on top of those. Their build number is set high to prevent standard packages from overwriting them during system upgrades.

Attachments (2)

Download all attachments as: .zip