<Project>
  <!-- Implicit SDK props import -->
  <Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />

  <PropertyGroup>
    <TargetFramework>net472</TargetFramework>
    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
    <EnableDefaultItems>false</EnableDefaultItems>
    <PayloadPath>$(PlatformOutPath)Installer.Windows\bin\$(Configuration)\net472\win-x86</PayloadPath>
    <InnoSetupVersion>6.3.1</InnoSetupVersion>
  </PropertyGroup>

  <ItemGroup>
    <ProjectReference Include="../../shared/Git-Credential-Manager/Git-Credential-Manager.csproj" ReferenceOutputAssembly="false" />
  </ItemGroup>

  <ItemGroup>
    <None Include="Setup.iss" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Tools.InnoSetup" Version="$(InnoSetupVersion)" />
  </ItemGroup>

  <!-- Implicit SDK targets import (so we can override the default targets below) -->
  <Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />

  <Target Name="CoreCompile" Condition="'$(OSPlatform)'=='windows'">
    <PropertyGroup>
      <InnoSetupCommandSystem>"$(NuGetPackageRoot)Tools.InnoSetup\$(InnoSetupVersion)\tools\ISCC.exe" /DPayloadDir="$(PayloadPath)" /DInstallTarget=system "$(RepoSrcPath)\windows\Installer.Windows\Setup.iss" /O"$(OutputPath)"</InnoSetupCommandSystem>
      <InnoSetupCommandUser>"$(NuGetPackageRoot)Tools.InnoSetup\$(InnoSetupVersion)\tools\ISCC.exe" /DPayloadDir="$(PayloadPath)" /DInstallTarget=user "$(RepoSrcPath)\windows\Installer.Windows\Setup.iss" /O"$(OutputPath)"</InnoSetupCommandUser>
    </PropertyGroup>

    <Message Text="Lay Out" Importance="High" />
    <Exec Condition="'$(NoLayout)'!='true'" Command="powershell.exe –NonInteractive –ExecutionPolicy Unrestricted -Command &quot;&amp; {&amp;'$(MSBuildProjectDirectory)\layout.ps1' -Configuration '$(Configuration)' -Output '$(PayloadPath)'}&quot;" />
    <Message Text="$(InnoSetupCommandSystem)" Importance="High" />
    <Exec Command="$(InnoSetupCommandSystem)" />
    <Message Text="$(InnoSetupCommandUser)" Importance="High" />
    <Exec Command="$(InnoSetupCommandUser)" />
  </Target>

  <!-- We don't produce or copy any dependent files for this project -->
  <Target Name="CopyFilesToOutputDirectory" />
  <Target Name="CoreClean">
    <RemoveDir Directories="$(ProjectOutPath)" />
  </Target>

</Project>
