From: Simon Rozman Date: Tue, 12 Jun 2018 11:06:43 +0000 Message-ID: <99D61A626FDA8A4B90A270669121BE10895D42FF@...2294...> References: <99D61A626FDA8A4B90A270669121BE10872BAB2E@...2294...> In-Reply-To: <99D61A626FDA8A4B90A270669121BE10872BAB2E@...2294...> Content-Language: en-US Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg=2.16.840.1.101.3.4.2.1; boundary="----=_NextPart_000_0020_01D4024E.35199280" MIME-Version: 1.0 Subject: Re: [Openvpn-devel] TAP-Windows MSI packages List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Simon Rozman , "openvpn-devel (openvpn-devel@lists.sourceforge.net)" ------=_NextPart_000_0020_01D4024E.35199280 Content-Type: multipart/alternative; boundary="----=_NextPart_001_0021_01D4024E.35199280" ------=_NextPart_001_0021_01D4024E.35199280 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi, After testing the MSI updating (installing newer MSI package over the previous one), I have found out that WiX driver installation custom action uninstalls the previous driver in RemoveExistingProducts pass, which effectively removes all existing TAP interfaces. Though it installs the new driver later on, the damage has been done. This means me going back to the drawing board inventing our own MSI custom action to install the driver and hopefully update seamlessly. Best regards, Simon From: Simon Rozman Sent: Thursday, June 7, 2018 3:51 PM To: openvpn-devel (openvpn-devel@lists.sourceforge.net) Subject: [Openvpn-devel] TAP-Windows MSI packages 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_0021_01D4024E.35199280 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi,

<= o:p> 

After te= sting the MSI updating (installing newer MSI package over the previous one)= , I have found out that WiX driver installation custom action uninstalls th= e previous driver in RemoveExistingProducts pass, which effectively removes= all existing TAP interfaces. Though it installs the new driver later on, t= he damage has been done.

 

This means me going back to the drawing board inventing our own MSI cus= tom action to install the driver and hopefully update seamlessly.

 

Best regards,

Simon

 

From:<= /b> Simon Rozman <s= imon@...2293...>
Sent: Thursday, June 7, 2018 3:51 PM
T= o: openvpn-devel (openvpn-devel@lists.sourceforge.net) <openvpn-deve= l@lists.sourceforge.net>
Subject: [Openvpn-devel] TAP-Windows = MSI packages

&nb= sp;

Hi!<= /p>

 

Finally, I have some MSI material to sh= are with community. My playground is at https://github.com/rozmansi/tap-windows6.<= /span>

 <= /p>

It proved a lot more work than I= estimated back in Karlsruhe. The core problem was driver install and TAP i= nterface creation within the MSI package. Well actually, the core problem w= as lack of my time.

 

<= o:p> 

1. tapct= l.exe

&nb= sp;

Anyway, a tapct= l.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/tapins= tall – it is GPLv2 licenced and was designed from ground up especiall= y for OpenVPN.

 

Main f= eatures 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 "Lo= cal Area Connection 2", "Ethernet 2" and random names like t= hat just don't.
  • Removal of individual network interfa= ces (by name or GUID)
  • Network interface listing<= /o:p>
  • It does not install or update TAP driver. The TAP driver m= ust be installed by other means. It only manipulates (TAP) network interfac= es.

 

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 re= member David had an idea at our lunch discussion to be nice to be able to r= euse 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 functional= ity 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 f= or packaging.

=  

The MSI= package also installs OpenVPN Inc.'s certificate before installing the dri= ver. This avoids the trust prompt on driver install and is important when i= nstalling MSI package using GPO or some other unattended mean deployment.

 

 

3. Initial TAP interface inst= allation

=  

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

 =

  • Existing TAP interface enumera= tion 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.
  • Thoroughly te= st upgrading (use old TAP drivers to make MSI packages for past versions)
  • Integrate into tap-windows6 build process = 211; discuss options to revise building process (Jon Kunkee proposals)
  • = Prepare MSI packages for OpenVPN
  • <= /ul>

     

     

    Best regards,

    Simon

     

= ------=_NextPart_001_0021_01D4024E.35199280-- ------=_NextPart_000_0020_01D4024E.35199280 Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgEFADCABgkqhkiG9w0BBwEAAKCCCXow ggQZMIIDAaADAgECAgQ7PPnJMA0GCSqGSIb3DQEBBQUAMD0xCzAJBgNVBAYTAnNpMRswGQYDVQQK ExJzdGF0ZS1pbnN0aXR1dGlvbnMxETAPBgNVBAsTCHNpZ2VuLWNhMB4XDTAxMDYyOTIxMjc0NloX DTIxMDYyOTIxNTc0NlowPTELMAkGA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