Windows installer: cross-build on Linux and publish to a downloads folder

scripts/windows-publish.sh builds the NSIS setup.exe for
x86_64-pc-windows-msvc through cargo-xwin, versioned like the RPM and
APK, and copies it into a folder to serve: the newest three installers,
a stable mtgc-latest-x64-setup.exe, and SHA256SUMS.
This commit is contained in:
2026-10-16 20:11:02 -05:00
parent 067e85dc69
commit 5d8549af2e
3 changed files with 190 additions and 1 deletions

View File

@@ -138,6 +138,45 @@ From then on, `sudo dnf upgrade` picks up new releases.
- The RPM is built against this machine's libraries, so it installs on this
Fedora release and newer.
### Distributing to Windows
The Windows installer is cross-built here on Linux and published to a plain
downloads folder you host. `scripts/windows-publish.sh` builds it through
[cargo-xwin](https://github.com/rust-cross/cargo-xwin) and needs, once:
```bash
sudo dnf install mingw-nsis-base llvm lld clang
```
```bash
cargo install --locked cargo-xwin
```
```bash
rustup target add x86_64-pc-windows-msvc
```
Then, for each release:
```bash
./scripts/windows-publish.sh ~/win-mtgc # or: npm run windows:publish -- ~/win-mtgc
```
On Windows, download and run the setup.exe. A newer one upgrades the
installed app in place.
- **Serve the whole directory.** It holds the versioned installers
(`mtgc_0.1.<n>_x64-setup.exe`, the newest three), `mtgc-latest-x64-setup.exe`
as a stable link to the newest, and `SHA256SUMS`.
- Only the NSIS `setup.exe` can be built off Windows; an MSI needs WiX, which
runs only on Windows. The first build downloads the MSVC CRT and Windows SDK
into `~/.cache/cargo-xwin`.
- The installer isn't code-signed, so SmartScreen warns about an unknown
publisher the first time: **More info → Run anyway**. It fetches WebView2 if
the machine lacks it (Windows 10 and 11 normally ship it).
- Versions work as on Android: `0.1.<commits on HEAD>`, see
[Distributing to phones](#distributing-to-phones-f-droid).
## Using it
- **Add Cards** — type a name (typos OK); ↑/↓ then Enter adds a copy.