Command-line installation of OpenVPN

OpenVPN’s installer allows for command-line based (silent) installation, but this feature is not actually documented explicitly anywhere. Here’s all I could find – hope this list will help someone in the same situation I was in.

The installer allows you to specify is the installation should be “silent” (i.e. no GUI, nothing to click on), to specify custom installation directory (esp. useful if included in another installer, e.g. NSIS, and installing in the same directory as the target app), and components to install.

The parameters can be used even when you’re not using the silent installation, to customize behavior of the graphical installer.

/S      - silent installation
/D=path - specify a custom installation path

Note – the /D parameter has to appear last on the command line, and the path may not be inclosed in quotes. The installer simply takes all of the command line left, and uses it as path (thus supporting spaces in the path).

To select individual OpenVPN components (1 = install, 0 = do not install; the values below indicate defaults):

/SELECT_SHORTCUTS=1              - create the start menu shortcuts
/SELECT_OPENVPN=1                - OpenVPN itself
/SELECT_SERVICE=1                - install the OpenVPN service
/SELECT_TAP=1                    - install the TAP device driver
/SELECT_OPENVPNGUI=1             - install the default OpenVPN GUI
/SELECT_ASSOCIATIONS=1           - associate with .ovpn files
/SELECT_OPENSSL_UTILITIES=0      - install the utilities for generating public-private key pairs
/SELECT_EASYRSA=0                - install the RSA X509 certificate management scripts
/SELECT_PATH=1                   - add openvpn.exe in PATH
/SELECT_OPENSSLDLLS=1            - dependencies - OpenSSL DLL's
/SELECT_LZODLLS=1                - dependencies - LZO compressor DLL's
/SELECT_PKCS11DLLS=1             - dependencies - PCKS#11 DLL's

8 responses to “Command-line installation of OpenVPN

  1. @Brian Goff

    You have to export / install the *.p7b Cert File (import to Cert Store) of OpenVPN before you install OpenPVN. You can automate that with the Std Windows Shell.

  2. Very good! Thanks!
    If you want to change the option on Services to OpenVPN service start automatically from command line, just use: sc config OpenVPNService start= auto
    Note the need for the space after =
    To start it imediately: net start OpenVPNService
    Hope it helps someone

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s