blob: 1d9f0f0df1deedd827393de0d81c79d138579a87 [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>
14 <!--
15 This URI is used to generate the various GUIDs used by the installer.
16 Installers built with the same URI will upgrade each other or block
17 when attempting to downgrade.
18
19 By default, this is the local computer name, which will produce
20 installers that do not interfere with other installers. Products
21 that intend to bundle Python should rebuild these modules with their
22 own URI to avoid conflicting with the official releases.
23
24 The official releases are built with http://www.python.org/.
25
26 This is not the same as the DownloadUrl property used in the bundle
27 projects.
28 -->
29 <ReleaseUri Condition="'$(ReleaseUri)' == ''">$(ComputerName)</ReleaseUri>
30 <ReleaseUri Condition="!$(ReleaseUri.EndsWith(`/`))">$(ReleaseUri)/</ReleaseUri>
31 </PropertyGroup>
32
33 <Import Project="wix.props" />
34 <Import Project="..\..\PCBuild\tcltk.props" />
35
36 <ItemGroup>
37 <Compile Include="$(MSBuildThisFileDirectory)common.wxs" />
38 <WxlTemplate Include="$(MSBuildThisFileDirectory)\*.wxl_template" />
39 <WixExtension Include="WixUtilExtension">
40 <HintPath>WixUtilExtension</HintPath>
41 <Name>WixUtilExtension</Name>
42 </WixExtension>
43 </ItemGroup>
44
45 <PropertyGroup>
Steve Dower49437492015-07-08 20:18:44 -070046 <IntermediateOutputPath>$(PySourcePath)PCBuild\obj\$(Configuration)_$(Platform)_Setup\$(OutputName)</IntermediateOutputPath>
Steve Dowerbb240872015-02-05 22:08:48 -080047 <IntermediateOutputPath Condition="'$(OutputSuffix)' != ''">$(IntermediateOutputPath)_$(OutputSuffix)</IntermediateOutputPath>
48 <OutputPath Condition="'$(OutputPath)' == ''">$(BuildPath)</OutputPath>
49 <OutputPath Condition="!HasTrailingSlash($(OutputPath))">$(OutputPath)\</OutputPath>
50 <OutDir>$(OutputPath)</OutDir>
51 <ReuseCabinetCache>true</ReuseCabinetCache>
Steve Dower102f72c2015-03-24 21:25:16 -070052 <CRTRedist Condition="'$(CRTRedist)' == ''">$(ExternalsDir)\redist</CRTRedist>
53 <CRTRedist Condition="!Exists($(CRTRedist))"></CRTRedist>
54 <DocFilename>python$(MajorVersionNumber)$(MinorVersionNumber)$(MicroVersionNumber)$(ReleaseLevelName).chm</DocFilename>
Steve Dowerbb240872015-02-05 22:08:48 -080055
56 <RevisionNumber>$(ReleaseLevelNumber)</RevisionNumber>
57 <RevisionNumber Condition="!$(BuildForRelease)">$([System.Math]::Floor($([System.DateTime]::Now.Subtract($([System.DateTime]::new(2001, 1, 1))).TotalDays)))</RevisionNumber>
58 </PropertyGroup>
59
60 <PropertyGroup>
61 <Bitness>32-bit</Bitness>
62 <Bitness Condition="$(Platform) == 'x64'">64-bit</Bitness>
63 <DefineConstants>
64 $(DefineConstants);
Steve Dowerc49de352015-03-08 15:29:39 -070065 Version=$(MajorVersionNumber).$(MinorVersionNumber).$(Field3Value).0;
Steve Dowerbb240872015-02-05 22:08:48 -080066 ShortVersion=$(MajorVersionNumber).$(MinorVersionNumber);
67 LongVersion=$(PythonVersion);
68 MajorVersionNumber=$(MajorVersionNumber);
69 MinorVersionNumber=$(MinorVersionNumber);
70 UpgradeMinimumVersion=$(MajorVersionNumber).$(MinorVersionNumber).0.0;
Steve Dowerbb240872015-02-05 22:08:48 -080071 NextMajorVersionNumber=$(MajorVersionNumber).$([msbuild]::Add($(MinorVersionNumber), 1)).0.0;
Steve Dower102f72c2015-03-24 21:25:16 -070072 Bitness=$(Bitness);
Steve Dowerbb240872015-02-05 22:08:48 -080073 PyDebugExt=$(PyDebugExt);
Steve Dower49437492015-07-08 20:18:44 -070074 OptionalFeatureName=$(OutputName);
Steve Dowerbb240872015-02-05 22:08:48 -080075 </DefineConstants>
Steve Dowerbb240872015-02-05 22:08:48 -080076 <DefineConstants Condition="'$(CRTRedist)' != ''">
77 $(DefineConstants);CRTRedist=$(CRTRedist);
78 </DefineConstants>
79 <DefineConstants Condition="$(Configuration) != 'Debug'">
80 $(DefineConstants);TestPrefix=;FileExtension=py;
81 </DefineConstants>
82 <DefineConstants Condition="$(Configuration) == 'Debug'">
83 $(DefineConstants);TestPrefix=x;FileExtension=px;
84 </DefineConstants>
85 <DefineConstants Condition="$(Platform) != 'x64'">
86 $(DefineConstants);Suffix32=-32;
87 </DefineConstants>
88 <DefineConstants Condition="$(Platform) == 'x64'">
89 $(DefineConstants);Suffix32=;
90 </DefineConstants>
91 </PropertyGroup>
92
93 <ItemDefinitionGroup>
94 <InstallFiles>
95 <Group>generated_filelist</Group>
96 <Condition></Condition>
97 <DiskId></DiskId>
98 </InstallFiles>
99 <LinkerBindInputPaths>
100 <Visible>false</Visible>
101 </LinkerBindInputPaths>
102 </ItemDefinitionGroup>
103 <ItemGroup>
104 <LinkerBindInputPaths Include="$(BuildPath);$(PySourcePath)Doc\build\htmlhelp">
105 <BindName></BindName>
106 </LinkerBindInputPaths>
107 <LinkerBindInputPaths Include="$(PySourcePath)">
108 <BindName>src</BindName>
109 </LinkerBindInputPaths>
110 <LinkerBindInputPaths Include="$(tcltkDir)">
111 <BindName>tcltk</BindName>
112 </LinkerBindInputPaths>
113 <LinkerBindInputPaths Include="$(CRTRedist)" Condition="'$(CRTRedist)' != ''">
Steve Dowere4969f52015-02-28 19:53:50 -0800114 <BindName>redist</BindName>
115 </LinkerBindInputPaths>
Steve Dowerbb240872015-02-05 22:08:48 -0800116 </ItemGroup>
117
118 <Target Name="_ValidateMsiProps" BeforeTargets="PrepareForBuild">
119 <Error Text="Platform '$(Platform)' is not supported. Use 'x86' or 'x64'." Condition="$(Platform) != 'x86' and $(Platform) != 'x64'" />
120 </Target>
121
122 <ItemGroup>
123 <_Uuid Include="CoreUpgradeCode">
124 <Uri>upgradecode</Uri>
125 </_Uuid>
126 <_Uuid Include="UpgradeCode">
127 <Uri>upgradecode/$(OutputName)</Uri>
128 </_Uuid>
129 <_Uuid Include="InstallDirectoryGuidSeed">
130 <Uri>installdirectoryseed</Uri>
131 </_Uuid>
132 <_Uuid Include="PythonExeComponentGuid">
133 <Uri>python.exe</Uri>
134 </_Uuid>
135 <_Uuid Include="PythonwExeComponentGuid">
136 <Uri>pythonw.exe</Uri>
137 </_Uuid>
138 <_Uuid Include="RemoveLib2to3PickleComponentGuid">
139 <Uri>lib2to3/pickles</Uri>
140 </_Uuid>
141 </ItemGroup>
142 <Target Name="_GenerateGuids" AfterTargets="PrepareForBuild">
143 <PropertyGroup>
Steve Dowerc49de352015-03-08 15:29:39 -0700144 <_Uuids>@(_Uuid->'("%(Identity)", "$(MajorVersionNumber).$(MinorVersionNumber)/%(Uri)")',',')</_Uuids>
Steve Dowerbb240872015-02-05 22:08:48 -0800145 <_GenerateCommand>import uuid; print('\n'.join('{}={}'.format(i, uuid.uuid5(uuid.UUID('c8d9733e-a70c-43ff-ab0c-e26456f11083'), '$(ReleaseUri)' + j)) for i,j in [$(_Uuids.Replace(`"`,`'`))]))</_GenerateCommand>
146 </PropertyGroup>
147
Steve Dower19694ab2015-05-02 15:23:27 -0700148 <Exec Command='"$(PythonExe)" -c "$(_GenerateCommand)" &gt; "$(IntermediateOutputPath)$(OutputName)guids.txt"'
149 WorkingDirectory="$(MSBuildThisFileDirectory)"
150 IgnoreExitCode="false" />
Steve Dowerbb240872015-02-05 22:08:48 -0800151
152 <ReadLinesFromFile File="$(IntermediateOutputPath)$(OutputName)guids.txt">
153 <Output TaskParameter="Lines" ItemName="_UuidValue" />
154 </ReadLinesFromFile>
155
156 <PropertyGroup>
157 <DefineConstants>$(DefineConstants);@(_UuidValue,';');</DefineConstants>
158 </PropertyGroup>
159 </Target>
160</Project>