Skip to content

Commit

Permalink
(GH-1131) Fixed WiX candle define values that include spaces.
Browse files Browse the repository at this point in the history
  • Loading branch information
galpin authored and gep13 committed Jul 29, 2016
1 parent 1883823 commit 78b4cfa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Cake.Common.Tests/Unit/Tools/WiX/CandleRunnerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -221,13 +221,13 @@ public void Should_Add_Defines_To_Arguments_If_Provided()
// Given
var fixture = new CandleFixture();
fixture.Settings.Defines = new Dictionary<string, string>();
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]
Expand Down
2 changes: 1 addition & 1 deletion src/Cake.Common/Tools/WiX/CandleRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ private ProcessArgumentBuilder GetArguments(IEnumerable<FilePath> 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);
Expand Down

0 comments on commit 78b4cfa

Please sign in to comment.