Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "[v17] [vnet] install wintun.dll and VNet service with Connect on Windows" #52449

Merged
merged 1 commit into from
Feb 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 0 additions & 29 deletions build.assets/windows/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -165,33 +165,6 @@ function Enable-Node {
}
}

function Install-Wintun {
<#
.SYNOPSIS
Downloads wintun.dll into the supplied dir
#>
[CmdletBinding()]
param(
[Parameter(Mandatory)]
[string] $InstallDir
)
begin {
Write-Host "::group::Installing wintun.dll to $InstallDir..."
New-Item -Path "$InstallDir" -ItemType Directory -Force | Out-Null
$WintunZipfile = "$InstallDir/wintun.zip"
Invoke-WebRequest -Uri https://www.wintun.net/builds/wintun-0.14.1.zip -OutFile $WintunZipfile
$ExpectedHash = "07C256185D6EE3652E09FA55C0B673E2624B565E02C4B9091C79CA7D2F24EF51"
$ZipFileHash = Get-FileHash -Path $WintunZipFile -Algorithm SHA256
if ($ZipFileHash.Hash -ne $ExpectedHash) {
Write-Host "checksum: $ZipFileHash"
throw "Checksum verification for wintun.zip failed! Expected $ExpectedHash but got $($ZipFileHash.Hash)"
}
Expand-Archive -Force -Path $WintunZipfile -DestinationPath $InstallDir
Move-Item -Force -Path "$InstallDir/wintun/bin/amd64/wintun.dll" -Destination "$InstallDir/wintun.dll"
Write-Host "::endgroup::"
}
}

function Get-Relcli {
<#
.SYNOPSIS
Expand Down Expand Up @@ -467,8 +440,6 @@ function Build-Connect {

$CommandDuration = Measure-Block {
Write-Host "::group::Building Teleport Connect..."
Install-Wintun -InstallDir "$TeleportSourceDirectory\wintun"
$env:CONNECT_WINTUN_DLL_PATH = "$TeleportSourceDirectory\wintun\wintun.dll"
$env:CONNECT_TSH_BIN_PATH = "$SignedTshBinaryPath"
pnpm install --frozen-lockfile
pnpm build-term
Expand Down
8 changes: 0 additions & 8 deletions web/packages/teleterm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,6 @@ When running `pnpm package-term`, you need to provide these environment variable

The details behind those vars are described below.

### Windows

Packaging Connect on Windows requires wintun.dll, which VNet uses to create a
virtual network interface.
A zip file containing the DLL can be downloaded from https://www.wintun.net/builds/wintun-0.14.1.zip
Extract the zip file and then pass the path to wintun.dll to `pnpm package-term`
with the `CONNECT_WINTUN_DLL_PATH` environment variable.

#### tsh.app

Unlike other platforms, macOS needs the whole tsh.app to be bundled with Connect, not just the tsh
Expand Down
17 changes: 0 additions & 17 deletions web/packages/teleterm/build_resources/installer.nsh
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,6 @@
# Make EnVar define user env vars instead of system env vars.
EnVar::SetHKCU
EnVar::AddValue "Path" $INSTDIR\resources\bin

nsExec::ExecToStack '"$INSTDIR\resources\bin\tsh.exe" vnet-install-service'
Pop $0 # ExitCode
Pop $1 # Output
${If} $0 != 0
MessageBox MB_ICONSTOP \
"tsh.exe vnet-install-service failed with exit code $0. Output: $1"
Quit
${Endif}
!macroend

!macro customUnInstall
Expand All @@ -30,12 +21,4 @@
# Fortunately, electron-builder puts the uninstaller directly into the actual installation dir.
# https://nsis.sourceforge.io/Docs/Chapter4.html#varother
EnVar::DeleteValue "Path" $INSTDIR\resources\bin

nsExec::ExecToStack 'sc delete TeleportVNet'
Pop $0 # ExitCode
Pop $1 # Output
${If} $0 != 0
MessageBox MB_ICONSTOP \
"sc delete TeleportVNet failed with exit code $0. Output: $1"
${Endif}
!macroend
13 changes: 0 additions & 13 deletions web/packages/teleterm/electron-builder-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ const { env, platform } = require('process');
const fs = require('fs');
const { spawnSync } = require('child_process');
const isMac = platform === 'darwin';
const isWindows = platform === 'win32';

// The following checks make no sense when cross-building because they check the platform of the
// host and not the platform we're building for.
Expand Down Expand Up @@ -30,10 +29,6 @@ if (!isMac && env.CONNECT_TSH_BIN_PATH === undefined) {
throw new Error('You must provide CONNECT_TSH_BIN_PATH');
}

if (isWindows && env.CONNECT_WINTUN_DLL_PATH === undefined) {
throw new Error('You must provide CONNECT_WINTUN_DLL_PATH');
}

// Holds tsh.app Info.plist during build. Used in afterPack.
let tshAppPlist;

Expand Down Expand Up @@ -183,20 +178,12 @@ module.exports = {
from: env.CONNECT_TSH_BIN_PATH,
to: './bin/tsh.exe',
},
env.CONNECT_WINTUN_DLL_PATH && {
from: env.CONNECT_WINTUN_DLL_PATH,
to: './bin/wintun.dll',
},
].filter(Boolean),
},
nsis: {
// Turn off blockmaps since we don't support automatic updates.
// https://github.com/electron-userland/electron-builder/issues/2900#issuecomment-730571696
differentialPackage: false,
// Use a per-machine installation to support VNet.
// VNet installs a Windows service per-machine, and tsh.exe must be
// installed in a path that is not user-writable.
perMachine: true,
},
rpm: {
artifactName: '${name}-${version}.${arch}.${ext}',
Expand Down
Loading