From: Simon Rozman Date: Thu, 7 Jun 2018 13:50:41 +0000 Message-ID: <99D61A626FDA8A4B90A270669121BE10872BAB2E@...2294...> Content-Language: en-US Content-Type: multipart/signed; micalg=2.16.840.1.101.3.4.2.1; protocol="application/x-pkcs7-signature"; boundary="----=_NextPart_000_005C_01D3FE77.48FCB280" MIME-Version: 1.0 Subject: [Openvpn-devel] TAP-Windows MSI packages List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "openvpn-devel (openvpn-devel@lists.sourceforge.net)" ------=_NextPart_000_005C_01D3FE77.48FCB280 Content-Type: multipart/alternative; boundary="----=_NextPart_001_005D_01D3FE77.48FCB280" ------=_NextPart_001_005D_01D3FE77.48FCB280 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi! Finally, I have some MSI material to share with community. My playground is at https://github.com/rozmansi/tap-windows6. It proved a lot more work than I estimated back in Karlsruhe. The core problem was driver install and TAP interface creation within the MSI package. Well actually, the core problem was lack of my time. 1. tapctl.exe Anyway, a tapctl.exe utility was developed (msi/src/tapctl). It is a command line utility to manage TAP interfaces. It is not a snap-in replacement for devcon/tapinstall - it is GPLv2 licenced and was designed from ground up especially for OpenVPN. Main features of tapctl.exe are: * Creation of (named) TAP interfaces - being able to set the name of the TAP interface to be created allows automation. The "Local Area Connection 2", "Ethernet 2" and random names like that just don't. * Removal of individual network interfaces (by name or GUID) * Network interface listing * It does not install or update TAP driver. The TAP driver must be installed by other means. It only manipulates (TAP) network interfaces. The network interface management source is located in separate tap.h/.c files suitable to be reused in OpenVPN project itself (imagine --mktun on Windows). That's why I chose C language in the end - though I would prefer C++. I remember David had an idea at our lunch discussion to be nice to be able to reuse the code in OpenVPN. For the time being, there is no "remove all TAP interfaces" function. If people will miss it, I can add it. 2. Driver installation The TAP driver installation/upgrade is handled by WiX. WiX already provides MSI custom actions for this task and that functionality was reused. Since the driver will need to be build on Windows anyway, I'll leave TAP-Windows6 MSI packaging to WiX. Note that OpenVPN itself will have quite simple setup in comparison and should allow us to use msitools for packaging. The MSI package also installs OpenVPN Inc.'s certificate before installing the driver. This avoids the trust prompt on driver install and is important when installing MSI package using GPO or some other unattended mean deployment. 3. Initial TAP interface installation Rather than using tapctl.exe to create the initial TAP interface on first install, an MSI custom action DLL was developed (msi/src/tapca). It features: * Existing TAP interface enumeration on initialization * A custom MSI table is used to list the TAP interfaces to create on install and delete on uninstall. This allows IT admins to author MSI with own set of TAP interfaces to install. * A complete set of execute/rollback/commit functionality is implemented, allowing complete rollback on install failure. By default, the MSI packages are authored to install a single TAP interface named "OpenVPN" if there are no existing TAP interfaces on computer: fresh installs will create "OpenVPN" TAP interface, upgrades will leave TAP interfaces intact. 4. The MSI packages The MSI packages are built using WiX Toolset. They provide simple UI (no EULA nagging). They detect the previous setup of TAP-Windows6 (including the NSIS one) and reuse the installation folder. The NSIS leftover files and registry data is cleaned. As mention before, the MSI setup installs/updates TAP driver and install "OpenVPN" TAP interface on first install. When any TAP interface exists (even from NSIS installs) it will skip creation of "OpenVPN" interface. There is one MSI file for each platform. ARM and ARM64 platforms are ready but commented for the time being - waiting for ARM64 driver support (Jon Kunkee patch), WiX support for ARM64 platform, somebody actually having an ARM64 Windows 10 device to test etc. 5. Building The building how-to is described in msi/README.rst. Meanwhile, I have published binaries for testing at https://github.com/rozmansi/tap-windows6/releases/tag/9.21.2-1. Remember: this is TAP driver and TAP network interface installation MSI only. 6. TODO * Thoroughly test upgrading (use old TAP drivers to make MSI packages for past versions) * Prepare self-extracting EXE installer to contain all MSI packages and a bootstrapper to launch msiexec /i with the platform-specific MSI * Integrate into tap-windows6 build process - discuss options to revise building process (Jon Kunkee proposals) * Prepare MSI packages for OpenVPN Best regards, Simon ------=_NextPart_001_005D_01D3FE77.48FCB280 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi!

<= o:p> 

Finally,= I have some MSI material to share with community. My playground is at https://github.com/rozmans= i/tap-windows6.

 

