|
74 | 74 | <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="10.0.1" /> |
75 | 75 | <PackageReference Include="SQLitePCLRaw.bundle_e_sqlcipher" Version="2.1.11" /> |
76 | 76 | <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="10.0.1" /> |
| 77 | + <PackageReference Include="System.Security.Cryptography.Pkcs" Version="9.0.21" /> |
77 | 78 | <PackageReference Include="QuestPDF" Version="2025.12.1" /> |
78 | 79 | </ItemGroup> |
79 | 80 |
|
|
103 | 104 | Linux/macOS: npm's allow-scripts policy and extract-zip failures prevent automatic download, |
104 | 105 | so the cache (~/.cache/electron) is used directly via unzip. |
105 | 106 |
|
106 | | - Windows: PowerShell Expand-Archive extracts from %LOCALAPPDATA%\electron\Cache. |
| 107 | + Windows: the zip is located with an item glob in %LOCALAPPDATA%\electron\Cache and extracted |
| 108 | + with MSBuild's Unzip task. PowerShell is avoided because a Windows PowerShell 5.1 child |
| 109 | + process can inherit a PowerShell 7 PSModulePath and fail in Expand-Archive. |
107 | 110 |
|
108 | 111 | First-time setup (no cache): the build emits a warning with exact steps to seed the cache. |
109 | 112 | --> |
|
136 | 139 | <Output TaskParameter="ConsoleOutput" PropertyName="_ElectronZipPath" /> |
137 | 140 | </Exec> |
138 | 141 |
|
139 | | - <!-- Locate zip in cache (Windows) --> |
140 | | - <Exec Command="powershell -NoProfile -Command "(Get-ChildItem -Path '$(_ElectronCacheDir)' -Filter '$(_ElectronZipName)' -Recurse -ErrorAction SilentlyContinue | Select-Object -First 1).FullName"" |
141 | | - ConsoleToMSBuild="true" |
142 | | - EchoOff="true" |
143 | | - Condition="!Exists('$(_ElectronBinaryPath)') And $([MSBuild]::IsOSPlatform('Windows'))"> |
144 | | - <Output TaskParameter="ConsoleOutput" PropertyName="_ElectronZipPath" /> |
145 | | - </Exec> |
| 142 | + <!-- Locate zip in cache (Windows) with an item glob; no shell involved --> |
| 143 | + <ItemGroup Condition="!Exists('$(_ElectronBinaryPath)') And $([MSBuild]::IsOSPlatform('Windows'))"> |
| 144 | + <_ElectronZipCandidate Include="$(_ElectronCacheDir)\**\$(_ElectronZipName)" /> |
| 145 | + </ItemGroup> |
| 146 | + |
| 147 | + <!-- Keep only the first match; the cache can hold the same zip in several folders --> |
| 148 | + <PropertyGroup Condition="!Exists('$(_ElectronBinaryPath)') And $([MSBuild]::IsOSPlatform('Windows'))"> |
| 149 | + <_ElectronZipPath>@(_ElectronZipCandidate)</_ElectronZipPath> |
| 150 | + <_ElectronZipPath Condition="$(_ElectronZipPath.Contains(';'))">$(_ElectronZipPath.Substring(0, $(_ElectronZipPath.IndexOf(';'))))</_ElectronZipPath> |
| 151 | + </PropertyGroup> |
146 | 152 |
|
147 | 153 | <Message Text="[ElectronRestore] Binary missing — restoring from cache: $(_ElectronZipPath)" |
148 | 154 | Importance="high" |
|
152 | 158 | <Exec Command="rm -rf "$(_ElectronDistPath)" && unzip -q "$(_ElectronZipPath)" -d "$(_ElectronDistPath)" && chmod -R a+x "$(_ElectronDistPath)"" |
153 | 159 | Condition="!Exists('$(_ElectronBinaryPath)') And '$(_ElectronZipPath)' != '' And $([MSBuild]::IsOSPlatform('Linux'))" /> |
154 | 160 |
|
155 | | - <!-- Extract (Windows) --> |
156 | | - <Exec Command="powershell -NoProfile -Command "if (Test-Path '$(_ElectronDistPath)') { Remove-Item -Path '$(_ElectronDistPath)' -Recurse -Force }; Expand-Archive -Path '$(_ElectronZipPath)' -DestinationPath '$(_ElectronDistPath)' -Force"" |
157 | | - Condition="!Exists('$(_ElectronBinaryPath)') And '$(_ElectronZipPath)' != '' And $([MSBuild]::IsOSPlatform('Windows'))" /> |
| 161 | + <!-- Extract (Windows) — overwrites any partial dist without deleting it first --> |
| 162 | + <Unzip SourceFiles="$(_ElectronZipPath)" |
| 163 | + DestinationFolder="$(_ElectronDistPath)" |
| 164 | + OverwriteReadOnlyFiles="true" |
| 165 | + Condition="!Exists('$(_ElectronBinaryPath)') And '$(_ElectronZipPath)' != '' And $([MSBuild]::IsOSPlatform('Windows'))" /> |
158 | 166 |
|
159 | 167 | <!-- |
160 | 168 | No cache found — first-time setup. Instruct the developer to run npm install once |
|
0 commit comments