<?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 DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup Label="ProjectConfigurations">
    <ProjectConfiguration Include="Debug|Win32">
      <Configuration>Debug</Configuration>
      <Platform>Win32</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="Release|Win32">
      <Configuration>Release</Configuration>
      <Platform>Win32</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="Debug|ARM">
      <Configuration>Debug</Configuration>
      <Platform>ARM</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="Release|ARM">
      <Configuration>Release</Configuration>
      <Platform>ARM</Platform>
    </ProjectConfiguration>
  </ItemGroup>

  <PropertyGroup Label="Globals">
    <ProjectGuid>{C38373AA-882F-4F55-B03F-2AAB4BFBE3F1}</ProjectGuid>
    <Keyword>Win32Proj</Keyword>
    <ConfigurationType>Application</ConfigurationType>
    <CharacterSet>Unicode</CharacterSet>
    <TargetName>burn</TargetName>
  </PropertyGroup>

  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), wix.proj))\tools\WixBuild.props" />

  <PropertyGroup>
    <ProjectAdditionalIncludeDirectories>$(WixRoot)src\libs\dutil\inc;$(ProjectDir)..\inc;$(ProjectDir)..\engine\inc</ProjectAdditionalIncludeDirectories>
    <ProjectAdditionalLinkLibraries>cabinet.lib;crypt32.lib;msi.lib;rpcrt4.lib;shlwapi.lib;wininet.lib;wintrust.lib;wuguid.lib;dutil.lib;deputil.lib;engine.lib;engine.res</ProjectAdditionalLinkLibraries>
  </PropertyGroup>

  <ItemDefinitionGroup>
    <Link>
      <SwapRunFromCD>true</SwapRunFromCD>
      <SwapRunFromNET>true</SwapRunFromNET>
      <DelayLoadDLLs>cabinet.dll;crypt32.dll;msi.dll;shlwapi.dll;version.dll;wininet.dll;wintrust.dll</DelayLoadDLLs>
    </Link>
  </ItemDefinitionGroup>

  <ItemGroup>
    <ClInclude Include="precomp.h" />
  </ItemGroup>
  <ItemGroup>
    <ClCompile Include="stub.cpp" />
    <ClCompile Include="StubSection.cpp">
      <!-- Workaround for VS2015 behavior change that omits the .wixburn section. -->
      <RemoveUnreferencedCodeData>false</RemoveUnreferencedCodeData>
    </ClCompile>
  </ItemGroup>
  <ItemGroup>
    <Manifest Include="stub.manifest" Condition=" '$(Platform)'!='arm' "/>
    <Manifest Include="stub_arm.manifest" Condition=" '$(Platform)'=='arm' "/>
  </ItemGroup>
  <ItemGroup>
    <ResourceCompile Include="stub.rc" />
  </ItemGroup>

  <ItemGroup>
    <ProjectReference Include="..\engine\engine.vcxproj" />
  </ItemGroup>

  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), wix.proj))\tools\WixBuild.targets" />

  <!---
  CopyBurnExe

    Copies burn.exe where light.exe expects to find it: output\$(Platform)\burn.exe
  -->
  <PropertyGroup>
    <AfterBuildDependsOn>$(AfterBuildDependsOn);CopyBurnExe</AfterBuildDependsOn>
  </PropertyGroup>
  <Target Name="CopyBurnExe"
          Inputs="$(TargetPath)"
          Outputs="$(OutputPath)$(NormalizedPlatform)\$(TargetName).exe">

    <MakeDir Directories="$(OutputPath)$(NormalizedPlatform)" />
    <Copy SourceFiles="$(TargetPath)" DestinationFolder="$(OutputPath)$(NormalizedPlatform)\" 
          UseHardlinksIfPossible="true" />
  </Target>
</Project>
