• 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 "https://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        <TclTkLibraryDir Condition="$(TclTkLibraryDir) == ''">$(tcltkDir)lib</TclTkLibraryDir>
60        <DocFilename>python$(MajorVersionNumber)$(MinorVersionNumber)$(MicroVersionNumber)$(ReleaseLevelName).chm</DocFilename>
61
62        <InstallerVersion>$(MajorVersionNumber).$(MinorVersionNumber).$(Field3Value).0</InstallerVersion>
63    </PropertyGroup>
64
65    <PropertyGroup Condition="!$(BuildForRelease)">
66        <RevisionNumber Condition="'$(RevisionNumber)' == ''">$([System.Math]::Floor($([System.DateTime]::Now.Subtract($([System.DateTime]::new(2001, 1, 1))).TotalDays)))</RevisionNumber>
67        <PythonVersion>$(MajorVersionNumber).$(MinorVersionNumber).$(MicroVersionNumber)dev$(RevisionNumber)</PythonVersion>
68        <InstallerVersion>$(MajorVersionNumber).$(MinorVersionNumber).$(RevisionNumber).0</InstallerVersion>
69    </PropertyGroup>
70
71    <PropertyGroup>
72        <Bitness>32-bit</Bitness>
73        <Bitness Condition="$(Platform) == 'x64'">64-bit</Bitness>
74        <PlatformArchitecture>32bit</PlatformArchitecture>
75        <PlatformArchitecture Condition="$(Platform) == 'x64'">64bit</PlatformArchitecture>
76        <DefineConstants>
77            $(DefineConstants);
78            Version=$(InstallerVersion);
79            ShortVersion=$(MajorVersionNumber).$(MinorVersionNumber);
80            LongVersion=$(PythonVersion);
81            MajorVersionNumber=$(MajorVersionNumber);
82            MinorVersionNumber=$(MinorVersionNumber);
83            UpgradeMinimumVersion=$(MajorVersionNumber).$(MinorVersionNumber).0.0;
84            NextMajorVersionNumber=$(MajorVersionNumber).$([msbuild]::Add($(MinorVersionNumber), 1)).0.0;
85            Bitness=$(Bitness);
86            PlatformArchitecture=$(PlatformArchitecture);
87            PyDebugExt=$(PyDebugExt);
88            PyArchExt=$(PyArchExt);
89            PyTestExt=$(PyTestExt);
90            OptionalFeatureName=$(OutputName);
91            ssltag=-1_1;
92        </DefineConstants>
93        <DefineConstants Condition="'$(CRTRedist)' != ''">
94            $(DefineConstants);CRTRedist=$(CRTRedist);
95        </DefineConstants>
96        <DefineConstants Condition="$(Platform) != 'x64'">
97            $(DefineConstants);Suffix32=-32;
98        </DefineConstants>
99        <DefineConstants Condition="$(Platform) == 'x64'">
100            $(DefineConstants);Suffix32=;
101        </DefineConstants>
102    </PropertyGroup>
103
104    <ItemDefinitionGroup>
105        <InstallFiles>
106            <Group>generated_filelist</Group>
107            <Condition></Condition>
108            <DiskId></DiskId>
109            <IncludeInCat>false</IncludeInCat>
110        </InstallFiles>
111        <LinkerBindInputPaths>
112            <Visible>false</Visible>
113        </LinkerBindInputPaths>
114    </ItemDefinitionGroup>
115    <ItemGroup>
116        <LinkerBindInputPaths Include="$(PGOBuildPath);$(BuildPath)">
117            <BindName></BindName>
118        </LinkerBindInputPaths>
119        <LinkerBindInputPaths Include="$(PySourcePath)Doc\build\htmlhelp">
120            <BindName></BindName>
121        </LinkerBindInputPaths>
122        <LinkerBindInputPaths Include="$(PySourcePath)">
123            <BindName>src</BindName>
124        </LinkerBindInputPaths>
125        <LinkerBindInputPaths Include="$(TclTkLibraryDir)">
126            <BindName>tcltk</BindName>
127        </LinkerBindInputPaths>
128        <LinkerBindInputPaths Include="$(CRTRedist)">
129            <BindName>redist</BindName>
130        </LinkerBindInputPaths>
131        <LinkerBindInputPaths Include="$(BuildPath32)">
132            <BindName>build32</BindName>
133        </LinkerBindInputPaths>
134        <LinkerBindInputPaths Include="$(BuildPath64)">
135            <BindName>build64</BindName>
136        </LinkerBindInputPaths>
137    </ItemGroup>
138
139    <Target Name="_ValidateMsiProps" BeforeTargets="PrepareForBuild">
140        <Error Text="Platform '$(Platform)' is not supported. Use 'x86' or 'x64'." Condition="$(Platform) != 'x86' and $(Platform) != 'x64'" />
141    </Target>
142
143    <ItemGroup>
144        <_Uuid Include="CoreUpgradeCode">
145            <Uri>upgradecode</Uri>
146        </_Uuid>
147        <_Uuid Include="UpgradeCode">
148            <Uri>upgradecode/$(OutputName)</Uri>
149        </_Uuid>
150        <_Uuid Include="InstallDirectoryGuidSeed">
151            <Uri>installdirectoryseed</Uri>
152        </_Uuid>
153        <_Uuid Include="PythonExeComponentGuid">
154            <Uri>python.exe</Uri>
155        </_Uuid>
156        <_Uuid Include="PythonwExeComponentGuid">
157            <Uri>pythonw.exe</Uri>
158        </_Uuid>
159        <_Uuid Include="RemoveLib2to3PickleComponentGuid">
160            <Uri>lib2to3/pickles</Uri>
161        </_Uuid>
162        <_Uuid Include="CommonPythonRegComponentGuid">
163            <Uri>registry</Uri>
164        </_Uuid>
165        <_Uuid Include="PythonRegComponentGuid">
166            <Uri>registry/$(OutputName)</Uri>
167        </_Uuid>
168    </ItemGroup>
169    <Target Name="_GenerateGuids" AfterTargets="PrepareForBuild" Condition="$(TargetName) != 'launcher'">
170        <PropertyGroup>
171            <_Uuids>@(_Uuid->'("%(Identity)", "$(MajorVersionNumber).$(MinorVersionNumber)/%(Uri)")',',')</_Uuids>
172            <_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>
173        </PropertyGroup>
174
175        <Exec Command='"$(PythonExe)" -c "$(_GenerateCommand)" &gt; "$(IntermediateOutputPath)$(OutputName)guids.txt"'
176              WorkingDirectory="$(MSBuildThisFileDirectory)"
177              IgnoreExitCode="false" />
178
179        <ReadLinesFromFile File="$(IntermediateOutputPath)$(OutputName)guids.txt">
180            <Output TaskParameter="Lines" ItemName="_UuidValue" />
181        </ReadLinesFromFile>
182
183        <PropertyGroup>
184            <DefineConstants>$(DefineConstants);@(_UuidValue,';');</DefineConstants>
185        </PropertyGroup>
186    </Target>
187</Project>