|
70 | 70 | </HarvestDirectory> |
71 | 71 | </ItemGroup> |
72 | 72 |
|
| 73 | + <PropertyGroup> |
| 74 | + <PreferredToolArchitecture>x64</PreferredToolArchitecture> |
| 75 | + </PropertyGroup> |
| 76 | + <Import Project="$(VCTargetsPath)Microsoft.Cpp.MSVC.Toolset.Common.props" /> |
| 77 | + |
73 | 78 | <Import Project="$(WixTargetsPath)" Condition=" '$(WixTargetsPath)' != '' " /> |
74 | 79 | <Import Project="$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets" Condition=" '$(WixTargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets') " /> |
| 80 | + <Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.targets', '$(MSBuildThisFileDirectory)'))" /> |
75 | 81 | <Target Name="EnsureWixToolsetInstalled" Condition=" '$(WixTargetsImported)' != 'true' "> |
76 | 82 | <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/" /> |
77 | 83 | </Target> |
78 | 84 |
|
79 | | - <Target Name="UsesFrameworkSdk"> |
80 | | - <GetFrameworkSdkPath> |
81 | | - <Output TaskParameter="Path" PropertyName="FrameworkSdkPath" /> |
82 | | - </GetFrameworkSdkPath> |
83 | | - <PropertyGroup> |
84 | | - <WinSDK>$(registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.0@InstallationFolder)</WinSDK> |
85 | | - <WinSDK Condition="('@(WinSDK)'=='')">$(registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Kits\Installed Roots@KitsRoot10)</WinSDK> |
86 | | - <Win10SDKBinPath>$(registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v10.0@InstallationFolder)bin\</Win10SDKBinPath> |
87 | | - <Win10SDKVersion>$(registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v10.0@ProductVersion).0\</Win10SDKVersion> |
88 | | - <Win10SDKVerBinPath>$(Win10SDKBinPath)$(Win10SDKVersion)</Win10SDKVerBinPath> |
89 | | - </PropertyGroup> |
90 | | - </Target> |
91 | | - <Target Name="UsesSignTool" DependsOnTargets="UsesFrameworkSdk"> |
92 | | - <PropertyGroup> |
93 | | - <SignToolPath Condition="('@(SignToolPath)'=='') and Exists('$(FrameworkSdkPath)bin\signtool.exe')">$(FrameworkSdkPath)bin\signtool.exe</SignToolPath> |
94 | | - <SignToolPath Condition="('@(SignToolPath)'=='') and Exists('$(WinSDK)\bin\x86\signtool.exe')">$(WinSDK)\bin\x86\signtool.exe</SignToolPath> |
95 | | - <SignToolPath Condition="('@(SignToolPath)'=='') and Exists('$(Win10SDKVerBinPath)x86\signtool.exe')">$(Win10SDKVerBinPath)x86\signtool.exe</SignToolPath> |
96 | | - </PropertyGroup> |
97 | | - </Target> |
98 | | - <Target Name="SignMsi" DependsOnTargets="UsesSignTool"> |
99 | | - <Exec |
100 | | - Command=""$(SignToolPath)" sign /d "Cyberduck" /fd sha256 /tr http://timestamp.entrust.net/TSS/RFC3161sha2TS /td sha256 /a /sm /n "iterate GmbH" "%(SignMsi.FullPath)""/> |
| 85 | + <Target Name="SignMsi" DependsOnTargets="SignToolArgs"> |
| 86 | + <Exec Command="$(SignToolArgs) "%(SignMsi.FullPath)"" EnvironmentVariables="@(SignToolEnvironmentVariable)" /> |
101 | 87 | </Target> |
102 | 88 | <!-- |
103 | 89 | To modify your build process, add your task inside one of the targets below and uncomment it. |
104 | 90 | Other similar extension points exist, see Wix.targets. |
105 | 91 | --> |
106 | | - <Target Name="SignDLLs" Condition=" '$(SignOutput)' == 'true' " DependsOnTargets="UsesSignTool" AfterTargets="Compile" BeforeTargets="Link"> |
| 92 | + <Target Name="_CollectPayload" Returns="@(SignPayload)"> |
107 | 93 | <ItemGroup> |
108 | | - <Assemblies Include="$(TargetBuildDir)*.dll" /> |
109 | | - <Assemblies Include="$(TargetBuildDir)*.exe" /> |
110 | | - <Assemblies Remove="$(TargetBuildDir)netstandard.dll" /> |
111 | | - <Assemblies Remove="$(TargetBuildDir)System*.dll" /> |
| 94 | + <SignPayload Include="$(TargetBuildDir)*.dll;$(TargetBuildDir)*.exe" /> |
112 | 95 | </ItemGroup> |
| 96 | + </Target> |
| 97 | + <Target Name="CollectSignPayload" DependsOnTargets="_CollectPayload;SignToolArgs" Outputs="%(SignPayload.Identity)" Returns="@(SignPayload)"> |
| 98 | + <Exec Command="%22$(SignToolExecutable)%22 verify /q /pa %22%(SignPayload.Identity)%22" |
| 99 | + EnvironmentVariables="@(SignToolEnvironmentVariable)" |
| 100 | + IgnoreStandardErrorWarningFormat="true" |
| 101 | + IgnoreExitCode="true"> |
| 102 | + <Output TaskParameter="ExitCode" PropertyName="PayloadSigned" /> |
| 103 | + </Exec> |
113 | 104 |
|
114 | | - <Exec |
115 | | - Command=""$(SignToolPath)" sign /d "Cyberduck" /fd sha256 /tr http://timestamp.entrust.net/TSS/RFC3161sha2TS /td sha256 /a /sm /n "iterate GmbH" "%(Assemblies.Identity)""/> |
| 105 | + <ItemGroup> |
| 106 | + <SignPayload Remove="%(SignPayload.Identity)" Condition="'$(PayloadSigned)'=='0'" /> |
| 107 | + </ItemGroup> |
| 108 | + </Target> |
| 109 | + <Target Name="SignPayload" Condition=" '$(SignOutput)' == 'true' " DependsOnTargets="CollectSignPayload;SignToolArgs" AfterTargets="Compile" BeforeTargets="Link"> |
| 110 | + <Exec Command="$(SignToolArgs) @(SignPayload->'%22%(Identity)%22', ' ')" EnvironmentVariables="@(SignToolEnvironmentVariable)" Condition="'@(SignPayload)'!=''" /> |
116 | 111 | </Target> |
117 | 112 | </Project> |
0 commit comments