Skip to content
/ wix Public
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -120,5 +120,18 @@ public void AppendTextIfNotWhitespace(string textToAppend)
this.AppendTextUnquoted(textToAppend);
}
}

/// <summary>
/// Append arbitrary text to the command-line if specified quoted if needed.
/// </summary>
/// <param name="textToAppend">Text to append.</param>
public void AppendTextQuotedIfNotWhitespace(string textToAppend)
{
if (!String.IsNullOrWhiteSpace(textToAppend))
{
this.AppendSpaceIfNotEmpty();
this.AppendTextWithQuoting(textToAppend);
}
}
}
}
8 changes: 4 additions & 4 deletions src/wix/WixToolset.BuildTasks/WixAcceptEula.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ namespace WixToolset.BuildTasks
public sealed class WixAcceptEula : WixExeBaseTask
{
[Required]
public string EulaVersion { get; set; }
public string EulaId { get; set; }

protected override void BuildCommandLine(WixCommandLineBuilder commandLineBuilder)
{
commandLineBuilder.AppendTextUnquoted("eula");
commandLineBuilder.AppendTextUnquoted("accept");
commandLineBuilder.AppendTextUnquoted(" accept");

foreach (var version in SplitEulaVersions(this.EulaVersion))
foreach (var eulaId in SplitEulaVersions(this.EulaId))
{
commandLineBuilder.AppendTextUnquoted(version);
commandLineBuilder.AppendTextQuotedIfNotWhitespace(eulaId);
}

base.BuildCommandLine(commandLineBuilder);
Expand Down
12 changes: 6 additions & 6 deletions src/wix/WixToolset.Sdk/tools/wix.targets
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,14 @@
<Target
Name="AcceptEula">

<PropertyGroup>
<_AcceptEulaVersion Condition="'$(AcceptEulaVersion)' != ''">$(AcceptEulaVersion)</_AcceptEulaVersion>
<_AcceptEulaVersion Condition="'$(_AcceptEulaVersion)' == '' and '$(AcceptEula)' != ''">$(AcceptEula)</_AcceptEulaVersion>
<_AcceptEulaVersion Condition="'$(_AcceptEulaVersion)' == ''">$(WixEulaVersion)</_AcceptEulaVersion>
</PropertyGroup>
<Error
Text="The 'EulaId' property is required. Add '-p:EulaId={eulaId}' to your command-line. For instructions, see https://wixtoolset.org/osmf/"
File="$(MSBuildProjectFile)"
HelpLink="https://wixtoolset.org/osmf"
Condition=" '$(EulaId)' == '' " />

<WixAcceptEula
EulaVersion="$(_AcceptEulaVersion)"
EulaId="$(EulaId)"
NoLogo="true"
ToolExe="$(WixToolExe)"
ToolPath="$(WixToolDir)" />
Expand Down