• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?xml version="1.0" encoding="utf-8"?>
2<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" TreatAsLocalProperty="ReleaseUri">
3    <PropertyGroup>
4        <TargetName>$(OutputName)</TargetName>
5        <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        <_MakeCatCommand Condition="'$(_MakeCatCommand)' == ''">makecat</_MakeCatCommand>
15    </PropertyGroup>
16
17    <Import Project="wix.props" />
18    <Import Project="..\..\PCbuild\tcltk.props" />
19
20    <PropertyGroup>
21        <!--
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
31        The official releases use "http://www.python.org/$(ArchName)"
32
33        This is not the same as the DownloadUrl property used in the bundle
34        projects.
35        -->
36        <ReleaseUri Condition="'$(ReleaseUri)' == ''">$(ComputerName)/$(ArchName)/</ReleaseUri>
37        <ReleaseUri Condition="!$(ReleaseUri.EndsWith(`/`))">$(ReleaseUri)/</ReleaseUri>
38    </PropertyGroup>
39
40
41    <ItemGroup>
42        <Compile Include="$(MSBuildThisFileDirectory)common.wxs" />
43        <WxlTemplate Include="$(MSBuildThisFileDirectory)\*.wxl_template" Condition="$(IgnoreCommonWxlTemplates) != 'true'" />
44        <WixExtension Include="WixUtilExtension">
45            <HintPath>WixUtilExtension</HintPath>
46            <Name>WixUtilExtension</Name>
47        </WixExtension>
48    </ItemGroup>
49
50    <PropertyGroup>
51        <IntermediateOutputPath>$(Py_IntDir)\$(MajorVersionNumber)$(MinorVersionNumber)$(ArchName)_$(Configuration)\msi_$(OutputName)</IntermediateOutputPath>
52        <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>
57        <CRTRedist Condition="'$(CRTRedist)' == ''">$(ExternalsDir)\windows-installer\redist-1\$(Platform)</CRTRedist>
58        <CRTRedist>$([System.IO.Path]::GetFullPath($(CRTRedist)))</CRTRedist>
59        <DocFilename>python$(MajorVersionNumber)$(MinorVersionNumber)$(MicroVersionNumber)$(ReleaseLevelName).chm</DocFilename>
60
61        <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>
68    </PropertyGroup>
69
70    <PropertyGroup>
71        <Bitness>32-bit</Bitness>
72        <Bitness Condition="$(Platform) == 'x64'">64-bit</Bitness>
73        <PlatformArchitecture>32bit</PlatformArchitecture>
74        <PlatformArchitecture Condition="$(Platform) == 'x64'">64bit</PlatformArchitecture>
75        <DefineConstants>
76            $(DefineConstants);
77            Version=$(InstallerVersion);
78            ShortVersion=$(MajorVersionNumber).$(MinorVersionNumber);
79            LongVersion=$(PythonVersion);
80            MajorVersionNumber=$(MajorVersionNumber);
81            MinorVersionNumber=$(MinorVersionNumber);
82            UpgradeMinimumVersion=$(MajorVersionNumber).$(MinorVersionNumber).0.0;
83            NextMajorVersionNumber=$(MajorVersionNumber).$([msbuild]::Add($(MinorVersionNumber), 1)).0.0;
84            Bitness=$(Bitness);
85            PlatformArchitecture=$(PlatformArchitecture);
86            PyDebugExt=$(PyDebugExt);
87            PyArchExt=$(PyArchExt);
88            PyTestExt=$(PyTestExt);
89            OptionalFeatureName=$(OutputName);
90        </DefineConstants>
91        <DefineConstants Condition="'$(CRTRedist)' != ''">
92            $(DefineConstants);CRTRedist=$(CRTRedist);
93        </DefineConstants>
94        <DefineConstants Condition="$(Platform) != 'x64'">
95            $(DefineConstants);Suffix32=-32;ssltag=-1_1;
96        </DefineConstants>
97        <DefineConstants Condition="$(Platform) == 'x64'">
98            $(DefineConstants);Suffix32=;ssltag=-1_1-x64;
99        </DefineConstants>
100    </PropertyGroup>
101
102    <ItemDefinitionGroup>
103        <InstallFiles>
104            <Group>generated_filelist</Group>
105            <Condition></Condition>
106            <DiskId></DiskId>
107            <IncludeInCat>false</IncludeInCat>
108        </InstallFiles>
109        <LinkerBindInputPaths>
110            <Visible>false</Visible>
111        </LinkerBindInputPaths>
112    </ItemDefinitionGroup>
113    <ItemGroup>
114        <LinkerBindInputPaths Include="$(PGOBuildPath);$(BuildPath)">
115            <BindName></BindName>
116        </LinkerBindInputPaths>
117        <LinkerBindInputPaths Include="$(PySourcePath)Doc\build\htmlhelp">
118            <BindName></BindName>
119        </LinkerBindInputPaths>
120        <LinkerBindInputPaths Include="$(PySourcePath)">
121            <BindName>src</BindName>
122        </LinkerBindInputPaths>
123        <LinkerBindInputPaths Include="$(tcltkDir)">
124            <BindName>tcltk</BindName>
125        </LinkerBindInputPaths>
126        <LinkerBindInputPaths Include="$(CRTRedist)">
127            <BindName>redist</BindName>
128        </LinkerBindInputPaths>
129        <LinkerBindInputPaths Include="$(BuildPath32)">
130            <BindName>build32</BindName>
131        </LinkerBindInputPaths>
132        <LinkerBindInputPaths Include="$(BuildPath64)">
133            <BindName>build64</BindName>
134        </LinkerBindInputPaths>
135    </ItemGroup>
136
137    <Target Name="_ValidateMsiProps" BeforeTargets="PrepareForBuild">
138        <Error Text="Platform '$(Platform)' is not supported. Use 'x86' or 'x64'." Condition="$(Platform) != 'x86' and $(Platform) != 'x64'" />
139    </Target>
140
141    <ItemGroup>
142        <_Uuid Include="CoreUpgradeCode">
143            <Uri>upgradecode</Uri>
144        </_Uuid>
145        <_Uuid Include="UpgradeCode">
146            <Uri>upgradecode/$(OutputName)</Uri>
147        </_Uuid>
148        <_Uuid Include="InstallDirectoryGuidSeed">
149            <Uri>installdirectoryseed</Uri>
150        </_Uuid>
151        <_Uuid Include="PythonExeComponentGuid">
152            <Uri>python.exe</Uri>
153        </_Uuid>
154        <_Uuid Include="PythonwExeComponentGuid">
155            <Uri>pythonw.exe</Uri>
156        </_Uuid>
157        <_Uuid Include="RemoveLib2to3PickleComponentGuid">
158            <Uri>lib2to3/pickles</Uri>
159        </_Uuid>
160        <_Uuid Include="CommonPythonRegComponentGuid">
161            <Uri>registry</Uri>
162        </_Uuid>
163        <_Uuid Include="PythonRegComponentGuid">
164            <Uri>registry/$(OutputName)</Uri>
165        </_Uuid>
166    </ItemGroup>
167    <Target Name="_GenerateGuids" AfterTargets="PrepareForBuild" Condition="$(TargetName) != 'launcher'">
168        <PropertyGroup>
169            <_Uuids>@(_Uuid->'("%(Identity)", "$(MajorVersionNumber).$(MinorVersionNumber)/%(Uri)")',',')</_Uuids>
170            <_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>
171        </PropertyGroup>
172
173        <Exec Command='"$(PythonExe)" -c "$(_GenerateCommand)" &gt; "$(IntermediateOutputPath)$(OutputName)guids.txt"'
174              WorkingDirectory="$(MSBuildThisFileDirectory)"
175              IgnoreExitCode="false" />
176
177        <ReadLinesFromFile File="$(IntermediateOutputPath)$(OutputName)guids.txt">
178            <Output TaskParameter="Lines" ItemName="_UuidValue" />
179        </ReadLinesFromFile>
180
181        <PropertyGroup>
182            <DefineConstants>$(DefineConstants);@(_UuidValue,';');</DefineConstants>
183        </PropertyGroup>
184    </Target>
185</Project>