blob: 9ae6d9988e1083dd4e4f2b4fd4d1fed05d829f15 [file] [log] [blame]
Steve Dowerbb240872015-02-05 22:08:48 -08001<?xml version="1.0" encoding="utf-8"?>
2<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" TreatAsLocalProperty="ReleaseUri">
3 <PropertyGroup>
Steve Dowere4969f52015-02-28 19:53:50 -08004 <TargetName>$(OutputName)</TargetName>
Steve Dowerbb240872015-02-05 22:08:48 -08005 <DefineSolutionProperties>false</DefineSolutionProperties>
6 <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
7 <SuppressIces>$(SuppressIces);ICE03;ICE57;ICE61</SuppressIces>
8 <CompilerSuppressSpecificWarnings>1026</CompilerSuppressSpecificWarnings>
9 <BuildForRelease Condition="'$(BuildForRelease)' == ''">false</BuildForRelease>
10 <SignOutput Condition="'$(SigningCertificate)' != ''">true</SignOutput>
11 <Configuration Condition="'$(Configuration)' == ''">Release</Configuration>
12 <Platform Condition="'$(Platform)' == ''">x86</Platform>
13 <InstallScope Condition="'$(InstallScope)' != 'perMachine'">perUser</InstallScope>
Steve Dowerc4b76002015-10-01 15:18:53 -070014 </PropertyGroup>
15
16 <Import Project="wix.props" />
17 <Import Project="..\..\PCBuild\tcltk.props" />
18
19 <PropertyGroup>
Steve Dowerbb240872015-02-05 22:08:48 -080020 <!--
21 This URI is used to generate the various GUIDs used by the installer.
22 Installers built with the same URI will upgrade each other or block
23 when attempting to downgrade.
24
25 By default, this is the local computer name, which will produce
26 installers that do not interfere with other installers. Products
27 that intend to bundle Python should rebuild these modules with their
28 own URI to avoid conflicting with the official releases.
29
Steve Dowerc4b76002015-10-01 15:18:53 -070030 The official releases use "http://www.python.org/$(ArchName)"
Steve Dowerbb240872015-02-05 22:08:48 -080031
32 This is not the same as the DownloadUrl property used in the bundle
33 projects.
34 -->
Steve Dowerc4b76002015-10-01 15:18:53 -070035 <ReleaseUri Condition="'$(ReleaseUri)' == ''">$(ComputerName)/$(ArchName)/</ReleaseUri>
Steve Dowerbb240872015-02-05 22:08:48 -080036 <ReleaseUri Condition="!$(ReleaseUri.EndsWith(`/`))">$(ReleaseUri)/</ReleaseUri>
37 </PropertyGroup>
38
Steve Dowerbb240872015-02-05 22:08:48 -080039
40 <ItemGroup>
41 <Compile Include="$(MSBuildThisFileDirectory)common.wxs" />
Steve Dower49621412016-05-18 15:54:05 -070042 <WxlTemplate Include="$(MSBuildThisFileDirectory)\*.wxl_template" Condition="$(IgnoreCommonWxlTemplates) != 'true'" />
Steve Dowerbb240872015-02-05 22:08:48 -080043 <WixExtension Include="WixUtilExtension">
44 <HintPath>WixUtilExtension</HintPath>
45 <Name>WixUtilExtension</Name>
46 </WixExtension>
47 </ItemGroup>
48
49 <PropertyGroup>
Steve Dower49437492015-07-08 20:18:44 -070050 <IntermediateOutputPath>$(PySourcePath)PCBuild\obj\$(Configuration)_$(Platform)_Setup\$(OutputName)</IntermediateOutputPath>
Steve Dowerbb240872015-02-05 22:08:48 -080051 <IntermediateOutputPath Condition="'$(OutputSuffix)' != ''">$(IntermediateOutputPath)_$(OutputSuffix)</IntermediateOutputPath>
52 <OutputPath Condition="'$(OutputPath)' == ''">$(BuildPath)</OutputPath>
53 <OutputPath Condition="!HasTrailingSlash($(OutputPath))">$(OutputPath)\</OutputPath>
54 <OutDir>$(OutputPath)</OutDir>
55 <ReuseCabinetCache>true</ReuseCabinetCache>
Steve Dowerd28a8a92015-10-23 09:50:49 -070056 <CRTRedist Condition="'$(CRTRedist)' == ''">$(ExternalsDir)\windows-installer\redist</CRTRedist>
Steve Dower102f72c2015-03-24 21:25:16 -070057 <CRTRedist Condition="!Exists($(CRTRedist))"></CRTRedist>
58 <DocFilename>python$(MajorVersionNumber)$(MinorVersionNumber)$(MicroVersionNumber)$(ReleaseLevelName).chm</DocFilename>
Steve Dowerbb240872015-02-05 22:08:48 -080059
Steve Dowerb85b42752015-07-08 22:43:48 -070060 <InstallerVersion>$(MajorVersionNumber).$(MinorVersionNumber).$(Field3Value).0</InstallerVersion>
61 </PropertyGroup>
62
63 <PropertyGroup Condition="!$(BuildForRelease)">
64 <RevisionNumber Condition="'$(RevisionNumber)' == ''">$([System.Math]::Floor($([System.DateTime]::Now.Subtract($([System.DateTime]::new(2001, 1, 1))).TotalDays)))</RevisionNumber>
65 <PythonVersion>$(MajorVersionNumber).$(MinorVersionNumber).$(MicroVersionNumber)dev$(RevisionNumber)</PythonVersion>
66 <InstallerVersion>$(MajorVersionNumber).$(MinorVersionNumber).$(RevisionNumber).0</InstallerVersion>
Steve Dowerbb240872015-02-05 22:08:48 -080067 </PropertyGroup>
68
69 <PropertyGroup>
70 <Bitness>32-bit</Bitness>
71 <Bitness Condition="$(Platform) == 'x64'">64-bit</Bitness>
72 <DefineConstants>
73 $(DefineConstants);
Steve Dowerb85b42752015-07-08 22:43:48 -070074 Version=$(InstallerVersion);
Steve Dowerbb240872015-02-05 22:08:48 -080075 ShortVersion=$(MajorVersionNumber).$(MinorVersionNumber);
76 LongVersion=$(PythonVersion);
77 MajorVersionNumber=$(MajorVersionNumber);
78 MinorVersionNumber=$(MinorVersionNumber);
79 UpgradeMinimumVersion=$(MajorVersionNumber).$(MinorVersionNumber).0.0;
Steve Dowerbb240872015-02-05 22:08:48 -080080 NextMajorVersionNumber=$(MajorVersionNumber).$([msbuild]::Add($(MinorVersionNumber), 1)).0.0;
Steve Dower102f72c2015-03-24 21:25:16 -070081 Bitness=$(Bitness);
Steve Dowerbb240872015-02-05 22:08:48 -080082 PyDebugExt=$(PyDebugExt);
Steve Dower940f6a82015-10-31 12:17:11 -070083 PyArchExt=$(PyArchExt);
84 PyTestExt=$(PyTestExt);
Steve Dower49437492015-07-08 20:18:44 -070085 OptionalFeatureName=$(OutputName);
Steve Dowerbb240872015-02-05 22:08:48 -080086 </DefineConstants>
Steve Dowerbb240872015-02-05 22:08:48 -080087 <DefineConstants Condition="'$(CRTRedist)' != ''">
88 $(DefineConstants);CRTRedist=$(CRTRedist);
89 </DefineConstants>
Steve Dowerbb240872015-02-05 22:08:48 -080090 <DefineConstants Condition="$(Platform) != 'x64'">
91 $(DefineConstants);Suffix32=-32;
92 </DefineConstants>
93 <DefineConstants Condition="$(Platform) == 'x64'">
94 $(DefineConstants);Suffix32=;
95 </DefineConstants>
96 </PropertyGroup>
97
98 <ItemDefinitionGroup>
99 <InstallFiles>
100 <Group>generated_filelist</Group>
101 <Condition></Condition>
102 <DiskId></DiskId>
103 </InstallFiles>
104 <LinkerBindInputPaths>
105 <Visible>false</Visible>
106 </LinkerBindInputPaths>
107 </ItemDefinitionGroup>
108 <ItemGroup>
Steve Dower148827c2015-10-14 10:40:09 -0700109 <LinkerBindInputPaths Include="$(PGOBuildPath);$(BuildPath)">
110 <BindName></BindName>
111 </LinkerBindInputPaths>
112 <LinkerBindInputPaths Include="$(PySourcePath)Doc\build\htmlhelp">
Steve Dowerbb240872015-02-05 22:08:48 -0800113 <BindName></BindName>
114 </LinkerBindInputPaths>
115 <LinkerBindInputPaths Include="$(PySourcePath)">
116 <BindName>src</BindName>
117 </LinkerBindInputPaths>
118 <LinkerBindInputPaths Include="$(tcltkDir)">
119 <BindName>tcltk</BindName>
120 </LinkerBindInputPaths>
121 <LinkerBindInputPaths Include="$(CRTRedist)" Condition="'$(CRTRedist)' != ''">
Steve Dowere4969f52015-02-28 19:53:50 -0800122 <BindName>redist</BindName>
123 </LinkerBindInputPaths>
Steve Dowerfcbe1df2015-09-08 21:39:01 -0700124 <LinkerBindInputPaths Include="$(VS140COMNTOOLS)\..\..\VC\redist\$(Platform)\Microsoft.VC140.CRT">
125 <BindName>redist</BindName>
126 </LinkerBindInputPaths>
Steve Dowerbb240872015-02-05 22:08:48 -0800127 </ItemGroup>
128
129 <Target Name="_ValidateMsiProps" BeforeTargets="PrepareForBuild">
130 <Error Text="Platform '$(Platform)' is not supported. Use 'x86' or 'x64'." Condition="$(Platform) != 'x86' and $(Platform) != 'x64'" />
131 </Target>
132
133 <ItemGroup>
134 <_Uuid Include="CoreUpgradeCode">
135 <Uri>upgradecode</Uri>
136 </_Uuid>
137 <_Uuid Include="UpgradeCode">
138 <Uri>upgradecode/$(OutputName)</Uri>
139 </_Uuid>
140 <_Uuid Include="InstallDirectoryGuidSeed">
141 <Uri>installdirectoryseed</Uri>
142 </_Uuid>
143 <_Uuid Include="PythonExeComponentGuid">
144 <Uri>python.exe</Uri>
145 </_Uuid>
146 <_Uuid Include="PythonwExeComponentGuid">
147 <Uri>pythonw.exe</Uri>
148 </_Uuid>
149 <_Uuid Include="RemoveLib2to3PickleComponentGuid">
150 <Uri>lib2to3/pickles</Uri>
151 </_Uuid>
152 </ItemGroup>
Steve Dower49621412016-05-18 15:54:05 -0700153 <Target Name="_GenerateGuids" AfterTargets="PrepareForBuild" Condition="$(TargetName) != 'launcher'">
Steve Dowerbb240872015-02-05 22:08:48 -0800154 <PropertyGroup>
Steve Dowerc49de352015-03-08 15:29:39 -0700155 <_Uuids>@(_Uuid->'("%(Identity)", "$(MajorVersionNumber).$(MinorVersionNumber)/%(Uri)")',',')</_Uuids>
Steve Dowerc4b76002015-10-01 15:18:53 -0700156 <_GenerateCommand>import uuid; print('\n'.join('{}={}'.format(i, uuid.uuid5(uuid.UUID('c8d9733e-a70c-43ff-ab0c-e26456f11083'), '$(ReleaseUri.Replace(`{arch}`, `$(ArchName)`))' + j)) for i,j in [$(_Uuids.Replace(`"`,`'`))]))</_GenerateCommand>
Steve Dowerbb240872015-02-05 22:08:48 -0800157 </PropertyGroup>
158
Steve Dower19694ab2015-05-02 15:23:27 -0700159 <Exec Command='"$(PythonExe)" -c "$(_GenerateCommand)" &gt; "$(IntermediateOutputPath)$(OutputName)guids.txt"'
160 WorkingDirectory="$(MSBuildThisFileDirectory)"
161 IgnoreExitCode="false" />
Steve Dowerbb240872015-02-05 22:08:48 -0800162
163 <ReadLinesFromFile File="$(IntermediateOutputPath)$(OutputName)guids.txt">
164 <Output TaskParameter="Lines" ItemName="_UuidValue" />
165 </ReadLinesFromFile>
166
167 <PropertyGroup>
168 <DefineConstants>$(DefineConstants);@(_UuidValue,';');</DefineConstants>
169 </PropertyGroup>
170 </Target>
171</Project>