From bbced9cc6a7bb8964fce295255d24f3f84fb7114 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Mon, 2 Feb 2026 17:22:35 -0800 Subject: Use `EulaId` with `-t:AcceptEula` to match documentation Resolves 9196 --- .../WixCommandLineBuilder.cs | 13 +++++++++++++ src/wix/WixToolset.BuildTasks/WixAcceptEula.cs | 8 ++++---- src/wix/WixToolset.Sdk/tools/wix.targets | 12 ++++++------ 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/src/internal/WixInternal.BaseBuildTasks.Sources/WixCommandLineBuilder.cs b/src/internal/WixInternal.BaseBuildTasks.Sources/WixCommandLineBuilder.cs index 61d7095d..985ef855 100644 --- a/src/internal/WixInternal.BaseBuildTasks.Sources/WixCommandLineBuilder.cs +++ b/src/internal/WixInternal.BaseBuildTasks.Sources/WixCommandLineBuilder.cs @@ -120,5 +120,18 @@ namespace WixToolset.BaseBuildTasks this.AppendTextUnquoted(textToAppend); } } + + /// + /// Append arbitrary text to the command-line if specified quoted if needed. + /// + /// Text to append. + public void AppendTextQuotedIfNotWhitespace(string textToAppend) + { + if (!String.IsNullOrWhiteSpace(textToAppend)) + { + this.AppendSpaceIfNotEmpty(); + this.AppendTextWithQuoting(textToAppend); + } + } } } diff --git a/src/wix/WixToolset.BuildTasks/WixAcceptEula.cs b/src/wix/WixToolset.BuildTasks/WixAcceptEula.cs index 8e398996..e71e4711 100644 --- a/src/wix/WixToolset.BuildTasks/WixAcceptEula.cs +++ b/src/wix/WixToolset.BuildTasks/WixAcceptEula.cs @@ -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); diff --git a/src/wix/WixToolset.Sdk/tools/wix.targets b/src/wix/WixToolset.Sdk/tools/wix.targets index 2dcfd0e9..88317edc 100644 --- a/src/wix/WixToolset.Sdk/tools/wix.targets +++ b/src/wix/WixToolset.Sdk/tools/wix.targets @@ -192,14 +192,14 @@ - - <_AcceptEulaVersion Condition="'$(AcceptEulaVersion)' != ''">$(AcceptEulaVersion) - <_AcceptEulaVersion Condition="'$(_AcceptEulaVersion)' == '' and '$(AcceptEula)' != ''">$(AcceptEula) - <_AcceptEulaVersion Condition="'$(_AcceptEulaVersion)' == ''">$(WixEulaVersion) - + -- cgit v1.2.3-55-g6feb