Allow customization of the .wixpdb output folder
Fixes 6857
Rob Mensching committed
Aug 24, 2022 at 14:38 UTC
3ba9b06b2ab5b67e53354134323e6551addb96b8
18 files changed
+303
-37
src/api/wix/WixToolset.Extensibility/Data/TrackedFileType.cs
+14
-2
@@ -25,10 +25,22 @@ namespace WixToolset.Extensibility.Data
25
Intermediate,
26
27
/// <summary>
28
- /// Output created by the build process itself (like a .msi, .cab or .wixpdb).
28
+ /// Output created by the build process itself (like a .cab).
29
/// These files can be recreated in the final output location by building again.
30
/// </summary>
31
- BuiltOutput,
31
+ BuiltContentOutput,
32
+
33
+ /// <summary>
34
+ /// Target output created by the build process itself (like a .msi, .msm, .wixlib, .exe).
35
+ /// These files can be recreated in the final output location by building again.
36
+ /// </summary>
37
+ BuiltTargetOutput,
38
+
39
+ /// <summary>
40
+ /// Output pdb created by the build process itself (like a .wixpdb).
41
+ /// These files can be recreated in the final output location by building again.
42
+ /// </summary>
43
+ BuiltPdbOutput,
44
45
/// <summary>
46
/// Output copied by the build process (like external files in an .msi).
src/ext/Bal/bal.cmd
+1
-1
@@ -18,7 +18,7 @@ msbuild -p:Configuration=%_C%;Platform=x86 test\examples\TestEngine\Example.Test
18
msbuild -p:Configuration=%_C%;Platform=x64 test\examples\TestEngine\Example.TestEngine.vcxproj || exit /b
19
msbuild -p:Configuration=%_C%;Platform=ARM64 test\examples\TestEngine\Example.TestEngine.vcxproj || exit /b
20
21
-msbuild -p:Configuration=%_C% || exit /b
21
+msbuild -p:Configuration=%_C% -bl:%_L%\bal_build.binlog || exit /b
22
23
dotnet test test\WixToolsetTest.Dnc.HostGenerator -c %_C% --nologo --no-build -l "trx;LogFileName=%_L%\TestResults\WixToolsetTest.Dnc.HostGenerator.trx" || exit /b
24
src/wix/WixToolset.BuildTasks/ReadTracking.cs
+26
-4
@@ -29,11 +29,29 @@ namespace WixToolset.BuildTasks
29
public ITaskItem[] All { get; private set; }
30
31
/// <summary>
32
- /// The tracked built outputs.
32
+ /// The union of tracked built outputs.
33
/// </summary>
34
[Output]
35
public ITaskItem[] BuiltOutputs { get; private set; }
36
37
+ /// <summary>
38
+ /// The tracked content built outputs.
39
+ /// </summary>
40
+ [Output]
41
+ public ITaskItem[] BuiltContentOutputs { get; private set; }
42
+
43
+ /// <summary>
44
+ /// The tracked target built outputs.
45
+ /// </summary>
46
+ [Output]
47
+ public ITaskItem[] BuiltTargetOutputs { get; private set; }
48
+
49
+ /// <summary>
50
+ /// The tracked pdb built outputs.
51
+ /// </summary>
52
+ [Output]
53
+ public ITaskItem[] BuiltPdbOutputs { get; private set; }
54
+
55
/// <summary>
56
/// The tracked copied outputs.
57
/// </summary>
@@ -47,7 +65,7 @@ namespace WixToolset.BuildTasks
65
public ITaskItem[] Inputs { get; private set; }
66
67
/// <summary>
50
- /// All tracked outputs.
68
+ /// The union of all tracked outputs.
69
/// </summary>
70
[Output]
71
public ITaskItem[] Outputs { get; private set; }
@@ -81,10 +99,14 @@ namespace WixToolset.BuildTasks
99
}
100
101
this.All = all.ToArray();
84
- this.BuiltOutputs = all.Where(t => FilterByTrackedType(t, "BuiltOutput")).ToArray();
102
+ this.BuiltContentOutputs = all.Where(t => FilterByTrackedType(t, "BuiltContentOutput")).ToArray();
103
+ this.BuiltTargetOutputs = all.Where(t => FilterByTrackedType(t, "BuiltTargetOutput")).ToArray();
104
+ this.BuiltPdbOutputs = all.Where(t => FilterByTrackedType(t, "BuiltPdbOutput")).ToArray();
105
this.CopiedOutputs = all.Where(t => FilterByTrackedType(t, "CopiedOutput")).ToArray();
106
this.Inputs = all.Where(t => FilterByTrackedType(t, "Input")).ToArray();
87
- this.Outputs = all.Where(t => FilterByTrackedType(t, "BuiltOutput") || FilterByTrackedType(t, "CopiedOutput")).ToArray();
107
+
108
+ this.BuiltOutputs = this.BuiltContentOutputs.Concat(this.BuiltTargetOutputs).Concat(this.BuiltPdbOutputs).ToArray();
109
+ this.Outputs = this.BuiltOutputs.Concat(this.CopiedOutputs).ToArray();
110
111
return true;
112
}
src/wix/WixToolset.Core.Burn/Bind/BindBundleCommand.cs
+2
-2
@@ -505,7 +505,7 @@ namespace WixToolset.Core.Burn
505
command.Execute();
506
507
fileTransfers.Add(command.Transfer);
508
- trackedFiles.Add(this.BackendHelper.TrackFile(this.OutputPath, TrackedFileType.BuiltOutput));
508
+ trackedFiles.Add(this.BackendHelper.TrackFile(this.OutputPath, TrackedFileType.BuiltTargetOutput));
509
}
510
511
#if TODO // does this need to come back, or do they only need to be in TrackedFiles?
@@ -577,7 +577,7 @@ namespace WixToolset.Core.Burn
577
}
578
else
579
{
580
- var trackPdb = this.BackendHelper.TrackFile(this.OutputPdbPath, TrackedFileType.BuiltOutput);
580
+ var trackPdb = this.BackendHelper.TrackFile(this.OutputPdbPath, TrackedFileType.BuiltPdbOutput);
581
trackedFiles.Add(trackPdb);
582
583
wixout = WixOutput.Create(trackPdb.Path);
src/wix/WixToolset.Core.Burn/Bundles/CreateNonUXContainers.cs
+1
-1
@@ -108,7 +108,7 @@ namespace WixToolset.Core.Burn.Bundles
108
var transfer = this.BackendHelper.CreateFileTransfer(container.WorkingPath, outputPath, true, container.SourceLineNumbers);
109
fileTransfers.Add(transfer);
110
111
- trackedFiles.Add(this.BackendHelper.TrackFile(outputPath, TrackedFileType.BuiltOutput, container.SourceLineNumbers));
111
+ trackedFiles.Add(this.BackendHelper.TrackFile(outputPath, TrackedFileType.BuiltContentOutput, container.SourceLineNumbers));
112
}
113
else // update the attached container index.
114
{
src/wix/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs
+2
-2
@@ -471,7 +471,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
471
{
472
this.Messaging.Write(VerboseMessages.GeneratingDatabase());
473
474
- var trackMsi = this.WindowsInstallerBackendHelper.TrackFile(this.OutputPath, TrackedFileType.BuiltOutput);
474
+ var trackMsi = this.WindowsInstallerBackendHelper.TrackFile(this.OutputPath, TrackedFileType.BuiltTargetOutput);
475
trackedFiles.Add(trackMsi);
476
477
var command = new GenerateDatabaseCommand(this.Messaging, this.WindowsInstallerBackendHelper, this.FileSystemManager, data, trackMsi.Path, tableDefinitions, this.IntermediateFolder, keepAddedColumns: false, this.SuppressAddingValidationRows, useSubdirectory: false);
@@ -601,7 +601,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
601
}
602
else
603
{
604
- var trackPdb = this.WindowsInstallerBackendHelper.TrackFile(this.OutputPdbPath, TrackedFileType.BuiltOutput);
604
+ var trackPdb = this.WindowsInstallerBackendHelper.TrackFile(this.OutputPdbPath, TrackedFileType.BuiltPdbOutput);
605
trackedFiles.Add(trackPdb);
606
607
wixout = WixOutput.Create(trackPdb.Path);
src/wix/WixToolset.Core.WindowsInstaller/Bind/CreateCabinetsCommand.cs
+2
-2
@@ -206,7 +206,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
206
}
207
else
208
{
209
- var trackDestination = this.BackendHelper.TrackFile(Path.Combine(cabinetDir, mediaSymbol.Cabinet), TrackedFileType.BuiltOutput, mediaSymbol.SourceLineNumbers);
209
+ var trackDestination = this.BackendHelper.TrackFile(Path.Combine(cabinetDir, mediaSymbol.Cabinet), TrackedFileType.BuiltContentOutput, mediaSymbol.SourceLineNumbers);
210
this.trackedFiles.Add(trackDestination);
211
212
var transfer = this.BackendHelper.CreateFileTransfer(resolvedCabinet.Path, trackDestination.Path, resolvedCabinet.BuildOption == CabinetBuildOption.BuildAndMove, mediaSymbol.SourceLineNumbers);
@@ -314,7 +314,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
314
var trackSource = this.BackendHelper.TrackFile(spannedCabinetSourcePath, TrackedFileType.Intermediate, transfer.SourceLineNumbers);
315
this.trackedFiles.Add(trackSource);
316
317
- var trackTarget = this.BackendHelper.TrackFile(spannedCabinetTargetPath, TrackedFileType.BuiltOutput, transfer.SourceLineNumbers);
317
+ var trackTarget = this.BackendHelper.TrackFile(spannedCabinetTargetPath, TrackedFileType.BuiltContentOutput, transfer.SourceLineNumbers);
318
this.trackedFiles.Add(trackTarget);
319
320
var newTransfer = this.BackendHelper.CreateFileTransfer(trackSource.Path, trackTarget.Path, transfer.Move, transfer.SourceLineNumbers);
src/wix/WixToolset.Core.WindowsInstaller/Bind/ProcessUncompressedFilesCommand.cs
+2
-6
@@ -112,12 +112,8 @@ namespace WixToolset.Core.WindowsInstaller.Bind
112
var transfer = this.BackendHelper.CreateFileTransfer(facade.SourcePath, fileLayoutPath, false, facade.SourceLineNumber);
113
fileTransfers.Add(transfer);
114
115
- // Track the location where the cabinet will be placed. If the transfer is
116
- // redundant then then the file should not be cleaned. This is important
117
- // because if the source and destination of the transfer is the same, we
118
- // don't want to clean the file because we'd be deleting the original
119
- // (and that would be bad).
120
- var tracked = this.BackendHelper.TrackFile(transfer.Destination, TrackedFileType.BuiltOutput, facade.SourceLineNumber);
115
+ var tracked = this.BackendHelper.TrackFile(transfer.Destination, TrackedFileType.CopiedOutput, facade.SourceLineNumber);
116
+
117
tracked.Clean = !transfer.Redundant;
118
119
trackedFiles.Add(tracked);
src/wix/WixToolset.Core/ExtensibilityServices/TrackedFile.cs
+1
-1
@@ -12,7 +12,7 @@ namespace WixToolset.Core.ExtensibilityServices
12
this.Path = path;
13
this.Type = type;
14
this.SourceLineNumbers = sourceLineNumbers;
15
- this.Clean = (type == TrackedFileType.Intermediate || type == TrackedFileType.BuiltOutput || type == TrackedFileType.CopiedOutput);
15
+ this.Clean = (type == TrackedFileType.Intermediate || type == TrackedFileType.BuiltContentOutput || type == TrackedFileType.BuiltTargetOutput || type == TrackedFileType.BuiltPdbOutput || type == TrackedFileType.CopiedOutput);
16
}
17
18
public bool Clean { get; set; }
src/wix/WixToolset.Sdk/tools/wix.targets
+22
-10
@@ -71,7 +71,8 @@
71
<!-- Default OutputType to a known WiX Toolset type. -->
72
<OutputType Condition=" '$(OutputType)' == '' ">Package</OutputType>
73
74
- <WixPdbType Condition=" '$(WixPdbType)' == '' ">full</WixPdbType>
74
+ <DebugType Condition=" '$(SuppressPdbOutput)' == 'true' ">none</DebugType>
75
+ <DebugType Condition=" '$(DebugType)' == '' ">full</DebugType>
76
</PropertyGroup>
77
78
<PropertyGroup>
@@ -113,6 +114,13 @@
114
<AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>
115
</PropertyGroup>
116
117
+ <PropertyGroup>
118
+ <!--
119
+ Only Package, Module and Bundle output types create .wixpdbs, so reset the flag indicating symbols will be produced outside of those output types.
120
+ -->
121
+ <_DebugSymbolsProduced Condition=" '$(OutputType)' != 'Package' and '$(OutputType)' != 'Module' and '$(OutputType)' != 'Bundle' ">false</_DebugSymbolsProduced>
122
+ </PropertyGroup>
123
+
124
<PropertyGroup>
125
<!-- Default pdb output path to the intermediate output directory -->
126
<PdbOutputDir Condition=" '$(PdbOutputDir)'=='' ">$(TargetDir)</PdbOutputDir>
@@ -625,7 +633,7 @@
633
OutputFile="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(TargetFileName)"
634
OutputType="$(OutputType)"
635
PdbFile="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(TargetPdbFileName)"
628
- PdbType="$(WixPdbType)"
636
+ PdbType="$(DebugType)"
637
638
AdditionalOptions="$(CompilerAdditionalOptions) $(LinkerAdditionalOptions)"
639
DefineConstants="$(DefineConstants);$(SolutionDefineConstants);$(ProjectDefineConstants);$(ProjectReferenceDefineConstants)"
@@ -887,7 +895,7 @@
895
896
<!-- Include build output pdb(s). Different than predefined itemgroup since AssignTargetPaths target may change -->
897
<ItemGroup>
890
- <DebugSymbolsProjectOutputGroupOutput Include="$(TargetPdbPath)" Condition=" '$(SuppressPdbOutput)' != 'true' "/>
898
+ <DebugSymbolsProjectOutputGroupOutput Include="$(TargetPdbPath)" Condition=" '$(DebugType)' != 'none' "/>
899
</ItemGroup>
900
</Target>
901
@@ -922,13 +930,18 @@
930
<FullIntermediateOutputPath>$([MSBuild]::NormalizeDirectory($(IntermediateOutputPath)))</FullIntermediateOutputPath>
931
</PropertyGroup>
932
925
- <!-- Copy the bound output files. -->
933
+ <!-- Add the target output to the list to be copied. -->
934
+ <ItemGroup>
935
+ <_FullPathToCopy Include="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(TargetFileName)" />
936
+ </ItemGroup>
937
+
938
+ <!-- Add the bound content output files to the list to be copied. -->
939
<ReadTracking File="$(IntermediateOutputPath)$(BindTrackingFilePrefix)%(CultureGroup.Identity)$(BindTrackingFileExtension)">
927
- <Output TaskParameter="Outputs" ItemName="_FullPathToCopy" />
940
+ <Output TaskParameter="BuiltContentOutputs" ItemName="_FullPathToCopy" />
941
+ <Output TaskParameter="CopiedOutputs" ItemName="_FullPathToCopy" />
942
</ReadTracking>
943
944
<ItemGroup>
931
- <_FullPathToCopy Include="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(TargetFileName)" Condition=" '@(_FullPathToCopy)'=='' " />
945
<_RelativePath Include="$([MSBuild]::MakeRelative($(FullIntermediateOutputPath), %(_FullPathToCopy.FullPath)))" />
946
</ItemGroup>
947
@@ -950,10 +963,10 @@
963
964
<Message Importance="High" Text="$(MSBuildProjectName) -> $(TargetPath)" Condition="'$(CopyBuildOutputToOutputDirectory)' == 'true' and '$(SkipCopyBuildProduct)'!='true'" />
965
953
- <!-- Copy the debug information file (.pdb), if any
966
+ <!-- Copy the debug information file (.wixpdb), if any -->
967
<Copy
955
- SourceFiles="@(_DebugSymbolsIntermediatePath)"
956
- DestinationFiles="@(_DebugSymbolsOutputPath)"
968
+ SourceFiles="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(TargetPdbFileName)"
969
+ DestinationFiles="$(TargetPdbDir)%(CultureGroup.OutputFolder)$(TargetPdbFileName)"
970
SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"
971
OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
972
Retries="$(CopyRetryCount)"
@@ -964,7 +977,6 @@
977
<Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
978
979
</Copy>
967
- -->
980
</Target>
981
982
<Import Project="$(WixSigningTargetsPath)" />
src/wix/test/WixToolsetTest.CoreIntegration/BundleFixture.cs
+5
-3
@@ -497,11 +497,13 @@ namespace WixToolsetTest.CoreIntegration
497
Assert.True(File.Exists(exePath));
498
Assert.True(File.Exists(Path.Combine(Path.GetDirectoryName(exePath), "test.txt")));
499
500
- var trackedLines = File.ReadAllLines(trackingFile).Select(s => s.Replace(baseFolder, null, StringComparison.OrdinalIgnoreCase).Replace(folder, null, StringComparison.OrdinalIgnoreCase)).ToArray();
500
+ var trackedLines = File.ReadAllLines(trackingFile).Select(s => s.Replace(baseFolder, null, StringComparison.OrdinalIgnoreCase).Replace(folder, null, StringComparison.OrdinalIgnoreCase))
501
+ .OrderBy(s => s)
502
+ .ToArray();
503
WixAssert.CompareLineByLine(new[]
504
{
503
- "BuiltOutput\tbin\\test.exe",
504
- "BuiltOutput\tbin\\test.wixpdb",
505
+ "BuiltPdbOutput\tbin\\test.wixpdb",
506
+ "BuiltTargetOutput\tbin\\test.exe",
507
"CopiedOutput\tbin\\test.txt",
508
"Input\tSimpleBundle\\data\\fakeba.dll",
509
"Input\tSimpleBundle\\data\\MsiPackage\\test.txt"
src/wix/test/WixToolsetTest.CoreIntegration/SigningFixture.cs
+1
-1
@@ -148,7 +148,7 @@ namespace WixToolsetTest.CoreIntegration
148
result.AssertSuccess();
149
150
result = WixRunner.Execute(new[]
151
-{
151
+ {
152
"burn",
153
"detach",
154
exePath,
src/wix/test/WixToolsetTest.Sdk/MsbuildFixture.cs
+112
-2
@@ -273,7 +273,47 @@ namespace WixToolsetTest.Sdk
273
});
274
}
275
276
- private void AssertWixpdb(BuildSystem buildSystem, string wixpdbType, string[] expectedOutputFiles)
276
+ [Theory]
277
+ [InlineData(BuildSystem.DotNetCoreSdk)]
278
+ [InlineData(BuildSystem.MSBuild)]
279
+ [InlineData(BuildSystem.MSBuild64)]
280
+ public void CanBuildWithWixpdbToDifferentFolder(BuildSystem buildSystem)
281
+ {
282
+ var expectedOutputFiles = new[]
283
+ {
284
+ @"bin\x86\Release\en-US\cab1.cab",
285
+ @"bin\x86\Release\en-US\MsiPackage.msi",
286
+ @"pdb\en-US\MsiPackage.wixpdb",
287
+ };
288
+
289
+ var sourceFolder = TestData.Get(@"TestData", "SimpleMsiPackage", "MsiPackage");
290
+
291
+ using (var fs = new TestDataFolderFileSystem())
292
+ {
293
+ fs.Initialize(sourceFolder);
294
+ var baseFolder = fs.BaseFolder;
295
+ var binFolder = Path.Combine(baseFolder, @"bin\");
296
+ var pdbFolder = Path.Combine(baseFolder, @"pdb\");
297
+ var projectPath = Path.Combine(baseFolder, "MsiPackage.wixproj");
298
+
299
+ var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[]
300
+ {
301
+ MsbuildUtilities.GetQuotedPropertySwitch(buildSystem, "WixMSBuildProps", MsbuildFixture.WixPropsPath),
302
+ $"-p:PdbOutputDir={pdbFolder}",
303
+ "-p:SuppressValidation=true"
304
+ });
305
+ result.AssertSuccess();
306
+
307
+ var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories)
308
+ .Concat(Directory.EnumerateFiles(pdbFolder, @"*.*", SearchOption.AllDirectories))
309
+ .Select(s => s.Substring(baseFolder.Length + 1))
310
+ .OrderBy(s => s)
311
+ .ToArray();
312
+ WixAssert.CompareLineByLine(expectedOutputFiles, paths);
313
+ }
314
+ }
315
+
316
+ private void AssertWixpdb(BuildSystem buildSystem, string debugType, string[] expectedOutputFiles)
317
{
318
var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage");
319
@@ -287,7 +327,7 @@ namespace WixToolsetTest.Sdk
327
var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[]
328
{
329
MsbuildUtilities.GetQuotedPropertySwitch(buildSystem, "WixMSBuildProps", MsbuildFixture.WixPropsPath),
290
- wixpdbType == null ? String.Empty : $"-p:WixPdbType={wixpdbType}",
330
+ debugType == null ? String.Empty : $"-p:DebugType={debugType}",
331
"-p:SuppressValidation=true"
332
});
333
result.AssertSuccess();
@@ -424,6 +464,76 @@ namespace WixToolsetTest.Sdk
464
}
465
}
466
467
+ [Theory]
468
+ [InlineData(BuildSystem.DotNetCoreSdk, null)]
469
+ [InlineData(BuildSystem.DotNetCoreSdk, true)]
470
+ [InlineData(BuildSystem.MSBuild, null)]
471
+ [InlineData(BuildSystem.MSBuild, true)]
472
+ [InlineData(BuildSystem.MSBuild64, null)]
473
+ [InlineData(BuildSystem.MSBuild64, true)]
474
+ public void CanBuildSimpleWixlib(BuildSystem buildSystem, bool? outOfProc)
475
+ {
476
+ var sourceFolder = TestData.Get(@"TestData", "Wixlib", "SimpleWixlib");
477
+
478
+ using (var fs = new TestDataFolderFileSystem())
479
+ {
480
+ fs.Initialize(sourceFolder);
481
+ var baseFolder = fs.BaseFolder;
482
+ var binFolder = Path.Combine(baseFolder, @"bin\");
483
+ var projectPath = Path.Combine(baseFolder, "SimpleWixlib.wixproj");
484
+
485
+ var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[]
486
+ {
487
+ MsbuildUtilities.GetQuotedPropertySwitch(buildSystem, "WixMSBuildProps", MsbuildFixture.WixPropsPath),
488
+ }, outOfProc: outOfProc);
489
+ result.AssertSuccess();
490
+
491
+ var wixBuildCommands = MsbuildUtilities.GetToolCommandLines(result, "wix", "build", buildSystem, outOfProc);
492
+ Assert.Single(wixBuildCommands);
493
+
494
+ var path = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories)
495
+ .Select(s => s.Substring(baseFolder.Length + 1))
496
+ .Single();
497
+ WixAssert.StringEqual(@"bin\x86\Release\SimpleWixlib.wixlib", path);
498
+ }
499
+ }
500
+
501
+ [Theory]
502
+ [InlineData(BuildSystem.DotNetCoreSdk, null)]
503
+ [InlineData(BuildSystem.DotNetCoreSdk, true)]
504
+ [InlineData(BuildSystem.MSBuild, null)]
505
+ [InlineData(BuildSystem.MSBuild, true)]
506
+ [InlineData(BuildSystem.MSBuild64, null)]
507
+ [InlineData(BuildSystem.MSBuild64, true)]
508
+ public void CanBuildPackageIncludingSimpleWixlib(BuildSystem buildSystem, bool? outOfProc)
509
+ {
510
+ var sourceFolder = TestData.Get(@"TestData", "Wixlib");
511
+
512
+ using (var fs = new TestDataFolderFileSystem())
513
+ {
514
+ fs.Initialize(sourceFolder);
515
+ var baseFolder = fs.BaseFolder;
516
+ var binFolder = Path.Combine(baseFolder, "PackageIncludesWixlib", @"bin\");
517
+ var projectPath = Path.Combine(baseFolder, "PackageIncludesWixlib", "PackageIncludesWixlib.wixproj");
518
+
519
+ var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[]
520
+ {
521
+ MsbuildUtilities.GetQuotedPropertySwitch(buildSystem, "WixMSBuildProps", MsbuildFixture.WixPropsPath),
522
+ }, outOfProc: outOfProc);
523
+ result.AssertSuccess();
524
+
525
+ var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories)
526
+ .Select(s => s.Substring(baseFolder.Length + 1))
527
+ .ToArray();
528
+ WixAssert.CompareLineByLine(new[]
529
+ {
530
+ @"PackageIncludesWixlib\bin\x86\Release\cab1.cab",
531
+ @"PackageIncludesWixlib\bin\x86\Release\PackageIncludesWixlib.msi",
532
+ @"PackageIncludesWixlib\bin\x86\Release\PackageIncludesWixlib.wixpdb",
533
+ }, paths);
534
+ }
535
+ }
536
+
537
[Theory]
538
[InlineData(BuildSystem.DotNetCoreSdk)]
539
[InlineData(BuildSystem.MSBuild)]
src/wix/test/WixToolsetTest.Sdk/TestData/Wixlib/PackageIncludesWixlib/Package.wxs
new
+9
@@ -0,0 +1,9 @@
1
+<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
2
+ <Package Name="MsiPackage" Language="1033" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a" Compressed="yes" InstallerVersion="200">
3
+ <MediaTemplate />
4
+
5
+ <Feature Id="ProductFeature" Title="ATitle">
6
+ <ComponentGroupRef Id="ProductComponents" />
7
+ </Feature>
8
+ </Package>
9
+</Wix>
src/wix/test/WixToolsetTest.Sdk/TestData/Wixlib/PackageIncludesWixlib/PackageIncludesWixlib.wixproj
new
+44
@@ -0,0 +1,44 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+ <Import Project="$(WixMSBuildProps)" />
4
+ <PropertyGroup>
5
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6
+ <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
7
+ </PropertyGroup>
8
+
9
+ <PropertyGroup>
10
+ <ProjectGuid>{B00939D5-7952-4ADF-BEB1-507D227B2FE2}</ProjectGuid>
11
+ </PropertyGroup>
12
+
13
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
14
+ <PlatformName>$(Platform)</PlatformName>
15
+ <OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
16
+ <DefineConstants>Debug</DefineConstants>
17
+ </PropertyGroup>
18
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
19
+ <PlatformName>$(Platform)</PlatformName>
20
+ <OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
21
+ </PropertyGroup>
22
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
23
+ <PlatformName>$(Platform)</PlatformName>
24
+ <OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
25
+ <DefineConstants>Debug</DefineConstants>
26
+ </PropertyGroup>
27
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
28
+ <PlatformName>$(Platform)</PlatformName>
29
+ <OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
30
+ </PropertyGroup>
31
+
32
+ <ItemGroup>
33
+ <Compile Include="Package.wxs" />
34
+ </ItemGroup>
35
+
36
+ <ItemGroup>
37
+ <ProjectReference Include="..\SimpleWixlib\SimpleWixlib.wixproj">
38
+ <Name>SimpleWixlib</Name>
39
+ <Project>{9F84998B-7F45-4CB3-8795-915801DBBB74}</Project>
40
+ </ProjectReference>
41
+ </ItemGroup>
42
+
43
+ <Import Project="$(WixTargetsPath)" />
44
+</Project>
src/wix/test/WixToolsetTest.Sdk/TestData/Wixlib/SimpleWixlib/Library.wxs
new
+15
@@ -0,0 +1,15 @@
1
+<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
2
+ <Fragment>
3
+ <StandardDirectory Id="ProgramFilesFolder">
4
+ <Directory Id="WixLibFolder" />
5
+ </StandardDirectory>
6
+ </Fragment>
7
+
8
+ <Fragment>
9
+ <ComponentGroup Id="ProductComponents" Directory="WixLibFolder">
10
+ <Component Id="TextFile" Guid="2D93B748-4926-4185-BC84-9F1D6883AF20">
11
+ <File Source="Library.txt" />
12
+ </Component>
13
+ </ComponentGroup>
14
+ </Fragment>
15
+</Wix>
src/wix/test/WixToolsetTest.Sdk/TestData/Wixlib/SimpleWixlib/SimpleWixlib.wixproj
new
+43
@@ -0,0 +1,43 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+ <Import Project="$(WixMSBuildProps)" />
4
+ <PropertyGroup>
5
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6
+ <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
7
+ <OutputType>Library</OutputType>
8
+ <BindFiles>true</BindFiles>
9
+ </PropertyGroup>
10
+
11
+ <PropertyGroup>
12
+ <ProjectGuid>{9F84998B-7F45-4CB3-8795-915801DBBB74}</ProjectGuid>
13
+ </PropertyGroup>
14
+
15
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
16
+ <PlatformName>$(Platform)</PlatformName>
17
+ <OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
18
+ <DefineConstants>Debug</DefineConstants>
19
+ </PropertyGroup>
20
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
21
+ <PlatformName>$(Platform)</PlatformName>
22
+ <OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
23
+ </PropertyGroup>
24
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
25
+ <PlatformName>$(Platform)</PlatformName>
26
+ <OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
27
+ <DefineConstants>Debug</DefineConstants>
28
+ </PropertyGroup>
29
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
30
+ <PlatformName>$(Platform)</PlatformName>
31
+ <OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
32
+ </PropertyGroup>
33
+
34
+ <ItemGroup>
35
+ <Compile Include="Library.wxs" />
36
+ </ItemGroup>
37
+
38
+ <ItemGroup>
39
+ <BindInputPaths Include="data" />
40
+ </ItemGroup>
41
+
42
+ <Import Project="$(WixTargetsPath)" />
43
+</Project>
src/wix/test/WixToolsetTest.Sdk/TestData/Wixlib/SimpleWixlib/data/Library.txt
new
+1
@@ -0,0 +1 @@
1
+This is Library.txt.