Skip to content

Commit

Permalink
Set keypath when parsing naked File child elements
Browse files Browse the repository at this point in the history
  • Loading branch information
barnson committed Mar 10, 2025
1 parent ae4c394 commit 63d1d72
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/wix/WixToolset.Core/Compiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5694,7 +5694,7 @@ private void ParseNakedFileElement(XElement node, ComplexReferenceParentType par
// so and create a file and component symbol with the right data.
id = id ?? this.Core.CreateIdentifier("nkf", directoryId, name, condition, win64.ToString());

var keyPath = this.ParseFileElementOtherAttributes(node, id.Id, directoryId, diskId: CompilerConstants.IntegerNotSet, id, name, shortName, source, out var _, componentGuid: "*", isNakedFile: true, fileSymbol: out var fileSymbol, assemblySymbol: out var assemblySymbol);
this.ParseFileElementOtherAttributes(node, id.Id, directoryId, diskId: CompilerConstants.IntegerNotSet, id, name, shortName, source, out var _, componentGuid: "*", isNakedFile: true, fileSymbol: out var fileSymbol, assemblySymbol: out var assemblySymbol);

this.Core.AddSymbol(fileSymbol);

Expand All @@ -5721,7 +5721,7 @@ private void ParseNakedFileElement(XElement node, ComplexReferenceParentType par
this.Core.AddSymbol(assemblySymbol);
}

this.ParseFileElementChildren(node, fileSymbol, keyPath, win64);
this.ParseFileElementChildren(node, fileSymbol, keyPath: YesNoType.Yes, win64);

// if this is a module, automatically add this component to the references to ensure it gets in the ModuleComponents table
if (this.compilingModule)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,11 @@
<Package Name="MsiPackage" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a">
<MajorUpgrade DowngradeErrorMessage="Downgrade error message." />

<!-- Relies on default INSTALLFOLDER feature. -->
<DirectoryRef Id="INSTALLFOLDER">
<!-- Relies on default-feature feature to include naked files in package. -->
<File Id="test.txt" Source="test.txt" />
<File Id="test2.txt" Source="test.txt" Name="test2.txt" />
</DirectoryRef>
</Package>

<Fragment>
<StandardDirectory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="MsiPackage" />
</StandardDirectory>
</Fragment>
</Wix>
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Package Name="MsiPackage" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a">
<File Directory="INSTALLFOLDER" Subdirectory="X" Source="test.txt" />
<File Directory="INSTALLFOLDER" Subdirectory="X" Source="test.txt">
<Shortcut Advertise="yes" Directory="ProgramMenuFolder" Name="Test" />
</File>
<File Directory="INSTALLFOLDER" Subdirectory="X" Source="test.txt" Name="test2.txt" />
<File Directory="INSTALLFOLDER" Subdirectory="X3" Source="test.txt" Name="test3.txt" />
<File Directory="INSTALLFOLDER" Subdirectory="X4" Source="test.txt" Name="test4.txt" />
Expand Down

0 comments on commit 63d1d72

Please # to comment.