# VeloraMesh Windows Client Install

Run these commands from an elevated PowerShell session inside this extracted package.

## Easiest Interactive Install

```powershell
powershell -NoProfile -ExecutionPolicy Bypass -File .\install-windows-client.ps1
```

The installer opens a guided menu when no advanced parameters are supplied:

```text
1) Guided install/update
2) Network operations
3) Service operations
4) Fresh install/reset client
5) Uninstall service, keep files/config
6) Purge client install and config
0) Exit
```

`Guided install/update` asks for API host/domain, API HTTPS port, network name, device name, network join secret, edge discovery host/domain, edge UDP port, and whether the background tunnel service should be installed.

Join secrets entered through the installer must be 24-256 characters. Short or overlong secrets are rejected locally before a control-plane join request is sent.

`Network operations` can join, leave, connect/disconnect, list peers, rename the device, and run doctor without remembering client CLI commands.

`Service operations` can show service status, start, stop, restart, and run service doctor.

`Fresh install/reset client` removes the Windows service, firewall rule, installed files, and config before running the guided install flow.

Optional hardening: set `VELORAMESH_CONTROL_PLANE_SPKI_PIN` to `sha256/<base64-SHA256-SPKI>` before install to pin the HTTPS control-plane certificate/public-key path.

## Install And Start Tunnel Service

```powershell
$SecretFile = Join-Path $env:TEMP "veloramesh-join.secret"
Set-Content -LiteralPath $SecretFile -Value "<network-join-secret>" -NoNewline
$NetworkName = "home"
$Discovery = "edge.veloramesh.com:3478"
powershell -NoProfile -ExecutionPolicy Bypass -File .\install-windows-client.ps1 `
  -Background `
  -ReplaceService `
  -Status `
  -NetworkName $NetworkName `
  -DeviceName $env:COMPUTERNAME `
  -JoinSecretFile $SecretFile `
  -Discovery $Discovery
Remove-Item -LiteralPath $SecretFile -Force
```

## LAN Discovery Broadcasts

Direct IP access uses the peer's VeloraMesh virtual IP and does not need LAN browser discovery support.

For LAN server-browser tests, enable discovery from the Ubuntu server manager or admin CLI:

```bash
sudo /opt/veloramesh/veloramesh-server admin networks broadcast -network home -mode all
```

Return to the safer default after testing:

```bash
sudo /opt/veloramesh/veloramesh-server admin networks broadcast -network home -mode filtered
```

Custom local UDP ports/ranges can still be supplied for diagnostics with `-ForwardBroadcastUDP`, for example `2300-2400,6073`.

When the server administrator sets the network to `broadcast_mode=all`, local custom UDP port allowlists are not required for that network's UDP discovery broadcasts.

## Status

```powershell
& "$env:ProgramFiles\VeloraMesh\veloramesh-client.exe" service status
Get-Content "$env:ProgramData\VeloraMesh\logs\service.log" -Tail 80
```

## Doctor

Run this after install to verify local identity, server auth, joined networks, peer visibility, MTU, and Windows tunnel prerequisites:

```powershell
& "$env:ProgramFiles\VeloraMesh\veloramesh-client.exe" doctor `
  -config "$env:ProgramData\VeloraMesh\client.json" `
  -network "home"
```

For a sanitized support bundle:

```powershell
& "$env:ProgramFiles\VeloraMesh\veloramesh-client.exe" doctor `
  -config "$env:ProgramData\VeloraMesh\client.json" `
  -network "home" `
  -bundle "$env:ProgramData\VeloraMesh\veloramesh-doctor.zip"
```

The guided installer also runs a non-blocking doctor self-test after setup. The Windows service log rotates at 5 MiB with five backups.

## Network Administration

Network creation, join-secret rotation, member removal, and device block/unblock are intentionally server-local operations. Use the Ubuntu server package's `manage-veloramesh-server.sh` menu or `/opt/veloramesh/veloramesh-server admin ...` on the server.

## Uninstall

Keep config and installed files:

```powershell
powershell -NoProfile -ExecutionPolicy Bypass -File .\install-windows-client.ps1 -Uninstall
```

Remove service, firewall rule, installed files, and config:

```powershell
powershell -NoProfile -ExecutionPolicy Bypass -File .\install-windows-client.ps1 -Uninstall -Purge
```

Fresh reset and guided reinstall:

```powershell
powershell -NoProfile -ExecutionPolicy Bypass -File .\install-windows-client.ps1 -Fresh
```