# Byte-Bak RustDesk Windows Deploy

Fast field package for enrolling a Windows PC into the Byte-Bak RustDesk server.

## What it does
- downloads and silently installs RustDesk `1.4.6`
- points the client at `remote.byte-bak.com`
- applies the current Byte-Bak RustDesk public key
- applies the server configuration with RustDesk's supported `--config` command after install/service creation
- installs/enables the RustDesk Windows service for unattended startup
- sets a permanent password you choose at deploy time
- prints the enrolled RustDesk ID at the end

## Included files
- `Install-ByteBak-RustDesk.ps1`
- `Run-ByteBak-RustDesk-Setup.cmd`
- `Verify-ByteBak-RustDesk.ps1`
- `MANUAL-INSTALL-FALLBACK.md`

## Easiest use in the field
1. Copy this folder onto the target PC.
2. Right-click `Run-ByteBak-RustDesk-Setup.cmd` and run it.
3. Accept UAC/admin elevation.
4. Enter the permanent RustDesk password for that PC when prompted.
5. Wait for the success screen and note the RustDesk ID.
6. If you want a quick post-install check, run `Verify-ByteBak-RustDesk.ps1`.

## One-line use with a known password
You can also run the CMD launcher with the password as the first argument:

> If the password contains awkward CMD characters like `&`, `|`, `^`, `<`, or `>`, use the normal prompted launcher or the PowerShell example instead.

```cmd
Run-ByteBak-RustDesk-Setup.cmd MyChosenPassword123!
```

Or run the PowerShell directly:

```powershell
powershell.exe -ExecutionPolicy Bypass -File .\Install-ByteBak-RustDesk.ps1 -SelfElevate -PermanentPassword 'MyChosenPassword123!'
```

## Important notes
- Current server host: `remote.byte-bak.com`
- Current public key: `3MrrIaLhWVgL8vP40V7VyKVgyg5YPwgfRuDxbCXukiM=`
- Current RustDesk config string: `host=remote.byte-bak.com,key=3MrrIaLhWVgL8vP40V7VyKVgyg5YPwgfRuDxbCXukiM=`
- Tested assumptions for this package:
  - RustDesk transport ports `21115/tcp`, `21116/tcp+udp`, and `21117/tcp` are expected to be reachable on `remote.byte-bak.com`
  - the local Byte-Bak server key above is still current
- The deployment summary is written to:
  - `C:\ProgramData\ByteBak\RustDeskDeploy\last-install-summary.txt`
- The run log is written to:
  - `C:\ProgramData\ByteBak\RustDeskDeploy\install.log`

## If you want to change defaults later
Edit these parameters at the top of `Install-ByteBak-RustDesk.ps1`:
- `ServerHost`
- `PublicKey`
- `ConfigString`
- `RustDeskVersion`

## 2026-04-25 fix note
The first field package installed the Windows service but could leave RustDesk in default mode because it only wrote fallback TOML config files. This version now calls RustDesk's supported CLI directly:

```powershell
RustDesk.exe --config "host=remote.byte-bak.com,key=3MrrIaLhWVgL8vP40V7VyKVgyg5YPwgfRuDxbCXukiM="
RustDesk.exe --password <chosen-password>
```

The TOML writes are still kept as a fallback, but the CLI path is now the primary configuration mechanism.
