Skip to content

Commit 32df836

Browse files
committed
update build scripts
1 parent a169cb0 commit 32df836

File tree

8 files changed

+42
-26
lines changed

8 files changed

+42
-26
lines changed

.appveyor.yml

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,19 @@ cache:
66
- packages -> **\packages.config
77
- '%USERPROFILE%\.nuget\packages -> **\project.json'
88
before_build:
9-
- cmd: >-
10-
FOR /F %%i in ('git describe --always --tags') do set GIT_TAG=%%i
9+
- ps: >-
10+
$env:GIT_TAG = git describe --always --tags
1111
1212
nuget restore
1313
build:
1414
verbosity: minimal
1515
after_build:
16-
- cmd: >-
17-
type GitVersion.cs
16+
- ps: >-
17+
Get-Content GitVersion.cs
1818
19-
cd Build
20-
21-
move QuickLook.msi ..\QuickLook-%GIT_TAG%.msi
22-
23-
dir ..\QuickLook-%GIT_TAG%.msi
24-
25-
7z a ..\QuickLook-%GIT_TAG%.zip .\Package\* -r
26-
27-
7z l ..\QuickLook-%GIT_TAG%.zip
19+
Move-Item Build\QuickLook-$env:GIT_TAG.msi QuickLook-$env:GIT_TAG.msi
20+
21+
Move-Item Build\QuickLook-$env:GIT_TAG.zip QuickLook-$env:GIT_TAG.zip
2822
2923
artifacts:
3024
- path: QuickLook-%GIT_TAG%.zip

QuickLook.Installer/QuickLook.Installer.wixproj

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
1919
<OutputPath>..\Build\</OutputPath>
2020
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
21+
<DefineConstants>PackageDir=$(SolutionDir)Build\Package\</DefineConstants>
2122
</PropertyGroup>
2223
<ItemGroup>
2324
<Compile Include="C_QuickLookComponents.wxs" />
@@ -32,25 +33,24 @@
3233
<ItemGroup>
3334
<Content Include="gpl.rtf" />
3435
</ItemGroup>
35-
<ItemGroup>
36-
<ProjectReference Include="..\QuickLook\QuickLook.csproj">
37-
<Name>QuickLook</Name>
38-
<Project>{8b4a9ce5-67b5-4a94-81cb-3771f688fdeb}</Project>
39-
<Private>True</Private>
40-
<DoNotHarvest>True</DoNotHarvest>
41-
<RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups>
42-
<RefTargetDir>INSTALLFOLDER</RefTargetDir>
43-
</ProjectReference>
44-
</ItemGroup>
4536
<Import Project="$(WixTargetsPath)" Condition=" '$(WixTargetsPath)' != '' " />
4637
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets" Condition=" '$(WixTargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets') " />
4738
<Target Name="EnsureWixToolsetInstalled" Condition=" '$(WixTargetsImported)' != 'true' ">
4839
<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/" />
4940
</Target>
5041
<PropertyGroup>
51-
<PreBuildEvent>robocopy "$(SolutionDir)Build\$(Configuration)" "$(SolutionDir)Build\Package" %2a.%2a /e /njh /njs /ndl /nfl /nc /ns /np /xf %2a.pdb /xf %2a.obj /xf %2a.ipdb /xf %2a.iobj /xf %2a.exp /xf %2a.lib /xf %2a.ilk /xf %2a.xml
42+
<PreBuildEvent>rmdir /S /Q "$(SolutionDir)Build\Package\%2a"
43+
44+
robocopy "$(SolutionDir)Build\$(Configuration)" "$(SolutionDir)Build\Package" %2a.%2a /e /njh /njs /ndl /nfl /nc /ns /np /xf %2a.pdb /xf %2a.obj /xf %2a.ipdb /xf %2a.iobj /xf %2a.exp /xf %2a.lib /xf %2a.ilk /xf %2a.xml
45+
46+
powershell -file "$(SolutionDir)Scripts\sign-package.ps1"
47+
48+
"$(WIX)bin\heat" dir "$(SolutionDir)Build\Package" -dr INSTALLFOLDER -cg QuickLookComponents -gg -g1 -sf -srd -sreg -var "var.PackageDir" -out "$(ProjectDir)C_QuickLookComponents.wxs"</PreBuildEvent>
49+
</PropertyGroup>
50+
<PropertyGroup>
51+
<PostBuildEvent>powershell -file "$(SolutionDir)Scripts\sign-msi.ps1"
5252

