blob: 29be12932801fc432bab38c82e89c96713fb2bde [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
Steve Dowerb85b42752015-07-08 22:43:48 -070056 <InstallerVersion>$(MajorVersionNumber).$(MinorVersionNumber).$(Field3Value).0</InstallerVersion>
57 </PropertyGroup>
58
59 <PropertyGroup Condition="!$(BuildForRelease)">
60 <RevisionNumber Condition="'$(RevisionNumber)' == ''">$([System.Math]::Floor($([System.DateTime]::Now.Subtract($([System.DateTime]::new(2001, 1, 1))).TotalDays)))</RevisionNumber>
61 <PythonVersion>$(MajorVersionNumber).$(MinorVersionNumber).$(MicroVersionNumber)dev$(RevisionNumber)</PythonVersion>
62 <InstallerVersion>$(MajorVersionNumber).$(MinorVersionNumber).$(RevisionNumber).0</InstallerVersion>
Steve Dowerbb240872015-02-05 22:08:48 -080063 </PropertyGroup>
64
65 <PropertyGroup>
66 <Bitness>32-bit</Bitness>
67 <Bitness Condition="$(Platform) == 'x64'">64-bit</Bitness>
68 <DefineConstants>
69 $(DefineConstants);
Steve Dowerb85b42752015-07-08 22:43:48 -070070 Version=$(InstallerVersion);
Steve Dowerbb240872015-02-05 22:08:48 -080071 ShortVersion=$(MajorVersionNumber).$(MinorVersionNumber);
72 LongVersion=$(PythonVersion);
73 MajorVersionNumber=$(MajorVersionNumber);
74 MinorVersionNumber=$(MinorVersionNumber);
75 UpgradeMinimumVersion=$(MajorVersionNumber).$(MinorVersionNumber).0.0;
Steve Dowerbb240872015-02-05 22:08:48 -080076 NextMajorVersionNumber=$(MajorVersionNumber).$([msbuild]::Add($(MinorVersionNumber), 1)).0.0;
Steve Dower102f72c2015-03-24 21:25:16 -070077 Bitness=$(Bitness);
Steve Dowerbb240872015-02-05 22:08:48 -080078 PyDebugExt=$(PyDebugExt);
Steve Dower49437492015-07-08 20:18:44 -070079 OptionalFeatureName=$(OutputName);
Steve Dowerbb240872015-02-05 22:08:48 -080080 </DefineConstants>
Steve Dowerbb240872015-02-05 22:08:48 -080081 <DefineConstants Condition="'$(CRTRedist)' != ''">
82 $(DefineConstants);CRTRedist=$(CRTRedist);
83 </DefineConstants>
Steve Dower2237bdc2015-07-16 16:33:55 -070084 <DefineConstants Condition="$(UseTestMarker) != 'true'">
Steve Dowerbb240872015-02-05 22:08:48 -080085 $(DefineConstants);TestPrefix=;FileExtension=py;
86 </DefineConstants>
Steve Dower2237bdc2015-07-16 16:33:55 -070087 <DefineConstants Condition="$(UseTestMarker) == 'true'">
Steve Dowerbb240872015-02-05 22:08:48 -080088 $(DefineConstants);TestPrefix=x;FileExtension=px;
89 </DefineConstants>
90 <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>
109 <LinkerBindInputPaths Include="$(BuildPath);$(PySourcePath)Doc\build\htmlhelp">
110 <BindName></BindName>
111 </LinkerBindInputPaths>
112 <LinkerBindInputPaths Include="$(PySourcePath)">
113 <BindName>src</BindName>
114 </LinkerBindInputPaths>
115 <LinkerBindInputPaths Include="$(tcltkDir)">
116 <BindName>tcltk</BindName>
117 </LinkerBindInputPaths>
118 <LinkerBindInputPaths Include="$(CRTRedist)" Condition="'$(CRTRedist)' != ''">
Steve Dowere4969f52015-02-28 19:53:50 -0800119 <BindName>redist</BindName>
120 </LinkerBindInputPaths>
Steve Dowerbb240872015-02-05 22:08:48 -0800121 </ItemGroup>
122
123 <Target Name="_ValidateMsiProps" BeforeTargets="PrepareForBuild">
124 <Error Text="Platform '$(Platform)' is not supported. Use 'x86' or 'x64'." Condition="$(Platform) != 'x86' and $(Platform) != 'x64'" />
125 </Target>
126
127 <ItemGroup>
128 <_Uuid Include="CoreUpgradeCode">
129 <Uri>upgradecode</Uri>
130 </_Uuid>
131 <_Uuid Include="UpgradeCode">
132 <Uri>upgradecode/$(OutputName)</Uri>
133 </_Uuid>
134 <_Uuid Include="InstallDirectoryGuidSeed">
135 <Uri>installdirectoryseed</Uri>
136 </_Uuid>
137 <_Uuid Include="PythonExeComponentGuid">
138 <Uri>python.exe</Uri>
139 </_Uuid>
140 <_Uuid Include="PythonwExeComponentGuid">
141 <Uri>pythonw.exe</Uri>
142 </_Uuid>
143 <_Uuid Include="RemoveLib2to3PickleComponentGuid">
144 <Uri>lib2to3/pickles</Uri>
145 </_Uuid>
146 </ItemGroup>
147 <Target Name="_GenerateGuids" AfterTargets="PrepareForBuild">
148 <PropertyGroup>
Steve Dowerc49de352015-03-08 15:29:39 -0700149 <_Uuids>@(_Uuid->'("%(Identity)", "$(MajorVersionNumber).$(MinorVersionNumber)/%(Uri)")',',')</_Uuids>
Steve Dowerbb240872015-02-05 22:08:48 -0800150 <_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>
151 </PropertyGroup>
152
Steve Dower19694ab2015-05-02 15:23:27 -0700153 <Exec Command='"$(PythonExe)" -c "$(_GenerateCommand)" &gt; "$(IntermediateOutputPath)$(OutputName)guids.txt"'
154 WorkingDirectory="$(MSBuildThisFileDirectory)"
155 IgnoreExitCode="false" />
Steve Dowerbb240872015-02-05 22:08:48 -0800156
157 <ReadLinesFromFile File="$(IntermediateOutputPath)$(OutputName)guids.txt">
158 <Output TaskParameter="Lines" ItemName="_UuidValue" />
159 </ReadLinesFromFile>
160
161 <PropertyGroup>
162 <DefineConstants>$(DefineConstants);@(_UuidValue,';');</DefineConstants>
163 </PropertyGroup>
164 </Target>
165</Project>