rem This script is intended for building official releases of Python.\r
rem To use it to build alternative releases, you should clone this file\r
rem and modify the following three URIs.\r
-rem\r
-rem The first two will ensure that your release can be installed\r
-rem alongside an official Python release, while the second specifies\r
-rem the URL that will be used to download installation files. The\r
-rem files available from this URL *will* conflict with your installer.\r
-rem Trust me, you don't want them, even if it seems like a good idea.\r
\r
-set RELEASE_URI_X86=http://www.python.org/win32\r
-set RELEASE_URI_X64=http://www.python.org/amd64\r
-set DOWNLOAD_URL_BASE=https://www.python.org/ftp/python\r
-set DOWNLOAD_URL=\r
+rem These two will ensure that your release can be installed\r
+rem alongside an official Python release, by modifying the GUIDs used\r
+rem for all components.\r
+rem\r
+rem The following substitutions will be applied to the release URI:\r
+rem Variable Description Example\r
+rem {arch} architecture amd64, win32\r
+set RELEASE_URI=http://www.python.org/{arch}\r
+\r
+rem This is the URL that will be used to download installation files.\r
+rem The files available from the default URL *will* conflict with your\r
+rem installer. Trust me, you don't want them, even if it seems like a\r
+rem good idea.\r
+rem\r
+rem The following substitutions will be applied to the download URL:\r
+rem Variable Description Example\r
+rem {version} version number 3.5.0\r
+rem {arch} architecture amd64, win32\r
+rem {releasename} release name a1, b2, rc3 (or blank for final)\r
+rem {msi} MSI filename core.msi\r
+set DOWNLOAD_URL=https://www.python.org/ftp/python/{version}/{arch}{releasename}/{msi}\r
\r
set D=%~dp0\r
set PCBUILD=%D%..\..\PCBuild\\r
set BUILD_PLAT=Win32\r
set OUTDIR_PLAT=win32\r
set OBJDIR_PLAT=x86\r
- set RELEASE_URI=%RELEASE_URI_X86%\r
) ELSE (\r
call "%PCBUILD%env.bat" x86_amd64\r
set BUILD=%PCBUILD%amd64\\r
set BUILD_PLAT=x64\r
set OUTDIR_PLAT=amd64\r
set OBJDIR_PLAT=x64\r
- set RELEASE_URI=%RELEASE_URI_X64%\r
)\r
\r
if exist "%BUILD%en-us" (\r
echo --build (-b) Incrementally build Python rather than rebuilding\r
echo --skip-build (-B) Do not build Python (just do the installers)\r
echo --skip-doc (-D) Do not build documentation\r
-echo --download Specify the full download URL for MSIs (should include {2})\r
+echo --download Specify the full download URL for MSIs\r
echo --test Specify the test directory to run the installer tests\r
echo -h Display this help information\r
echo.\r
echo If no architecture is specified, all architectures will be built.\r
echo If --test is not specified, the installer tests are not run.\r
-echo.
\ No newline at end of file
+echo.\r
+echo The following substitutions will be applied to the download URL:\r
+echo Variable Description Example\r
+echo {version} version number 3.5.0\r
+echo {arch} architecture amd64, win32\r
+echo {releasename} release name a1, b2, rc3 (or blank for final)\r
+echo {msi} MSI filename core.msi\r
<OutputPath>$(OutputPath)en-us\</OutputPath>
<OutDir>$(OutputPath)</OutDir>
- <DownloadUrl Condition="'$(DownloadUrl)' == '' and '$(DownloadUrlBase)' != ''">$(DownloadUrlBase.TrimEnd(`/`))/$(MajorVersionNumber).$(MinorVersionNumber).$(MicroVersionNumber)/$(ArchName)$(ReleaseLevelName)/</DownloadUrl>
- <DefineConstants Condition="'$(DownloadUrl)' != ''">$(DefineConstants);DownloadUrl=$(DownloadUrl){2}</DefineConstants>
+ <!-- See Tools/msi/buildrelease.bat for help on configuring the download URL -->
+ <DownloadUrl Condition="'$(DownloadUrl)' == '' and '$(DownloadUrlBase)' != ''">$(DownloadUrlBase.TrimEnd(`/`))/{version}/{arch}{releasename}/{msi}</DownloadUrl>
+ <DefineConstants Condition="'$(DownloadUrl)' != ''">$(DefineConstants);DownloadUrl=$(DownloadUrl.Replace(`{version}`, `$(MajorVersionNumber).$(MinorVersionNumber).$(MicroVersionNumber)`).Replace(`{arch}`, `$(ArchName)`).Replace(`{releasename}`, `$(ReleaseName)`).Replace(`{msi}`, `{2}`))</DefineConstants>
<DefineConstants Condition="'$(DownloadUrl)' == ''">$(DefineConstants);DownloadUrl={2}</DefineConstants>
</PropertyGroup>
<Target Name="BuildLauncher" BeforeTargets="BeforeBuild" Condition="'$(RebuildAll)' != 'false'">
<!-- Build the launcher MSI using Exec rather than MSBuild -->
- <Exec Command='msbuild ..\launcher\launcher.wixproj /p:Platform=x86 /p:OutputPath="$(BuildPath.TrimEnd(`\`))" /p:OutputSuffix=$(Platform) /p:BuildForRelease=$(BuildForRelease) /p:UseTestMarker=$(UseTestMarker)'
+ <Exec Command='msbuild ..\launcher\launcher.wixproj /p:Platform=x86 /p:ReleaseUri="$(ReleaseUri)" /p:OutputPath="$(BuildPath.TrimEnd(`\`))" /p:OutputSuffix=$(Platform) /p:BuildForRelease=$(BuildForRelease) /p:UseTestMarker=$(UseTestMarker)'
ContinueOnError="false" />
</Target>
<PackageGroupRef Id="tools" />
<PackageGroupRef Id="tcltk" />
<PackageGroupRef Id="launcher" />
+ <PackageGroupRef Id="pip" />
+ <PackageGroupRef Id="packageinstall" />
<PackageGroupRef Id="postinstall" />
</Chain>
</Bundle>
DownloadUrl="$(var.DownloadUrl)"
ForcePerMachine="yes"
EnableFeatureSelection="yes"
+ Permanent="yes"
+ Visible="yes"
InstallCondition="(InstallAllUsers or InstallLauncherAllUsers) and Include_launcher" />
<MsiPackage Id="launcher_JustForMe"
DownloadUrl="$(var.DownloadUrl)"
ForcePerMachine="no"
EnableFeatureSelection="yes"
+ Permanent="yes"
+ Visible="yes"
InstallCondition="not (InstallAllUsers or InstallLauncherAllUsers) and Include_launcher" />
</PackageGroup>
</Fragment>
--- /dev/null
+<?xml version="1.0"?>
+<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
+ <Fragment>
+ <PackageGroup Id="packageinstall">
+ <!--
+ This is an example of installing a package using pip as part of main install.
+
+ For a network-only install, remove the Payload element and change the install
+ command to specify the package and (optionally) version specifier.
+
+ <ExePackage Id="requests"
+ SourceFile="py.exe"
+ Compressed="yes"
+ DisplayName="!(loc.CompileAllDescription)"
+ InstallCommand='-$(var.ShortVersion)$(var.Suffix32) -m pip install requests-2.7.0-py2.py3-none-any.whl'
+ UninstallCommand='-$(var.ShortVersion)$(var.Suffix32) -m pip uninstall -y requests'
+ Vital="no"
+ InstallCondition="Include_pip and not LauncherOnly">
+ <Payload SourceFile="requests-2.7.0-py2.py3-none-any.whl"
+ Compressed="$(var.CompressMSI)"
+ DownloadUrl="$(var.DownloadUrl)" />
+ </ExePackage>
+ -->
+ </PackageGroup>
+ </Fragment>
+</Wix>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0"?>
+<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
+ <Fragment>
+ <PackageGroup Id="pip">
+ <MsiPackage Id="pip_AllUsers"
+ SourceFile="pip.msi"
+ Compressed="$(var.CompressMSI)"
+ DownloadUrl="$(var.DownloadUrl)"
+ ForcePerMachine="yes"
+ InstallCondition="InstallAllUsers and Include_pip and not LauncherOnly">
+ <MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
+ <MsiProperty Name="OPTIONALFEATURESREGISTRYKEY" Value="[OptionalFeaturesRegistryKey]" />
+ </MsiPackage>
+ <MsiPackage Id="pip_JustForMe"
+ SourceFile="pip.msi"
+ Compressed="$(var.CompressMSI)"
+ DownloadUrl="$(var.DownloadUrl)"
+ ForcePerMachine="no"
+ InstallCondition="not InstallAllUsers and Include_pip and not LauncherOnly">
+ <MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
+ <MsiProperty Name="OPTIONALFEATURESREGISTRYKEY" Value="[OptionalFeaturesRegistryKey]" />
+ </MsiPackage>
+ </PackageGroup>
+ </Fragment>
+</Wix>
\ No newline at end of file
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<PackageGroup Id="postinstall">
- <MsiPackage Id="pip_AllUsers"
- SourceFile="pip.msi"
- Compressed="$(var.CompressMSI)"
- DownloadUrl="$(var.DownloadUrl)"
- ForcePerMachine="yes"
- InstallCondition="InstallAllUsers and Include_pip and not LauncherOnly">
- <MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
- <MsiProperty Name="OPTIONALFEATURESREGISTRYKEY" Value="[OptionalFeaturesRegistryKey]" />
- </MsiPackage>
- <MsiPackage Id="pip_JustForMe"
- SourceFile="pip.msi"
- Compressed="$(var.CompressMSI)"
- DownloadUrl="$(var.DownloadUrl)"
- ForcePerMachine="no"
- InstallCondition="not InstallAllUsers and Include_pip and not LauncherOnly">
- <MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
- <MsiProperty Name="OPTIONALFEATURESREGISTRYKEY" Value="[OptionalFeaturesRegistryKey]" />
- </MsiPackage>
-
<MsiPackage Id="path_AllUsers"
SourceFile="path.msi"
Compressed="$(var.CompressMSI)"
<Configuration Condition="'$(Configuration)' == ''">Release</Configuration>
<Platform Condition="'$(Platform)' == ''">x86</Platform>
<InstallScope Condition="'$(InstallScope)' != 'perMachine'">perUser</InstallScope>
+ </PropertyGroup>
+
+ <Import Project="wix.props" />
+ <Import Project="..\..\PCBuild\tcltk.props" />
+
+ <PropertyGroup>
<!--
This URI is used to generate the various GUIDs used by the installer.
Installers built with the same URI will upgrade each other or block
that intend to bundle Python should rebuild these modules with their
own URI to avoid conflicting with the official releases.
- The official releases are built with http://www.python.org/.
+ The official releases use "http://www.python.org/$(ArchName)"
This is not the same as the DownloadUrl property used in the bundle
projects.
-->
- <ReleaseUri Condition="'$(ReleaseUri)' == ''">$(ComputerName)</ReleaseUri>
+ <ReleaseUri Condition="'$(ReleaseUri)' == ''">$(ComputerName)/$(ArchName)/</ReleaseUri>
<ReleaseUri Condition="!$(ReleaseUri.EndsWith(`/`))">$(ReleaseUri)/</ReleaseUri>
</PropertyGroup>
- <Import Project="wix.props" />
- <Import Project="..\..\PCBuild\tcltk.props" />
<ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)common.wxs" />
<Target Name="_GenerateGuids" AfterTargets="PrepareForBuild">
<PropertyGroup>
<_Uuids>@(_Uuid->'("%(Identity)", "$(MajorVersionNumber).$(MinorVersionNumber)/%(Uri)")',',')</_Uuids>
- <_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>
+ <_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>
</PropertyGroup>
<Exec Command='"$(PythonExe)" -c "$(_GenerateCommand)" > "$(IntermediateOutputPath)$(OutputName)guids.txt"'