diff options
Diffstat (limited to 'src/internal')
| -rw-r--r-- | src/internal/WixInternal.BaseBuildTasks.Sources/WixCommandLineBuilder.cs | 20 | ||||
| -rw-r--r-- | src/internal/targets/CheckLicenseAcceptance.targets | 30 |
2 files changed, 50 insertions, 0 deletions
diff --git a/src/internal/WixInternal.BaseBuildTasks.Sources/WixCommandLineBuilder.cs b/src/internal/WixInternal.BaseBuildTasks.Sources/WixCommandLineBuilder.cs index d950bca9..61d7095d 100644 --- a/src/internal/WixInternal.BaseBuildTasks.Sources/WixCommandLineBuilder.cs +++ b/src/internal/WixInternal.BaseBuildTasks.Sources/WixCommandLineBuilder.cs | |||
| @@ -76,6 +76,26 @@ namespace WixToolset.BaseBuildTasks | |||
| 76 | } | 76 | } |
| 77 | 77 | ||
| 78 | /// <summary> | 78 | /// <summary> |
| 79 | /// Append a switch to the command-line for each value in a split text. | ||
| 80 | /// </summary> | ||
| 81 | /// <param name="switchName">Switch to append.</param> | ||
| 82 | /// <param name="values">Text to split and append.</param> | ||
| 83 | /// <param name="split">Character to use to split the string</param> | ||
| 84 | public void AppendTextAsArray(string switchName, string values, char splitter = ';') | ||
| 85 | { | ||
| 86 | if (!String.IsNullOrEmpty(values)) | ||
| 87 | { | ||
| 88 | foreach (string value in values.Split([ splitter ], StringSplitOptions.RemoveEmptyEntries)) | ||
| 89 | { | ||
| 90 | if (!String.IsNullOrWhiteSpace(value)) | ||
| 91 | { | ||
| 92 | this.AppendSwitchIfNotNull(switchName, value.Trim()); | ||
| 93 | } | ||
| 94 | } | ||
| 95 | } | ||
| 96 | } | ||
| 97 | |||
| 98 | /// <summary> | ||
| 79 | /// Append arbitrary text to the command-line if specified. | 99 | /// Append arbitrary text to the command-line if specified. |
| 80 | /// </summary> | 100 | /// </summary> |
| 81 | /// <param name="textToAppend">Text to append.</param> | 101 | /// <param name="textToAppend">Text to append.</param> |
diff --git a/src/internal/targets/CheckLicenseAcceptance.targets b/src/internal/targets/CheckLicenseAcceptance.targets new file mode 100644 index 00000000..61155827 --- /dev/null +++ b/src/internal/targets/CheckLicenseAcceptance.targets | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <!-- 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. --> | ||
| 3 | |||
| 4 | <Project> | ||
| 5 | |||
| 6 | <Target | ||
| 7 | Name="CheckWix7LicenseAcceptance" | ||
| 8 | BeforeTargets="CoreCompile"> | ||
| 9 | |||
| 10 | <ItemGroup> | ||
| 11 | <_AcceptEula Include="$(AcceptEula)" /> | ||
| 12 | </ItemGroup> | ||
| 13 | |||
| 14 | <PropertyGroup> | ||
| 15 | <_Wix7EulaFile>$(USERPROFILE)\.wix\wix7-osmf-eula.txt</_Wix7EulaFile> | ||
| 16 | </PropertyGroup> | ||
| 17 | |||
| 18 | <FindInList List="@(_AcceptEula)" ItemSpecToFind="wix7"> | ||
| 19 | <Output TaskParameter="ItemFound" ItemName="_Wix7LicenseAccepted" /> | ||
| 20 | </FindInList> | ||
| 21 | |||
| 22 | <Error | ||
| 23 | Text="You must accept the Open Source Maintenance Fee (OSMF) EULA to use WiX Toolset v7. For instructions, see https://wixtoolset.org/osmf/" | ||
| 24 | Code="WIX7015" | ||
| 25 | File="$(MSBuildProjectFile)" | ||
| 26 | HelpLink="https://wixtoolset.org/osmf" | ||
| 27 | Condition=" '@(_Wix7LicenseAccepted)' == '' and !Exists('$(_Wix7EulaFile)')" /> | ||
| 28 | </Target> | ||
| 29 | |||
| 30 | </Project> | ||
