From 28779cbbaa5fcba61009d416654345d50a96fa91 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Wed, 16 Jan 2019 22:53:19 -0500 Subject: Plumb InstallerPlatform through MSBuild task. --- src/WixToolset.BuildTasks/DoIt.cs | 1 + .../WixToolsetTest.BuildTasks/MsbuildFixture.cs | 28 ++++++++++++++++++++++ 2 files changed, 29 insertions(+) (limited to 'src') diff --git a/src/WixToolset.BuildTasks/DoIt.cs b/src/WixToolset.BuildTasks/DoIt.cs index ac0f895c..7089ff12 100644 --- a/src/WixToolset.BuildTasks/DoIt.cs +++ b/src/WixToolset.BuildTasks/DoIt.cs @@ -159,6 +159,7 @@ namespace WixToolset.BuildTasks commandLineBuilder.AppendTextUnquoted("build"); + commandLineBuilder.AppendSwitchIfNotNull("-platform ", this.InstallerPlatform); commandLineBuilder.AppendSwitchIfNotNull("-out ", this.OutputFile); commandLineBuilder.AppendSwitchIfNotNull("-outputType ", this.OutputType); commandLineBuilder.AppendIfTrue("-nologo", this.NoLogo); diff --git a/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs b/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs index 3b96f0ba..74978322 100644 --- a/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs +++ b/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs @@ -39,6 +39,9 @@ namespace WixToolsetTest.BuildTasks }); 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.Equal(4, warnings.Count()); @@ -55,6 +58,31 @@ namespace WixToolsetTest.BuildTasks } } + [Fact] + public void CanBuild64BitMsiPackage() + { + var projectPath = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage\MsiPackage.wixproj"); + + using (var fs = new DisposableFileSystem()) + { + var baseFolder = fs.GetFolder(); + var binFolder = Path.Combine(baseFolder, @"bin\"); + var intermediateFolder = Path.Combine(baseFolder, @"obj\"); + + var result = this.MsbuildRunner.Execute(projectPath, new[] + { + $"-p:WixTargetsPath={WixTargetsPath}", + $"-p:IntermediateOutputPath={intermediateFolder}", + $"-p:OutputPath={binFolder}", + $"-p:InstallerPlatform=x64", + }); + result.AssertSuccess(); + + var platformSwitches = result.Output.Where(line => line.TrimStart().StartsWith("wix.exe build -platform x64")); + Assert.Single(platformSwitches); + } + } + [Fact(Skip = "Currently fails")] public void CanBuildSimpleMsiPackageWithIceSuppressions() { -- cgit v1.2.3-55-g6feb