-
Notifications
You must be signed in to change notification settings - Fork 2.7k
/
Copy pathYarnSetup.wixproj
88 lines (85 loc) · 3.76 KB
/
YarnSetup.wixproj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>3.10</ProductVersion>
<ProjectGuid>fe1c2574-72c2-4f4a-80d6-dc3aa428bb00</ProjectGuid>
<SchemaVersion>2.0</SchemaVersion>
<OutputName>Yarn</OutputName>
<OutputType>Package</OutputType>
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' AND '$(MSBuildExtensionsPath32)' != '' ">$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
<YarnDistPath>..\..\dist</YarnDistPath>
<DefineSolutionProperties>false</DefineSolutionProperties>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<OutputPath>bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
<DefineConstants>Debug</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
<DefineConstants></DefineConstants>
</PropertyGroup>
<ItemGroup>
<Compile Include="generated.wxs" />
<Compile Include="Yarn.wxs" />
</ItemGroup>
<ItemGroup>
<WixExtension Include="WixUIExtension">
<HintPath>$(WixExtDir)\WixUIExtension.dll</HintPath>
<Name>WixUIExtension</Name>
</WixExtension>
</ItemGroup>
<ItemGroup>
<Content Include="license.rtf" />
<Content Include="yarn-banner.bmp" />
<Content Include="yarn-dialog.bmp" />
<Content Include="yarn.ico" />
</ItemGroup>
<Import Project="$(WixTargetsPath)" />
<Target Name="BeforeBuild">
<!-- Ensure Yarn build was performed already -->
<Error
Condition="!Exists('$(YarnDistPath)\bin\yarn.js')"
Text="Please run scripts\build-dist.sh before building the installer"
/>
<!-- Delete .tar.gz from dist path, leaving only the files -->
<Delete Files="$(YarnDistPath)\*.tar.gz" />
<Exec Command="node $(YarnDistPath)\..\scripts\update-dist-manifest.js $([System.IO.Path]::GetFullPath($(YarnDistPath)))\package.json msi" />
<!-- Get Yarn version -->
<Exec Command="node $(YarnDistPath)\bin\yarn.js --version" ConsoleToMSBuild="true">
<Output TaskParameter="ConsoleOutput" PropertyName="YarnVersion" />
</Exec>
<!-- WiX doesn't allow extra stuff in the version number, so we omit the
date/time for nightly builds here -->
<Exec
Command="node -p "require('./package.json').version.replace(/\-(.+)$/, '')""
ConsoleToMSBuild="true"
WorkingDirectory="$(YarnDistPath)\..">
<Output TaskParameter="ConsoleOutput" PropertyName="YarnShortVersion" />
</Exec>
<PropertyGroup>
<DefineConstants>$(DefineConstants);YarnDistPath=$(YarnDistPath);YarnVersion=$(YarnShortVersion)</DefineConstants>
</PropertyGroup>
<HeatDirectory
AutogenerateGuids="true"
ComponentGroupName="YarnFiles"
Directory="$(YarnDistPath)"
DirectoryRefId="INSTALLDIR"
OutputFile="generated.wxs"
PreprocessorVariable="var.YarnDistPath"
SuppressRootDirectory="true"
ToolPath="$(WixToolPath)"
/>
</Target>
<Target Name="AfterBuild">
<!-- Rename installer to yarn-[version]-unsigned.msi -->
<Copy
SourceFiles="$(OutputPath)\Yarn.msi"
DestinationFiles="$(YarnDistPath)\..\artifacts\yarn-$(YarnVersion)-unsigned.msi"
/>
</Target>
</Project>