# SirayaPrinter.Sync (.NET 8)

Windows OTA updater CLI. Ships as `Sync.exe` in the release zip.

## Build on Windows (or any machine with .NET 8 SDK)

```bash
cd thermal-printer-service
bash scripts/build-sync-exe.sh
# or:
dotnet publish updater/SirayaPrinter.Sync/SirayaPrinter.Sync.csproj \
  -c Release -r win-x64 --self-contained true \
  -p:PublishSingleFile=true -o dist/sync-publish
cp dist/sync-publish/Sync.exe dist/release/Sync.exe
```

## Build via Docker (Linux)

```bash
docker run --rm -v "$PWD:/src" -w /src/updater/SirayaPrinter.Sync \
  mcr.microsoft.com/dotnet/sdk:8.0 \
  dotnet publish -c Release -r win-x64 --self-contained true \
  -p:PublishSingleFile=true -o /src/dist/sync-publish
```

## Fallback

If `Sync.exe` is missing, `Update.cmd` runs `sync-apply.js` with the installed Node runtime.

## Usage

```
Sync.exe check  [--channel dev|stable]
Sync.exe apply  [--channel dev|stable]
```
