From ba0069bf9572d26a9deac77bac3613bc2f96e01a Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Sat, 30 May 2020 23:01:11 +1000 Subject: Provide x86 and x64 versions of net461 build tasks. --- .../WixToolset.BuildTasks.csproj | 1 + src/WixToolset.MSBuild/tools/wix.targets | 40 ++++++++++--- src/heat/heat.csproj | 1 - src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs | 68 ++++++++++++++++++++++ .../MergeMsiPackage/MergeMsiPackage.wixproj | 44 ++++++++++++++ .../MergeModule/MergeMsiPackage/Package.wxs | 22 +++++++ .../MergeModule/SimpleMergeModule/MergeModule.wxs | 22 +++++++ .../SimpleMergeModule/SimpleMergeModule.wixproj | 42 +++++++++++++ .../SimpleMergeModule/data/MergeModule.txt | 1 + .../WixToolsetTest.MSBuild.csproj | 5 ++ src/wix/wix.csproj | 1 - src/wixcop/WixCop.csproj | 1 - 12 files changed, 237 insertions(+), 11 deletions(-) create mode 100644 src/test/WixToolsetTest.MSBuild/TestData/MergeModule/MergeMsiPackage/MergeMsiPackage.wixproj create mode 100644 src/test/WixToolsetTest.MSBuild/TestData/MergeModule/MergeMsiPackage/Package.wxs create mode 100644 src/test/WixToolsetTest.MSBuild/TestData/MergeModule/SimpleMergeModule/MergeModule.wxs create mode 100644 src/test/WixToolsetTest.MSBuild/TestData/MergeModule/SimpleMergeModule/SimpleMergeModule.wixproj create mode 100644 src/test/WixToolsetTest.MSBuild/TestData/MergeModule/SimpleMergeModule/data/MergeModule.txt (limited to 'src') diff --git a/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj b/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj index a8363e7b..221478ed 100644 --- a/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj +++ b/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj @@ -9,6 +9,7 @@ embedded true win-x86 + AnyCPU diff --git a/src/WixToolset.MSBuild/tools/wix.targets b/src/WixToolset.MSBuild/tools/wix.targets index b35d18c7..62414017 100644 --- a/src/WixToolset.MSBuild/tools/wix.targets +++ b/src/WixToolset.MSBuild/tools/wix.targets @@ -20,8 +20,13 @@ $(MSBuildThisFileDirectory)netcoreapp2.1\ - $(MSBuildThisFileDirectory)net461\ + $(MSBuildThisFileDirectory)net461\x86\ + $(MSBuildThisFileDirectory)net461\x64\ $(WixBinDir)WixToolset.BuildTasks.dll + $(WixBinDir64)WixToolset.BuildTasks.dll + + + $(MSBuildThisFileDirectory)wix.harvest.targets $(MSBuildThisFileDirectory)wix.signing.targets @@ -99,15 +104,34 @@ --> - + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + $(MSBuildProjectFile).BindContentsFileList.txt diff --git a/src/heat/heat.csproj b/src/heat/heat.csproj index f6548e65..c2dc5116 100644 --- a/src/heat/heat.csproj +++ b/src/heat/heat.csproj @@ -11,7 +11,6 @@ true win-x86 - AnyCPU app.config heat.exe.manifest diff --git a/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs b/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs index 3515b314..cd9ef9fc 100644 --- a/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs +++ b/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs @@ -46,6 +46,41 @@ namespace WixToolsetTest.MSBuild } } + [Theory] + [InlineData(BuildSystem.MSBuild)] + [InlineData(BuildSystem.MSBuild64)] + public void CanBuildSimpleMergeModule(BuildSystem buildSystem) + { + var sourceFolder = TestData.Get(@"TestData\MergeModule\SimpleMergeModule"); + + using (var fs = new TestDataFolderFileSystem()) + { + fs.Initialize(sourceFolder); + var baseFolder = fs.BaseFolder; + var binFolder = Path.Combine(baseFolder, @"bin\"); + var projectPath = Path.Combine(baseFolder, "SimpleMergeModule.wixproj"); + + var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); + result.AssertSuccess(); + + var platformSwitches = result.Output.Where(line => line.TrimStart().StartsWith("wix.exe build -platform x86")); + Assert.Single(platformSwitches); + + var warnings = result.Output.Where(line => line.Contains(": warning")); + Assert.Empty(warnings); + + var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) + .Select(s => s.Substring(baseFolder.Length + 1)) + .OrderBy(s => s) + .ToArray(); + Assert.Equal(new[] + { + @"bin\x86\Debug\SimpleMergeModule.msm", + @"bin\x86\Debug\SimpleMergeModule.wixpdb", + }, paths); + } + } + [Theory] [InlineData(BuildSystem.MSBuild)] [InlineData(BuildSystem.MSBuild64)] @@ -82,6 +117,39 @@ namespace WixToolsetTest.MSBuild } } + [Theory] + [InlineData(BuildSystem.MSBuild)] + [InlineData(BuildSystem.MSBuild64)] + public void CanBuildSimpleMsiPackageWithMergeModule(BuildSystem buildSystem) + { + var sourceFolder = TestData.Get(@"TestData\MergeModule"); + + using (var fs = new TestDataFolderFileSystem()) + { + fs.Initialize(sourceFolder); + var baseFolder = Path.Combine(fs.BaseFolder, "MergeMsiPackage"); + var binFolder = Path.Combine(baseFolder, @"bin\"); + var projectPath = Path.Combine(baseFolder, "MergeMsiPackage.wixproj"); + + var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); + result.AssertSuccess(); + + var warnings = result.Output.Where(line => line.Contains(": warning")); + Assert.Empty(warnings); + + var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) + .Select(s => s.Substring(baseFolder.Length + 1)) + .OrderBy(s => s) + .ToArray(); + Assert.Equal(new[] + { + @"bin\x86\Debug\cab1.cab", + @"bin\x86\Debug\MergeMsiPackage.msi", + @"bin\x86\Debug\MergeMsiPackage.wixpdb", + }, paths); + } + } + [Theory] [InlineData(BuildSystem.MSBuild)] [InlineData(BuildSystem.MSBuild64)] diff --git a/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/MergeMsiPackage/MergeMsiPackage.wixproj b/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/MergeMsiPackage/MergeMsiPackage.wixproj new file mode 100644 index 00000000..77ee4420 --- /dev/null +++ b/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/MergeMsiPackage/MergeMsiPackage.wixproj @@ -0,0 +1,44 @@ + + + + + Debug + x86 + + + + {B00939D5-7952-4ADF-BEB1-507D227B2FE2} + + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + + + + + + + SimpleMergeModule + {9F84998B-7F45-4CB3-8795-915801DBBB74} + + + + + \ No newline at end of file diff --git a/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/MergeMsiPackage/Package.wxs b/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/MergeMsiPackage/Package.wxs new file mode 100644 index 00000000..1c25e684 --- /dev/null +++ b/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/MergeMsiPackage/Package.wxs @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/SimpleMergeModule/MergeModule.wxs b/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/SimpleMergeModule/MergeModule.wxs new file mode 100644 index 00000000..b9ab953a --- /dev/null +++ b/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/SimpleMergeModule/MergeModule.wxs @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/SimpleMergeModule/SimpleMergeModule.wixproj b/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/SimpleMergeModule/SimpleMergeModule.wixproj new file mode 100644 index 00000000..91579790 --- /dev/null +++ b/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/SimpleMergeModule/SimpleMergeModule.wixproj @@ -0,0 +1,42 @@ + + + + + Debug + x86 + Module + + + + {9F84998B-7F45-4CB3-8795-915801DBBB74} + + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/SimpleMergeModule/data/MergeModule.txt b/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/SimpleMergeModule/data/MergeModule.txt new file mode 100644 index 00000000..cd0db0e1 --- /dev/null +++ b/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/SimpleMergeModule/data/MergeModule.txt @@ -0,0 +1 @@ +This is test.txt. \ No newline at end of file diff --git a/src/test/WixToolsetTest.MSBuild/WixToolsetTest.MSBuild.csproj b/src/test/WixToolsetTest.MSBuild/WixToolsetTest.MSBuild.csproj index bb109557..916300af 100644 --- a/src/test/WixToolsetTest.MSBuild/WixToolsetTest.MSBuild.csproj +++ b/src/test/WixToolsetTest.MSBuild/WixToolsetTest.MSBuild.csproj @@ -15,6 +15,11 @@ + + + + + diff --git a/src/wix/wix.csproj b/src/wix/wix.csproj index 8fd45631..f1b85752 100644 --- a/src/wix/wix.csproj +++ b/src/wix/wix.csproj @@ -11,7 +11,6 @@ true win-x86 - AnyCPU app.config wix.exe.manifest diff --git a/src/wixcop/WixCop.csproj b/src/wixcop/WixCop.csproj index 63e1aa06..ac5af52e 100644 --- a/src/wixcop/WixCop.csproj +++ b/src/wixcop/WixCop.csproj @@ -11,7 +11,6 @@ true win-x86 - AnyCPU app.config wixcop.exe.manifest -- cgit v1.2.3-55-g6feb