Skip to content

Commit ccf2b7b

Browse files
committed
Add Payloads element to harvest bundle payloads.
Implements wixtoolset/issues#9049
1 parent fddc154 commit ccf2b7b

File tree

30 files changed

+342
-198
lines changed

30 files changed

+342
-198
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2+
3+
namespace WixToolset.Data
4+
{
5+
using WixToolset.Data.Symbols;
6+
7+
public static partial class SymbolDefinitions
8+
{
9+
public static readonly IntermediateSymbolDefinition HarvestPayloads = new IntermediateSymbolDefinition(
10+
SymbolDefinitionType.HarvestPayloads,
11+
new[]
12+
{
13+
new IntermediateFieldDefinition(nameof(HarvestFilesSymbolFields.Inclusions), IntermediateFieldType.String),
14+
new IntermediateFieldDefinition(nameof(HarvestFilesSymbolFields.Exclusions), IntermediateFieldType.String),
15+
new IntermediateFieldDefinition(nameof(HarvestFilesSymbolFields.ComplexReferenceParentType), IntermediateFieldType.String),
16+
new IntermediateFieldDefinition(nameof(HarvestFilesSymbolFields.ParentId), IntermediateFieldType.String),
17+
},
18+
typeof(HarvestPayloadsSymbol));
19+
}
20+
}
21+
22+
namespace WixToolset.Data.Symbols
23+
{
24+
public enum HarvestPayloadsSymbolFields
25+
{
26+
Inclusions,
27+
Exclusions,
28+
ComplexReferenceParentType,
29+
ParentId,
30+
}
31+
32+
public class HarvestPayloadsSymbol : IntermediateSymbol
33+
{
34+
public HarvestPayloadsSymbol() : base(SymbolDefinitions.HarvestPayloads, null, null)
35+
{
36+
}
37+
38+
public HarvestPayloadsSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SymbolDefinitions.HarvestPayloads, sourceLineNumber, id)
39+
{
40+
}
41+
42+
public IntermediateField this[HarvestPayloadsSymbolFields index] => this.Fields[(int)index];
43+
44+
public string Inclusions
45+
{
46+
get => (string)this.Fields[(int)HarvestPayloadsSymbolFields.Inclusions];
47+
set => this.Set((int)HarvestPayloadsSymbolFields.Inclusions, value);
48+
}
49+
50+
public string Exclusions
51+
{
52+
get => (string)this.Fields[(int)HarvestPayloadsSymbolFields.Exclusions];
53+
set => this.Set((int)HarvestPayloadsSymbolFields.Exclusions, value);
54+
}
55+
56+
public string ComplexReferenceParentType
57+
{
58+
get => (string)this.Fields[(int)HarvestPayloadsSymbolFields.ComplexReferenceParentType];
59+
set => this.Set((int)HarvestPayloadsSymbolFields.ComplexReferenceParentType, value);
60+
}
61+
62+
public string ParentId
63+
{
64+
get => (string)this.Fields[(int)HarvestPayloadsSymbolFields.ParentId];
65+
set => this.Set((int)HarvestPayloadsSymbolFields.ParentId, value);
66+
}
67+
}
68+
}

src/api/wix/WixToolset.Data/Symbols/SymbolDefinitions.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public enum SymbolDefinitionType
4141
File,
4242
FileSFPCatalog,
4343
HarvestFiles,
44+
HarvestPayloads,
4445
Icon,
4546
ImageFamilies,
4647
IniFile,
Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
22
<Project Sdk="WixToolset.Sdk">
33
<ItemGroup>
4-
<BindPath Include="$(OutputPath)publish\Example.EarliestCoreMBA\scd" />
5-
<HarvestDirectory Include="$(OutputPath)publish\Example.EarliestCoreMBA\scd">
6-
<DirectoryRefId>publish.Example.EarliestCoreMBA.scd</DirectoryRefId>
7-
<Transforms>ba.xslt</Transforms>
8-
</HarvestDirectory>
9-
</ItemGroup>
10-
11-
<ItemGroup>
12-
<PackageReference Include="WixToolset.Heat" />
4+
<BindPath Include="$(OutputPath)publish\Example.EarliestCoreMBA\scd" BindName="ba.payloads" />
135
</ItemGroup>
146
</Project>

src/ext/Bal/test/examples/EarliestCoreBundleSCD/SelfContainedBundle.wxs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal">
22
<Bundle Name="SCDEarliestCoreMBA" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="5CE5B5C7-4B6B-4B95-B297-731F1F956533">
3-
<BootstrapperApplication SourceFile="Example.EarliestCoreMBA.exe">
4-
<!-- <bal:WixDotNetCoreBootstrapperApplicationHost SelfContainedDeployment="yes" /> -->
5-
<PayloadGroupRef Id="publish.Example.EarliestCoreMBA.scd" />
3+
<BootstrapperApplication SourceFile="!(bindpath.ba.payloads)\Example.EarliestCoreMBA.exe">
4+
<Payloads Include="!(bindpath.ba.payloads)\**">
5+
<Exclude Files="!(bindpath.ba.payloads)\Example.EarliestCoreMBA.exe" />
6+
</Payloads>
67
</BootstrapperApplication>
8+
79
<Chain>
810
<ExePackage DetectCondition="none" UninstallArguments="-foo" SourceFile="..\.data\notanexe.exe" PerMachine="yes" />
911
</Chain>

