Skip to content

Commit 19fcfe6

Browse files
Ryanmello07claude
andcommitted
fix(installer): Files Exclude is a child element, not an attribute
WiX 5.0.2 rejected Exclude="..." as an attribute on <Files> with WIX0004 -- confirmed against the pinned compiler binary (5.0.2+aa65968c, pulled from the local NuGet cache), not guessed. The correct form is a child <Exclude Files="..."/> element, one per pattern. Also drop the "**\obj\**" exclusion: WiX 5.0.2's harvester throws (System.ArgumentException: Illegal characters in path, inside HarvestFilesCommand.GetWildcardFiles) on any Exclude Files pattern with two "**" segments -- reproduced locally against the real compiler. A single-"**" trailing form only matches a root-level obj folder and fires a permanent "missing directory" warning since BinDir never has one; the real CI-built payload (304 files, inspected in a prior session) contains zero "obj" path segments at any depth, so this exclusion was a no-op to begin with. Verified end-to-end, not just XML-well-formed: compiled the actual Package.wxs with the actual pinned WiX 5.0.2 binary against this checkout's real app/build/x64/Release output (307 files) using the same Util/Firewall extensions the wixproj references. Exit 0, only the pre-existing WIX1149 warning. The resulting MSI's File table has 303 entries (0 leaked .pdb, 0 leaked obj/) and carries Microsoft.WindowsAppRuntime.dll, Microsoft.ui.xaml.dll, resources.pri, a brand font, and App.xbf -- confirmed both by direct query and by running app/tools/verify-msi-payload.ps1 against it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PT7KcWCPKfFwQUc7SM3oZY
1 parent 53406bc commit 19fcfe6

1 file changed

Lines changed: 37 additions & 4 deletions

File tree

app/installer/Package.wxs

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,11 @@
137137
tools/package-portable.ps1 zips as the portable build, so this
138138
payload and the zip's payload cannot drift apart.
139139
140+
Exclude is a CHILD element here (Exclude Files="..."), not an
141+
attribute on <Files> — WiX 5.0.2 rejects Exclude="..." on Files
142+
itself with WIX0004 (confirmed against the pinned 5.0.2 compiler
143+
binary, not guessed).
144+
140145
The five files above (AppExe/SdkDll/ResourcesPri/ServiceExe/
141146
WintunDll) keep their own hand-authored <Component> because they
142147
need behavior <Files> harvesting cannot express — the advertised
@@ -146,11 +151,39 @@
146151
SplitTunnelDriver is excluded for the same reason: it is
147152
conditioned on INSTALLDRIVER=1 and must not be unconditionally
148153
harvested when -IncludeDriver built the .sys into BinDir. Build
149-
junk (.pdb/.lib/.exp/.ilk, any obj\ tree) is excluded to match
150-
package-portable.ps1's own exclusions exactly. -->
154+
junk (.pdb/.lib/.exp/.ilk) is excluded to match
155+
package-portable.ps1's own exclusions.
156+
157+
package-portable.ps1 also defensively drops any path segment
158+
literally named "obj" at any depth. That pattern is deliberately
159+
NOT reproduced here: WiX 5.0.2's harvester crashes
160+
(System.ArgumentException: Illegal characters in path, inside
161+
HarvestFilesCommand.GetWildcardFiles) on an Exclude Files value
162+
with two "**" segments, such as "...\**\obj\**" — confirmed
163+
against the pinned compiler, not guessed. A single trailing form
164+
("...\obj\**") compiles but only matches an "obj" directory
165+
directly under BinDir, and fires a permanent
166+
"missing directory for harvesting" warning on every build where it
167+
(correctly) does not exist — which is always: the real CI-built
168+
payload (304 files, inspected directly from a prior successful
169+
run) contains zero "obj" path segments at any depth, so this is a
170+
belt-and-suspenders guard in the zip packager with nothing to
171+
guard against here. If BinDir ever legitimately grows an obj\
172+
subtree, add a targeted Exclude for that specific path rather than
173+
reintroducing the double-"**" form. -->
151174
<ComponentGroup Id="RuntimeFiles" Directory="INSTALLFOLDER">
152-
<Files Include="$(var.BinDir)\**"
153-
Exclude="$(var.BinDir)\URnetwork.exe;$(var.BinDir)\URnetworkSdk.dll;$(var.BinDir)\resources.pri;$(var.BinDir)\urnetworkd.exe;$(var.BinDir)\wintun.dll;$(var.BinDir)\SplitTunnel.sys;$(var.BinDir)\**\*.pdb;$(var.BinDir)\**\*.lib;$(var.BinDir)\**\*.exp;$(var.BinDir)\**\*.ilk;$(var.BinDir)\**\obj\**" />
175+
<Files Include="$(var.BinDir)\**">
176+
<Exclude Files="$(var.BinDir)\URnetwork.exe" />
177+
<Exclude Files="$(var.BinDir)\URnetworkSdk.dll" />
178+
<Exclude Files="$(var.BinDir)\resources.pri" />
179+
<Exclude Files="$(var.BinDir)\urnetworkd.exe" />
180+
<Exclude Files="$(var.BinDir)\wintun.dll" />
181+
<Exclude Files="$(var.BinDir)\SplitTunnel.sys" />
182+
<Exclude Files="$(var.BinDir)\**\*.pdb" />
183+
<Exclude Files="$(var.BinDir)\**\*.lib" />
184+
<Exclude Files="$(var.BinDir)\**\*.exp" />
185+
<Exclude Files="$(var.BinDir)\**\*.ilk" />
186+
</Files>
154187
</ComponentGroup>
155188

156189
<!-- urnetwork:// protocol handler (OAuth callbacks + deep links) -->

0 commit comments

Comments
 (0)