From 7967f0f1cbe55fe76e2ded1aa5fbd51a9b38d2c4 Mon Sep 17 00:00:00 2001 From: Solid One Date: Thu, 12 Nov 2026 06:06:12 -0600 Subject: [PATCH 1/7] fix: restore Electron binary with MSBuild Unzip instead of PowerShell RestoreElectronBinary shelled out to Windows PowerShell 5.1, which fails when the build inherits a PowerShell 7 PSModulePath (Expand-Archive MethodCountCouldNotFindBest). The old target deleted dist first, leaving it empty and the Electron window never opening. Locate the cached zip with an item glob and extract it with the built-in Unzip task instead. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- 4-Nine/Nine.csproj | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/4-Nine/Nine.csproj b/4-Nine/Nine.csproj index 462930f..5fe0a42 100644 --- a/4-Nine/Nine.csproj +++ b/4-Nine/Nine.csproj @@ -101,9 +101,12 @@ Electron binary. This target auto-restores the binary from the npm cache after every build. Linux/macOS: npm's allow-scripts policy and extract-zip failures prevent automatic download, - so the cache (~/.cache/electron) is used directly via unzip. + so the cache (~/.cache/electron) is used directly. - Windows: PowerShell Expand-Archive extracts from %LOCALAPPDATA%\electron\Cache. + Windows: the cache is %LOCALAPPDATA%\electron\Cache. + + The zip is located with an item glob and extracted with MSBuild's Unzip task on every OS, + so the result does not depend on which shell or PowerShell version launched the build. First-time setup (no cache): the build emits a warning with exact steps to seed the cache. --> @@ -128,33 +131,30 @@ <_ElectronZipName>electron-v$(ElectronVersion)-$(_ElectronPlatformArch).zip - - - - - - - - - + + + <_ElectronZipCandidate Include="$(_ElectronCacheDir)/**/$(_ElectronZipName)" /> + + + + + <_ElectronZipPath>@(_ElectronZipCandidate) + <_ElectronZipPath Condition="$(_ElectronZipPath.Contains(';'))">$(_ElectronZipPath.Substring(0, $(_ElectronZipPath.IndexOf(';')))) + - - + + - - + + @@ -131,13 +130,21 @@ <_ElectronZipName>electron-v$(ElectronVersion)-$(_ElectronPlatformArch).zip - - - <_ElectronZipCandidate Include="$(_ElectronCacheDir)/**/$(_ElectronZipName)" /> + + + + + + + + <_ElectronZipCandidate Include="$(_ElectronCacheDir)\**\$(_ElectronZipName)" /> - + <_ElectronZipPath>@(_ElectronZipCandidate) <_ElectronZipPath Condition="$(_ElectronZipPath.Contains(';'))">$(_ElectronZipPath.Substring(0, $(_ElectronZipPath.IndexOf(';')))) @@ -146,15 +153,15 @@ Importance="high" Condition="!Exists('$(_ElectronBinaryPath)') And '$(_ElectronZipPath)' != ''" /> - + + + + - - - + Condition="!Exists('$(_ElectronBinaryPath)') And '$(_ElectronZipPath)' != '' And $([MSBuild]::IsOSPlatform('Windows'))" />