From 78b4cfa8807c3d049d008423016400ad6776e3f3 Mon Sep 17 00:00:00 2001 From: Martin Galpin Date: Thu, 28 Jul 2016 13:47:19 +0100 Subject: [PATCH] (GH-1131) Fixed WiX candle define values that include spaces. --- src/Cake.Common.Tests/Unit/Tools/WiX/CandleRunnerTests.cs | 4 ++-- src/Cake.Common/Tools/WiX/CandleRunner.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Cake.Common.Tests/Unit/Tools/WiX/CandleRunnerTests.cs b/src/Cake.Common.Tests/Unit/Tools/WiX/CandleRunnerTests.cs index 87abd83f13..e07c3566c6 100644 --- a/src/Cake.Common.Tests/Unit/Tools/WiX/CandleRunnerTests.cs +++ b/src/Cake.Common.Tests/Unit/Tools/WiX/CandleRunnerTests.cs @@ -221,13 +221,13 @@ public void Should_Add_Defines_To_Arguments_If_Provided() // Given var fixture = new CandleFixture(); fixture.Settings.Defines = new Dictionary(); - fixture.Settings.Defines.Add("Foo", "Bar"); + fixture.Settings.Defines.Add("Foo", "Foo Bar"); // When var result = fixture.Run(); // Then - Assert.Equal("-dFoo=Bar \"/Working/Test.wxs\"", result.Args); + Assert.Equal("-dFoo=\"Foo Bar\" \"/Working/Test.wxs\"", result.Args); } [Fact] diff --git a/src/Cake.Common/Tools/WiX/CandleRunner.cs b/src/Cake.Common/Tools/WiX/CandleRunner.cs index 48bfff5665..8c867c853d 100644 --- a/src/Cake.Common/Tools/WiX/CandleRunner.cs +++ b/src/Cake.Common/Tools/WiX/CandleRunner.cs @@ -79,7 +79,7 @@ private ProcessArgumentBuilder GetArguments(IEnumerable sourceFiles, C // Add defines if (settings.Defines != null && settings.Defines.Any()) { - var defines = settings.Defines.Select(define => string.Format(CultureInfo.InvariantCulture, "-d{0}={1}", define.Key, define.Value)); + var defines = settings.Defines.Select(define => string.Format(CultureInfo.InvariantCulture, "-d{0}=\"{1}\"", define.Key, define.Value)); foreach (var define in defines) { builder.Append(define);