Skip to content

Your Android phone and your Windows PC, working as one. Local-first, end-to-end encrypted, no account.

feat(windows): add native Windows 11 ARM64 packaging and release support

Hosseinc7e238cb749c
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index c4948ef..7774526 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -113,11 +113,21 @@ jobs:
arch: win64_msvc2022_arm64_cross_compiled
cache: true
aqtsource: git+https://github.com/miurahr/aqtinstall.git
- - name: Build
+ - name: Install NSIS
shell: pwsh
run: |
- $env:QMAKE = ./scripts/qmake-arm64.ps1 -QtRoot (Split-Path -Parent $env:QT_ROOT_DIR)
- cargo build --locked --release --target aarch64-pc-windows-msvc -p nectarlink-desktop -p nectarlink-vcam
+ if (-not (Get-Command makensis -ErrorAction SilentlyContinue) -and
+ -not (Test-Path "${env:ProgramFiles(x86)}\NSIS\makensis.exe")) {
+ choco install nsis --yes --no-progress
+ }
+ - name: Build and Package
+ shell: pwsh
+ run: ./scripts/package.ps1 -Arch arm64
+ - uses: actions/upload-artifact@v7
+ with:
+ name: nectarlink-windows-arm64
+ path: target/package/*-setup.exe
+ retention-days: 14
android:
name: Android app
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 5248984..9473a8f 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -63,6 +63,40 @@ jobs:
name: windows
path: target/package/*-setup.exe
+ windows-arm64:
+ name: Windows installer (ARM64)
+ needs: version
+ runs-on: windows-latest
+ steps:
+ - uses: actions/checkout@v7
+ - name: Install the pinned Rust toolchain and the ARM64 target
+ run: |
+ rustup show active-toolchain || rustup toolchain install
+ rustup target add aarch64-pc-windows-msvc
+ - name: Install Qt (ARM64, with the x64 host tools)
+ uses: jurplel/install-qt-action@v4
+ with:
+ version: ${{ env.QT_VERSION }}
+ host: windows
+ target: desktop
+ arch: win64_msvc2022_arm64_cross_compiled
+ cache: true
+ aqtsource: git+https://github.com/miurahr/aqtinstall.git
+ - name: Install NSIS
+ shell: pwsh
+ run: |
+ if (-not (Get-Command makensis -ErrorAction SilentlyContinue) -and
+ -not (Test-Path "${env:ProgramFiles(x86)}\NSIS\makensis.exe")) {
+ choco install nsis --yes --no-progress
+ }
+ - name: Build the installer
+ shell: pwsh
+ run: ./scripts/package.ps1 -Arch arm64
+ - uses: actions/upload-artifact@v7
+ with:
+ name: windows-arm64
+ path: target/package/*-setup.exe
+
android:
name: Android app (signed)
needs: version
@@ -113,7 +147,7 @@ jobs:
publish:
name: Draft the release
- needs: [windows, android]
+ needs: [windows, windows-arm64, android]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v8
diff --git a/README.md b/README.md
index 380d49e..625b3c9 100644
--- a/README.md
+++ b/README.md
@@ -38,7 +38,8 @@ of new features I wanted that I think you'll enjoy having too.
| | Download | Needs |
|---|---|---|
-| **Windows** | [Installer (.exe)](https://github.com/thtbee/nectarlink/releases/download/v0.1.4/Nectarlink-0.1.4-x64-setup.exe) | Windows 11, 64-bit |
+| **Windows (x64)** | [Installer (.exe)](https://github.com/thtbee/nectarlink/releases/download/v0.1.4/Nectarlink-0.1.4-x64-setup.exe) | Windows 11, 64-bit Intel or AMD |
+| **Windows (ARM64)** | From the next release | Windows 11 on ARM (Snapdragon) |
| **Android** | [App (.apk)](https://github.com/thtbee/nectarlink/releases/download/v0.1.4/Nectarlink-0.1.4-android.apk) | Android 8.0 or newer |
Both apps update themselves from GitHub Releases and check every download
diff --git a/docs/guide/getting-started.md b/docs/guide/getting-started.md
index 363acb7..32b33c8 100644
--- a/docs/guide/getting-started.md
+++ b/docs/guide/getting-started.md
@@ -14,7 +14,7 @@ This guide walks you through installing NectarLink on Windows 11 and Android, co
### On Windows 11
-1. Download the latest Windows installer (`Nectarlink-<version>-x64-setup.exe`) from the project's GitHub Releases page.
+1. Download the latest Windows installer (`Nectarlink-<version>-x64-setup.exe` for Intel/AMD PCs or `Nectarlink-<version>-arm64-setup.exe` for Snapdragon/ARM64 PCs) from the project's GitHub Releases page.
2. Run the installer. The installer isn't code-signed yet, so Windows SmartScreen may show **Windows protected your PC**: choose **More info**, then **Run anyway**.
3. Click **Install** and allow the administrator prompt. Setup installs NectarLink, registers the required Windows Firewall rule for local QUIC discovery and connections, adds Start Menu and desktop shortcuts, and sets NectarLink to start in the system tray when you sign in (turn this off with **Start with Windows** in **Settings › General**). **What this installs** on the first screen lists everything it adds.
4. The last screen shows a QR code for the Android app's download page. Scan it with your phone's camera, then click **Open NectarLink**.
diff --git a/docs/technical/building-and-testing.md b/docs/technical/building-and-testing.md
index dbc9aae..fe440c8 100644
--- a/docs/technical/building-and-testing.md
+++ b/docs/technical/building-and-testing.md
@@ -110,16 +110,19 @@ Pop-Location
To stage the release desktop binary, `nectarlink_vcam.dll`, `windeployqt` Qt runtime DLLs and QML modules, `THIRD-PARTY-NOTICES.txt`, and Sparse Package manifest (`AppxManifest.xml`), and build the NSIS setup installer (`desktop/installer/nectarlink.nsi`):
```powershell
-# Full release build + staging + NSIS installer
+# Full release build + staging + NSIS installer (default x64):
powershell -ExecutionPolicy Bypass -File scripts\package.ps1
-# Stage files into target\package\Nectarlink\ without running makensis
+# Full release build + staging + NSIS installer for Windows 11 ARM64:
+powershell -ExecutionPolicy Bypass -File scripts\package.ps1 -Arch arm64
+
+# Stage files into target\package\Nectarlink\ without running makensis:
powershell -ExecutionPolicy Bypass -File scripts\package.ps1 -StageOnly
```
Artifacts are written to `target/package/`:
- `target/package/Nectarlink/` (staged portable directory)
-- `target/package/Nectarlink-<version>-x64-setup.exe` (NSIS installer when `makensis.exe` is installed)
+- `target/package/Nectarlink-<version>-x64-setup.exe` or `Nectarlink-<version>-arm64-setup.exe` (NSIS installer when `makensis.exe` is installed)
## Running the Test Suites
diff --git a/docs/technical/releasing.md b/docs/technical/releasing.md
index 8ff65ef..173952b 100644
--- a/docs/technical/releasing.md
+++ b/docs/technical/releasing.md
@@ -10,10 +10,11 @@ A GitHub release with three files:
| File | Built by |
|---|---|
| `Nectarlink-<version>-x64-setup.exe` | The `windows` job: `scripts/package.ps1`, then `scripts/smoke-installer.ps1` installs and uninstalls it |
+| `Nectarlink-<version>-arm64-setup.exe` | The `windows-arm64` job: cross-compiled and packaged via `scripts/package.ps1 -Arch arm64` |
| `Nectarlink-<version>-android.apk` | The `android` job: a release build for 64-bit and 32-bit ARM, signed with the release key and checked with `apksigner verify` |
-| `SHA256SUMS.txt` | The `publish` job, over both |
+| `SHA256SUMS.txt` | The `publish` job, over all installers and APKs |
-Both apps' updaters need all three: they only accept an installer that
+Both apps' updaters need all four: they only accept an installer that
`SHA256SUMS.txt` lists with a matching hash.
## Steps
diff --git a/scripts/package.ps1 b/scripts/package.ps1
index 0183dc3..3b4f5e3 100644
--- a/scripts/package.ps1
+++ b/scripts/package.ps1
@@ -19,6 +19,8 @@
#>
param(
[string]$QtRoot,
+ [ValidateSet('x64', 'arm64')]
+ [string]$Arch = 'x64',
[switch]$SkipBuild,
[switch]$StageOnly
)
@@ -45,25 +47,56 @@ if (-not $version) { throw "can't read the version from Cargo.toml" }
# Windows file versions are numbers only: 0.0.1-beta.2 -> 0.0.1.
$numeric = ($version -split '[-+]')[0]
+# ---- Target Architecture & Build Paths ----
+$isArm64 = $Arch -eq 'arm64'
+$targetDir = if ($isArm64) {
+ Join-Path $root 'target\aarch64-pc-windows-msvc\release'
+} else {
+ Join-Path $root 'target\release'
+}
+
# ---- Qt ----
if (-not $QtRoot) { $QtRoot = $env:QT_ROOT_DIR }
if (-not $QtRoot) {
$qmake = Get-Command qmake6, qmake -ErrorAction SilentlyContinue | Select-Object -First 1
if ($qmake) { $QtRoot = Split-Path -Parent (Split-Path -Parent $qmake.Source) }
}
-if (-not $QtRoot) { $QtRoot = 'C:\Qt\6.12.0\msvc2022_64' }
-$windeployqt = Join-Path $QtRoot 'bin\windeployqt.exe'
-if (-not (Test-Path $windeployqt)) { throw "windeployqt not found under $QtRoot; pass -QtRoot" }
+if (-not $QtRoot) {
+ $QtRoot = if ($isArm64) { 'C:\Qt\6.12.0\msvc2022_arm64' } else { 'C:\Qt\6.12.0\msvc2022_64' }
+}
+
+# Normalize Qt base folder and kits
+$qtBase = if ($QtRoot -match 'msvc2022_(64|arm64)') { Split-Path -Parent $QtRoot } else { $QtRoot }
+$hostKit = Join-Path $qtBase 'msvc2022_64'
+$targetKit = if ($isArm64) { Join-Path $qtBase 'msvc2022_arm64' } else { $hostKit }
+
+# windeployqt always runs as host (x64)
+$windeployqt = Join-Path $hostKit 'bin\windeployqt.exe'
+if (-not (Test-Path $windeployqt)) {
+ # Fallback to QtRoot bin
+ $windeployqt = Join-Path $QtRoot 'bin\windeployqt.exe'
+}
+if (-not (Test-Path $windeployqt)) { throw "windeployqt not found under $hostKit or $QtRoot; pass -QtRoot" }
+
+$qtpaths = Join-Path $targetKit 'bin\qtpaths.bat'
+if (-not (Test-Path $qtpaths)) {
+ $qtpaths = Join-Path $targetKit 'bin\qtpaths.exe'
+}
# ---- Build ----
if (-not $SkipBuild) {
- Step "Build"
- $env:PATH = "$(Join-Path $QtRoot 'bin');$env:PATH"
- Invoke-Native "the build" { cargo build --locked --release -p nectarlink-desktop -p nectarlink-vcam }
+ Step "Build ($Arch)"
+ if ($isArm64) {
+ $env:QMAKE = & (Join-Path $PSScriptRoot "qmake-arm64.ps1") -QtRoot $qtBase
+ Invoke-Native "the build" { cargo build --locked --release --target aarch64-pc-windows-msvc -p nectarlink-desktop -p nectarlink-vcam }
+ } else {
+ $env:PATH = "$(Join-Path $targetKit 'bin');$env:PATH"
+ Invoke-Native "the build" { cargo build --locked --release -p nectarlink-desktop -p nectarlink-vcam }
+ }
}
-$exe = Join-Path $root 'target\release\nectarlink-desktop.exe'
+$exe = Join-Path $targetDir 'nectarlink-desktop.exe'
if (-not (Test-Path $exe)) { throw "no release build at $exe" }
-$vcamDll = Join-Path $root 'target\release\nectarlink_vcam.dll'
+$vcamDll = Join-Path $targetDir 'nectarlink_vcam.dll'
if (-not (Test-Path $vcamDll)) { throw "no release build at $vcamDll" }
# ---- Stage ----
@@ -91,8 +124,19 @@ Copy-Item $exe $stage
Copy-Item $vcamDll $stage
Invoke-Native "windeployqt" {
- & $windeployqt --verbose 0 --release --qmldir (Join-Path $root 'desktop\app\qml') `
- --no-system-d3d-compiler --no-opengl-sw --no-compiler-runtime --dir $stage (Join-Path $stage 'nectarlink-desktop.exe')
+ $deployArgs = @(
+ '--verbose', '0',
+ '--release',
+ '--qmldir', (Join-Path $root 'desktop\app\qml'),
+ '--no-system-d3d-compiler',
+ '--no-opengl-sw',
+ '--no-compiler-runtime',
+ '--dir', $stage
+ )
+ if ($isArm64 -and (Test-Path $qtpaths)) {
+ $deployArgs = @('--qtpaths', $qtpaths) + $deployArgs
+ }
+ & $windeployqt @deployArgs (Join-Path $stage 'nectarlink-desktop.exe')
}
# Translations. windeployqt stages Qt's own .qm files (in translations/, so its
@@ -125,11 +169,12 @@ foreach ($style in 'Fusion', 'Imagine', 'Material', 'Universal') {
# so it runs on PCs without the Visual C++ Redistributable.
$vswhere = Join-Path ${env:ProgramFiles(x86)} 'Microsoft Visual Studio\Installer\vswhere.exe'
$vs = & $vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
+$crtArch = if ($isArm64) { 'arm64' } else { 'x64' }
$crt = Get-ChildItem (Join-Path $vs 'VC\Redist\MSVC') -Directory |
Where-Object { $_.Name -match '^\d' } | Sort-Object { [version]$_.Name } -Descending |
- ForEach-Object { Get-ChildItem (Join-Path $_.FullName 'x64') -Directory -Filter 'Microsoft.VC*.CRT' -ErrorAction SilentlyContinue } |
+ ForEach-Object { Get-ChildItem (Join-Path $_.FullName $crtArch) -Directory -Filter 'Microsoft.VC*.CRT' -ErrorAction SilentlyContinue } |
Select-Object -First 1
-if (-not $crt) { throw "can't find the Visual C++ runtime to ship" }
+if (-not $crt) { throw "can't find the Visual C++ runtime ($crtArch) to ship" }
Copy-Item (Join-Path $crt.FullName '*.dll') $stage
# Licenses.
@@ -137,7 +182,7 @@ Copy-Item (Join-Path $root 'LICENSE') (Join-Path $stage 'LICENSE.txt')
Invoke-Native "writing the notices" { cargo xtask notices (Join-Path $stage 'THIRD-PARTY-NOTICES.txt') }
# The icon build.rs drew for the .exe, and Sparse Package assets for Windows Share sheet.
-$icon = Get-ChildItem (Join-Path $root 'target\release\build') -Recurse -Filter 'nectarlink.ico' |
+$icon = Get-ChildItem (Join-Path $targetDir 'build') -Recurse -Filter 'nectarlink.ico' |
Sort-Object LastWriteTime -Descending | Select-Object -First 1
if (-not $icon) { throw "the app icon isn't built" }
$assetsDir = Join-Path $stage 'Assets'
@@ -156,6 +201,7 @@ foreach ($spec in @(@{ Name = 'Square44x44Logo.png'; Size = 44 }, @{ Name = 'Squ
}
$manifest = Get-Content (Join-Path $root 'desktop\installer\AppxManifest.xml') -Raw
$manifest = $manifest -replace 'Version="\d+\.\d+\.\d+\.\d+"', "Version=`"$numeric.0`""
+$manifest = $manifest -replace 'ProcessorArchitecture="x64"', "ProcessorArchitecture=`"$Arch`""
Set-Content -Path (Join-Path $stage 'AppxManifest.xml') -Value $manifest -Encoding UTF8 -NoNewline
$size = (Get-ChildItem $stage -Recurse -File | Measure-Object Length -Sum).Sum / 1MB
@@ -163,13 +209,13 @@ Write-Host ("Staged {0:N1} MB in {1}" -f $size, $stage)
if ($StageOnly) { return }
# ---- Installer ----
-Step "Installer"
+Step "Installer ($Arch)"
$makensis = (Get-Command makensis -ErrorAction SilentlyContinue).Source
if (-not $makensis) { $makensis = Join-Path ${env:ProgramFiles(x86)} 'NSIS\makensis.exe' }
if (-not (Test-Path $makensis)) { throw "NSIS (makensis) not found" }
-$out = Join-Path $package "Nectarlink-$version-x64-setup.exe"
+$out = Join-Path $package "Nectarlink-$version-$Arch-setup.exe"
Invoke-Native "makensis" {
- & $makensis /V2 "/DVERSION=$numeric" "/DDISPLAY_VERSION=$version" /DARCH=x64 "/DSTAGE=$stage" `
+ & $makensis /V2 "/DVERSION=$numeric" "/DDISPLAY_VERSION=$version" "/DARCH=$Arch" "/DSTAGE=$stage" `
"/DICON=$($icon.FullName)" "/DOUTFILE=$out" (Join-Path $root 'desktop\installer\nectarlink.nsi')
}
Write-Host ("Installer: {0} ({1:N1} MB)" -f $out, ((Get-Item $out).Length / 1MB))
diff --git a/scripts/smoke-installer.ps1 b/scripts/smoke-installer.ps1
index 6851087..9236750 100644
--- a/scripts/smoke-installer.ps1
+++ b/scripts/smoke-installer.ps1
@@ -4,9 +4,22 @@
Installs, starts, quits and uninstalls the packaged app silently, checking
each step. For CI (needs admin; changes this PC), not for everyday use.
#>
-param([string]$Setup = (Get-ChildItem (Join-Path $PSScriptRoot '..\target\package\*-setup.exe') | Select-Object -First 1).FullName)
+param(
+ [string]$Setup
+)
$ErrorActionPreference = 'Stop'
+
+if (-not $Setup) {
+ $arch = if ([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture -eq [System.Runtime.InteropServices.Architecture]::Arm64) { 'arm64' } else { 'x64' }
+ $pkgDir = Join-Path $PSScriptRoot '..\target\package'
+ $match = Get-ChildItem (Join-Path $pkgDir "*-$arch-setup.exe") -ErrorAction SilentlyContinue | Select-Object -First 1
+ if (-not $match) {
+ $match = Get-ChildItem (Join-Path $pkgDir '*-setup.exe') -ErrorAction SilentlyContinue | Select-Object -First 1
+ }
+ if ($match) { $Setup = $match.FullName }
+}
+if (-not $Setup -or -not (Test-Path $Setup)) { throw "no setup installer found to test under target\package" }
$dir = Join-Path $env:ProgramFiles 'Nectarlink'
$exe = Join-Path $dir 'nectarlink-desktop.exe'
$uninstallKey = 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\Nectarlink'