aboutsummaryrefslogtreecommitdiff
path: root/src/internal/targets/CheckLicenseAcceptance.targets
blob: 4ab1701625f32bb6e512823673950400ffbb4e45 (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
<?xml version="1.0" encoding="utf-8"?>
<!-- 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. -->

<Project>

  <Target
    Name="CheckWix8LicenseAcceptance"
    BeforeTargets="CoreCompile">

    <ItemGroup>
      <_AcceptEula Include="$(AcceptEula)" />
    </ItemGroup>

    <PropertyGroup>
      <_Wix8EulaFile>$(USERPROFILE)\.wix\wix8-osmf-eula.txt</_Wix8EulaFile>
    </PropertyGroup>

    <FindInList List="@(_AcceptEula)" ItemSpecToFind="wix8">
      <Output TaskParameter="ItemFound" ItemName="_Wix8LicenseAccepted" />
    </FindInList>

    <Error
      Text="You must accept the Open Source Maintenance Fee (OSMF) EULA to use WiX Toolset v8. For instructions, see https://wixtoolset.org/osmf/"
      Code="WIX7015"
      File="$(MSBuildProjectFile)"
      HelpLink="https://wixtoolset.org/osmf"
      Condition=" '@(_Wix8LicenseAccepted)' == '' and !Exists('$(_Wix8EulaFile)')" />
  </Target>

</Project>