1+ <?xml version =" 1.0" encoding =" utf-8" ?>
2+ <Project ToolsVersion =" 14.0" DefaultTargets =" Build" xmlns =" http://schemas.microsoft.com/developer/msbuild/2003" >
3+ <PropertyGroup >
4+ <ProductName >Authenticode Lint</ProductName >
5+ <ProductUrl >https://vcsjones.com/authlint</ProductUrl >
6+ <ProductCompanyName >Kevin Jones</ProductCompanyName >
7+ </PropertyGroup >
8+ <PropertyGroup >
9+ <OutputDir >$(MSBuildThisFileDirectory)..\out\</OutputDir >
10+ <OutZip >$(OutputDir)AuthenticodeLint.zip</OutZip >
11+ </PropertyGroup >
12+ <Target Name =" Build" DependsOnTargets =" Clean" >
13+ <ItemGroup >
14+ <AuthenticodeLintSolution Include =" $(MSBuildThisFileDirectory)..\AuthenticodeLint\AuthenticodeLint.csproj" >
15+ <Properties >OutputPath=$(OutputDir);Configuration=Release</Properties >
16+ </AuthenticodeLintSolution >
17+ </ItemGroup >
18+ <MSBuild Targets =" Rebuild" Projects =" @(AuthenticodeLintSolution)" >
19+ <Output ItemName =" ProjectOutputs" TaskParameter =" TargetOutputs" />
20+ </MSBuild >
21+ </Target >
22+ <Target Name =" Sign" DependsOnTargets =" Build" >
23+ <Exec Command =" signtool.exe sign /d " $(ProductName)" /du $(ProductUrl) /n " $(ProductCompanyName)" /t http://timestamp.digicert.com /fd SHA1 " @(ProjectOutputs)" " />
24+ <Exec Command =" signtool.exe sign /as /d " $(ProductName)" /du $(ProductUrl) /n " $(ProductCompanyName)" /tr http://timestamp.digicert.com /fd SHA256 /td SHA256 " @(ProjectOutputs)" " />
25+ <!-- Run tool on itself -->
26+ <Exec Command =" " @(ProjectOutputs)" -in " @(ProjectOutputs)" " />
27+ </Target >
28+ <Target Name =" Package" DependsOnTargets =" Sign" >
29+ <Zip InputDirectory =" $(OutputDir)" OutputFile =" $(OutZip)" />
30+ </Target >
31+ <Target Name =" Clean" >
32+ <RemoveDir Directories =" $(OutputDir)" Condition =" Exists($(OutputDir))" />
33+ </Target >
34+
35+ <UsingTask
36+ TaskName =" Zip"
37+ TaskFactory =" CodeTaskFactory"
38+ AssemblyFile =" $(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll" >
39+ <ParameterGroup >
40+ <InputDirectory ParameterType =" System.String" Required =" true" />
41+ <OutputFile ParameterType =" System.String" Required =" true" />
42+ </ParameterGroup >
43+ <Task >
44+ <Reference Include =" System.IO.Compression.FileSystem" />
45+ <Using Namespace =" System.IO" />
46+ <Using Namespace =" System.IO.Compression" />
47+ <Code Type =" Fragment" Language =" cs" >
48+ <![CDATA[
49+ var path = Path.Combine(Path.GetTempPath(), System.Guid.NewGuid().ToString("D") + ".zip");
50+ ZipFile.CreateFromDirectory(InputDirectory, path);
51+ File.Move(path, OutputFile);
52+ ]]>
53+ </Code >
54+ </Task >
55+ </UsingTask >
56+ </Project >
0 commit comments