Win32Installer plugin for the openvpn web gui

About.

This plugin allows to create customized win32 installer using OpenVPN GUI 
project and nsis installer. Customized installer contains clients key, 
certificate and root ca. Resulted installers are ready to use right after 
installation.

Requirements.

1. NSIS installer (makensis) installed and configured. On debian use
   'apt-get install nsis'. Also it is possible to compile it from source, see
   http://www.xdevsoftware.com/blog/post/How-to-Install-the-Nullsoft-Installer---NSIS-on-Linux-.aspx
   for more information.
2. Installer source package of the openvpn gui project. 
   See http://openvpn.se/files/install_packages_source/ for the latest version,
   i`m using openvpn_install_source-2.0.9-gui-1.0.3.zip file. Unpack it 
   somewhere, e.g. to the /opt/openvpn-gui folder. Please, make sure that this 
   folder is readable by web server.
3. Openvpn web gui installed and configured properly

Installation.

1. Edit local.inc in the plugin directory and specify paths to the nsis binary
   and unpacked installer sources.
2. You will need to customize openvpn-gui.nsi located in the installer source
   directory. There are some required changes:
   a) add "!undef SF_SELECTED" line before "!define SF_SELECTED" and 
      "!undef SF_RO" before "!define SF_RO" (makensis will fail without this)

   b) Replace line 'OutFile "openvpn-${VERSION}${OUTFILE_LABEL}-install.exe"' with

    !ifdef OUTFILE
      OutFile "${OUTFILE}"
    !else
      OutFile "openvpn-${VERSION}${OUTFILE_LABEL}-install.exe"
    !endif

   c) after line 'SetOutPath "$INSTDIR\config"' add block
       SetOutPath "$INSTDIR\config"
       File /oname=Office.ovpn \var\www\vpngui\plugins\win32installer\tmp\server.ovpn
       File /oname=ca.crt ${KEY_CA}
       File /oname=client.key ${KEY_PVT}
       File /oname=client.crt ${KEY_CRT}
      If you want to use other names than "Office" in "connect" menu then 
      change '/oname=Office.ovpn' to something else. 
   Also you may disable non required sections (like OpenVPN sources, etc.) to 
   make the package smaller. I provided sample configuration in the 
   openvpn-gui.nsi.sample.
3. Customize tmp/server.ovpn. Put hostname of your OpenVPN server there. Do 
   NOT change ca,key and cert values. It is better to keep this file in DOS 
   (\r\n) format or user will not be able to edit it with notepad.

Usage.
Select "Win32 Installer" from the top menu, and then click to "Download" link near selected certificate. 

Author.

Alex Samorukov, samm@os2.kiev.ua