Skip to content
/ wix Public

Commit 14c738d

Browse files
committed
Use EulaId with -t:AcceptEula to match documentation
Resolves 9196
1 parent 5886bd8 commit 14c738d

File tree

3 files changed

+23
-10
lines changed

3 files changed

+23
-10
lines changed

src/internal/WixInternal.BaseBuildTasks.Sources/WixCommandLineBuilder.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,5 +120,18 @@ public void AppendTextIfNotWhitespace(string textToAppend)
120120
this.AppendTextUnquoted(textToAppend);
121121
}
122122
}
123+
124+
/// <summary>
125+
/// Append arbitrary text to the command-line if specified quoted if needed.
126+
/// </summary>
127+
/// <param name="textToAppend">Text to append.</param>
128+
public void AppendTextQuotedIfNotWhitespace(string textToAppend)
129+
{
130+
if (!String.IsNullOrWhiteSpace(textToAppend))
131+
{
132+
this.AppendSpaceIfNotEmpty();
133+
this.AppendTextWithQuoting(textToAppend);
134+
}
135+
}
123136
}
124137
}

src/wix/WixToolset.BuildTasks/WixAcceptEula.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@ namespace WixToolset.BuildTasks
1414
public sealed class WixAcceptEula : WixExeBaseTask
1515
{
1616
[Required]
17-
public string EulaVersion { get; set; }
17+
public string EulaId { get; set; }
1818

1919
protected override void BuildCommandLine(WixCommandLineBuilder commandLineBuilder)
2020
{
2121
commandLineBuilder.AppendTextUnquoted("eula");
22-
commandLineBuilder.AppendTextUnquoted("accept");
22+
commandLineBuilder.AppendTextUnquoted(" accept");
2323

24-
foreach (var version in SplitEulaVersions(this.EulaVersion))
24+
foreach (var eulaId in SplitEulaVersions(this.EulaId))
2525
{
26-
commandLineBuilder.AppendTextUnquoted(version);
26+
commandLineBuilder.AppendTextQuotedIfNotWhitespace(eulaId);
2727
}
2828

2929
base.BuildCommandLine(commandLineBuilder);

src/wix/WixToolset.Sdk/tools/wix.targets

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -192,14 +192,14 @@
192192
<Target
193193
Name="AcceptEula">
194194

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

201201
<WixAcceptEula
202-
EulaVersion="$(_AcceptEulaVersion)"
202+
EulaId="$(EulaId)"
203203
NoLogo="true"
204204
ToolExe="$(WixToolExe)"
205205
ToolPath="$(WixToolDir)" />

0 commit comments

Comments
 (0)