blob: 5da901c0215a2f92c880dfc93391eb1e0008d745 [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 Dower425ec152016-10-09 20:18:52 -070014 <_MakeCatCommand Condition="'$(_MakeCatCommand)' == ''">makecat</_MakeCatCommand>
Steve Dowerc4b76002015-10-01 15:18:53 -070015 </PropertyGroup>
16
17 <Import Project="wix.props" />
Stefan Grönkef1502d02017-09-25 18:58:10 +020018 <Import Project="..\..\PCbuild\tcltk.props" />
Steve Dowerc4b76002015-10-01 15:18:53 -070019
20 <PropertyGroup>
Steve Dowerbb240872015-02-05 22:08:48 -080021 <!--
22 This URI is used to generate the various GUIDs used by the installer.
23 Installers built with the same URI will upgrade each other or block
24 when attempting to downgrade.
25
26 By default, this is the local computer name, which will produce
27 installers that do not interfere with other installers. Products
28 that intend to bundle Python should rebuild these modules with their
29 own URI to avoid conflicting with the official releases.
30
Steve Dowerc4b76002015-10-01 15:18:53 -070031 The official releases use "http://www.python.org/$(ArchName)"
Steve Dowerbb240872015-02-05 22:08:48 -080032
33 This is not the same as the DownloadUrl property used in the bundle
34 projects.
35 -->
Steve Dowerc4b76002015-10-01 15:18:53 -070036 <ReleaseUri Condition="'$(ReleaseUri)' == ''">$(ComputerName)/$(ArchName)/</ReleaseUri>
Steve Dowerbb240872015-02-05 22:08:48 -080037 <ReleaseUri Condition="!$(ReleaseUri.EndsWith(`/`))">$(ReleaseUri)/</ReleaseUri>
38 </PropertyGroup>
39
Steve Dowerbb240872015-02-05 22:08:48 -080040
41 <ItemGroup>
42 <Compile Include="$(MSBuildThisFileDirectory)common.wxs" />
Steve Dower49621412016-05-18 15:54:05 -070043 <WxlTemplate Include="$(MSBuildThisFileDirectory)\*.wxl_template" Condition="$(IgnoreCommonWxlTemplates) != 'true'" />
Steve Dowerbb240872015-02-05 22:08:48 -080044 <WixExtension Include="WixUtilExtension">
45 <HintPath>WixUtilExtension</HintPath>
46 <Name>WixUtilExtension</Name>
47 </WixExtension>
48 </ItemGroup>
49
50 <PropertyGroup>
Steve Dower2084b302017-10-05 13:35:36 -070051 <IntermediateOutputPath>$(Py_IntDir)\$(MajorVersionNumber)$(MinorVersionNumber)$(ArchName)_$(Configuration)\msi_$(OutputName)</IntermediateOutputPath>
Steve Dowerbb240872015-02-05 22:08:48 -080052 <IntermediateOutputPath Condition="'$(OutputSuffix)' != ''">$(IntermediateOutputPath)_$(OutputSuffix)</IntermediateOutputPath>
53 <OutputPath Condition="'$(OutputPath)' == ''">$(BuildPath)</OutputPath>
54 <OutputPath Condition="!HasTrailingSlash($(OutputPath))">$(OutputPath)\</OutputPath>
55 <OutDir>$(OutputPath)</OutDir>
56 <ReuseCabinetCache>true</ReuseCabinetCache>
Steve Dowerd135f202018-01-09 19:14:46 +110057 <CRTRedist Condition="'$(CRTRedist)' == ''">$(ExternalsDir)\windows-installer\redist-1\$(Platform)</CRTRedist>
58 <CRTRedist>$([System.IO.Path]::GetFullPath($(CRTRedist)))</CRTRedist>
Steve Dower102f72c2015-03-24 21:25:16 -070059 <DocFilename>python$(MajorVersionNumber)$(MinorVersionNumber)$(MicroVersionNumber)$(ReleaseLevelName).chm</DocFilename>
Steve Dowerbb240872015-02-05 22:08:48 -080060
Steve Dowerb85b42752015-07-08 22:43:48 -070061 <InstallerVersion>$(MajorVersionNumber).$(MinorVersionNumber).$(Field3Value).0</InstallerVersion>
62 </PropertyGroup>
63
64 <PropertyGroup Condition="!$(BuildForRelease)">
65 <RevisionNumber Condition="'$(RevisionNumber)' == ''">$([System.Math]::Floor($([System.DateTime]::Now.Subtract($([System.DateTime]::new(2001, 1, 1))).TotalDays)))</RevisionNumber>
66 <PythonVersion>$(MajorVersionNumber).$(MinorVersionNumber).$(MicroVersionNumber)dev$(RevisionNumber)</PythonVersion>
67 <InstallerVersion>$(MajorVersionNumber).$(MinorVersionNumber).$(RevisionNumber).0</InstallerVersion>
Steve Dowerbb240872015-02-05 22:08:48 -080068 </PropertyGroup>
69
70 <PropertyGroup>
71 <Bitness>32-bit</Bitness>
72 <Bitness Condition="$(Platform) == 'x64'">64-bit</Bitness>
Steve Dower05338262016-07-24 18:04:29 -070073 <PlatformArchitecture>32bit</PlatformArchitecture>
74 <PlatformArchitecture Condition="$(Platform) == 'x64'">64bit</PlatformArchitecture>
Steve Dowerbb240872015-02-05 22:08:48 -080075 <DefineConstants>
76 $(DefineConstants);
Steve Dowerb85b42752015-07-08 22:43:48 -070077 Version=$(InstallerVersion);
Steve Dowerbb240872015-02-05 22:08:48 -080078 ShortVersion=$(MajorVersionNumber).$(MinorVersionNumber);
79 LongVersion=$(PythonVersion);
80 MajorVersionNumber=$(MajorVersionNumber);
81 MinorVersionNumber=$(MinorVersionNumber);
82 UpgradeMinimumVersion=$(MajorVersionNumber).$(MinorVersionNumber).0.0;
Steve Dowerbb240872015-02-05 22:08:48 -080083 NextMajorVersionNumber=$(MajorVersionNumber).$([msbuild]::Add($(MinorVersionNumber), 1)).0.0;
Steve Dower102f72c2015-03-24 21:25:16 -070084 Bitness=$(Bitness);
Steve Dower05338262016-07-24 18:04:29 -070085 PlatformArchitecture=$(PlatformArchitecture);
Steve Dowerbb240872015-02-05 22:08:48 -080086 PyDebugExt=$(PyDebugExt);
Steve Dower940f6a82015-10-31 12:17:11 -070087 PyArchExt=$(PyArchExt);
88 PyTestExt=$(PyTestExt);
Steve Dower49437492015-07-08 20:18:44 -070089 OptionalFeatureName=$(OutputName);
Steve Dowere0c0c7e2019-06-06 09:06:51 -070090 ssltag=-1_1;
Steve Dowerbb240872015-02-05 22:08:48 -080091 </DefineConstants>
Steve Dowerbb240872015-02-05 22:08:48 -080092 <DefineConstants Condition="'$(CRTRedist)' != ''">
93 $(DefineConstants);CRTRedist=$(CRTRedist);
94 </DefineConstants>
Steve Dowerbb240872015-02-05 22:08:48 -080095 <DefineConstants Condition="$(Platform) != 'x64'">
Steve Dowere0c0c7e2019-06-06 09:06:51 -070096 $(DefineConstants);Suffix32=-32;
Steve Dowerbb240872015-02-05 22:08:48 -080097 </DefineConstants>
98 <DefineConstants Condition="$(Platform) == 'x64'">
Steve Dowere0c0c7e2019-06-06 09:06:51 -070099 $(DefineConstants);Suffix32=;
Steve Dowerbb240872015-02-05 22:08:48 -0800100 </DefineConstants>
101 </PropertyGroup>
102
103 <ItemDefinitionGroup>
104 <InstallFiles>
105 <Group>generated_filelist</Group>
106 <Condition></Condition>
107 <DiskId></DiskId>
Steve Dower425ec152016-10-09 20:18:52 -0700108 <IncludeInCat>false</IncludeInCat>
Steve Dowerbb240872015-02-05 22:08:48 -0800109 </InstallFiles>
110 <LinkerBindInputPaths>
111 <Visible>false</Visible>
112 </LinkerBindInputPaths>
113 </ItemDefinitionGroup>
114 <ItemGroup>
Steve Dower148827c2015-10-14 10:40:09 -0700115 <LinkerBindInputPaths Include="$(PGOBuildPath);$(BuildPath)">
116 <BindName></BindName>
117 </LinkerBindInputPaths>
118 <LinkerBindInputPaths Include="$(PySourcePath)Doc\build\htmlhelp">
Steve Dowerbb240872015-02-05 22:08:48 -0800119 <BindName></BindName>
120 </LinkerBindInputPaths>
121 <LinkerBindInputPaths Include="$(PySourcePath)">
122 <BindName>src</BindName>
123 </LinkerBindInputPaths>
124 <LinkerBindInputPaths Include="$(tcltkDir)">
125 <BindName>tcltk</BindName>
126 </LinkerBindInputPaths>
Steve Dowerd135f202018-01-09 19:14:46 +1100127 <LinkerBindInputPaths Include="$(CRTRedist)">
Steve Dowerfcbe1df2015-09-08 21:39:01 -0700128 <BindName>redist</BindName>
129 </LinkerBindInputPaths>
Steve Dower6fd76bc2016-07-16 16:13:19 -0700130 <LinkerBindInputPaths Include="$(BuildPath32)">
131 <BindName>build32</BindName>
132 </LinkerBindInputPaths>
133 <LinkerBindInputPaths Include="$(BuildPath64)">
134 <BindName>build64</BindName>
135 </LinkerBindInputPaths>
Steve Dowerbb240872015-02-05 22:08:48 -0800136 </ItemGroup>
137
138 <Target Name="_ValidateMsiProps" BeforeTargets="PrepareForBuild">
139 <Error Text="Platform '$(Platform)' is not supported. Use 'x86' or 'x64'." Condition="$(Platform) != 'x86' and $(Platform) != 'x64'" />
140 </Target>
141
142 <ItemGroup>
143 <_Uuid Include="CoreUpgradeCode">
144 <Uri>upgradecode</Uri>
145 </_Uuid>
146 <_Uuid Include="UpgradeCode">
147 <Uri>upgradecode/$(OutputName)</Uri>
148 </_Uuid>
149 <_Uuid Include="InstallDirectoryGuidSeed">
150 <Uri>installdirectoryseed</Uri>
151 </_Uuid>
152 <_Uuid Include="PythonExeComponentGuid">
153 <Uri>python.exe</Uri>
154 </_Uuid>
155 <_Uuid Include="PythonwExeComponentGuid">
156 <Uri>pythonw.exe</Uri>
157 </_Uuid>
158 <_Uuid Include="RemoveLib2to3PickleComponentGuid">
159 <Uri>lib2to3/pickles</Uri>
160 </_Uuid>
Steve Dower05338262016-07-24 18:04:29 -0700161 <_Uuid Include="CommonPythonRegComponentGuid">
162 <Uri>registry</Uri>
163 </_Uuid>
164 <_Uuid Include="PythonRegComponentGuid">
165 <Uri>registry/$(OutputName)</Uri>
166 </_Uuid>
Steve Dowerbb240872015-02-05 22:08:48 -0800167 </ItemGroup>
Steve Dower49621412016-05-18 15:54:05 -0700168 <Target Name="_GenerateGuids" AfterTargets="PrepareForBuild" Condition="$(TargetName) != 'launcher'">
Steve Dowerbb240872015-02-05 22:08:48 -0800169 <PropertyGroup>
Steve Dowerc49de352015-03-08 15:29:39 -0700170 <_Uuids>@(_Uuid->'("%(Identity)", "$(MajorVersionNumber).$(MinorVersionNumber)/%(Uri)")',',')</_Uuids>
Steve Dowerc4b76002015-10-01 15:18:53 -0700171 <_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 -0800172 </PropertyGroup>
173
Steve Dower19694ab2015-05-02 15:23:27 -0700174 <Exec Command='"$(PythonExe)" -c "$(_GenerateCommand)" &gt; "$(IntermediateOutputPath)$(OutputName)guids.txt"'
175 WorkingDirectory="$(MSBuildThisFileDirectory)"
176 IgnoreExitCode="false" />
Steve Dowerbb240872015-02-05 22:08:48 -0800177
178 <ReadLinesFromFile File="$(IntermediateOutputPath)$(OutputName)guids.txt">
179 <Output TaskParameter="Lines" ItemName="_UuidValue" />
180 </ReadLinesFromFile>
181
182 <PropertyGroup>
183 <DefineConstants>$(DefineConstants);@(_UuidValue,';');</DefineConstants>
184 </PropertyGroup>
185 </Target>
186</Project>