| 1 | = OpenVPN 2.5 Windows MSI Parameters for Unattended Installations = |
| 2 | Barton Nicholls • Nov 19, 2020 |
| 3 | Source: https://www.cohesive.net/openvpn-2_5-windows-parameters |
| 4 | |
| 5 | |
| 6 | Since the release of OpenVPN 2.5 the OpenVPN Project has moved it’s installer from an EXE (executable file) to the more modern MSI (windows installation file) method. |
| 7 | MSI files have some clear advantages so no surprise that they have gone this route. |
| 8 | |
| 9 | Previously the OpenVPN EXE had well documented installation parameters for their Windows installer: |
| 10 | |
| 11 | S - silent installation |
| 12 | /D=path - specify a custom installation path |
| 13 | '''Note:''' the /D parameter has to appear last on the command line, and the path may not be enclosed in quotes. |
| 14 | The installer simply takes all of the command line left, and uses it as path (thus supporting spaces in the path). |
| 15 | |
| 16 | To select individual OpenVPN components (1 = install, 0 = do not install; the values below indicate defaults): |
| 17 | {{{ |
| 18 | /SELECT_SHORTCUTS=1 - create the start menu shortcuts |
| 19 | /SELECT_OPENVPN=1 - OpenVPN itself |
| 20 | /SELECT_SERVICE=1 - install the OpenVPN service |
| 21 | /SELECT_TAP=1 - install the TAP device driver |
| 22 | /SELECT_OPENVPNGUI=1 - install the default OpenVPN GUI |
| 23 | /SELECT_ASSOCIATIONS=1 - associate with .ovpn files |
| 24 | /SELECT_OPENSSL_UTILITIES=0 - install the utilities for generating public-private key pairs |
| 25 | /SELECT_EASYRSA=0 - install the RSA X509 certificate management scripts |
| 26 | /SELECT_PATH=1 - add openvpn.exe in PATH |
| 27 | /SELECT_OPENSSLDLLS=1 - dependencies - OpenSSL DLL's |
| 28 | /SELECT_LZODLLS=1 - dependencies - LZO compressor DLL's |
| 29 | /SELECT_PKCS11DLLS=1 - dependencies - PCKS#11 DLL's |
| 30 | }}} |
| 31 | These parameters are useful and necessary when performing an unattended or programatic installation. |
| 32 | Unfortunately with the release of 2.5 and the moving to an MSI installer these parameters no longer work and at the time of this writing the OpenVPN Project has not documented new parameters. |
| 33 | Luckilyfor us MSI files have some basic characteristics and behaviors. |
| 34 | |
| 35 | You can run any MSI file with logging like this: |
| 36 | {{{ |
| 37 | msiexec /i installer.msi /l*v log.txt |
| 38 | }}} |
| 39 | It will pop up your installation GUI and you can then pick the customize option and choose the combination of features that you need. |
| 40 | Once complete you can open your log file that you signified and search for ADDLOCAL. |
| 41 | In our case where we desire to install only the OpenVPN Service and the new Wintun Drivers we find this: |
| 42 | {{{ |
| 43 | ADDLOCAL=OpenVPN.Service,OpenVPN,Drivers,Drivers.Wintun |
| 44 | }}} |
| 45 | We can now run the installer on subsequent windows servers with the following command: |
| 46 | {{{ |
| 47 | msiexec /i OpenVPN-2.5.0-I601-amd64.msi ADDLOCAL=OpenVPN.Service,OpenVPN,Drivers,Drivers.Wintun /passive |
| 48 | }}} |
| 49 | If we wanted to change the installation directory we could do so like this: |
| 50 | {{{ |
| 51 | msiexec /i OpenVPN-2.5.0-I601-amd64.msi PRODUCTDIR="C:\Program Files\OpenVPN25\" ADDLOCAL=OpenVPN.Service,OpenVPN,Drivers,Drivers.Wintun /passive |
| 52 | }}} |
| 53 | If you are looking to install the GUI and the older Windows TAP adapter you would do so like this: |
| 54 | {{{ |
| 55 | msiexec /i OpenVPN-2.5.0-I601-amd64.msi ADDLOCAL=OpenVPN.GUI,OpenVPN,OpenVPN.GUI.OnLogon,Drivers.TAPWindows6,Drivers /passive |
| 56 | }}} |
| 57 | So there you have it. An easy work around to perform silent windows installations. |
| 58 | Hopefully this will save some time and effort for people looking to utilize the new OpenVPN 2.5 client in their DevOps environments. |
| 59 | |
| 60 | |
| 61 | |