blob: bd22345ec31704a5844840bf26937856bd4b78c0 [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>
46 <IntermediateOutputPath>$(MSBuildThisFileDirectory)\obj\$(Configuration)_$(Platform)\$(OutputName)</IntermediateOutputPath>
47 <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);
74 </DefineConstants>
Steve Dowerbb240872015-02-05 22:08:48 -080075 <DefineConstants Condition="'$(CRTRedist)' != ''">
76 $(DefineConstants);CRTRedist=$(CRTRedist);
77 </DefineConstants>
78 <DefineConstants Condition="$(Configuration) != 'Debug'">
79 $(DefineConstants);TestPrefix=;FileExtension=py;
80 </DefineConstants>
81 <DefineConstants Condition="$(Configuration) == 'Debug'">
82 $(DefineConstants);TestPrefix=x;FileExtension=px;
83 </DefineConstants>
84 <DefineConstants Condition="$(Platform) != 'x64'">
85 $(DefineConstants);Suffix32=-32;
86 </DefineConstants>
87 <DefineConstants Condition="$(Platform) == 'x64'">
88 $(DefineConstants);Suffix32=;
89 </DefineConstants>
90 </PropertyGroup>
91
92 <ItemDefinitionGroup>
93 <InstallFiles>
94 <Group>generated_filelist</Group>
95 <Condition></Condition>
96 <DiskId></DiskId>
97 </InstallFiles>
98 <LinkerBindInputPaths>
99 <Visible>false</Visible>
100 </LinkerBindInputPaths>
101 </ItemDefinitionGroup>
102 <ItemGroup>
103 <LinkerBindInputPaths Include="$(BuildPath);$(PySourcePath)Doc\build\htmlhelp">
104 <BindName></BindName>
105 </LinkerBindInputPaths>
106 <LinkerBindInputPaths Include="$(PySourcePath)">
107 <BindName>src</BindName>
108 </LinkerBindInputPaths>
109 <LinkerBindInputPaths Include="$(tcltkDir)">
110 <BindName>tcltk</BindName>
111 </LinkerBindInputPaths>
112 <LinkerBindInputPaths Include="$(CRTRedist)" Condition="'$(CRTRedist)' != ''">
Steve Dowere4969f52015-02-28 19:53:50 -0800113 <BindName>redist</BindName>
114 </LinkerBindInputPaths>
Steve Dower102f72c2015-03-24 21:25:16 -0700115 <LinkerBindInputPaths Include="$(CRTRedist)\$(Platform)" Condition="'$(CRTRedist)' != ''">
116 <BindName>crt</BindName>
117 </LinkerBindInputPaths>
Steve Dowerbb240872015-02-05 22:08:48 -0800118 </ItemGroup>
119
120 <Target Name="_ValidateMsiProps" BeforeTargets="PrepareForBuild">
121 <Error Text="Platform '$(Platform)' is not supported. Use 'x86' or 'x64'." Condition="$(Platform) != 'x86' and $(Platform) != 'x64'" />
122 </Target>
123
124 <ItemGroup>
125 <_Uuid Include="CoreUpgradeCode">
126 <Uri>upgradecode</Uri>
127 </_Uuid>
128 <_Uuid Include="UpgradeCode">
129 <Uri>upgradecode/$(OutputName)</Uri>
130 </_Uuid>
131 <_Uuid Include="InstallDirectoryGuidSeed">
132 <Uri>installdirectoryseed</Uri>
133 </_Uuid>
134 <_Uuid Include="PythonExeComponentGuid">
135 <Uri>python.exe</Uri>
136 </_Uuid>
137 <_Uuid Include="PythonwExeComponentGuid">
138 <Uri>pythonw.exe</Uri>
139 </_Uuid>
140 <_Uuid Include="RemoveLib2to3PickleComponentGuid">
141 <Uri>lib2to3/pickles</Uri>
142 </_Uuid>
143 </ItemGroup>
144 <Target Name="_GenerateGuids" AfterTargets="PrepareForBuild">
145 <PropertyGroup>
Steve Dowerc49de352015-03-08 15:29:39 -0700146 <_Uuids>@(_Uuid->'("%(Identity)", "$(MajorVersionNumber).$(MinorVersionNumber)/%(Uri)")',',')</_Uuids>
Steve Dowerbb240872015-02-05 22:08:48 -0800147 <_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>
148 </PropertyGroup>
149
Steve Dower19694ab2015-05-02 15:23:27 -0700150 <Exec Command='"$(PythonExe)" -c "$(_GenerateCommand)" &gt; "$(IntermediateOutputPath)$(OutputName)guids.txt"'
151 WorkingDirectory="$(MSBuildThisFileDirectory)"
152 IgnoreExitCode="false" />
Steve Dowerbb240872015-02-05 22:08:48 -0800153
154 <ReadLinesFromFile File="$(IntermediateOutputPath)$(OutputName)guids.txt">
155 <Output TaskParameter="Lines" ItemName="_UuidValue" />
156 </ReadLinesFromFile>
157
158 <PropertyGroup>
159 <DefineConstants>$(DefineConstants);@(_UuidValue,';');</DefineConstants>
160 </PropertyGroup>
161 </Target>
162</Project>