2019-07-22 09:36:21 +02:00
<?xml version="1.0" encoding="UTF-8"?>
2019-04-19 15:24:39 +02:00
<!--
SPDX-License-Identifier: GPL-2.0
Copyright (C) 2018-2019 WireGuard LLC. All Rights Reserved.
-->
<Project
xmlns="http://schemas.microsoft.com/developer/msbuild/2003"
ToolsVersion="4.0"
2019-07-22 09:36:21 +02:00
InitialTargets="EnsureWixToolsetInstalled;HashInstallerLibrary"
2019-04-19 15:24:39 +02:00
DefaultTargets="Build">
<PropertyGroup>
<Configuration Condition="'$(Configuration)'==''">Release</Configuration>
<Platform Condition="'$(Platform)'==''">x64</Platform>
<ProjectGuid>{F95A1EBF-1E19-47D4-9D8C-4F0C41B9E3B8}</ProjectGuid>
<ProjectName>wintun</ProjectName>
<OutputType>Module</OutputType>
<DefineSolutionProperties>false</DefineSolutionProperties>
</PropertyGroup>
2019-08-02 13:21:15 +02:00
<Import Project="..\wintun.props" />
2019-04-19 15:24:39 +02:00
<PropertyGroup>
2019-07-22 09:36:21 +02:00
<IntermediateOutputPath>..\$(WintunPlatform)\$(Configuration)\</IntermediateOutputPath>
<OutputPath>..\$(WintunPlatform)\$(Configuration)\</OutputPath>
2019-04-19 15:24:39 +02:00
<OutputName>$(ProjectName)</OutputName>
<DefineConstants>WINTUN_VERSION=$(WintunVersion);$(DefineConstants)</DefineConstants>
2019-04-19 16:19:49 +02:00
<SuppressSpecificWarnings>1006;1086;$(SuppressSpecificWarnings)</SuppressSpecificWarnings>
2019-07-22 09:36:21 +02:00
<LinkerSuppressSpecificWarnings>1079;1103;$(LinkerSuppressSpecificWarnings)</LinkerSuppressSpecificWarnings>
<SuppressIces>ICE30;ICE49;$(SuppressIces)</SuppressIces>
<LinkerAdditionalOptions>-b output_dir="$(IntermediateOutputPath.TrimEnd('\'))" $(LinkerAdditionalOptions)</LinkerAdditionalOptions>
2019-04-19 15:24:39 +02:00
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'">
<SuppressPdbOutput>true</SuppressPdbOutput>
2019-07-22 09:36:21 +02:00
<OutputPath>..\$(DistributionDir)</OutputPath>
2019-04-19 15:24:39 +02:00
<OutputName>$(ProjectName)-$(WintunPlatform)-$(WintunVersionStr)</OutputName>
</PropertyGroup>
<ItemGroup>
2019-08-02 13:21:15 +02:00
<Compile Include="installer.wxs" />
2019-04-19 15:24:39 +02:00
</ItemGroup>
2019-08-02 13:21:15 +02:00
<Import Project="$(MSBuildProjectName).user" Condition="exists('$(MSBuildProjectName).user')" />
<Import Project="$(WixTargetsPath)" Condition="'$(WixTargetsPath)'!=''" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets" Condition="'$(WixTargetsPath)'=='' AND Exists('$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets')" />
2019-04-19 15:24:39 +02:00
<Target Name="EnsureWixToolsetInstalled" Condition="'$(WixTargetsImported)'!='true'">
2019-08-02 13:21:15 +02:00
<Error Text="The WiX Toolset v3.11 (or newer) build tools must be installed to build this project. To download the WiX Toolset, see http://wixtoolset.org/releases/" />
2019-04-19 15:24:39 +02:00
</Target>
2019-07-22 09:36:21 +02:00
<Target Name="HashInstallerLibrary">
<GetFileHash Files="$(IntermediateOutputPath)installer.dll" Algorithm="SHA256" HashEncoding="hex">
2019-08-02 13:21:15 +02:00
<Output TaskParameter="Items" ItemName="InstallerLibraryHash" />
2019-07-22 09:36:21 +02:00
</GetFileHash>
<PropertyGroup>
<DefineConstants>$(DefineConstants);INSTALLER_LIBRARY_HASH=@(InstallerLibraryHash->Metadata('FileHash'));INSTALLER_LIBRARY_TIME=$([System.IO.File]::GetLastWriteTime('$(IntermediateOutputPath)installer.dll').Ticks)</DefineConstants>
</PropertyGroup>
</Target>
2019-08-02 13:21:15 +02:00
<Import Project="..\wintun.vcxproj.user" Condition="exists('..\wintun.vcxproj.user')" />
2019-04-19 15:24:39 +02:00
<PropertyGroup>
<SigningCertificate Condition="$(SignMode)=='TestSign' And '$(TestCertificate)'!=''">$(TestCertificate)</SigningCertificate>
<SigningCertificate Condition="$(SignMode)=='ProductionSign' And '$(ProductionCertificate)'!=''">$(ProductionCertificate)</SigningCertificate>
2019-04-19 20:14:38 +02:00
<BuildDependsOn Condition="'$(SigningCertificate)'!='' And '$(TimeStampServer)'!=''">$(BuildDependsOn);SignTarget</BuildDependsOn>
2019-04-19 15:24:39 +02:00
<CleanDependsOn>CleanSignTarget;$(CleanDependsOn)</CleanDependsOn>
</PropertyGroup>
<Target
Name="SignTarget"
Inputs="$(TargetPath)"
Outputs="$(IntermediateOutputPath)$(TargetName).sign">
2019-04-19 20:14:38 +02:00
<Exec Command="signtool.exe sign /sha1 "$(SigningCertificate)" /fd sha256 /tr "$(TimeStampServer)" /td sha256 "$(TargetPath)"" />
2019-08-02 13:21:15 +02:00
<Touch Files="$(IntermediateOutputPath)$(TargetName).sign" AlwaysCreate="true" />
2019-04-19 15:24:39 +02:00
</Target>
<Target Name="CleanSignTarget">
2019-08-02 13:21:15 +02:00
<Delete Files="$(IntermediateOutputPath)$(TargetName).sign" />
2019-04-19 15:24:39 +02:00
</Target>
</Project>