src/ext/Bal/test/examples/EarliestCoreBundleSCD/ba.xslt

Lines changed: 0 additions & 15 deletions
This file was deleted.
Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
22
<Project Sdk="WixToolset.Sdk">
33
<ItemGroup>
4-
<BindInputPaths Include="$(OutputPath)publish\Example.EarliestCoreMBA\trimmedscd" />
5-
<HarvestDirectory Include="$(OutputPath)publish\Example.EarliestCoreMBA\trimmedscd">
6-
<DirectoryRefId>publish.Example.EarliestCoreMBA.trimmedscd</DirectoryRefId>
7-
<Transforms>ba.xslt</Transforms>
8-
</HarvestDirectory>
9-
</ItemGroup>
10-
11-
<ItemGroup>
12-
<PackageReference Include="WixToolset.Heat" />
4+
<BindInputPaths Include="$(OutputPath)publish\Example.EarliestCoreMBA\trimmedscd" BindName="ba.payloads" />
135
</ItemGroup>
146
</Project>

src/ext/Bal/test/examples/EarliestCoreBundleTrimmedSCD/TrimmedSelfContainedBundle.wxs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal">
22
<Bundle Name="TrimmedSCDEarliestCoreMBA" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="5CE5B5C7-4B6B-4B95-B297-731F1F956533">
3-
<BootstrapperApplication SourceFile="SourceDir\Example.EarliestCoreMBA.exe" >
4-
<!-- <bal:WixDotNetCoreBootstrapperApplicationHost SelfContainedDeployment="yes" /> -->
5-
<PayloadGroupRef Id="publish.Example.EarliestCoreMBA.trimmedscd" />
3+
<BootstrapperApplication SourceFile="!(bindpath.ba.payloads)\Example.EarliestCoreMBA.exe" >
4+
<Payloads Include="!(bindpath.ba.payloads)\**">
5+
<Exclude Files="!(bindpath.ba.payloads)\Example.EarliestCoreMBA.exe" />
6+
</Payloads>
67
</BootstrapperApplication>
8+
79
<Chain>
810
<ExePackage DetectCondition="none" UninstallArguments="-foo" SourceFile="..\.data\notanexe.exe" PerMachine="yes" />
911
</Chain>

src/ext/Bal/test/examples/EarliestCoreBundleTrimmedSCD/ba.xslt

Lines changed: 0 additions & 15 deletions
This file was deleted.
Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
22
<Project Sdk="WixToolset.Sdk">
33
<ItemGroup>
4-
<BindInputPaths Include="$(OutputPath)publish\Example.LatestCoreMBA\scd" />
5-
<HarvestDirectory Include="$(OutputPath)publish\Example.LatestCoreMBA\scd">
6-
<DirectoryRefId>publish.Example.LatestCoreMBA.scd</DirectoryRefId>
7-
<Transforms>ba.xslt</Transforms>
8-
</HarvestDirectory>
9-
</ItemGroup>
10-
11-
<ItemGroup>
12-
<PackageReference Include="WixToolset.Heat" />
4+
<BindInputPaths Include="$(OutputPath)publish\Example.LatestCoreMBA\scd" BindName="ba.payloads" />
135
</ItemGroup>
146
</Project>

src/ext/Bal/test/examples/LatestCoreBundleSCD/SelfContainedBundle.wxs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal">
22
<Bundle Name="SCDLatestCoreMBA" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="5CE5B5C7-4B6B-4B95-B297-731F1F956533">
3-
<BootstrapperApplication SourceFile="Example.LatestCoreMBA.exe">
4-
<!-- <bal:WixDotNetCoreBootstrapperApplicationHost SelfContainedDeployment="yes" /> -->
5-
<PayloadGroupRef Id="publish.Example.LatestCoreMBA.scd" />
3+
<BootstrapperApplication SourceFile="!(bindpath.ba.payloads)\Example.LatestCoreMBA.exe">
4+
<Payloads Include="!(bindpath.ba.payloads)\**">
5+
<Exclude Files="!(bindpath.ba.payloads)\Example.LatestCoreMBA.exe" />
6+
</Payloads>
67
</BootstrapperApplication>
8+
79
<Chain>
810
<ExePackage DetectCondition="none" UninstallArguments="-foo" SourceFile="..\.data\notanexe.exe" PerMachine="yes" />
911
</Chain>

0 commit comments

Comments
 (0)