I= t proved a lot more work than I estimated back in Karlsruhe. The core probl= em was driver install and TAP interface creation within the MSI package. We= ll actually, the core problem was lack of my time.

 

 

1. tapctl.exe

 

<= span lang=3DEN-GB>Anyway, a tapctl.exe utility was developed (msi/src/tapct= l). It is a command line utility to manage TAP interfaces. It is not a snap= -in replacement for devcon/tapinstall – it is GPLv2 licenced and was = designed from ground up especially for OpenVPN.

 

Main features of tapctl.exe are:

  • Creat= ion of (named) TAP interfaces – being able to set the name of the TAP= interface to be created allows automation. The "Local Area Connection= 2", "Ethernet 2" and random names like that just don't.
  • Removal of individual network int= erfaces (by name or GUID)
  • Netw= ork interface listing
  • It does = not install or update TAP driver. The TAP driver must be installed by other= means. It only manipulates (TAP) network interfaces.

 

<= p class=3DMsoNormal>The network interface management sou= rce is located in separate tap.h/.c files suitable to be reused in OpenVPN = project itself (imagine --mktun on Windows). That's why I chose C language = in the end – though I would prefer C++. I remember David had an idea = at our lunch discussion to be nice to be able to reuse the code in OpenVPN.=

 

For the time being, = there is no "remove all TAP interfaces" function. If people will = miss it, I can add it.

 

 

2. Dr= iver installation

 

The= TAP driver installation/upgrade is handled by WiX. WiX already provides MS= I custom actions for this task and that functionality was reused. Since the= driver will need to be build on Windows anyway, I'll leave TAP-Windows6 MS= I packaging to WiX. Note that OpenVPN itself will have quite simple setup i= n comparison and should allow us to use msitools for packaging.<= /span>

 <= /p>

The MSI package also installs Op= enVPN Inc.'s certificate before installing the driver. This avoids the trus= t prompt on driver install and is important when installing MSI package usi= ng GPO or some other unattended mean deployment.

 

 

3. Initial TAP interface installation

 

Rather than using tapctl.exe to creat= e the initial TAP interface on first install, an MSI custom action DLL was = developed (msi/src/tapca). It features:

 

  • Existing TAP interface enumerati= on on initialization
  • A custom = MSI table is used to list the TAP interfaces to create on install and delet= e on uninstall. This allows IT admins to author MSI with own set of TAP int= erfaces to install.
  • A complete= set of execute/rollback/commit functionality is implemented, allowing comp= lete rollback on install failure.

 

= By default, the MSI packages are authored to install a s= ingle TAP interface named "OpenVPN" if there are no existing TAP = interfaces on computer: fresh installs will create "OpenVPN" TAP = interface, upgrades will leave TAP interfaces intact.

=

 

 

4. The MSI packages

 

The MSI packages are built using WiX Toolset. They= provide simple UI (no EULA nagging). They detect the previous setup of TAP= -Windows6 (including the NSIS one) and reuse the installation folder. The N= SIS leftover files and registry data is cleaned. As mention before, the MSI= setup installs/updates TAP driver and install "OpenVPN" TAP inte= rface on first install. When any TAP interface exists (even from NSIS insta= lls) it will skip creation of "OpenVPN" interface.

 

=

There is one MSI file for each plat= form. ARM and ARM64 platforms are ready but commented for the time being &#= 8211; waiting for ARM64 driver support (Jon Kunkee patch), WiX support for = ARM64 platform, somebody actually having an ARM64 Windows 10 device to test= etc.

&nb= sp;

 

5. Building=

 =

The building how-to is describe= d in msi/README.rst. Meanwhile, I have published binaries for testing at ht= tps://github.com/rozmansi/tap-windows6/releases/tag/9.21.2-1. Remember:= this is TAP driver and TAP network interface installation MSI only.

 

 

6. TODO

 

  • Thoroughly test upgradi= ng (use old TAP drivers to make MSI packages for past versions)<= /span>
  • Prepare self-extracting EXE installer to = contain all MSI packages and a bootstrapper to launch msiexec /i with the p= latform-specific MSI
  • Integrate= into tap-windows6 build process – discuss options to revise building= process (Jon Kunkee proposals)
  • Prepare MSI packages for OpenVPN

 

 

Best regards,

Simon

 

= ------=_NextPart_001_005D_01D3FE77.48FCB280-- ------=_NextPart_000_005C_01D3FE77.48FCB280 Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgEFADCABgkqhkiG9w0BBwEAAKCCD9Qw ggSKMIIC8qADAgECAg0AkK53dgAAAABXHdBvMA0GCSqGSIb3DQEBCwUAMFwxCzAJBgNVBAYTAlNJ MRwwGgYDVQQKExNSZXB1Ymxpa2EgU2xvdmVuaWphMRcwFQYDVQRhEw5WQVRTSS0xNzY1OTk1NzEW MBQGA1UEAxMNU0ktVFJVU1QgUm9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