Steve Dower | bb24087 | 2015-02-05 22:08:48 -0800 | [diff] [blame] | 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> |
Steve Dower | e4969f5 | 2015-02-28 19:53:50 -0800 | [diff] [blame] | 4 | <TargetName>$(OutputName)</TargetName> |
Steve Dower | bb24087 | 2015-02-05 22:08:48 -0800 | [diff] [blame] | 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> |
Steve Dower | c4b7600 | 2015-10-01 15:18:53 -0700 | [diff] [blame] | 14 | </PropertyGroup> |
| 15 | |
| 16 | <Import Project="wix.props" /> |
| 17 | <Import Project="..\..\PCBuild\tcltk.props" /> |
| 18 | |
| 19 | <PropertyGroup> |
Steve Dower | bb24087 | 2015-02-05 22:08:48 -0800 | [diff] [blame] | 20 | <!-- |
| 21 | This URI is used to generate the various GUIDs used by the installer. |
| 22 | Installers built with the same URI will upgrade each other or block |
| 23 | when attempting to downgrade. |
| 24 | |
| 25 | By default, this is the local computer name, which will produce |
| 26 | installers that do not interfere with other installers. Products |
| 27 | that intend to bundle Python should rebuild these modules with their |
| 28 | own URI to avoid conflicting with the official releases. |
| 29 | |
Steve Dower | c4b7600 | 2015-10-01 15:18:53 -0700 | [diff] [blame] | 30 | The official releases use "http://www.python.org/$(ArchName)" |
Steve Dower | bb24087 | 2015-02-05 22:08:48 -0800 | [diff] [blame] | 31 | |
| 32 | This is not the same as the DownloadUrl property used in the bundle |
| 33 | projects. |
| 34 | --> |
Steve Dower | c4b7600 | 2015-10-01 15:18:53 -0700 | [diff] [blame] | 35 | <ReleaseUri Condition="'$(ReleaseUri)' == ''">$(ComputerName)/$(ArchName)/</ReleaseUri> |
Steve Dower | bb24087 | 2015-02-05 22:08:48 -0800 | [diff] [blame] | 36 | <ReleaseUri Condition="!$(ReleaseUri.EndsWith(`/`))">$(ReleaseUri)/</ReleaseUri> |
| 37 | </PropertyGroup> |
| 38 | |
Steve Dower | bb24087 | 2015-02-05 22:08:48 -0800 | [diff] [blame] | 39 | |
| 40 | <ItemGroup> |
| 41 | <Compile Include="$(MSBuildThisFileDirectory)common.wxs" /> |
| 42 | <WxlTemplate Include="$(MSBuildThisFileDirectory)\*.wxl_template" /> |
| 43 | <WixExtension Include="WixUtilExtension"> |
| 44 | <HintPath>WixUtilExtension</HintPath> |
| 45 | <Name>WixUtilExtension</Name> |
| 46 | </WixExtension> |
| 47 | </ItemGroup> |
| 48 | |
| 49 | <PropertyGroup> |
Steve Dower | 4943749 | 2015-07-08 20:18:44 -0700 | [diff] [blame] | 50 | <IntermediateOutputPath>$(PySourcePath)PCBuild\obj\$(Configuration)_$(Platform)_Setup\$(OutputName)</IntermediateOutputPath> |
Steve Dower | bb24087 | 2015-02-05 22:08:48 -0800 | [diff] [blame] | 51 | <IntermediateOutputPath Condition="'$(OutputSuffix)' != ''">$(IntermediateOutputPath)_$(OutputSuffix)</IntermediateOutputPath> |
| 52 | <OutputPath Condition="'$(OutputPath)' == ''">$(BuildPath)</OutputPath> |
| 53 | <OutputPath Condition="!HasTrailingSlash($(OutputPath))">$(OutputPath)\</OutputPath> |
| 54 | <OutDir>$(OutputPath)</OutDir> |
| 55 | <ReuseCabinetCache>true</ReuseCabinetCache> |
Steve Dower | d28a8a9 | 2015-10-23 09:50:49 -0700 | [diff] [blame^] | 56 | <CRTRedist Condition="'$(CRTRedist)' == ''">$(ExternalsDir)\windows-installer\redist</CRTRedist> |
Steve Dower | 102f72c | 2015-03-24 21:25:16 -0700 | [diff] [blame] | 57 | <CRTRedist Condition="!Exists($(CRTRedist))"></CRTRedist> |
| 58 | <DocFilename>python$(MajorVersionNumber)$(MinorVersionNumber)$(MicroVersionNumber)$(ReleaseLevelName).chm</DocFilename> |
Steve Dower | bb24087 | 2015-02-05 22:08:48 -0800 | [diff] [blame] | 59 | |
Steve Dower | b85b4275 | 2015-07-08 22:43:48 -0700 | [diff] [blame] | 60 | <InstallerVersion>$(MajorVersionNumber).$(MinorVersionNumber).$(Field3Value).0</InstallerVersion> |
| 61 | </PropertyGroup> |
| 62 | |
| 63 | <PropertyGroup Condition="!$(BuildForRelease)"> |
| 64 | <RevisionNumber Condition="'$(RevisionNumber)' == ''">$([System.Math]::Floor($([System.DateTime]::Now.Subtract($([System.DateTime]::new(2001, 1, 1))).TotalDays)))</RevisionNumber> |
| 65 | <PythonVersion>$(MajorVersionNumber).$(MinorVersionNumber).$(MicroVersionNumber)dev$(RevisionNumber)</PythonVersion> |
| 66 | <InstallerVersion>$(MajorVersionNumber).$(MinorVersionNumber).$(RevisionNumber).0</InstallerVersion> |
Steve Dower | bb24087 | 2015-02-05 22:08:48 -0800 | [diff] [blame] | 67 | </PropertyGroup> |
| 68 | |
| 69 | <PropertyGroup> |
| 70 | <Bitness>32-bit</Bitness> |
| 71 | <Bitness Condition="$(Platform) == 'x64'">64-bit</Bitness> |
| 72 | <DefineConstants> |
| 73 | $(DefineConstants); |
Steve Dower | b85b4275 | 2015-07-08 22:43:48 -0700 | [diff] [blame] | 74 | Version=$(InstallerVersion); |
Steve Dower | bb24087 | 2015-02-05 22:08:48 -0800 | [diff] [blame] | 75 | ShortVersion=$(MajorVersionNumber).$(MinorVersionNumber); |
| 76 | LongVersion=$(PythonVersion); |
| 77 | MajorVersionNumber=$(MajorVersionNumber); |
| 78 | MinorVersionNumber=$(MinorVersionNumber); |
| 79 | UpgradeMinimumVersion=$(MajorVersionNumber).$(MinorVersionNumber).0.0; |
Steve Dower | bb24087 | 2015-02-05 22:08:48 -0800 | [diff] [blame] | 80 | NextMajorVersionNumber=$(MajorVersionNumber).$([msbuild]::Add($(MinorVersionNumber), 1)).0.0; |
Steve Dower | 102f72c | 2015-03-24 21:25:16 -0700 | [diff] [blame] | 81 | Bitness=$(Bitness); |
Steve Dower | bb24087 | 2015-02-05 22:08:48 -0800 | [diff] [blame] | 82 | PyDebugExt=$(PyDebugExt); |
Steve Dower | 4943749 | 2015-07-08 20:18:44 -0700 | [diff] [blame] | 83 | OptionalFeatureName=$(OutputName); |
Steve Dower | bb24087 | 2015-02-05 22:08:48 -0800 | [diff] [blame] | 84 | </DefineConstants> |
Steve Dower | bb24087 | 2015-02-05 22:08:48 -0800 | [diff] [blame] | 85 | <DefineConstants Condition="'$(CRTRedist)' != ''"> |
| 86 | $(DefineConstants);CRTRedist=$(CRTRedist); |
| 87 | </DefineConstants> |
Steve Dower | 2237bdc | 2015-07-16 16:33:55 -0700 | [diff] [blame] | 88 | <DefineConstants Condition="$(UseTestMarker) != 'true'"> |
Steve Dower | bb24087 | 2015-02-05 22:08:48 -0800 | [diff] [blame] | 89 | $(DefineConstants);TestPrefix=;FileExtension=py; |
| 90 | </DefineConstants> |
Steve Dower | 2237bdc | 2015-07-16 16:33:55 -0700 | [diff] [blame] | 91 | <DefineConstants Condition="$(UseTestMarker) == 'true'"> |
Steve Dower | bb24087 | 2015-02-05 22:08:48 -0800 | [diff] [blame] | 92 | $(DefineConstants);TestPrefix=x;FileExtension=px; |
| 93 | </DefineConstants> |
| 94 | <DefineConstants Condition="$(Platform) != 'x64'"> |
| 95 | $(DefineConstants);Suffix32=-32; |
| 96 | </DefineConstants> |
| 97 | <DefineConstants Condition="$(Platform) == 'x64'"> |
| 98 | $(DefineConstants);Suffix32=; |
| 99 | </DefineConstants> |
| 100 | </PropertyGroup> |
| 101 | |
| 102 | <ItemDefinitionGroup> |
| 103 | <InstallFiles> |
| 104 | <Group>generated_filelist</Group> |
| 105 | <Condition></Condition> |
| 106 | <DiskId></DiskId> |
| 107 | </InstallFiles> |
| 108 | <LinkerBindInputPaths> |
| 109 | <Visible>false</Visible> |
| 110 | </LinkerBindInputPaths> |
| 111 | </ItemDefinitionGroup> |
| 112 | <ItemGroup> |
Steve Dower | 148827c | 2015-10-14 10:40:09 -0700 | [diff] [blame] | 113 | <LinkerBindInputPaths Include="$(PGOBuildPath);$(BuildPath)"> |
| 114 | <BindName></BindName> |
| 115 | </LinkerBindInputPaths> |
| 116 | <LinkerBindInputPaths Include="$(PySourcePath)Doc\build\htmlhelp"> |
Steve Dower | bb24087 | 2015-02-05 22:08:48 -0800 | [diff] [blame] | 117 | <BindName></BindName> |
| 118 | </LinkerBindInputPaths> |
| 119 | <LinkerBindInputPaths Include="$(PySourcePath)"> |
| 120 | <BindName>src</BindName> |
| 121 | </LinkerBindInputPaths> |
| 122 | <LinkerBindInputPaths Include="$(tcltkDir)"> |
| 123 | <BindName>tcltk</BindName> |
| 124 | </LinkerBindInputPaths> |
| 125 | <LinkerBindInputPaths Include="$(CRTRedist)" Condition="'$(CRTRedist)' != ''"> |
Steve Dower | e4969f5 | 2015-02-28 19:53:50 -0800 | [diff] [blame] | 126 | <BindName>redist</BindName> |
| 127 | </LinkerBindInputPaths> |
Steve Dower | fcbe1df | 2015-09-08 21:39:01 -0700 | [diff] [blame] | 128 | <LinkerBindInputPaths Include="$(VS140COMNTOOLS)\..\..\VC\redist\$(Platform)\Microsoft.VC140.CRT"> |
| 129 | <BindName>redist</BindName> |
| 130 | </LinkerBindInputPaths> |
Steve Dower | bb24087 | 2015-02-05 22:08:48 -0800 | [diff] [blame] | 131 | </ItemGroup> |
| 132 | |
| 133 | <Target Name="_ValidateMsiProps" BeforeTargets="PrepareForBuild"> |
| 134 | <Error Text="Platform '$(Platform)' is not supported. Use 'x86' or 'x64'." Condition="$(Platform) != 'x86' and $(Platform) != 'x64'" /> |
| 135 | </Target> |
| 136 | |
| 137 | <ItemGroup> |
| 138 | <_Uuid Include="CoreUpgradeCode"> |
| 139 | <Uri>upgradecode</Uri> |
| 140 | </_Uuid> |
| 141 | <_Uuid Include="UpgradeCode"> |
| 142 | <Uri>upgradecode/$(OutputName)</Uri> |
| 143 | </_Uuid> |
| 144 | <_Uuid Include="InstallDirectoryGuidSeed"> |
| 145 | <Uri>installdirectoryseed</Uri> |
| 146 | </_Uuid> |
| 147 | <_Uuid Include="PythonExeComponentGuid"> |
| 148 | <Uri>python.exe</Uri> |
| 149 | </_Uuid> |
| 150 | <_Uuid Include="PythonwExeComponentGuid"> |
| 151 | <Uri>pythonw.exe</Uri> |
| 152 | </_Uuid> |
| 153 | <_Uuid Include="RemoveLib2to3PickleComponentGuid"> |
| 154 | <Uri>lib2to3/pickles</Uri> |
| 155 | </_Uuid> |
| 156 | </ItemGroup> |
| 157 | <Target Name="_GenerateGuids" AfterTargets="PrepareForBuild"> |
| 158 | <PropertyGroup> |
Steve Dower | c49de35 | 2015-03-08 15:29:39 -0700 | [diff] [blame] | 159 | <_Uuids>@(_Uuid->'("%(Identity)", "$(MajorVersionNumber).$(MinorVersionNumber)/%(Uri)")',',')</_Uuids> |
Steve Dower | c4b7600 | 2015-10-01 15:18:53 -0700 | [diff] [blame] | 160 | <_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> |
Steve Dower | bb24087 | 2015-02-05 22:08:48 -0800 | [diff] [blame] | 161 | </PropertyGroup> |
| 162 | |
Steve Dower | 19694ab | 2015-05-02 15:23:27 -0700 | [diff] [blame] | 163 | <Exec Command='"$(PythonExe)" -c "$(_GenerateCommand)" > "$(IntermediateOutputPath)$(OutputName)guids.txt"' |
| 164 | WorkingDirectory="$(MSBuildThisFileDirectory)" |
| 165 | IgnoreExitCode="false" /> |
Steve Dower | bb24087 | 2015-02-05 22:08:48 -0800 | [diff] [blame] | 166 | |
| 167 | <ReadLinesFromFile File="$(IntermediateOutputPath)$(OutputName)guids.txt"> |
| 168 | <Output TaskParameter="Lines" ItemName="_UuidValue" /> |
| 169 | </ReadLinesFromFile> |
| 170 | |
| 171 | <PropertyGroup> |
| 172 | <DefineConstants>$(DefineConstants);@(_UuidValue,';');</DefineConstants> |
| 173 | </PropertyGroup> |
| 174 | </Target> |
| 175 | </Project> |