| 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 |
<SkipCopySSLDLL>true</SkipCopySSLDLL> |
| 16 |
</PropertyGroup> |
| 17 |
|
| 18 |
<Import Project="wix.props" /> |
| 19 |
<Import Project="..\..\PCbuild\openssl.props" /> |
| 20 |
<Import Project="..\..\PCbuild\tcltk.props" /> |
| 21 |
|
| 22 |
<PropertyGroup> |
| 23 |
<!-- |
| 24 |
This URI is used to generate the various GUIDs used by the installer. |
| 25 |
Installers built with the same URI will upgrade each other or block |
| 26 |
when attempting to downgrade. |
| 27 |
|
| 28 |
By default, this is the local computer name, which will produce |
| 29 |
installers that do not interfere with other installers. Products |
| 30 |
that intend to bundle Python should rebuild these modules with their |
| 31 |
own URI to avoid conflicting with the official releases. |
| 32 |
|
| 33 |
The official releases use "https://www.python.org/$(ArchName)" |
| 34 |
|
| 35 |
This is not the same as the DownloadUrl property used in the bundle |
| 36 |
projects. |
| 37 |
--> |
| 38 |
<ReleaseUri Condition="'$(ReleaseUri)' == ''">$(ComputerName)/$(ArchName)/</ReleaseUri> |
| 39 |
<ReleaseUri Condition="!$(ReleaseUri.EndsWith(`/`))">$(ReleaseUri)/</ReleaseUri> |
| 40 |
</PropertyGroup> |
| 41 |
|
| 42 |
|
| 43 |
<ItemGroup> |
| 44 |
<Compile Include="$(MSBuildThisFileDirectory)common.wxs" /> |
| 45 |
<WxlTemplate Include="$(MSBuildThisFileDirectory)\*.wxl_template" Condition="$(IgnoreCommonWxlTemplates) != 'true'" /> |
| 46 |
<WixExtension Include="WixUtilExtension"> |
| 47 |
<HintPath>WixUtilExtension</HintPath> |
| 48 |
<Name>WixUtilExtension</Name> |
| 49 |
</WixExtension> |
| 50 |
</ItemGroup> |
| 51 |
|
| 52 |
<PropertyGroup> |
| 53 |
<IntermediateOutputPath>$(Py_IntDir)\$(MajorVersionNumber)$(MinorVersionNumber)$(ArchName)_$(Configuration)\msi_$(OutputName)</IntermediateOutputPath> |
| 54 |
<IntermediateOutputPath Condition="'$(OutputSuffix)' != ''">$(IntermediateOutputPath)_$(OutputSuffix)</IntermediateOutputPath> |
| 55 |
<OutputPath Condition="'$(OutputPath)' == ''">$(BuildPath)</OutputPath> |
| 56 |
<OutputPath Condition="!HasTrailingSlash($(OutputPath))">$(OutputPath)\</OutputPath> |
| 57 |
<OutDir>$(OutputPath)</OutDir> |
| 58 |
<ReuseCabinetCache>true</ReuseCabinetCache> |
| 59 |
<CRTRedist Condition="'$(CRTRedist)' == ''">$(ExternalsDir)\windows-installer\redist-1\$(Platform)</CRTRedist> |
| 60 |
<CRTRedist>$([System.IO.Path]::GetFullPath($(CRTRedist)))</CRTRedist> |
| 61 |
<TclTkLibraryDir Condition="$(TclTkLibraryDir) == ''">$(tcltkDir)lib</TclTkLibraryDir> |
| 62 |
<DocFilename>python$(MajorVersionNumber)$(MinorVersionNumber)$(MicroVersionNumber)$(ReleaseLevelName).chm</DocFilename> |
| 63 |
|
| 64 |
<InstallerVersion>$(MajorVersionNumber).$(MinorVersionNumber).$(Field3Value).0</InstallerVersion> |
| 65 |
</PropertyGroup> |
| 66 |
|
| 67 |
<PropertyGroup> |
| 68 |
<IncludeFreethreaded Condition="$(IncludeFreethreaded) != 'true'">false</IncludeFreethreaded> |
| 69 |
</PropertyGroup> |
| 70 |
|
| 71 |
<PropertyGroup Condition="!$(BuildForRelease)"> |
| 72 |
<RevisionNumber Condition="'$(RevisionNumber)' == ''">$([System.Math]::Floor($([System.DateTime]::Now.Subtract($([System.DateTime]::new(2001, 1, 1))).TotalDays)))</RevisionNumber> |
| 73 |
<PythonVersion>$(MajorVersionNumber).$(MinorVersionNumber).$(MicroVersionNumber)dev$(RevisionNumber)</PythonVersion> |
| 74 |
<InstallerVersion>$(MajorVersionNumber).$(MinorVersionNumber).$(RevisionNumber).0</InstallerVersion> |
| 75 |
</PropertyGroup> |
| 76 |
|
| 77 |
<PropertyGroup> |
| 78 |
<Bitness>32-bit</Bitness> |
| 79 |
<Bitness Condition="$(Platform) == 'x64'">64-bit</Bitness> |
| 80 |
<Bitness Condition="$(Platform) == 'ARM64'">ARM64</Bitness> |
| 81 |
<PlatformArchitecture>32bit</PlatformArchitecture> |
| 82 |
<PlatformArchitecture Condition="$(Platform) == 'x64'">64bit</PlatformArchitecture> |
| 83 |
<PlatformArchitecture Condition="$(Platform) == 'ARM64'">ARM64</PlatformArchitecture> |
| 84 |
<DefineConstants> |
| 85 |
$(DefineConstants); |
| 86 |
Version=$(InstallerVersion); |
| 87 |
ShortVersion=$(MajorVersionNumber).$(MinorVersionNumber); |
| 88 |
LongVersion=$(PythonVersion); |
| 89 |
MajorVersionNumber=$(MajorVersionNumber); |
| 90 |
MinorVersionNumber=$(MinorVersionNumber); |
| 91 |
UpgradeMinimumVersion=$(MajorVersionNumber).$(MinorVersionNumber).0.0; |
| 92 |
NextMajorVersionNumber=$(MajorVersionNumber).$([msbuild]::Add($(MinorVersionNumber), 1)).0.0; |
| 93 |
Bitness=$(Bitness); |
| 94 |
PlatformArchitecture=$(PlatformArchitecture); |
| 95 |
PyDebugExt=$(PyDebugExt); |
| 96 |
PyArchExt=$(PyArchExt); |
| 97 |
PyTestExt=$(PyTestExt); |
| 98 |
PydTag=$(PydTag); |
| 99 |
FreethreadedPydTag=$(FreethreadedPydTag); |
| 100 |
OptionalFeatureName=$(OutputName); |
| 101 |
ssltag=$(OpenSSLDLLSuffix); |
| 102 |
Suffix32=$(PyArchExt); |
| 103 |
IncludeFreethreaded=$(IncludeFreethreaded); |
| 104 |
</DefineConstants> |
| 105 |
<DefineConstants Condition="'$(CRTRedist)' != ''"> |
| 106 |
$(DefineConstants);CRTRedist=$(CRTRedist); |
| 107 |
</DefineConstants> |
| 108 |
</PropertyGroup> |
| 109 |
|
| 110 |
<ItemDefinitionGroup> |
| 111 |
<InstallFiles> |
| 112 |
<Group>generated_filelist</Group> |
| 113 |
<Condition></Condition> |
| 114 |
<DiskId></DiskId> |
| 115 |
<IncludeInCat>false</IncludeInCat> |
| 116 |
</InstallFiles> |
| 117 |
<LinkerBindInputPaths> |
| 118 |
<Visible>false</Visible> |
| 119 |
</LinkerBindInputPaths> |
| 120 |
</ItemDefinitionGroup> |
| 121 |
<ItemGroup> |
| 122 |
<LinkerBindInputPaths Include="$(PGOBuildPath);$(BuildPath)"> |
| 123 |
<BindName></BindName> |
| 124 |
</LinkerBindInputPaths> |
| 125 |
<LinkerBindInputPaths Include="$(PySourcePath)"> |
| 126 |
<BindName>src</BindName> |
| 127 |
</LinkerBindInputPaths> |
| 128 |
<LinkerBindInputPaths Include="$(TclTkLibraryDir)"> |
| 129 |
<BindName>tcltk</BindName> |
| 130 |
</LinkerBindInputPaths> |
| 131 |
<LinkerBindInputPaths Include="$(CRTRedist)"> |
| 132 |
<BindName>redist</BindName> |
| 133 |
</LinkerBindInputPaths> |
| 134 |
<LinkerBindInputPaths Include="$(BuildPath32)"> |
| 135 |
<BindName>build32</BindName> |
| 136 |
</LinkerBindInputPaths> |
| 137 |
<LinkerBindInputPaths Include="$(BuildPath64)"> |
| 138 |
<BindName>build64</BindName> |
| 139 |
</LinkerBindInputPaths> |
| 140 |
<LinkerBindInputPaths Include="$(BuildPathARM64)"> |
| 141 |
<BindName>buildarm64</BindName> |
| 142 |
</LinkerBindInputPaths> |
| 143 |
</ItemGroup> |
| 144 |
|
| 145 |
<Target Name="_ValidateMsiProps" BeforeTargets="PrepareForBuild"> |
| 146 |
<Error Text="Platform '$(Platform)' is not supported. Use 'x86', 'x64' or 'ARM64'." |
| 147 |
Condition="$(Platform) != 'x86' and $(Platform) != 'x64' and $(Platform) != 'ARM64'" /> |
| 148 |
</Target> |
| 149 |
|
| 150 |
<ItemGroup> |
| 151 |
<_Uuid Include="CoreUpgradeCode"> |
| 152 |
<Uri>upgradecode</Uri> |
| 153 |
</_Uuid> |
| 154 |
<_Uuid Include="UpgradeCode"> |
| 155 |
<Uri>upgradecode/$(OutputName)</Uri> |
| 156 |
</_Uuid> |
| 157 |
<_Uuid Include="InstallDirectoryGuidSeed"> |
| 158 |
<Uri>installdirectoryseed</Uri> |
| 159 |
</_Uuid> |
| 160 |
<_Uuid Include="PythonExeComponentGuid"> |
| 161 |
<Uri>python.exe</Uri> |
| 162 |
</_Uuid> |
| 163 |
<_Uuid Include="PythonwExeComponentGuid"> |
| 164 |
<Uri>pythonw.exe</Uri> |
| 165 |
</_Uuid> |
| 166 |
<_Uuid Include="CommonPythonRegComponentGuid"> |
| 167 |
<Uri>registry</Uri> |
| 168 |
</_Uuid> |
| 169 |
<_Uuid Include="PythonRegComponentGuid"> |
| 170 |
<Uri>registry/$(OutputName)</Uri> |
| 171 |
</_Uuid> |
| 172 |
<_Uuid Include="FreethreadedPythonExeComponentGuid" Condition="$(IncludeFreethreaded)"> |
| 173 |
<Uri>freethreaded/python.exe</Uri> |
| 174 |
</_Uuid> |
| 175 |
<_Uuid Include="FreethreadedPythonwExeComponentGuid" Condition="$(IncludeFreethreaded)"> |
| 176 |
<Uri>freethreaded/pythonw.exe</Uri> |
| 177 |
</_Uuid> |
| 178 |
</ItemGroup> |
| 179 |
<Target Name="_GenerateGuids" |
| 180 |
AfterTargets="PrepareForBuild" |
| 181 |
DependsOnTargets="FindPythonForBuild" |
| 182 |
Condition="$(TargetName) != 'launcher'"> |
| 183 |
<PropertyGroup> |
| 184 |
<_Uuids>@(_Uuid->'("%(Identity)", "$(MajorVersionNumber).$(MinorVersionNumber)/%(Uri)")',',')</_Uuids> |
| 185 |
<_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> |
| 186 |
</PropertyGroup> |
| 187 |
|
| 188 |
<Exec Command='$(PythonForBuild) -c "$(_GenerateCommand)" > "$(IntermediateOutputPath)$(OutputName)guids.txt"' |
| 189 |
WorkingDirectory="$(MSBuildThisFileDirectory)" |
| 190 |
IgnoreExitCode="false" /> |
| 191 |
|
| 192 |
<ReadLinesFromFile File="$(IntermediateOutputPath)$(OutputName)guids.txt"> |
| 193 |
<Output TaskParameter="Lines" ItemName="_UuidValue" /> |
| 194 |
</ReadLinesFromFile> |
| 195 |
|
| 196 |
<PropertyGroup> |
| 197 |
<DefineConstants>$(DefineConstants);@(_UuidValue,';');</DefineConstants> |
| 198 |
</PropertyGroup> |
| 199 |
</Target> |
| 200 |
</Project> |