Repository navigation
Commit da4f34f
Replace makeappx and signtool with in-process MSIX writing and psign-tool (#60)
## Summary
Follow-up to #59. The WinGet source publishers no longer need the
Windows SDK (`makeappx.exe`, `signtool.exe`) or, in Rust, PowerShell.
- **Packaging:** both publishers write `source2.msix` in-process, in the
exact AppxPackaging (makeappx) ZIP layout:
- stored entries;
- central directory entries with version-made-by 45 and zero external
attributes;
- ZIP64 end records;
- an SHA-256 block map with a hash per 64 KiB block;
- content types.
Windows AppxSip rejects signatures over any other layout with
`TRUST_E_BAD_DIGEST`. The Rust (`msix.rs`) and .NET
(`MsixPackageWriter.cs`) writers are byte-identical for the same
payload, and a .NET test pins hashes produced by the Rust writer.
- **Signing:** done with the cross-platform
[psign-tool](https://github.com/Devolutions/psign)
(`Devolutions.Psign.Tool`, **0.8.2 or later**; 0.8.1's portable MSIX
signatures fail Windows verification, fixed in Devolutions/psign#46).
- All arguments, including the PFX password, go through a private,
short-lived response file, so the password never appears on a command
line. That matters on Linux, where `/proc/*/cmdline` is readable by
other users, and for the `.cmd` launcher `dotnet tool install` creates
on Windows.
- **Verification**, after signing and in `verify --destination`:
- the package digests;
- the signer subject matches `--publisher`, formatted the way Windows
formats certificate subjects;
- the signer has the Code Signing EKU and is currently valid;
- chain trust: the Windows store on Windows (as `signtool verify /pa`
did), or new repeatable `--trusted-ca` anchors.
- **CLI:** `--makeappx`/`--signtool` become `--psign-tool`; `doctor`
JSON reports `psignToolPath`.
- **Portability:** `publish` and `verify` now run off Windows, using the
existing portable MSZIP decoders. `build` still compresses with the
Windows Compression API.
- **CI, scripts and docs:**
- CI installs psign-tool 0.8.2.
- The gate scripts take `-PsignToolPath`.
- The interoperability check no longer needs makeappx.
- Docs are updated.
## Validation (local, Windows 11, SDK 10.0.26100)
- **Rust:** publisher tests pass (19 unit + 26 conformance), as do the
CLI tests; `clippy` and `fmt` are clean.
- **.NET:** the solution builds; 80/80 publisher tests pass.
- **Interop:** `tests/publisher/run-production-conformance.ps1` passes:
Rust and .NET reopen each other's state and verify each other's unsigned
feeds.
- **Signed end to end** with released psign-tool 0.8.2, both CLIs, via
the plain exe and the dotnet-tool `.cmd` launcher, with a password
containing quotes, `@` and `%PATH%`:
- `signtool verify /pa` and `Get-AuthenticodeSignature` report only the
untrusted throwaway root, never a bad digest;
- `--trusted-ca` publish and verify succeed;
- a mismatched `--publisher` is rejected;
- `makeappx unpack` accepts both signed and unsigned output.
- **Not yet run:** the signed stock-WinGet acceptance job, which runs in
CI on this PR. Note that NuGet had not yet listed the 0.8.2 platform
packages (`Devolutions.Psign.Tool.win-x64`, …) shortly after the
release. If they're still missing, the job's install step will fail
until NuGet finishes indexing.
## Notes
- The full Rust and .NET `source2.msix` still differ, because their
manifest text and generated logos differ (unchanged from before). Only
the container layout is identical.
- `tests/publisher/build_v2_fixture.ps1` still uses makeappx on purpose.
It's a manual, independent reference-fixture builder, and nothing calls
it.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>1 parent 0757005 commit da4f34f
23 files changed
Lines changed: 2317 additions & 678 deletions
File tree
- .github/workflows
- docs
- dotnet/src
- Devolutions.Pinget.Cli
- Devolutions.Pinget.Publisher.Tests
- Devolutions.Pinget.Publisher
- rust/crates
- pinget-cli/src
- pinget-core/src
- pinget-publisher
- src
- tests
- tests/publisher
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | 124 | | |
132 | 125 | | |
133 | | - | |
134 | | - | |
| 126 | + | |
135 | 127 | | |
136 | 128 | | |
137 | 129 | | |
| |||
193 | 185 | | |
194 | 186 | | |
195 | 187 | | |
196 | | - | |
| 188 | + | |
197 | 189 | | |
198 | 190 | | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
214 | 196 | | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
215 | 200 | | |
216 | 201 | | |
217 | 202 | | |
218 | | - | |
219 | | - | |
| 203 | + | |
220 | 204 | | |
221 | 205 | | |
222 | 206 | | |
| |||
225 | 209 | | |
226 | 210 | | |
227 | 211 | | |
| 212 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | | - | |
24 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
25 | 29 | | |
26 | | - | |
| 30 | + | |
27 | 31 | | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
33 | 38 | | |
34 | 39 | | |
35 | 40 | | |
| |||
92 | 97 | | |
93 | 98 | | |
94 | 99 | | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
101 | 113 | | |
102 | 114 | | |
103 | 115 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
| 71 | + | |
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
75 | | - | |
| 76 | + | |
| 77 | + | |
76 | 78 | | |
77 | 79 | | |
78 | 80 | | |
| |||
81 | 83 | | |
82 | 84 | | |
83 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
84 | 90 | | |
85 | | - | |
| 91 | + | |
86 | 92 | | |
87 | 93 | | |
88 | 94 | | |
| |||
92 | 98 | | |
93 | 99 | | |
94 | 100 | | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
100 | 104 | | |
101 | 105 | | |
102 | | - | |
103 | | - | |
104 | | - | |
| 106 | + | |
105 | 107 | | |
106 | 108 | | |
107 | | - | |
108 | | - | |
| 109 | + | |
109 | 110 | | |
110 | | - | |
| 111 | + | |
111 | 112 | | |
112 | 113 | | |
113 | 114 | | |
| |||
118 | 119 | | |
119 | 120 | | |
120 | 121 | | |
121 | | - | |
122 | | - | |
123 | | - | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
124 | 125 | | |
125 | 126 | | |
126 | 127 | | |
127 | 128 | | |
128 | 129 | | |
129 | | - | |
| 130 | + | |
130 | 131 | | |
131 | 132 | | |
132 | 133 | | |
| |||
140 | 141 | | |
141 | 142 | | |
142 | 143 | | |
143 | | - | |
144 | | - | |
| 144 | + | |
145 | 145 | | |
146 | | - | |
| 146 | + | |
| 147 | + | |
147 | 148 | | |
148 | 149 | | |
149 | 150 | | |
| |||
161 | 162 | | |
162 | 163 | | |
163 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
164 | 175 | | |
165 | 176 | | |
166 | 177 | | |
| |||
0 commit comments