Changes between Version 84 and Version 85 of BuildingOnWindows


Ignore:
Timestamp:
03/31/11 13:08:49 (13 years ago)
Author:
Samuli Seppänen
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • BuildingOnWindows

    v84 v85  
    130130  * '''<openvpn-sources>''': a directory containing openvpn sources (from tarball/zip/git)
    131131  * '''tapinstall'''
    132    * '''7600''': copy of devcon.exe ''build directory''. Can be found from ''C:\WINDDK\7600.16385.1\src\setup\devcon'' or similar, depending on the version of WINDDK. Note that in OpenVPN world ''devcon.exe'' is (confusingly) also known as ''tapinstall.exe''.
     132   * '''7600''': copy of devcon.exe ''build directory''. Can be found from ''C:\WINDDK\7600.16385.1\src\setup\devcon'' or similar, depending on the version of WINDDK. Note that in OpenVPN world ''devcon.exe'' is (confusingly) also known as ''tapinstall.exe''. This is not necessary if you use prebuilt TAP-drivers.
    133133  * '''pkcs11-helper''': copy of pkcs11-helper ''build directory''
    134134   * '''lib''': must also contain ''libpkcs11-helper-1.dll'' and ''libpkcs11-helper-1.dll.manifest'' files produced by pkcs11-helper build
     
    139139   * '''lib''': must also contain the ''lzo2.lib'' file generated by lzo build
    140140  * '''Microsoft.VC90.CRT''': a copy of ''C:\Program Files\MicrosofT Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT'' directory; the exact path may vary. Note that using the wrong version will cause issues on 32-bit or 64-bit Windows versions.
    141   * '''tap-prebuilt''': this directory contain prebuilt, signed TAP-drivers for and tapinstall.exe. This is only needed if you don't build the TAP-drivers yourself.
    142    * '''i386''': should contain 32-bit versions of ''tap0901.cat'', ''tap0901.sys'', ''OemWin2k.inf'' and ''tapinstall.exe''
     141  * '''tap-prebuilt''': this directory contain prebuilt, signed TAP-drivers and tapinstall.exe [#Extracting_signed_TAP-drivers_from_an_OpenVPN_installer|extracted from an OpenVPN installer] This is only needed if you don't build the TAP-drivers yourself.
     142   * '''i386''': should contain 32-bit versions of TAP-driver and ''tapinstall.exe''
    143143   * '''amd64''': should contain 64-bit versions of the above
    144144  * '''signtool''': this directory should contain ''signtool.exe'', which can be found from the Microsoft SDK directory (e.g. ''C:\Program
     
    161161}}}
    162162
    163 This builds ''openvpn.exe'', ''openvpnserv.exe'' and the TAP driver and copies the results to ''<openvpn-sources>\dist''. The ''--unsigned'' switch disables TAP driver signing, which would not work anyways because the ''Sign'' Python module is only available internally at OpenVPN Technologies. If you intend to use signed TAP drivers from an existing OpenVPN installer, you can skip building the TAP driver altogether:
     163This builds ''openvpn.exe'', ''openvpnserv.exe'' and the TAP driver and copies the results to ''<openvpn-sources>\dist''. The ''--unsigned'' switch disables TAP driver signing, which would not work anyways because the ''Sign'' Python module is only available internally at OpenVPN Technologies. In case you want to test new TAP-driver versions on Windows Vista/7 64-bit you need to self-sign them and jump through several hoops. If you intend to use signed TAP drivers from an existing OpenVPN installer, you can [#Extracting_signed_TAP-drivers_from_an_OpenVPN_installer|extract signed TAP drivers from an existing installer] and skip building the TAP driver altogether:
    164164
    165165{{{
     
    167167}}}
    168168
    169 Note that in this case you ''need'' to copy signed TAP-drivers to the ''TAP_PREBUILT'' directory defined in ''win/settings.in''.
    170 
    171169To clean up before or after the build, issue
    172170
     
    181179}}}
    182180
     181== Extracting signed TAP-drivers from an OpenVPN installer ==
     182
     183If you need to run OpenVPN on Windows Vista/7 64-bit you have to use signed TAP drivers. Unless you sign them yourself, you need to do two extra steps:
     184
     185 * Extract the TAP-drivers (*.cat, *.sys, *.inf) and ''tapinstall.exe'' from an official OpenVPN installer using [http://www.7-zip.org/ 7-zip]. There are separate versions for 32-bit and 64-bit versions of Windows: 64-bit versions are larger.
     186 * Place 32-bit signed TAP drivers and corresponding ''tapinstall.exe'' to ''<openvpn-build-root>\tap-prebuilt\i386''
     187 * Place 64-bit versions to ''<openvpn-build-root>\tap-prebuilt\amd64''
     188
    183189== Packaging OpenVPN ==
    184190
    185 Once OpenVPN build is finished, you may want to make an installer executable. OpenVPN installers are packaged using [http://nsis.sourceforge.net/Main_Page NSIS], which you can download from [http://nsis.sourceforge.net/Download here]. The buildsystem, or more correctly ''<openvpn-sources>\win\make_dist.py'' - puts everything the NSI script (''<openvpn-sources>\win\openvpn.nsi'') needs to ''<openvpn-sources>\dist''. However, as of OpenVPN 2.2-RC there are still a few manual steps involved:
    186 
    187  * If you need to run OpenVPN on Windows Vista/7 64-bit you have to use signed TAP drivers. Unless you sign them yourself, you need to do two extra steps:
    188   * Extract TAP-drivers and ''tapinstall.exe'' from an official OpenVPN installer using [http://www.7-zip.org/ 7-zip].
    189   * Place the signed TAP drivers and corresponding ''tapinstall.exe'' to ''<openvpn-sources>\dist\i386'' and ''<openvpn-sources>\dist\amd64'', respectively. Put 32-bit files to the ''i386'' directory and 64-bit files to the ''amd64'' directory.
    190  * [http://msdn.microsoft.com/en-us/library/ms235591%28v=vs.80%29.aspx Embed manifest files manually] to ''openvpn.exe'', ''openvpnserv.exe'', ''lzo2.dll'' and ''libpkcs11-helper-1.dll''. The purpose of the manifest file (whether embedded or not) is to declare the run-time dependencies of the EXE/DLL. This step is required because the NSI script is not configured to install external manifest files and a manifest file is needed for proper operation.
    191 
    192 All of this has been automated in OpenVPN 2.2-RC2 and later. In case you want to test new TAP-driver versions on Windows Vista/7 64-bit you need to self-sign them and jump through several hoops. For details, look below.
     191Once OpenVPN build is finished, you may want to make an installer executable. OpenVPN installers are packaged using [http://nsis.sourceforge.net/Main_Page NSIS], which you can download from [http://nsis.sourceforge.net/Download here]. The buildsystem, or more correctly ''<openvpn-sources>\win\make_dist.py'' - puts most of what the NSI script (''<openvpn-sources>\win\openvpn.nsi'') needs to ''<openvpn-sources>\dist''. The NSI script still (as of 2.2-RC2) pulls some files from directories other that ''dist'', but that will be fixed later.
    193192
    194193OpenVPN installer is driven by the ''<openvpn-sources>\win\openvpn.nsi'' NSI script, which has to be loaded with the [http://nsis.sourceforge.net/Main_Page MakeNSIS] application to generate an installer. If the ''<openvpn-sources>\dist'' directory has been properly set up, you should not encounter any errors. However, if ''MakeNSIS'' complains about missing files, make sure the ''<openvpn-sources>\dist'' directory contains all of the packaging dependencies: