From 94bf0e8c417549bde16c8a3b48a6beb100eb4ff5 Mon Sep 17 00:00:00 2001 From: jwinterm Date: Fri, 7 Aug 2026 12:38:36 -0400 Subject: [PATCH] ci(windows): enable Developer Mode for plugin symlink support flutter build windows materialises plugins under windows/flutter/ephemeral/.plugin_symlinks/ as NTFS symlinks. Flutter gates this on the AppModelUnlock registry key rather than the actual privilege, so the build failed with "Building with plugins requires symlink support". Sets AllowDevelopmentWithoutDevLicense=1 in HKLM (what the Settings toggle does); LocalSystem can write it, so no interactive login. Idempotent. --- .github/workflows/build-windows.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index e1f2030ba..4fcf9255d 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -127,6 +127,32 @@ jobs: echo "RUSTUP_HOME=$RUSTUP_HOME" >> "$GITHUB_ENV" /c/Rust/cargo/bin/rustc --version + # ---- Windows Developer Mode (symlink support) ------------------------ + # `flutter build windows` materialises each plugin under + # windows/flutter/ephemeral/.plugin_symlinks/ as a real NTFS symlink, and + # creating one needs SeCreateSymbolicLinkPrivilege. Flutter doesn't test + # the privilege directly — it reads the AppModelUnlock registry key and + # bails with: + # "Building with plugins requires symlink support. + # Please enable Developer Mode in your system settings." + # Setting the key is exactly what the Settings toggle does; HKLM is + # writable by the LocalSystem service account, so no interactive login + # is involved. Idempotent — a no-op once the value is 1. + - name: Enable Developer Mode (symlink support for plugin builds) + run: | + set -e + powershell -NoProfile -Command ' + $key = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" + if (-not (Test-Path $key)) { New-Item -Path $key -Force | Out-Null } + $cur = (Get-ItemProperty -Path $key -Name AllowDevelopmentWithoutDevLicense -ErrorAction SilentlyContinue).AllowDevelopmentWithoutDevLicense + if ($cur -eq 1) { + Write-Host "Developer Mode already enabled" + } else { + Set-ItemProperty -Path $key -Name AllowDevelopmentWithoutDevLicense -Value 1 -Type DWord + Write-Host "Developer Mode enabled (was: $cur)" + } + ' + # ---- Toolchain sanity ------------------------------------------------ # Our self-hosted runner has Flutter / Rust / VS Build Tools / Inno # Setup pre-installed (see scripts/windows/setup-windows-runner.ps1).