blob: bd93b7e7d38f8b83790ac3e70152390e98a8a76d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
namespace WixToolset.Mba.Core
{
using System;
using System.Collections.Generic;
/// <summary>
/// Default implementation of <see cref="IMbaCommand"/>.
/// </summary>
internal sealed class MbaCommand : IMbaCommand
{
public Restart Restart { get; internal set; }
public string[] UnknownCommandLineArgs { get; internal set; }
public KeyValuePair<string, string>[] Variables { get; internal set; }
internal MbaCommand() { }
public void SetOverridableVariables(IOverridableVariables overridableVariables, IEngine engine)
{
foreach (var kvp in this.Variables)
{
var key = kvp.Key;
if (!overridableVariables.Variables.TryGetValue(key, out var overridableVariable))
{
engine.Log(LogLevel.Error, String.Format("Ignoring attempt to set non-overridable variable: '{0}'.", key));
}
else
{
engine.SetVariableString(overridableVariable.Name, kvp.Value, false);
}
}
}
}
}
|