53-
"$(WIX)bin\heat" dir "$(SolutionDir)Build\Package" -dr INSTALLFOLDER -cg QuickLookComponents -gg -g1 -sf -srd -sreg -var "var.QuickLook.TargetDir" -out "$(ProjectDir)C_QuickLookComponents.wxs"</PreBuildEvent>
53+
powershell -file "$(SolutionDir)Scripts\rename-pkg.ps1"</PostBuildEvent>
5454
</PropertyGroup>
5555
<!--
5656
To modify your build process, add your task inside one of the targets below and uncomment it.

QuickLook.sln

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "QuickLook.Installer", "Quic
3838
{D31EE321-C2B0-4984-B749-736F7DE509F1} = {D31EE321-C2B0-4984-B749-736F7DE509F1}
3939
{AE041682-E3A1-44F6-8BB4-916A98D89FBE} = {AE041682-E3A1-44F6-8BB4-916A98D89FBE}
4040
{1B746D92-49A5-4A37-9D75-DCC490393290} = {1B746D92-49A5-4A37-9D75-DCC490393290}
41+
{45E94893-3076-4A8E-8969-6955B6340739} = {45E94893-3076-4A8E-8969-6955B6340739}
4142
{A82AC69C-EDF5-4F0D-8CBD-8E5E3C06E64D} = {A82AC69C-EDF5-4F0D-8CBD-8E5E3C06E64D}
43+
{863ECAAC-18D9-4256-A27D-0F308089FB47} = {863ECAAC-18D9-4256-A27D-0F308089FB47}
4244
{AB1270AF-7EB4-4B4F-9E09-6404F1A28EA0} = {AB1270AF-7EB4-4B4F-9E09-6404F1A28EA0}
4345
{2C58F9B2-D8FA-4586-942B-5170CECE5963} = {2C58F9B2-D8FA-4586-942B-5170CECE5963}
4446
{DE2E3BC5-6AB2-4420-A160-48C7A7506C1C} = {DE2E3BC5-6AB2-4420-A160-48C7A7506C1C}

QuickLook/QuickLook.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,6 @@
255255
</ItemGroup>
256256
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
257257
<PropertyGroup>
258-
<PreBuildEvent>"$(SolutionDir)update-version.cmd" "$(SolutionDir)" "$(SolutionDir)GitVersion.cs"</PreBuildEvent>
258+
<PreBuildEvent>"$(SolutionDir)Scripts\update-version.cmd" "$(SolutionDir)" "$(SolutionDir)GitVersion.cs"</PreBuildEvent>
259259
</PropertyGroup>
260260
</Project>

Scripts/rename-pkg.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
$version = git describe --always --tags
2+
3+
Rename-Item ..\Build\QuickLook.msi QuickLook-$version.msi
4+
Compress-Archive ..\Build\Package\* ..\Build\QuickLook-$version.zip

Scripts/sign-msi.ps1

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
if(-not (Test-Path env:CI))
2+
{
3+
$signExe = 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.15063.0\x86\signtool.exe'
4+
$file = '..\Build\QuickLook.msi'
5+
$timestampUrl = 'http://time.certum.pl/'
6+
7+
.$signExe sign /a /v /fd sha256 /t $timestampUrl $file
8+
}

Scripts/sign-package.ps1

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
if(-not (Test-Path env:CI))
2+
{
3+
$signExe = 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.15063.0\x86\signtool.exe'
4+
$files = gci '..\Build\Package\*' -Recurse -Include *.exe,*.dll | %{('"{0}"' -f $_.FullName)}
5+
$timestampUrl = 'http://time.certum.pl/'
6+
7+
.$signExe sign /a /v /fd sha256 /t $timestampUrl $files
8+
}

0 commit comments

Comments
 (0)