Issue #23260: Update Windows installer

This commit is contained in:
Steve Dower 2015-02-05 22:08:48 -08:00
parent 7425f36ee7
commit bb24087a2c
133 changed files with 7036 additions and 4991 deletions

1
.gitignore vendored
View File

@ -82,5 +82,6 @@ TAGS
coverage/
externals/
htmlcov/
Tools/msi/obj
Tools/ssl/amd64
Tools/ssl/win32

View File

@ -90,5 +90,6 @@ htmlcov/
*.gcno
*.gcov
coverage.info
Tools/msi/obj
Tools/ssl/amd64
Tools/ssl/win32

View File

@ -8,11 +8,15 @@ set this=%~n0
if "%SPHINXBUILD%" EQU "" set SPHINXBUILD=sphinx-build
if "%PYTHON%" EQU "" set PYTHON=py
if DEFINED ProgramFiles(x86) set _PRGMFLS=%ProgramFiles(x86)%
if NOT DEFINED ProgramFiles(x86) set _PRGMFLS=%ProgramFiles%
if "%HTMLHELP%" EQU "" set HTMLHELP=%_PRGMFLS%\HTML Help Workshop\hhc.exe
if "%HTMLHELP%" EQU "" (
where hhc 2>nul >"%TEMP%\hhc.loc"
if errorlevel 1 dir "..\externals\hhc.exe" /s/b > "%TEMP%\hhc.loc"
if errorlevel 1 echo Cannot find HHC on PATH or in externals & exit /B 1
set /P HTMLHELP= < "%TEMP%\hhc.loc"
del "%TEMP%\hhc.loc"
)
if "%DISTVERSION%" EQU "" for /f "usebackq" %%v in (`%PYTHON% tools/patchlevel.py`) do set DISTVERSION=%%v
if "%DISTVERSION%" EQU "" for /f "usebackq" %%v in (`%PYTHON% tools/extensions/patchlevel.py`) do set DISTVERSION=%%v
if "%BUILDDIR%" EQU "" set BUILDDIR=build
@ -36,7 +40,8 @@ if errorlevel 9009 (
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
goto end
popd
exit /B 1
)
rem Targets that do require sphinx-build and have their own label

BIN
Doc/using/win_installer.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB

View File

@ -7,6 +7,7 @@
*************************
.. sectionauthor:: Robert Lehmann <lehmannro@gmail.com>
.. sectionauthor:: Steve Dower <steve.dower@microsoft.com>
This document aims to give an overview of Windows-specific behaviour you should
know about when using Python on Microsoft Windows.
@ -19,10 +20,172 @@ know about when using Python on Microsoft Windows.
Installing Python
=================
Unlike most Unix systems and services, Windows does not require Python natively
and thus does not pre-install a version of Python. However, the CPython team
Unlike most Unix systems and services, Windows does not include a system
supported installation of Python. To make Python available, the CPython team
has compiled Windows installers (MSI packages) with every `release
<https://www.python.org/download/releases/>`_ for many years.
<https://www.python.org/download/releases/>`_ for many years. These installers
are primarily intended to add a system-wide installation of Python, with the
core interpreter and library being shared by all application. Non-shared
layouts of the Python interpreter may also be created with the same installer,
however, the released installer is not intended for embedding in other
installers.
Installation Steps
------------------
Four Python 3.5 installers are available for download - two each for the 32-bit
and 64-bit versions of the interpreter. The *web installer* is a small initial
download, and it will automatically download the required components as
necessary. The *offline installer* includes the components necessary for a
default installation and only requires an internet connection for optional
features. See :ref:`install-layout-option` for other ways to avoid downloading
during installation.
After starting the installer, one of three options may be selected:
.. image:: win_installer.png
If you select "Install for All Users":
* You may be required to provide administrative credentials or approval
* Python will be installed into your Program Files directory
* The :ref:`launcher` will be installed into your Windows directory
* The standard library, test suite, launcher and pip will be installed
* After installation, the standard library will be pre-compiled to bytecode
* If selected, the install directory will be added to :envvar:`PATH`
If you select "Install Just for Me":
* You will *not* need to be an administrator
* Python will be installed into your user directory
* The :ref:`launcher` will *also* be installed into your user directory
* The standard library, test suite, launcher and pip will be installed
* If selected, the install directory will be added to :envvar:`PATH`
Selecting "Customize installation" will allow you to select the features to
install, the installation location and other options or post-install actions.
To install debugging symbols or binaries, you will need to use this option.
.. _install-quiet-option:
Installing Without UI
---------------------
All of the options available in the installer UI can also be specified from the
command line, allowing scripted installers to replicate an installation on many
machines without user interaction. These options may also be set without
suppressing the UI in order to change some of the defaults.
To completely hide the installer UI and install Python silently, pass the
``/quiet`` (``/q``) option. To skip past the user interaction but still display
progress and errors, pass the ``/passive`` (``/p``) option. The ``/uninstall``
option may be passed to immediately begin removing Python - no prompt will be
displayed.
All other options are passed as ``name=value``, where the value is usually
``0`` to disable a feature, ``1`` to enable a feature, or a path. The full list
of available options is shown below.
+---------------------------+--------------------------------------+--------------------------+
| Name | Description | Default |
+===========================+======================================+==========================+
| InstallAllUsers | Perform a system-wide installation. | 1 |
+---------------------------+--------------------------------------+--------------------------+
| TargetDir | The installation directory | Selected based on |
| | | InstallAllUsers |
+---------------------------+--------------------------------------+--------------------------+
| DefaultAllUsersTargetDir | The default installation directory | :file:`%ProgramFiles%\\\ |
| | for all-user installs | Python X.Y` or :file:`\ |
| | | %ProgramFiles(x86)%\\\ |
| | | Python X.Y` |
+---------------------------+--------------------------------------+--------------------------+
| DefaultJustForMeTargetDir | The default install directory for | :file:`%LocalAppData%\\\ |
| | just-for-me installs | Programs\\PythonXY` or |
| | | :file:`%LocalAppData%\\\ |
| | | Programs\\PythonXY-32` |
+---------------------------+--------------------------------------+--------------------------+
| DefaultCustomTargetDir | The default custom install directory | (empty) |
| | displayed in the UI | |
+---------------------------+--------------------------------------+--------------------------+
| AssociateFiles | Create file associations if the | 1 |
| | launcher is also installed. | |
+---------------------------+--------------------------------------+--------------------------+
| CompileAll | Compile all ``.py`` files to | 0 |
| | ``.pyc`` and ``.pyo``. | |
+---------------------------+--------------------------------------+--------------------------+
| PrependPath | Add install and Scripts directories | 0 |
| | tho :envvar:`PATH` and ``.PY`` to | |
| | :envvar:`PATHEXT` | |
+---------------------------+--------------------------------------+--------------------------+
| Include_doc | Install Python manual | 1 |
+---------------------------+--------------------------------------+--------------------------+
| Include_debug | Install debug binaries | 0 |
+---------------------------+--------------------------------------+--------------------------+
| Include_dev | Install developer headers and | 1 |
| | libraries | |
+---------------------------+--------------------------------------+--------------------------+
| Include_exe | Install :file:`python.exe` and | 1 |
| | related files | |
+---------------------------+--------------------------------------+--------------------------+
| Include_launcher | Install :ref:`launcher`. | 1 |
+---------------------------+--------------------------------------+--------------------------+
| Include_lib | Install standard library and | 1 |
| | extension modules | |
+---------------------------+--------------------------------------+--------------------------+
| Include_pip | Install bundled pip and setuptools | 1 |
+---------------------------+--------------------------------------+--------------------------+
| Include_symbols | Install debugging symbols (`*`.pdb) | 0 |
+---------------------------+--------------------------------------+--------------------------+
| Include_tcltk | Install Tcl/Tk support and IDLE | 1 |
+---------------------------+--------------------------------------+--------------------------+
| Include_test | Install standard library test suite | 1 |
+---------------------------+--------------------------------------+--------------------------+
| Include_tools | Install utility scripts | 1 |
+---------------------------+--------------------------------------+--------------------------+
| SimpleInstall | Disable most install UI | 0 |
+---------------------------+--------------------------------------+--------------------------+
For example, to silently install a default, system-wide Python installation,
you could use the following command (from an elevated command prompt)::
python-3.5.0.exe /quiet InstallAllUsers=1 PrependPath=1 Include_test=0
To allow users to easily install a personal copy of Python without the test
suite, you could provide a shortcut with the following command::
python-3.5.0.exe /passive InstallAllUsers=0 Include_launcher=0 Include_test=0 SimpleInstall=1
(Note that omitting the launcher also omits file associations, and is only
recommended for per-user installs when there is also a system-wide installation
that included the launcher.)
.. _install-layout-option:
Installing Without Downloading
------------------------------
As some features of Python are not included in the initial installer download,
selecting those features may require an internet connection. To avoid this
need, all possible components may be downloaded on-demand to create a complete
*layout* that will no longer require an internet connection regardless of the
selected features. Note that this download may be bigger than required, but
where a large number of installations are going to be performed it is very
useful to have a locally cached copy.
Execute the following command from Command Prompt to download all possible
required files. Remember to substitute ``python-3.5.0.exe`` for the actual
name of your installer, and to create layouts in their own directories to
avoid collisions between files with the same name.
::
python-3.5.0.exe /layout [optional target directory]
You may also specify the ``/quiet`` option to hide the progress display.
Other Platforms
---------------
With ongoing development of Python, some platforms that used to be supported
earlier are no longer supported (due to the lack of users or developers).
@ -66,19 +229,31 @@ key features:
`ActivePython <http://www.activestate.com/activepython/>`_
Installer with multi-platform compatibility, documentation, PyWin32
`Enthought Python Distribution <https://www.enthought.com/products/epd/>`_
Popular modules (such as PyWin32) with their respective documentation, tool
suite for building extensible Python applications
`Anaconda <http://www.continuum.io/downloads/>`_
Popular scientific modules (such as numpy, scipy and pandas) and the
``conda`` package manager.
Notice that these packages are likely to install *older* versions of Python.
`Canopy <https://www.enthought.com/products/canopy/>`_
A "comprehensive Python analysis environment" with editors and other
development tools.
`WinPython <https://winpython.github.io/>`_
Windows-specific distribution with prebuilt scientific packages and
tools for building packages.
Note that these packages may not include the latest versions of Python or
other libraries, and are not maintained or supported by the core Python team.
Configuring Python
==================
In order to run Python flawlessly, you might have to change certain environment
settings in Windows.
To run Python conveniently from a command prompt, you might consider changing
some default environment variables in Windows. While the installer provides an
option to configure the PATH and PATHEXT variables for you, this is only
reliable for a single, system-wide installation. If you regularly use multiple
versions of Python, consider using the :ref:`launcher`.
.. _setting-envvars:
@ -86,163 +261,86 @@ settings in Windows.
Excursus: Setting environment variables
---------------------------------------
Windows has a built-in dialog for changing environment variables (following
guide applies to XP classical view): Right-click the icon for your machine
(usually located on your Desktop and called "My Computer") and choose
:menuselection:`Properties` there. Then, open the :guilabel:`Advanced` tab
and click the :guilabel:`Environment Variables` button.
Windows allows environment variables to be configured permanently at both the
User level and the System level, or temporarily in a command prompt.
In short, your path is:
To temporarily set environment variables, open Command Prompt and use the
:command:`set` command::
:menuselection:`My Computer
--> Properties
--> Advanced
--> Environment Variables`
C:\>set PATH=C:\Program Files\Python 3.5;%PATH%
C:\>set PYTHONPATH=%PYTHONPATH%;C:\My_python_lib
C:\>python
These changes will apply to any further commands executed in that console, and
will be inherited by any applications started from the console.
Including the variable name within percent signs will expand to the existing
value, allowing you to add your new value at either the start or the end.
Modifying :envvar:`PATH` by adding the directory containing
:program:`python.exe` to the start is a common way to ensure the correct version
of Python is launched.
To permanently modify the default environment variables, click Start and search
for 'edit environment variables', or open System properties, :guilabel:`Advanced
system settings` and click the :guilabel:`Environment Variables` button.
In this dialog, you can add or modify User and System variables. To change
System variables, you need non-restricted access to your machine
(i.e. Administrator rights).
Another way of adding variables to your environment is using the :command:`set`
command::
.. note::
set PYTHONPATH=%PYTHONPATH%;C:\My_python_lib
Windows will concatenate User variables *after* System variables, which may
cause unexpected results when modifying :envvar:`PATH`.
To make this setting permanent, you could add the corresponding command line to
your :file:`autoexec.bat`. :program:`msconfig` is a graphical interface to this
file.
Viewing environment variables can also be done more straight-forward: The
command prompt will expand strings wrapped into percent signs automatically::
echo %PATH%
Consult :command:`set /?` for details on this behaviour.
The :envvar:`PYTHONPATH` variable is used by all versions of Python 2 and
Python 3, so you should not permanently configure this variable unless it
only includes code that is compatible all of your installed Python
versions.
.. seealso::
http://support.microsoft.com/kb/100843
http://support.microsoft.com/kb/100843
Environment variables in Windows NT
http://support.microsoft.com/kb/310519
http://technet.microsoft.com/en-us/library/cc754250.aspx
The SET command, for temporarily modifying environment variables
http://technet.microsoft.com/en-us/library/cc755104.aspx
The SETX command, for permanently modifying environment variables
http://support.microsoft.com/kb/310519
How To Manage Environment Variables in Windows XP
http://www.chem.gla.ac.uk/~louis/software/faq/q1.html
http://www.chem.gla.ac.uk/~louis/software/faq/q1.html
Setting Environment variables, Louis J. Farrugia
.. _windows-path-mod:
Finding the Python executable
-----------------------------
.. versionchanged:: 3.3
.. versionchanged:: 3.5
Besides using the automatically created start menu entry for the Python
interpreter, you might want to start Python in the command prompt. As of
Python 3.3, the installer has an option to set that up for you.
interpreter, you might want to start Python in the command prompt. The
installer for Python 3.5 and later has an option to set that up for you.
At the "Customize Python 3.3" screen, an option called
"Add python.exe to search path" can be enabled to have the installer place
your installation into the :envvar:`%PATH%`. This allows you to type
:command:`python` to run the interpreter. Thus, you can also execute your
On the first page of the installer, an option labelled "Add Python 3.5 to
PATH" can be selected to have the installer add the install location into the
:envvar:`PATH`. The location of the :file:`Scripts\\` folder is also added.
This allows you to type :command:`python` to run the interpreter, and
:command:`pip` or . Thus, you can also execute your
scripts with command line options, see :ref:`using-on-cmdline` documentation.
If you don't enable this option at install time, you can always re-run the
installer to choose it.
The alternative is manually modifying the :envvar:`%PATH%` using the
directions in :ref:`setting-envvars`. You need to set your :envvar:`%PATH%`
environment variable to include the directory of your Python distribution,
delimited by a semicolon from other entries. An example variable could look
like this (assuming the first two entries are Windows' default)::
C:\WINDOWS\system32;C:\WINDOWS;C:\Python33
Finding modules
---------------
Python usually stores its library (and thereby your site-packages folder) in the
installation directory. So, if you had installed Python to
:file:`C:\\Python\\`, the default library would reside in
:file:`C:\\Python\\Lib\\` and third-party modules should be stored in
:file:`C:\\Python\\Lib\\site-packages\\`.
This is how :data:`sys.path` is populated on Windows:
* An empty entry is added at the start, which corresponds to the current
directory.
* If the environment variable :envvar:`PYTHONPATH` exists, as described in
:ref:`using-on-envvars`, its entries are added next. Note that on Windows,
paths in this variable must be separated by semicolons, to distinguish them
from the colon used in drive identifiers (``C:\`` etc.).
* Additional "application paths" can be added in the registry as subkeys of
:samp:`\\SOFTWARE\\Python\\PythonCore\\{version}\\PythonPath` under both the
``HKEY_CURRENT_USER`` and ``HKEY_LOCAL_MACHINE`` hives. Subkeys which have
semicolon-delimited path strings as their default value will cause each path
to be added to :data:`sys.path`. (Note that all known installers only use
HKLM, so HKCU is typically empty.)
* If the environment variable :envvar:`PYTHONHOME` is set, it is assumed as
"Python Home". Otherwise, the path of the main Python executable is used to
locate a "landmark file" (``Lib\os.py``) to deduce the "Python Home". If a
Python home is found, the relevant sub-directories added to :data:`sys.path`
(``Lib``, ``plat-win``, etc) are based on that folder. Otherwise, the core
Python path is constructed from the PythonPath stored in the registry.
* If the Python Home cannot be located, no :envvar:`PYTHONPATH` is specified in
the environment, and no registry entries can be found, a default path with
relative entries is used (e.g. ``.\Lib;.\plat-win``, etc).
The end result of all this is:
* When running :file:`python.exe`, or any other .exe in the main Python
directory (either an installed version, or directly from the PCbuild
directory), the core path is deduced, and the core paths in the registry are
ignored. Other "application paths" in the registry are always read.
* When Python is hosted in another .exe (different directory, embedded via COM,
etc), the "Python Home" will not be deduced, so the core path from the
registry is used. Other "application paths" in the registry are always read.
* If Python can't find its home and there is no registry (eg, frozen .exe, some
very strange installation setup) you get a path with some default, but
relative, paths.
Executing scripts
-----------------
As of Python 3.3, Python includes a launcher which facilitates running Python
scripts. See :ref:`launcher` for more information.
Executing scripts without the Python launcher
---------------------------------------------
Without the Python launcher installed, Python scripts (files with the extension
``.py``) will be executed by :program:`python.exe` by default. This executable
opens a terminal, which stays open even if the program uses a GUI. If you do
not want this to happen, use the extension ``.pyw`` which will cause the script
to be executed by :program:`pythonw.exe` by default (both executables are
located in the top-level of your Python installation directory). This
suppresses the terminal window on startup.
You can also make all ``.py`` scripts execute with :program:`pythonw.exe`,
setting this through the usual facilities, for example (might require
administrative rights):
#. Launch a command prompt.
#. Associate the correct file group with ``.py`` scripts::
assoc .py=Python.File
#. Redirect all Python files to the new executable::
ftype Python.File=C:\Path\to\pythonw.exe "%1" %*
installer, select Modify, and enable it. Alternatively, you can manually
modify the :envvar:`PATH` using the directions in :ref:`setting-envvars`. You
need to set your :envvar:`PATH` environment variable to include the directory
of your Python installation, delimited by a semicolon from other entries. An
example variable could look like this (assuming the first two entries already
existed)::
C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files\Python 3.5
.. _launcher:
@ -251,21 +349,26 @@ Python Launcher for Windows
.. versionadded:: 3.3
The Python launcher for Windows is a utility which aids in the location and
execution of different Python versions. It allows scripts (or the
The Python launcher for Windows is a utility which aids in locating and
executing of different Python versions. It allows scripts (or the
command-line) to indicate a preference for a specific Python version, and
will locate and execute that version.
Unlike the :envvar:`PATH` variable, the launcher will correctly select the most
appropriate version of Python. It will prefer per-user installations over
system-wide ones, and orders by language version rather than using the most
recently installed version.
Getting started
---------------
From the command-line
^^^^^^^^^^^^^^^^^^^^^
You should ensure the launcher is on your PATH - depending on how it was
installed it may already be there, but check just in case it is not.
From a command-prompt, execute the following command:
System-wide installations of Python 3.3 and later will put the launcher on your
:envvar:`PATH`. The launcher is compatible with all available versions of
Python, so it does not matter which version is installed. To check that the
launcher is available, execute the following command in Command Prompt:
::
@ -291,6 +394,16 @@ If you have a Python 3.x installed, try the command:
You should find the latest version of Python 3.x starts.
If you see the following error, you do not have the launcher installed:
::
'py' is not recognized as an internal or external command,
operable program or batch file.
Per-user installations of Python do not add the launcher to :envvar:`PATH`
unless the option was selected on installation.
From a script
^^^^^^^^^^^^^
@ -383,17 +496,16 @@ Customization
Customization via INI files
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Two .ini files will be searched by the launcher - ``py.ini`` in the
current user's "application data" directory (i.e. the directory returned
by calling the Windows function SHGetFolderPath with CSIDL_LOCAL_APPDATA)
and ``py.ini`` in the same directory as the launcher. The same .ini
files are used for both the 'console' version of the launcher (i.e.
py.exe) and for the 'windows' version (i.e. pyw.exe)
Two .ini files will be searched by the launcher - ``py.ini`` in the current
user's "application data" directory (i.e. the directory returned by calling the
Windows function SHGetFolderPath with CSIDL_LOCAL_APPDATA) and ``py.ini`` in the
same directory as the launcher. The same .ini files are used for both the
'console' version of the launcher (i.e. py.exe) and for the 'windows' version
(i.e. pyw.exe)
Customization specified in the "application directory" will have
precedence over the one next to the executable, so a user, who may not
have write access to the .ini file next to the launcher, can override
commands in that global .ini file)
Customization specified in the "application directory" will have precedence over
the one next to the executable, so a user, who may not have write access to the
.ini file next to the launcher, can override commands in that global .ini file)
Customizing default Python versions
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -488,6 +600,78 @@ particular version was chosen and the exact command-line used to execute the
target Python.
Finding modules
===============
Python usually stores its library (and thereby your site-packages folder) in the
installation directory. So, if you had installed Python to
:file:`C:\\Python\\`, the default library would reside in
:file:`C:\\Python\\Lib\\` and third-party modules should be stored in
:file:`C:\\Python\\Lib\\site-packages\\`.
This is how :data:`sys.path` is populated on Windows:
* An empty entry is added at the start, which corresponds to the current
directory.
* If the environment variable :envvar:`PYTHONPATH` exists, as described in
:ref:`using-on-envvars`, its entries are added next. Note that on Windows,
paths in this variable must be separated by semicolons, to distinguish them
from the colon used in drive identifiers (``C:\`` etc.).
* Additional "application paths" can be added in the registry as subkeys of
:samp:`\\SOFTWARE\\Python\\PythonCore\\{version}\\PythonPath` under both the
``HKEY_CURRENT_USER`` and ``HKEY_LOCAL_MACHINE`` hives. Subkeys which have
semicolon-delimited path strings as their default value will cause each path
to be added to :data:`sys.path`. (Note that all known installers only use
HKLM, so HKCU is typically empty.)
* If the environment variable :envvar:`PYTHONHOME` is set, it is assumed as
"Python Home". Otherwise, the path of the main Python executable is used to
locate a "landmark file" (``Lib\os.py``) to deduce the "Python Home". If a
Python home is found, the relevant sub-directories added to :data:`sys.path`
(``Lib``, ``plat-win``, etc) are based on that folder. Otherwise, the core
Python path is constructed from the PythonPath stored in the registry.
* If the Python Home cannot be located, no :envvar:`PYTHONPATH` is specified in
the environment, and no registry entries can be found, a default path with
relative entries is used (e.g. ``.\Lib;.\plat-win``, etc).
The end result of all this is:
* When running :file:`python.exe`, or any other .exe in the main Python
directory (either an installed version, or directly from the PCbuild
directory), the core path is deduced, and the core paths in the registry are
ignored. Other "application paths" in the registry are always read.
* When Python is hosted in another .exe (different directory, embedded via COM,
etc), the "Python Home" will not be deduced, so the core path from the
registry is used. Other "application paths" in the registry are always read.
* If Python can't find its home and there is no registry (eg, frozen .exe, some
very strange installation setup) you get a path with some default, but
relative, paths.
For those who want to bundle Python into their application or distribution, the
following advice will prevent conflicts with other installations:
* If you are loading :file:`python3.dll` or :file:`python35.dll` in your own
executable, explicitly call :c:func:`Py_SetPath` or (at least)
:c:func:`Py_SetProgramName` before :c:func:`Py_Initialize`.
* Clear and/or overwrite :envvar:`PYTHONPATH` and set :envvar:`PYTHONHOME`
before launching :file:`python.exe` from your application.
* If you cannot use the previous suggestions (for example, you are a
distribution that allows people to run :file:`python.exe` directly), ensure
that the landmark file (:file:`Lib\\os.py`) exists in your bundled library.
(Note that it will not be detected inside a ZIP file.)
These will ensure that the files in a system-wide installation will not take
precedence over the copy of the standard library bundled with your application.
Otherwise, your users may experience problems using your application.
Additional modules
==================
@ -498,7 +682,6 @@ and external, and snippets exist to use these features.
The Windows-specific standard modules are documented in
:ref:`mswin-specific-services`.
PyWin32
-------
@ -557,20 +740,8 @@ latest release's source or just grab a fresh `checkout
<https://docs.python.org/devguide/setup.html#getting-the-source-code>`_.
The source tree contains a build solution and project files for Microsoft
Visual C++, which is the compiler used to build the official Python releases.
View the :file:`readme.txt` in their respective directories:
+--------------------+--------------+-----------------------+
| Directory | MSVC version | Visual Studio version |
+====================+==============+=======================+
| :file:`PC/VS9.0/` | 9.0 | 2008 |
+--------------------+--------------+-----------------------+
| :file:`PCbuild/` | 10.0 | 2010 |
+--------------------+--------------+-----------------------+
Note that any build directories within the :file:`PC` directory are not
necessarily fully supported. The :file:`PCbuild` directory contains the files
for the compiler used to build the official release.
Visual Studio 2015, which is the compiler used to build the official Python
releases. These files are in the :file:`PCbuild` directory.
Check :file:`PCbuild/readme.txt` for general information on the build process.

View File

@ -1778,6 +1778,8 @@ Tools/Demos
Windows
-------
- Issue #23260: Update Windows installer
- The bundled version of Tcl/Tk has been updated to 8.6.3. The most visible
result of this change is the addition of new native file dialogs when
running on Windows Vista or newer. See Tcl/Tk's TIP 432 for more

View File

@ -157,14 +157,19 @@ static INSTALLED_PYTHON installed_pythons[MAX_INSTALLED_PYTHONS];
static size_t num_installed_pythons = 0;
/* to hold SOFTWARE\Python\PythonCore\X.Y\InstallPath */
/*
* To hold SOFTWARE\Python\PythonCore\X.Y...\InstallPath
* The version name can be longer than MAX_VERSION_SIZE, but will be
* truncated to just X.Y for comparisons.
*/
#define IP_BASE_SIZE 40
#define IP_SIZE (IP_BASE_SIZE + MAX_VERSION_SIZE)
#define IP_VERSION_SIZE 8
#define IP_SIZE (IP_BASE_SIZE + IP_VERSION_SIZE)
#define CORE_PATH L"SOFTWARE\\Python\\PythonCore"
static wchar_t * location_checks[] = {
L"\\",
L"\\PCBuild\\",
L"\\PCBuild\\win32\\",
L"\\PCBuild\\amd64\\",
NULL
};
@ -196,6 +201,7 @@ locate_pythons_for_key(HKEY root, REGSAM flags)
BOOL ok;
DWORD type, data_size, attrs;
INSTALLED_PYTHON * ip, * pip;
wchar_t ip_version[IP_VERSION_SIZE];
wchar_t ip_path[IP_SIZE];
wchar_t * check;
wchar_t ** checkp;
@ -207,19 +213,21 @@ locate_pythons_for_key(HKEY root, REGSAM flags)
else {
ip = &installed_pythons[num_installed_pythons];
for (i = 0; num_installed_pythons < MAX_INSTALLED_PYTHONS; i++) {
status = RegEnumKeyW(core_root, i, ip->version, MAX_VERSION_SIZE);
status = RegEnumKeyW(core_root, i, ip_version, IP_VERSION_SIZE);
if (status != ERROR_SUCCESS) {
if (status != ERROR_NO_MORE_ITEMS) {
/* unexpected error */
winerror(status, message, MSGSIZE);
debug(L"Can't enumerate registry key for version %ls: %ls\n",
ip->version, message);
ip_version, message);
}
break;
}
else {
wcsncpy_s(ip->version, MAX_VERSION_SIZE, ip_version,
MAX_VERSION_SIZE-1);
_snwprintf_s(ip_path, IP_SIZE, _TRUNCATE,
L"%ls\\%ls\\InstallPath", CORE_PATH, ip->version);
L"%ls\\%ls\\InstallPath", CORE_PATH, ip_version);
status = RegOpenKeyExW(root, ip_path, 0, flags, &ip_key);
if (status != ERROR_SUCCESS) {
winerror(status, message, MSGSIZE);

View File

@ -81,7 +81,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
<Target Name="RebuildImportLib" AfterTargets="AfterBuild">
<Target Name="RebuildImportLib" AfterTargets="AfterBuild" Condition="$(Configuration) == 'Debug' or $(Configuration) == 'Release'">
<Exec Command='"$(TargetPath)" "$(PySourcePath)Lib\importlib\_bootstrap.py" "$(IntDir)importlib.g.h"' />
<PropertyGroup>
@ -93,9 +93,10 @@
DestinationFiles="$(PySourcePath)Python\importlib.h"
Condition="Exists('$(IntDir)importlib.g.h') and '$(_OldContent)' != '$(_NewContent)'" />
<Message Text="importlib.h has been updated. You will need to rebuild pythoncore to see the changes."
Importance="high"
Condition="Exists('$(IntDir)importlib.g.h') and '$(_OldContent)' != '$(_NewContent)'" />
<Warning Text="importlib.h has been updated. You will need to rebuild pythoncore to see the changes."
Condition="Exists('$(IntDir)importlib.g.h') and '$(_OldContent)' != '$(_NewContent)' and $(Configuration) == 'Debug'" />
<Error Text="importlib.h has been updated. You will need to rebuild pythoncore to see the changes."
Condition="Exists('$(IntDir)importlib.g.h') and '$(_OldContent)' != '$(_NewContent)' and $(Configuration) == 'Release'" />
</Target>
<Target Name="_CleanImportLib" BeforeTargets="CoreClean">
<ItemGroup>

View File

@ -41,8 +41,12 @@
<Import Project="python.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
</PropertyGroup>
<Import Project="openssl.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<Target Name="CreateBuildinfH" Inputs="$(MSBuildProjectFullPath)" Outputs="$(IntDir)\buildinf.h" AfterTargets="PrepareForBuild">

View File

@ -61,6 +61,7 @@
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions>_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<AdditionalDependencies>version.lib;%(AdditionalDependencies)</AdditionalDependencies>

View File

@ -11,6 +11,9 @@
<GenerateManifest>false</GenerateManifest>
<EmbedManifest>false</EmbedManifest>
<SupportPGO Condition="'$(SupportPGO)' == ''">true</SupportPGO>
<SupportSigning Condition="'$(SupportSigning)' == ''">true</SupportSigning>
<SupportSigning Condition="'$(Configuration)' == 'Debug'">false</SupportSigning>
<SupportSigning Condition="'$(ConfigurationType)' == 'StaticLibrary'">false</SupportSigning>
</PropertyGroup>
<PropertyGroup>
@ -138,4 +141,16 @@ foreach (System.Diagnostics.Process p in System.Diagnostics.Process.GetProcesses
Condition="Exists(%(FullPath))"
Targets="CleanAll" />
</Target>
<PropertyGroup Condition="'$(SigningCertificate)' != '' and $(SupportSigning)">
<SignToolPath Condition="'$(SignToolPath)' == '' or !Exists($(SignToolPath))">$(registry:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows Kits\Installed Roots@KitsRoot81)\bin\x86\signtool.exe</SignToolPath>
<SignToolPath Condition="!Exists($(SignToolPath))">$(registry:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows Kits\Installed Roots@KitsRoot)\bin\x86\signtool.exe</SignToolPath>
<SignToolPath Condition="!Exists($(SignToolPath))">$(registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.1A@InstallationFolder)\Bin\signtool.exe</SignToolPath>
<_SignCommand Condition="Exists($(SignToolPath))">"$(SignToolPath)" sign /q /n "$(SigningCertificate)" /t http://timestamp.verisign.com/scripts/timestamp.dll /d "Python $(PythonVersion)"</_SignCommand>
</PropertyGroup>
<Target Name="_SignBuild" AfterTargets="AfterBuild" Condition="'$(SigningCertificate)' != '' and $(SupportSigning)">
<Error Text="Unable to locate signtool.exe. Set /p:SignToolPath and rebuild" Condition="'$(_SignCommand)' == ''" />
<Exec Command='$(_SignCommand) "$(TargetPath)" || $(_SignCommand) "$(TargetPath)" || $(_SignCommand) "$(TargetPath)"' ContinueOnError="false" />
</Target>
</Project>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" TreatAsLocalProperty="Platform">
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Platform Condition="'$(Platform)' == '' or '$(Platform)' == 'x86'">Win32</Platform>
<Platform Condition="'$(Platform)' == ''">Win32</Platform>
<Configuration Condition="'$(Configuration)' == ''">Release</Configuration>
<!--
Use the latest available version of Visual Studio to build. To override
@ -98,12 +98,12 @@
<PyDllName>python$(MajorVersionNumber)$(MinorVersionNumber)$(PyDebugExt)</PyDllName>
<!-- The version and platform tag to include in .pyd filenames -->
<PydTag Condition="$(Platform) == 'Win32'">.cp$(MajorVersionNumber)$(MinorVersionNumber)-win32</PydTag>
<PydTag Condition="$(Platform) == 'Win32' or $(Platform) == 'x86'">.cp$(MajorVersionNumber)$(MinorVersionNumber)-win32</PydTag>
<PydTag Condition="$(Platform) == 'x64'">.cp$(MajorVersionNumber)$(MinorVersionNumber)-win_amd64</PydTag>
<!-- The version number for sys.winver -->
<SysWinVer>$(MajorVersionNumber).$(MinorVersionNumber)</SysWinVer>
<SysWinVer Condition="$(Platform) == 'Win32'">$(SysWinVer)-32</SysWinVer>
<SysWinVer Condition="$(Platform) == 'Win32' or $(Platform) == 'x86'">$(SysWinVer)-32</SysWinVer>
</PropertyGroup>
<!-- Displays the calculated version info -->

View File

@ -61,6 +61,7 @@
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions>_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<AdditionalDependencies>version.lib;%(AdditionalDependencies)</AdditionalDependencies>

View File

@ -41,8 +41,12 @@
<Import Project="python.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
</PropertyGroup>
<Import Project="openssl.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ItemGroup>

View File

@ -1,21 +1,9 @@
@rem Used by the buildbot "buildmsi" step.
setlocal
set cwd=%CD%
pushd
@rem build release versions of things
call "%~dp0build.bat" -c Release
@rem build both snapshot MSIs
call "%~dp0..\msi\build.bat" -x86 -x64
@rem build the documentation
call "%~dp0..\..\Doc\make.bat" htmlhelp
@rem build the MSI file
call "%~dp0..\..\PCBuild\env.bat" x86
cd "%~dp0..\..\PC"
nmake /f icons.mak
cd ..\Tools\msi
del *.msi
nmake /f msisupport.mak
%HOST_PYTHON% msi.py
cd "%cwd%"
popd

View File

@ -1,25 +1,488 @@
Packaging Python as a Microsoft Installer Package (MSI)
=======================================================
Quick Build Info
================
Using this library, Python can be packaged as a MS-Windows
MSI file. To generate an installer package, you need
a build tree. By default, the build tree root directory
is assumed to be in "../..". This location can be changed
by adding a file config.py; see the beginning of msi.py
for additional customization options.
For testing, the installer should be built with the Tools/msi/build.bat
script:
The packaging process assumes that binaries have been
generated according to the instructions in PCBuild/README.txt,
and that you have either Visual Studio or the Platform SDK
installed. In addition, you need the Python COM extensions,
either from PythonWin, or from ActivePython.
build.bat [-x86] [-x64] [--doc]
To invoke the script, open a cmd.exe window which has
cabarc.exe in its PATH (e.g. "Visual Studio .NET 2003
Command Prompt"). Then invoke
For an official release, the installer should be built with the
Tools/msi/buildrelease.bat script and environment variables:
<path-to-python.exe> msi.py
set PYTHON=<path to Python 2.7>
set SPHINXBUILD=<path to sphinx-build.exe>
set PATH=<path to Mercurial (hg.exe)>;
<path to HTML Help Compiler (hhc.exe)>;%PATH%
If everything succeeds, pythonX.Y.Z.msi is generated
in the current directory.
buildrelease.bat [-x86] [-x64] [-D] [-B]
[-o <output directory>] [-c <certificate name>]
See the Building the Installer section for more information.
Overview
========
Python is distributed on Windows as an installer that will configure the
user's system. This allows users to have a functioning copy of Python
without having to build it themselves.
The main tasks of the installer are:
* copy required files into the expected layout
* configure system settings so the installation can be located by
other programs
* add entry points for modifying, repairing and uninstalling Python
* make it easy to launch Python, its documentation, and IDLE
Each of these is discussed in a later section of this document.
Structure of the Installer
==========================
The installer is structured as a 'layout', which consists of a number of
CAB and MSI files and a single EXE.
The EXE is the main entry point into the installer. It contains the UI
and command-line logic, as well as the ability to locate and optionally
download other parts of the layout.
Each MSI contains the logic required to install a component or feature
of Python. These MSIs should not be launched directly by users. MSIs can
be embedded into the EXE or automatically downloaded as needed.
Each CAB contains the files making up a Python installation. CABs are
embedded into their associated MSI and are never seen by users.
MSIs are only required when the related feature or component is being
installed. When components are not selected for installation, the
associated MSI is not downloaded. This allows the installer to offer
options to install debugging symbols and binaries without increasing
the initial download size by separating them into their own MSIs.
Building the Installer
======================
For testing, the installer should be built with the Tools/msi/build.bat
script:
build.bat [-x86] [-x64] [--doc]
This script will build the required configurations of Python and
generate an installer layout in PCBuild/(win32|amd64)/en-us.
Specify -x86 and/or -x64 to build for each platform. If neither is
specified, both platforms will be built. Currently, both the debug and
release versions of Python are required for the installer.
Specify --doc to build the documentation (.chm) file. If the file is not
available, it will simply be excluded from the installer. Ensure
%PYTHON% and %SPHINXBUILD% are set when passing this option. You may
also set %HTMLHELP% to the Html Help Compiler (hhc.exe), or put HHC on
your PATH or in externals/.
If WiX is not found on your system, it will be automatically downloaded
and extracted to the externals/ directory.
For an official release, the installer should be built with the
Tools/msi/buildrelease.bat script:
set PYTHON=<path to Python 2.7>
set SPHINXBUILD=<path to sphinx-build.exe>
set PATH=<path to Mercurial (hg.exe)>;
<path to HTML Help Compiler (hhc.exe)>;%PATH%
buildrelease.bat [-x86] [-x64] [-D] [-B]
[-o <output directory>] [-c <certificate name>]
Specify -x86 and/or -x64 to build for each platform. If neither is
specified, both platforms will be built. Currently, both the debug and
release versions of Python are required for the installer.
Specify -D to skip rebuilding the documentation. The documentation is
required for a release and the build will fail if it is not available.
Specify -B to skip rebuilding Python. This is useful to only rebuild the
installer layout after a previous call to buildrelease.bat.
Specify -o to set an output directory. The installer layouts will be
copied to platform-specific subdirectories of this path.
Specify -c to choose a code-signing certificate to be used for all the
signable binaries in Python as well as each file making up the
installer. Official releases of Python must be signed.
Ensure %PYTHON% and %SPHINXBUILD% are set when passing this option. You
may also set %HTMLHELP% to the Html Help Compiler (hhc.exe), or put HHC
on your PATH or in externals/. You will also need Mercurial (hg.exe) on
your PATH.
If WiX is not found on your system, it will be automatically downloaded
and extracted to the externals/ directory.
To manually build layouts of the installer, build one of the projects in
the bundle folder.
msbuild bundle\snapshot.wixproj
msbuild bundle\releaseweb.wixproj
msbuild bundle\releaselocal.wixproj
msbuild bundle\full.wixproj
snapshot.wixproj produces a test installer versioned based on the date.
releaseweb.wixproj produces a release installer that does not embed any
of the layout.
releaselocal.wixproj produces a release installer that embeds the files
required for a default installation.
full.wixproj produces a test installer that embeds the entire layout.
The following properties may be passed when building these projects.
/p:BuildForRelease=(true|false)
When true, adds extra verification to ensure a complete installer is
produced. For example, binutils is required when building for a release
to generate MinGW-compatible libraries, and the build will be aborted if
this fails. Defaults to false.
/p:ReleaseUri=(any URI)
Used to generate unique IDs for the installers to allow side-by-side
installation. Forks of Python can use the same installer infrastructure
by providing a unique URI for this property. It does not need to be an
active internet address. Defaults to $(ComputerName).
Official releases use http://www.python.org/(architecture name)
/p:DownloadUrlBase=(any URI)
Specifies the base of a URL where missing parts of the installer layout
can be downloaded from. The build version and architecture will be
appended to create the full address. If omitted, missing components will
not be automatically downloaded.
/p:DownloadUrl=(any URI)
Specifies the full URL where missing parts of the installer layout can
be downloaded from. Should normally include '{2}', which will be
substituted for the filename. If omitted, missing components will not be
automatically downloaded. If specified, this value overrides
DownloadUrlBase.
/p:SigningCertificate=(certificate name)
Specifies the certificate to sign the installer layout with. If omitted,
the layout will not be signed.
/p:RebuildAll=(true|false)
When true, rebuilds all of the MSIs making up the layout. Defaults to
true.
Modifying the Installer
=======================
The code for the installer is divided into three main groups: packages,
the bundle and the bootstrap application.
Packages
--------
Packages appear as subdirectories of Tools/msi (other than the bundle/
directory). The project file is a .wixproj and the build output is a
single MSI. Packages are built with the WiX Toolset. Some project files
share source files and use preprocessor directives to enable particular
features. These are typically used to keep the sources close when the
files are related, but produce multiple independent packages.
A package is the smallest element that may be independently installed or
uninstalled (as used in this installer). For example, the test suite has
its own package, as users can choose to add or remove it after the
initial installation.
All the files installed by a single package should be related, though
some packages may not install any files. For example, the pip package
executes the ensurepip package, but does not add or remove any of its
own files. (It is represented as a package because of its
installed/uninstalled nature, as opposed to the "precompile standard
library" option, for example.) Dependencies between packages are handled
by the bundle, but packages should detect when dependencies are missing
and raise an error.
Packages that include a lot of files may use an InstallFiles element in
the .wixproj file to generate sources. See lib/lib.wixproj for an
example, and msi.targets and csv_to_wxs.py for the implementation. This
element is also responsible for generating the code for cleaning up and
removing __pycache__ folders in any directory containing .py files.
All packages are built with the Tools/msi/common.wxs file, and so any
directory or property in this file may be referenced. Of particular
interest:
REGISTRYKEY (property)
The registry key for the current installation.
InstallDirectory (directory)
The root install directory for the current installation. Subdirectories
are also specified in this file (DLLs, Lib, etc.)
MenuDir (directory)
The Start Menu folder for the current installation.
UpgradeTable (property)
Every package should reference this property to include upgrade
information.
The .wxl_template file is specially handled by the build system for this
project to perform {{substitutions}} as defined in msi.targets. They
should be included in projects as <WxlTemplate> items, where .wxl files
are normally included as <EmbeddedResource> items.
Bundle
------
The bundle is compiled to the main EXE entry point that for most users
will represent the Python installer. It is built from Tools/msi/bundle
with packages references in Tools/msi/bundle/packagegroups.
Build logic for the bundle is in bundle.targets, but should be invoked
through one of the .wixproj files as described in Building the
Installer.
The UI is separated between Default.thm (UI layout), Default.wxl
(strings), bundle.wxs (properties) and the bootstrap application.
Bundle.wxs also contains the chain, which is the list of packages to
install and the order they should be installed in. These refer to named
package groups in bundle/packagegroups.
Each package group specifies one or more packages to install. Most
packages require two separate entries to support both per-user and
all-users installations. Because these reuse the same package, it does
not increase the overall size of the package.
Package groups refer to payload groups, which allow better control over
embedding and downloading files than the default settings. Whether files
are embedded and where they are downloaded from depends on settings
created by the project files.
Package references can include install conditions that determine when to
install the package. When a package is a dependency for others, the
condition should be crafted to ensure it is installed.
MSI packages are installed or uninstalled based on their current state
and the install condition. This makes them most suitable for features
that are clearly present or absent from the user's machine.
EXE packages are executed based on a customisable condition that can be
omitted. This makes them suitable for pre- or post-install tasks that
need to run regardless of whether features have been added or removed.
Bootstrap Application
---------------------
The bootstrap application is a C++ application that controls the UI and
installation. While it does not directly compile into the main EXE of
the installer, it forms the main active component. Most of the
installation functionality is provided by WiX, and so the bootstrap
application is predominantly responsible for the code behind the UI that
is defined in the Default.thm file. The bootstrap application code is in
bundle/bootstrap and is built automatically when building the bundle.
Installation Layout
===================
There are two installation layouts for Python on Windows, with the only
differences being supporting files. A layout is selected implicitly
based on whether the install is for all users of the machine or just for
the user performing the installation.
The default installation location when installing for all users is
"%ProgramFiles%\Python 3.X" for the 64-bit interpreter and
"%ProgramFiles(x86)%\Python 3.X" for the 32-bit interpreter. (Note that
the latter path is equivalent to "%ProgramFiles%\Python 3.X" when
running a 32-bit version of Windows.) This location requires
administrative privileges to install or later modify the installation.
The default installation location when installing for the current user
is "%LocalAppData%\Programs\Python\Python3X" for the 64-bit interpreter
and "%LocalAppData%\Programs\Python\Python3X-32" for the 32-bit
interpreter. Only the current user can access this location. This
provides a suitable level of protection against malicious modification
of Python's files.
Within this install directory is the following approximate layout:
.\python[w].exe The core executable files
.\DLLs Stdlib extensions (*.pyd) and dependencies
.\Doc Documentation (*.chm)
.\include Development headers (*.h)
.\Lib Standard library
.\Lib\test Test suite
.\libs Development libraries (*.lib)
.\Scripts Launcher scripts (*.exe, *.py)
.\tcl Tcl dependencies (*.dll, *.tcl and others)
.\Tools Tool scripts (*.py)
When installed for all users, the following files are installed to
either "%SystemRoot%\System32" or "%SystemRoot%\SysWOW64" as
appropriate. For the current user, they are installed in the Python
install directory.
.\python3x.dll The core interpreter
.\python3.dll The stable ABI reference
.\appcrt140.dll Microsoft Visual C Runtime
.\desktopcrt140.dll Microsoft Visual C Runtime
.\vcruntime140.dll Microsoft Visual C Runtime
When installed for all users, the following files are installed to
"%SystemRoot%" (typically "C:\Windows") to ensure they are always
available on PATH. (See Launching Python below.) For the current user,
they are installed in the Python install directory.
.\py[w].exe PEP 397 launcher
System Settings
===============
On installation, registry keys are created so that other applications
can locate and identify installations of Python. The locations of these
keys vary based on the install type.
For 64-bit interpreters installed for all users, the root key is:
HKEY_LOCAL_MACHINE\Software\Python\PythonCore\3.X
For 32-bit interpreters installed for all users on a 64-bit operating
system, the root key is:
HKEY_LOCAL_MACHINE\Software\Wow6432Node\Python\PythonCore\3.X-32
For 32-bit interpreters installed for all users on a 32-bit operating
system, the root key is:
HKEY_LOCAL_MACHINE\Software\Python\PythonCore\3.X-32
For 64-bit interpreters installed for the current user:
HKEY_CURRENT_USER\Software\Python\PythonCore\3.X
For 32-bit interpreters installed for the current user:
HKEY_CURRENT_USER\Software\Python\PythonCore\3.X-32
When the core Python executables are installed, a key "InstallPath" is
created within the root key with its default value set to the
executable's install directory. Within this key, a key "InstallGroup" is
created with its default value set to the product name "Python 3.X".
When the Python standard library is installed, a key "PythonPath" is
created within the root key with its default value set to the full path
to the Lib folder followed by the path to the DLLs folder, separated by
a semicolon.
When the documentation is installed, a key "Help" is created within the
root key, with a subkey "Main Python Documentation" with its default
value set to the full path to the installed CHM file.
The py.exe launcher is installed as part of a regular Python install,
but using a separate mechanism that allows it to more easily span
versions of Python. As a result, it has different root keys for its
registry entries:
When installed for all users on a 64-bit operating system, the
launcher's root key is:
HKEY_LOCAL_MACHINE\Software\Wow6432Node\Python\Launcher
When installed for all users on a 32-bit operating system, the
launcher's root key is:
HKEY_LOCAL_MACHINE\Software\Python\Launcher
When installed for the current user:
HKEY_CURRENT_USER\Software\Python\Launcher
When the launcher is installed, a key "InstallPath" is created within
its root key with its default value set to the launcher's install
directory. File associations are also created for .py, .pyw, .pyc and
.pyo files.
Launching Python
================
When a feature offering user entry points in the Start Menu is
installed, a folder "Python 3.X" is created. Every shortcut should be
created within this folder, and each shortcut should include the version
and platform to allow users to identify the shortcut in a search results
page.
The core Python executables creates a shortcut "Python 3.X (32-bit)" or
"Python 3.X (64-bit)" depending on the interpreter.
The documentation creates a shortcut "Python 3.X 32-bit Manuals" or
"Python 3.X 64-bit Manuals". The documentation is identical for all
platforms, but the shortcuts need to be separate to avoid uninstallation
conflicts.
Installing IDLE creates a shortcut "IDLE (Python 3.X 32-bit)" or "IDLE
(Python 3.X 64-bit)" depending on the interpreter.
For users who often launch Python from a Command Prompt, an option is
provided to add the directory containing python.exe to the user or
system PATH variable. If the option is selected, the install directory
and the Scripts directory will be added at the start of the system PATH
for an all users install and the user PATH for a per-user install.
When the user only has one version of Python installed, this will behave
as expected. However, because Windows searches the system PATH before
the user PATH, users cannot override a system-wide installation of
Python on their PATH. Further, because the installer can only prepend to
the path, later installations of Python will take precedence over
earlier installations, regardless of interpreter version.
Because it is not possible to automatically create a sensible PATH
configuration, users are recommended to use the py.exe launcher and
manually modify their PATH variable to add Scripts directories in their
preferred order. System-wide installations of Python should consider not
modifying PATH, or using an alternative technology to modify their
users' PATH variables.
The py.exe launcher is recommended because it uses a consistent and
sensible search order for Python installations. User installations are
preferred over system-wide installs, and later versions are preferred
regardless of installation order (with the exception that py.exe
currently prefers 2.x versions over 3.x versions without the -3 command
line argument).
For both 32-bit and 64-bit interpreters, the 32-bit version of the
launcher is installed. This ensures that the search order is always
consistent (as the 64-bit launcher is subtly different from the 32-bit
launcher) and also avoids the need to install it multiple times. Future
versions of Python will upgrade the launcher in-place, using Windows
Installer's upgrade functionality to avoid conflicts with earlier
installed versions.
When installed, file associations are created for .py, .pyc and .pyo
files to launch with py.exe and .pyw files to launch with pyw.exe. This
makes Python files respect shebang lines by default and also avoids
conflicts between multiple Python installations.
Repair, Modify and Uninstall
============================
After installation, Python may be modified, repaired or uninstalled by
running the original EXE again or via the Programs and Features applet
(formerly known as Add or Remove Programs).
Modifications allow features to be added or removed. The install
directory and kind (all users/single user) cannot be modified. Because
Windows Installer caches installation packages, removing features will
not require internet access unless the package cache has been corrupted
or deleted. Adding features that were not previously installed and are
not embedded or otherwise available will require internet access.
Repairing will rerun the installation for all currently installed
features, restoring files and registry keys that have been modified or
removed. This operation generally will not redownload any files unless
the cached packages have been corrupted or deleted.
Removing Python will clean up all the files and registry keys that were
created by the installer, as well as __pycache__ folders that are
explicitly handled by the installer. Python packages installed later
using a tool like pip will not be removed. Some components may be
installed by other installers (such as the MSVCRT) and these will not be
removed if another product has a dependency on them.

46
Tools/msi/build.bat Normal file
View File

@ -0,0 +1,46 @@
@echo off
setlocal
set D=%~dp0
set PCBUILD=%D%..\..\PCBuild\
set BUILDX86=
set BUILDX64=
set BUILDDOC=
:CheckOpts
if '%1'=='-x86' (set BUILDX86=1) && shift && goto CheckOpts
if '%1'=='-x64' (set BUILDX64=1) && shift && goto CheckOpts
if '%1'=='--doc' (set BUILDDOC=1) && shift && goto CheckOpts
if not defined BUILDX86 if not defined BUILDX64 (set BUILDX86=1) && (set BUILDX64=1)
call "%PCBUILD%env.bat" x86
if defined BUILDX86 (
call "%PCBUILD%build.bat" -d
if errorlevel 1 goto :eof
call "%PCBUILD%build.bat"
if errorlevel 1 goto :eof
)
if defined BUILDX64 (
call "%PCBUILD%build.bat" -p x64 -d
if errorlevel 1 goto :eof
call "%PCBUILD%build.bat" -p x64
if errorlevel 1 goto :eof
)
if defined BUILDDOC (
call "%PCBUILD%..\Doc\make.bat" htmlhelp
if errorlevel 1 goto :eof
)
if defined BUILDX86 (
"%PCBUILD%win32\python.exe" "%D%get_wix.py"
msbuild "%D%bundle\snapshot.wixproj"
if errorlevel 1 goto :eof
)
if defined BUILDX64 (
"%PCBUILD%amd64\python.exe" "%D%get_wix.py"
msbuild "%D%bundle\snapshot.wixproj" /p:Platform=x64
if errorlevel 1 goto :eof
)

131
Tools/msi/buildrelease.bat Normal file
View File

@ -0,0 +1,131 @@
@setlocal
@echo off
rem This script is intended for building official releases of Python.
rem To use it to build alternative releases, you should clone this file
rem and modify the following three URIs.
rem
rem The first two will ensure that your release can be installed
rem alongside an official Python release, while the second specifies
rem the URL that will be used to download installation files. The
rem files available from this URL *will* conflict with your installer.
rem Trust me, you don't want them, even if it seems like a good idea.
set RELEASE_URI_X86=http://www.python.org/win32
set RELEASE_URI_X64=http://www.python.org/amd64
set DOWNLOAD_URL_BASE=https://www.python.org/ftp/python
set DOWNLOAD_URL=
set D=%~dp0
set PCBUILD=%D%..\..\PCBuild\
set BUILDX86=
set BUILDX64=
set TARGET=Rebuild
:CheckOpts
if "%1" EQU "-c" (set CERTNAME=%~2) && shift && shift && goto CheckOpts
if "%1" EQU "-o" (set OUTDIR=%~2) && shift && shift && goto CheckOpts
if "%1" EQU "-D" (set SKIPDOC=1) && shift && goto CheckOpts
if "%1" EQU "-B" (set SKIPBUILD=1) && shift && goto CheckOpts
if "%1" EQU "--download" (set DOWNLOAD_URL=%~2) && shift && shift && goto CheckOpts
if "%1" EQU "-b" (set TARGET=Build) && shift && goto CheckOpts
if '%1' EQU '-x86' (set BUILDX86=1) && shift && goto CheckOpts
if '%1' EQU '-x64' (set BUILDX64=1) && shift && goto CheckOpts
if not defined BUILDX86 if not defined BUILDX64 (set BUILDX86=1) && (set BUILDX64=1)
:builddoc
if "%SKIPBUILD%" EQU "1" goto skipdoc
if "%SKIPDOC%" EQU "1" goto skipdoc
call "%D%..\..\doc\make.bat" htmlhelp
if errorlevel 1 goto :eof
:skipdoc
where dlltool 2>nul >"%TEMP%\dlltool.loc"
if errorlevel 1 dir "%D%..\..\externals\dlltool.exe" /s/b > "%TEMP%\dlltool.loc"
if errorlevel 1 echo Cannot find binutils on PATH or in externals & exit /B 1
set /P DLLTOOL= < "%TEMP%\dlltool.loc"
set PATH=%PATH%;%DLLTOOL:~,-12%
set DLLTOOL=
del "%TEMP%\dlltool.loc"
if defined BUILDX86 (
call :build x86
if errorlevel 1 exit /B
)
if defined BUILDX64 (
call :build x64
if errorlevel 1 exit /B
)
exit /B 0
:build
@setlocal
@echo off
if "%1" EQU "x86" (
call "%PCBUILD%env.bat" x86
set BUILD=%PCBUILD%win32\
set BUILD_PLAT=Win32
set OUTDIR_PLAT=win32
set OBJDIR_PLAT=x86
set RELEASE_URI=%RELEASE_URI_X86%
) ELSE (
call "%PCBUILD%env.bat" x86_amd64
set BUILD=%PCBUILD%amd64\
set BUILD_PLAT=x64
set OUTDIR_PLAT=amd64
set OBJDIR_PLAT=x64
set RELEASE_URI=%RELEASE_URI_X64%
)
echo on
if exist "%BUILD%en-us" (
echo Deleting %BUILD%en-us
rmdir /q/s "%BUILD%en-us"
if errorlevel 1 exit /B
)
echo on
if exist "%D%obj\Release_%OBJDIR_PLAT%" (
echo Deleting "%D%obj\Release_%OBJDIR_PLAT%"
rmdir /q/s "%D%obj\Release_%OBJDIR_PLAT%"
if errorlevel 1 exit /B
)
if not "%CERTNAME%" EQU "" (
set CERTOPTS="/p:SigningCertificate=%CERTNAME%"
) else (
set CERTOPTS=
)
if not "%SKIPBUILD%" EQU "1" (
call "%PCBUILD%build.bat" -e -p %BUILD_PLAT% -d -t %TARGET% %CERTOPTS%
if errorlevel 1 exit /B
call "%PCBUILD%build.bat" -p %BUILD_PLAT% -t %TARGET% %CERTOPTS%
if errorlevel 1 exit /B
@rem build.bat turns echo back on, so we disable it again
@echo off
)
"%BUILD%python.exe" "%D%get_wix.py"
set BUILDOPTS=/p:Platform=%1 /p:BuildForRelease=true /p:DownloadUrl=%DOWNLOAD_URL% /p:DownloadUrlBase=%DOWNLOAD_URL_BASE% /p:ReleaseUri=%RELEASE_URI%
msbuild "%D%bundle\releaselocal.wixproj" /t:Rebuild %BUILDOPTS% %CERTOPTS% /p:RebuildAll=true
if errorlevel 1 exit /B
msbuild "%D%bundle\releaseweb.wixproj" /t:Rebuild %BUILDOPTS% %CERTOPTS% /p:RebuildAll=false
if errorlevel 1 exit /B
if not "%OUTDIR%" EQU "" (
mkdir "%OUTDIR%\%OUTDIR_PLAT%"
copy /Y "%BUILD%en-us\*.cab" "%OUTDIR%\%OUTDIR_PLAT%"
copy /Y "%BUILD%en-us\*.exe" "%OUTDIR%\%OUTDIR_PLAT%"
copy /Y "%BUILD%en-us\*.msi" "%OUTDIR%\%OUTDIR_PLAT%"
)

View File

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<Theme xmlns="http://wixtoolset.org/schemas/thmutil/2010">
<Window Width="640" Height="382" HexStyle="100a0000" FontId="0">#(loc.Caption)</Window>
<Font Id="0" Height="-12" Weight="500" Foreground="000000" Background="ffffff">Segoe UI</Font>
<Font Id="1" Height="-24" Weight="500" Foreground="000000" Background="ffffff">Segoe UI</Font>
<Font Id="2" Height="-22" Weight="500" Foreground="666666" Background="ffffff">Segoe UI</Font>
<Font Id="3" Height="-12" Weight="500" Foreground="000000" Background="ffffff">Segoe UI</Font>
<Font Id="4" Height="-12" Weight="500" Foreground="ff0000" Background="ffffff" Underline="yes">Segoe UI</Font>
<Font Id="5" Height="-12" Weight="500" Foreground="666666" Background="ffffff">Segoe UI</Font>
<Page Name="Help">
<Text X="185" Y="11" Width="-11" Height="32" FontId="1" DisablePrefix="yes">#(loc.HelpHeader)</Text>
<Image X="0" Y="0" Width="162" Height="352" ImageFile="SideBar.png"/>
<Text X="185" Y="50" Width="-11" Height="-35" FontId="3" DisablePrefix="yes">#(loc.HelpText)</Text>
<Button Name="SuccessCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.CloseButton)</Button>
</Page>
<Page Name="Install">
<Text X="185" Y="11" Width="-11" Height="32" FontId="1" DisablePrefix="yes">#(loc.InstallHeader)</Text>
<Image X="0" Y="0" Width="162" Height="352" ImageFile="SideBar.png"/>
<Text X="185" Y="50" Width="-11" Height="50" FontId="3" TabStop="yes">#(loc.InstallMessage)</Text>
<Button Name="InstallAllUsersButton" X="175" Y="101" Width="-11" Height="59" TabStop="yes" FontId="3" HexStyle="0xF">#(loc.InstallAllUsersButton)</Button>
<Button Name="InstallJustForMeButton" X="175" Y="171" Width="-11" Height="59" TabStop="yes" FontId="3" HexStyle="0xE">#(loc.InstallJustForMeButton)</Button>
<Button Name="InstallCustomButton" X="175" Y="241" Width="-11" Height="59" TabStop="yes" FontId="3" HexStyle="0xE">#(loc.InstallCustomButton)</Button>
<Checkbox Name="PrependPath" X="185" Y="-13" Width="-100" Height="20" TabStop="yes" FontId="3">#(loc.ShortPrependPathLabel)</Checkbox>
<Button Name="InstallCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.CancelButton)</Button>
</Page>
<Page Name="SimpleInstall">
<Text X="185" Y="11" Width="-11" Height="32" FontId="1" DisablePrefix="yes">#(loc.InstallHeader)</Text>
<Image X="0" Y="0" Width="162" Height="352" ImageFile="SideBar.png"/>
<Button Name="InstallSimpleButton" X="175" Y="101" Width="-11" Height="59" TabStop="yes" FontId="3" HideWhenDisabled="yes" HexStyle="0xF">#(loc.InstallSimpleButton)</Button>
<Button Name="InstallCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.CancelButton)</Button>
</Page>
<Page Name="Custom1">
<Text X="185" Y="11" Width="-11" Height="32" FontId="1" DisablePrefix="yes">#(loc.Custom1Header)</Text>
<Image X="0" Y="0" Width="162" Height="352" ImageFile="SideBar.png"/>
<Checkbox Name="Include_doc" X="185" Y="51" Width="-11" Height="20" TabStop="yes" FontId="3" HideWhenDisabled="yes">#(loc.Include_docLabel)</Checkbox>
<Text X="205" Y="71" Width="-11" Height="20" TabStop="no" FontId="5">#(loc.Include_docHelpLabel)</Text>
<Checkbox Name="Include_pip" X="185" Y="96" Width="-11" Height="20" TabStop="yes" FontId="3" HideWhenDisabled="yes">#(loc.Include_pipLabel)</Checkbox>
<Text X="205" Y="116" Width="-11" Height="20" TabStop="no" FontId="5">#(loc.Include_pipHelpLabel)</Text>
<Checkbox Name="Include_tcltk" X="185" Y="141" Width="-11" Height="20" TabStop="yes" FontId="3" HideWhenDisabled="yes">#(loc.Include_tcltkLabel)</Checkbox>
<Text X="205" Y="161" Width="-11" Height="20" TabStop="no" FontId="5">#(loc.Include_tcltkHelpLabel)</Text>
<Checkbox Name="Include_test" X="185" Y="186" Width="-11" Height="20" TabStop="yes" FontId="3" HideWhenDisabled="yes">#(loc.Include_testLabel)</Checkbox>
<Text X="205" Y="206" Width="-11" Height="20" TabStop="no" FontId="5">#(loc.Include_testHelpLabel)</Text>
<Checkbox Name="Include_launcher" X="185" Y="231" Width="-11" Height="20" TabStop="yes" FontId="3" HideWhenDisabled="yes">#(loc.Include_launcherLabel)</Checkbox>
<Text X="205" Y="251" Width="-11" Height="20" TabStop="no" FontId="5">#(loc.Include_launcherHelpLabel)</Text>
<Button Name="Custom1BackButton" X="185" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.CustomBackButton)</Button>
<Button Name="CustomNextButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.CustomNextButton)</Button>
<Button Name="Custom1CancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.CancelButton)</Button>
</Page>
<Page Name="Custom2">
<Text X="185" Y="11" Width="-11" Height="32" FontId="1" DisablePrefix="yes">#(loc.Custom2Header)</Text>
<Image X="0" Y="0" Width="162" Height="352" ImageFile="SideBar.png"/>
<Checkbox Name="AssociateFiles" X="185" Y="51" Width="-11" Height="20" TabStop="yes" FontId="3" HideWhenDisabled="no">#(loc.AssociateFilesLabel)</Checkbox>
<Checkbox Name="PrependPath" X="185" Y="76" Width="-11" Height="20" TabStop="yes" FontId="3" HideWhenDisabled="no">#(loc.PrependPathLabel)</Checkbox>
<Checkbox Name="InstallAllUsers" X="185" Y="101" Width="-11" Height="20" TabStop="yes" FontId="3" HideWhenDisabled="no">#(loc.InstallAllUsersLabel)</Checkbox>
<Checkbox Name="CompileAll" X="185" Y="126" Width="-11" Height="20" TabStop="yes" FontId="3" HideWhenDisabled="no">#(loc.PrecompileLabel)</Checkbox>
<Checkbox Name="Include_symbols" X="185" Y="151" Width="-11" Height="20" TabStop="yes" FontId="3" HideWhenDisabled="no">#(loc.Include_symbolsLabel)</Checkbox>
<Checkbox Name="Include_debug" X="185" Y="176" Width="-11" Height="20" TabStop="yes" FontId="3" HideWhenDisabled="no">#(loc.Include_debugLabel)</Checkbox>
<Text X="185" Y="221" Width="-11" Height="17" FontId="3">#(loc.CustomLocationLabel)</Text>
<Editbox Name="TargetDir" X="185" Y="237" Width="-91" Height="21" TabStop="yes" FontId="3" FileSystemAutoComplete="yes" />
<Button Name="CustomBrowseButton" X="-11" Y="236" Width="75" Height="23" TabStop="yes" FontId="3">#(loc.CustomBrowseButton)</Button>
<Text X="185" Y="261" Width="-91" Height="35" FontId="5">#(loc.CustomLocationHelpLabel)</Text>
<Button Name="Custom2BackButton" X="185" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.CustomBackButton)</Button>
<Button Name="CustomInstallButton" X="-91" Y="-11" Width="95" Height="23" TabStop="yes" FontId="0">#(loc.CustomInstallButton)</Button>
<Button Name="Custom2CancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.CancelButton)</Button>
</Page>
<Page Name="Progress">
<Text X="185" Y="11" Width="-11" Height="32" FontId="1" DisablePrefix="yes">#(loc.ProgressHeader)</Text>
<Image X="0" Y="0" Width="162" Height="352" ImageFile="SideBar.png"/>
<Text X="185" Y="111" Width="70" Height="17" FontId="3" DisablePrefix="yes">#(loc.ProgressLabel)</Text>
<Text Name="OverallProgressPackageText" X="185" Y="141" Width="-11" Height="17" FontId="3" DisablePrefix="yes">#(loc.OverallProgressPackageText)</Text>
<Progressbar Name="OverallCalculatedProgressbar" X="185" Y="163" Width="-11" Height="20" />
<Button Name="ProgressCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.CancelButton)</Button>
</Page>
<Page Name="Modify">
<Text X="185" Y="11" Width="-11" Height="32" FontId="1" DisablePrefix="yes">#(loc.ModifyHeader)</Text>
<Image X="0" Y="0" Width="162" Height="352" ImageFile="SideBar.png"/>
<Button Name="ModifyButton" X="175" Y="101" Width="-11" Height="59" TabStop="yes" FontId="3" HexStyle="0xF">#(loc.ModifyModifyButton)</Button>
<Button Name="RepairButton" X="175" Y="171" Width="-11" Height="59" TabStop="yes" FontId="3" HexStyle="0xE">#(loc.ModifyRepairButton)</Button>
<Button Name="UninstallButton" X="175" Y="241" Width="-11" Height="59" TabStop="yes" FontId="3" HexStyle="0xE">#(loc.ModifyUninstallButton)</Button>
<Button Name="ModifyCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.CancelButton)</Button>
</Page>
<Page Name="Success">
<Text X="185" Y="11" Width="-11" Height="32" FontId="1" DisablePrefix="yes">#(loc.SuccessHeader)</Text>
<Image X="0" Y="0" Width="162" Height="352" ImageFile="SideBar.png"/>
<Hypertext Name="SuccessText" X="205" Y="71" Width="-31" Height="100" FontId="3" DisablePrefix="yes"></Hypertext>
<Text Name="SuccessRestartText" X="185" Y="-100" Width="-11" Height="34" FontId="3" HideWhenDisabled="yes" DisablePrefix="yes">#(loc.SuccessRestartText)</Text>
<Button Name="LaunchButton" X="185" Y="-50" Width="-11" Height="59" TabStop="yes" FontId="3" HexStyle="0xF" HideWhenDisabled="yes">#(loc.SuccessLaunchButton)</Button>
<Button Name="SuccessRestartButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" HideWhenDisabled="yes">#(loc.SuccessRestartButton)</Button>
<Button Name="SuccessCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.CloseButton)</Button>
</Page>
<Page Name="Failure">
<Text X="185" Y="11" Width="-11" Height="32" FontId="1" DisablePrefix="yes">#(loc.FailureHeader)</Text>
<Image X="0" Y="0" Width="162" Height="352" ImageFile="SideBar.png"/>
<Hypertext Name="FailureLogFileLink" X="185" Y="71" Width="-11" Height="60" FontId="3" TabStop="yes" HideWhenDisabled="yes">#(loc.FailureHyperlinkLogText)</Hypertext>
<Hypertext Name="FailureMessageText" X="185" Y="-100" Width="-11" Height="34" FontId="3" TabStop="yes" HideWhenDisabled="yes">Failure Message</Hypertext>
<Text Name="FailureRestartText" X="185" Y="-40" Width="-11" Height="34" FontId="3" HideWhenDisabled="yes" DisablePrefix="yes">#(loc.FailureRestartText)</Text>
<Button Name="FailureRestartButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" HideWhenDisabled="yes">#(loc.FailureRestartButton)</Button>
<Button Name="FailureCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.CloseButton)</Button>
</Page>
</Theme>

View File

@ -0,0 +1,103 @@
<?xml version="1.0" encoding="utf-8"?>
<WixLocalization Culture="en-us" Language="1033" xmlns="http://schemas.microsoft.com/wix/2006/localization">
<String Id="Caption">[WixBundleName] Setup</String>
<String Id="Title">[WixBundleName]</String>
<String Id="Installing">Installing</String>
<String Id="Installation">Setup</String>
<String Id="Modifying">Updating</String>
<String Id="Modification">Modify</String>
<String Id="Repairing">Repairing</String>
<String Id="Repair">Repair</String>
<String Id="Uninstalling">Removing</String>
<String Id="Uninstallation">Uninstall</String>
<String Id="CancelButton">&amp;Cancel</String>
<String Id="CloseButton">&amp;Close</String>
<String Id="InstallHeader">Install [WixBundleName]</String>
<String Id="InstallMessage">Select to location to install Python, or choose Customize to enable or disable features.</String>
<String Id="InstallVersion">Version [WixBundleVersion]</String>
<String Id="ConfirmCancelMessage">Are you sure you want to cancel?</String>
<String Id="ExecuteUpgradeRelatedBundleMessage">Previous version</String>
<String Id="HelpHeader">Setup Help</String>
<String Id="HelpText">/uninstall
Uninstalls Python without prompting for confirmation.
/layout [\[]directory[\]]
Downloads all components for offline installation.
/passive
Displays progress without requiring user interaction.
/quiet
Performs the requested action without displaying any UI.
/log [\[]filename[\]]
Logs to a specific file. By default, log files are created in %TEMP%.</String>
<String Id="InstallLicenseLinkText">[WixBundleName] &lt;a href="#"&gt;license terms&lt;/a&gt;.</String>
<String Id="InstallAcceptCheckbox">I &amp;agree to the license terms and conditions</String>
<String Id="InstallAllUsersButton">Install for &amp;All Users</String>
<String Id="InstallAllUsersButtonNote">[DefaultAllUsersTargetDir]</String>
<String Id="InstallJustForMeButton">Install &amp;Just for Me</String>
<String Id="InstallJustForMeButtonNote">[DefaultJustForMeTargetDir]</String>
<String Id="InstallCustomButton">C&amp;ustomize installation</String>
<String Id="InstallCustomButtonNote">Choose location and features</String>
<String Id="InstallSimpleButton">&amp;Install</String>
<String Id="InstallSimpleButtonNote">Uses setting preselected by your administrator</String>
<String Id="Custom1Header">Optional Features</String>
<String Id="Custom2Header">Advanced Options</String>
<String Id="CustomLocationLabel">Customize install location</String>
<String Id="CustomLocationHelpLabel">If not installing as administrator, you will require write permissions for this location.</String>
<String Id="CustomInstallButton">&amp;Install</String>
<String Id="CustomNextButton">&amp;Next</String>
<String Id="CustomBackButton">&amp;Back</String>
<String Id="CustomBrowseButton">B&amp;rowse</String>
<String Id="Include_docLabel">&amp;Documentation</String>
<String Id="Include_docHelpLabel">Installs the Python documentation file.</String>
<String Id="Include_pipLabel">&amp;pip</String>
<String Id="Include_pipHelpLabel">Installs pip, which can download and install other Python packages.</String>
<String Id="Include_tcltkLabel">tcl/tk and &amp;IDLE</String>
<String Id="Include_tcltkHelpLabel">Installs tkinter and the IDLE development environment.</String>
<String Id="Include_testLabel">Python &amp;test suite</String>
<String Id="Include_testHelpLabel">Installs the standard library test suite.</String>
<String Id="Include_launcherLabel">py &amp;launcher</String>
<String Id="Include_launcherHelpLabel">Installs the global 'py' launcher to make it easier to start Python.</String>
<String Id="AssociateFilesLabel">Associate &amp;files with Python (requires the py launcher)</String>
<String Id="PrependPathLabel">Add Python to &amp;environment variables</String>
<String Id="ShortPrependPathLabel">Add &amp;Python [ShortVersion] to PATH</String>
<String Id="InstallAllUsersLabel">Install as &amp;Administrator</String>
<String Id="PrecompileLabel">&amp;Precompile standard library</String>
<String Id="Include_symbolsLabel">Install debugging &amp;symbols</String>
<String Id="Include_debugLabel">Install debu&amp;g binaries</String>
<String Id="ProgressHeader">[ActionLikeInstallation] Progress</String>
<String Id="ProgressLabel">[ActionLikeInstalling]:</String>
<String Id="OverallProgressPackageText">Initializing...</String>
<String Id="ModifyHeader">Modify Setup</String>
<String Id="ModifyModifyButton">&amp;Modify</String>
<String Id="ModifyButtonNote">Add or remove individual features.</String>
<String Id="ModifyRepairButton">&amp;Repair</String>
<String Id="RepairButtonNote">Ensure all current features are correctly installed.</String>
<String Id="ModifyUninstallButton">&amp;Uninstall</String>
<String Id="UninstallButtonNote">Remove the entire [WixBundleName] installation.</String>
<String Id="SuccessHeader">[ActionLikeInstallation] was successful</String>
<String Id="SuccessLaunchButton">&amp;Launch</String>
<String Id="SuccessRestartText">You may need to restart your computer to finish updating files.</String>
<String Id="SuccessRestartButton">&amp;Restart</String>
<String Id="SuccessInstallMessage">Special thanks to Mark Hammond, without whose years of freely shared Windows expertise, Python for Windows would still be Python for DOS.
New to Python? Start with the &lt;a href="https://docs.python.org/[ShortVersion]/tutorial/index.html"&gt;online tutorial&lt;/a&gt; and &lt;a href="https://docs.python.org/[ShortVersion]/index.html"&gt;documentation&lt;/a&gt;.
See &lt;a href="https://docs.python.org/[ShortVersion]/whatsnew/[ShortVersion].html"&gt;what's new&lt;/a&gt; in this release.</String>
<String Id="SuccessModifyMessage">Thank you for using [WixBundleName].</String>
<String Id="SuccessRepairMessage">Thank you for using [WixBundleName].
Feel free to email &lt;a href="mailto:python-list@python.org"&gt;python-list@python.org&lt;/a&gt; if you continue to encounter issues.</String>
<String Id="SuccessRemoveMessage">Thank you for using [WixBundleName].
Feel free to email &lt;a href="mailto:python-list@python.org"&gt;python-list@python.org&lt;/a&gt; if you encountered problems.</String>
<String Id="FailureHeader">Setup failed</String>
<String Id="FailureHyperlinkLogText">One or more issues caused the setup to fail. Please fix the issues and then retry setup. For more information see the &lt;a href="#"&gt;log file&lt;/a&gt;.</String>
<String Id="FailureRestartText">You must restart your computer to complete the rollback of the software.</String>
<String Id="FailureRestartButton">&amp;Restart</String>
</WixLocalization>

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

View File

@ -0,0 +1,25 @@
This license applies to the bootstrapper application that is embedded within the installer. It has no impact on the licensing for the rest of the installer or Python itself, as no code covered by this license exists in any other part of the product.
---
Microsoft Reciprocal License (MS-RL)
This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software.
1. Definitions
The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under U.S. copyright law.
A "contribution" is the original software, or any additions or changes to the software.
A "contributor" is any person that distributes its contribution under this license.
"Licensed patents" are a contributor's patent claims that read directly on its contribution.
2. Grant of Rights
(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.
(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.
3. Conditions and Limitations
(A) Reciprocal Grants- For any file you distribute that contains code from the software (in source code or binary format), you must provide recipients the source code to that file along with a copy of this license, which license will govern that file. You may license other files that are entirely your own work and do not contain code from the software under any terms you choose.
(B) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.
(C) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically.
(D) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software.
(E) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.
(F) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1 @@
#include "pch.h"

View File

@ -0,0 +1,59 @@
//-------------------------------------------------------------------------------------------------
// <copyright file="precomp.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// Precompiled header for standard bootstrapper application.
// </summary>
//-------------------------------------------------------------------------------------------------
#pragma once
#include <windows.h>
#include <gdiplus.h>
#include <Uxtheme.h>
#include <msiquery.h>
#include <objbase.h>
#include <shlobj.h>
#include <shlwapi.h>
#include <stdlib.h>
#include <strsafe.h>
#include <stddef.h>
#include "dutil.h"
#include "memutil.h"
#include "dictutil.h"
#include "dirutil.h"
#include "fileutil.h"
#include "locutil.h"
#include "logutil.h"
#include "pathutil.h"
#include "resrutil.h"
#include "shelutil.h"
#include "strutil.h"
#include "thmutil.h"
#include "uriutil.h"
#include "xmlutil.h"
#include "IBootstrapperEngine.h"
#include "IBootstrapperApplication.h"
#include "BalBaseBootstrapperApplication.h"
#include "balinfo.h"
#include "balcondition.h"
HRESULT CreateBootstrapperApplication(
__in HMODULE hModule,
__in BOOL fPrereq,
__in HRESULT hrHostInitialization,
__in IBootstrapperEngine* pEngine,
__in const BOOTSTRAPPER_COMMAND* pCommand,
__out IBootstrapperApplication** ppApplication
);
#include "IBootstrapperBAFunction.h"

View File

@ -0,0 +1,76 @@
//-------------------------------------------------------------------------------------------------
// <copyright file="wixstdba.cpp" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// Setup chainer/bootstrapper standard UI for WiX toolset.
// </summary>
//-------------------------------------------------------------------------------------------------
#include "pch.h"
static HINSTANCE vhInstance = NULL;
extern "C" BOOL WINAPI DllMain(
IN HINSTANCE hInstance,
IN DWORD dwReason,
IN LPVOID /* pvReserved */
)
{
switch(dwReason)
{
case DLL_PROCESS_ATTACH:
::DisableThreadLibraryCalls(hInstance);
vhInstance = hInstance;
break;
case DLL_PROCESS_DETACH:
vhInstance = NULL;
break;
}
return TRUE;
}
extern "C" HRESULT WINAPI BootstrapperApplicationCreate(
__in IBootstrapperEngine* pEngine,
__in const BOOTSTRAPPER_COMMAND* pCommand,
__out IBootstrapperApplication** ppApplication
)
{
HRESULT hr = S_OK;
BalInitialize(pEngine);
hr = CreateBootstrapperApplication(vhInstance, FALSE, S_OK, pEngine, pCommand, ppApplication);
BalExitOnFailure(hr, "Failed to create bootstrapper application interface.");
LExit:
return hr;
}
extern "C" void WINAPI BootstrapperApplicationDestroy()
{
BalUninitialize();
}
extern "C" HRESULT WINAPI MbaPrereqBootstrapperApplicationCreate(
__in HRESULT hrHostInitialization,
__in IBootstrapperEngine* pEngine,
__in const BOOTSTRAPPER_COMMAND* pCommand,
__out IBootstrapperApplication** ppApplication
)
{
return E_NOTIMPL;
}
extern "C" void WINAPI MbaPrereqBootstrapperApplicationDestroy()
{ }

View File

@ -0,0 +1,18 @@
;-------------------------------------------------------------------------------------------------
; <copyright file="wixstdba.def" company="Outercurve Foundation">
; Copyright (c) 2004, Outercurve Foundation.
; This software is released under Microsoft Reciprocal License (MS-RL).
; The license and further copyright text can be found in the file
; LICENSE.TXT at the root directory of the distribution.
; </copyright>
;
; <summary>
; WiX Standard Bootstrapper Application DLL entry points.
; </summary>
;-------------------------------------------------------------------------------------------------
EXPORTS
BootstrapperApplicationCreate
BootstrapperApplicationDestroy
MbaPrereqBootstrapperApplicationCreate
MbaPrereqBootstrapperApplicationDestroy

View File

@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.30501.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pythonba", "pythonba.vcxproj", "{7A09B132-B3EE-499B-A700-A4B2157FEA3D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7A09B132-B3EE-499B-A700-A4B2157FEA3D}.Debug|Win32.ActiveCfg = Debug|Win32
{7A09B132-B3EE-499B-A700-A4B2157FEA3D}.Debug|Win32.Build.0 = Debug|Win32
{7A09B132-B3EE-499B-A700-A4B2157FEA3D}.Release|Win32.ActiveCfg = Release|Win32
{7A09B132-B3EE-499B-A700-A4B2157FEA3D}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<copyright file="wixstdba.vcxproj" company="Outercurve Foundation">
Copyright (c) 2004, Outercurve Foundation.
This software is released under Microsoft Reciprocal License (MS-RL).
The license and further copyright text can be found in the file
LICENSE.TXT at the root directory of the distribution.
</copyright>
-->
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<Configuration Condition="'$(Configuration)' == ''">Release</Configuration>
<Platform Condition="'$(Platform)' == ''">Win32</Platform>
<PlatformToolset Condition="'$(PlatformToolset)' == '' and '$(VCTargetsPath14)' != ''">v140</PlatformToolset>
<PlatformToolset Condition="'$(PlatformToolset)' == '' and '$(VCTargetsPath12)' != ''">v120</PlatformToolset>
<ProjectGuid>{7A09B132-B3EE-499B-A700-A4B2157FEA3D}</ProjectGuid>
<TargetName>PythonBA</TargetName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="..\..\wix.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<IntDir>$(ProjectDir)..\..\obj\$(Configuration)_Bootstrap\</IntDir>
<OutDir>$(IntDir)</OutDir>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions>_CRT_STDIO_LEGACY_WIDE_SPECIFIERS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(WixInstallPath)sdk\inc</AdditionalIncludeDirectories>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<AdditionalDependencies>comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib;wininet.lib;dutil.lib;balutil.lib;version.lib;uxtheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories Condition="'$(PlatformToolset)' == 'v140'">$(WixInstallPath)sdk\vs2015\lib\x86</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories Condition="'$(PlatformToolset)' == 'v120'">$(WixInstallPath)sdk\vs2013\lib\x86</AdditionalLibraryDirectories>
<ModuleDefinitionFile>pythonba.def</ModuleDefinitionFile>
<GenerateDebugInformation Condition="'$(Configuration)'=='Debug'">true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="PythonBootstrapperApplication.cpp" />
<ClCompile Include="pythonba.cpp" />
<ClCompile Include="pch.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="pch.h" />
<ClInclude Include="resource.h" />
</ItemGroup>
<ItemGroup>
<None Include="pythonba.def" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>

View File

@ -0,0 +1,25 @@
//-------------------------------------------------------------------------------------------------
// <copyright file="resource.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//-------------------------------------------------------------------------------------------------
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
//
#define IDC_STATIC -1
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 102
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1003
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

BIN
Tools/msi/bundle/bundle.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

View File

@ -0,0 +1,99 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
<OutputType>Bundle</OutputType>
<BootstrapConfiguration Condition="'$(BootstrapConfiguration)' == ''">Release</BootstrapConfiguration>
<LinkerSuppressSpecificWarnings>1132;1135;1140</LinkerSuppressSpecificWarnings>
<OutputName Condition="$(BuildForRelease)">$(OutputName)-$(PythonVersion)</OutputName>
<OutputName Condition="!$(BuildForRelease)">$(OutputName)-$(MajorVersionNumber).$(MinorVersionNumber).$(MicroVersionNumber).$(RevisionNumber)</OutputName>
<OutputName Condition="$(Platform) == 'x64'">$(OutputName)-amd64</OutputName>
<OutputName Condition="'$(OutputSuffix)' != ''">$(OutputName)-$(OutputSuffix)</OutputName>
<OutputPath>$(OutputPath)en-us\</OutputPath>
<OutDir>$(OutputPath)</OutDir>
<DownloadUrl Condition="'$(DownloadUrl)' == '' and '$(DownloadUrlBase)' != ''">$(DownloadUrlBase.TrimEnd(`/`))/$(PythonVersion)/$(ArchName)/{2}</DownloadUrl>
<DefineConstants Condition="'$(DownloadUrl)' != ''">$(DefineConstants);DownloadUrl=$(DownloadUrl)</DefineConstants>
<DefineConstants Condition="'$(DownloadUrl)' == ''">$(DefineConstants);DownloadUrl={2}</DefineConstants>
</PropertyGroup>
<ItemGroup>
<WixExtension Include="WixUtilExtension">
<HintPath>WixUtilExtension</HintPath>
<Name>WixUtilExtension</Name>
</WixExtension>
<WixExtension Include="WixDependencyExtension">
<HintPath>WixDependencyExtension</HintPath>
<Name>WixDependencyExtension</Name>
</WixExtension>
<WixExtension Include="WixBalExtension">
<HintPath>WixBalExtension</HintPath>
<Name>WixBalExtension</Name>
</WixExtension>
</ItemGroup>
<ItemGroup>
<Compile Include="bundle.wxs" />
<Compile Include="packagegroups\*.wxs" />
</ItemGroup>
<ItemGroup>
<Content Include="Default.thm" />
<Content Include="Default.wxl" />
<Content Include="SideBar.png" />
</ItemGroup>
<ItemGroup>
<WxlTemplate Include="*_en-US.wxl_template" />
</ItemGroup>
<ItemGroup>
<LinkerBindInputPaths Include="$(OutputPath)">
<BindName></BindName>
</LinkerBindInputPaths>
</ItemGroup>
<ItemDefinitionGroup>
<Package>
<Properties>BuildForRelease=$(BuildForRelease)</Properties>
</Package>
</ItemDefinitionGroup>
<ItemGroup>
<Package Include="..\core\core*.wixproj" />
<Package Include="..\crt\crt*.wixproj" />
<Package Include="..\dev\dev*.wixproj" />
<Package Include="..\doc\doc*.wixproj" />
<Package Include="..\exe\exe*.wixproj" />
<Package Include="..\lib\lib*.wixproj" />
<Package Include="..\path\path*.wixproj" />
<Package Include="..\pip\pip*.wixproj" />
<Package Include="..\tcltk\tcltk*.wixproj" />
<Package Include="..\test\test*.wixproj" />
<Package Include="..\tools\tools*.wixproj" />
</ItemGroup>
<Target Name="BuildPackages" BeforeTargets="BeforeBuild" Condition="'$(RebuildAll)' != 'false'">
<MSBuild Projects="@(Package)" BuildInParallel="true" />
</Target>
<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)'
ContinueOnError="false" />
</Target>
<Target Name="BuildBootstrapApplication" BeforeTargets="BeforeBuild">
<Message Text="Building bootstrap app" Importance="high" />
<MSBuild Projects="bootstrap\pythonba.vcxproj"
Targets="Build;GetNativeTargetPath"
UseResultsCache="true"
Properties="Configuration=$(BootstrapConfiguration);Platform=Win32">
<Output TaskParameter="TargetOutputs" PropertyName="BootstrapAppPath" />
</MSBuild>
<PropertyGroup>
<DefineConstants>$(DefineConstants);BootstrapApp=$(BootstrapAppPath)</DefineConstants>
</PropertyGroup>
</Target>
<Import Project="..\msi.targets" />
</Project>

View File

@ -0,0 +1,80 @@
<?xml version="1.0"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:bal="http://schemas.microsoft.com/wix/BalExtension">
<Bundle Name="!(loc.FullProductName)"
UpgradeCode="$(var.UpgradeCode)"
Version="$(var.Version)"
IconSourceFile="bundle.ico"
Manufacturer="!(loc.Manufacturer)"
UpdateUrl="http://www.python.org/"
DisableModify="button"
Compressed="no">
<BootstrapperApplication Id="PythonBA" SourceFile="$(var.BootstrapApp)">
<Payload Compressed='yes' SourceFile='Default.thm' />
<Payload Compressed='yes' SourceFile='Default.wxl' />
<Payload Compressed='yes' SourceFile='SideBar.png' />
</BootstrapperApplication>
<!-- May be set to "Removing" or "Repairing" -->
<Variable Name="ActionLikeInstalling" Value="Installing" />
<!-- May be set to "Uninstallation" or "Repair" -->
<Variable Name="ActionLikeInstallation" Value="Setup" />
<Variable Name="ShortVersion" Value="$(var.MajorVersionNumber).$(var.MinorVersionNumber)" />
<Variable Name="ShortVersionNoDot" Value="$(var.MajorVersionNumber)$(var.MinorVersionNumber)" />
<Variable Name="InstallAllUsers" Value="1" Persisted="yes" bal:Overridable="yes" />
<Variable Name="TargetDir" Value="" Persisted="yes" bal:Overridable="yes" />
<?if $(var.Platform)~="x64" ?>
<Variable Name="DefaultAllUsersTargetDir" Value="[ProgramFiles64Folder]Python [ShortVersion]" bal:Overridable="yes" />
<?else ?>
<Variable Name="DefaultAllUsersTargetDir" Value="[ProgramFilesFolder]Python [ShortVersion]" bal:Overridable="yes" />
<?endif ?>
<Variable Name="DefaultJustForMeTargetDir" Value="[LocalAppDataFolder]Programs\Python\Python[ShortVersionNoDot]$(var.Suffix32)" bal:Overridable="yes" />
<!--
An empty string will use the other defaults based on InstallAllUsers
(and switch dynamically in the UI). To get the old default, pass
this property on the command line:
DefaultCustomTargetDir=[WindowsVolume]Python[ShortVersionNoDot]
-->
<Variable Name="DefaultCustomTargetDir" Value="" bal:Overridable="yes" />
<Variable Name="InstallAllUsersState" Value="enabled" />
<Variable Name="TargetDirState" Value="enabled" />
<Variable Name="CustomBrowseButtonState" Value="enabled" />
<Variable Name="Include_core" Value="1" Persisted="yes" />
<Variable Name="Include_exe" Value="1" Persisted="yes" bal:Overridable="yes" />
<Variable Name="Include_dev" Value="1" Persisted="yes" bal:Overridable="yes" />
<Variable Name="Include_lib" Value="1" Persisted="yes" bal:Overridable="yes" />
<Variable Name="Include_test" Value="1" Persisted="yes" bal:Overridable="yes" />
<Variable Name="Include_doc" Value="1" Persisted="yes" bal:Overridable="yes" />
<Variable Name="Include_tools" Value="1" Persisted="yes" bal:Overridable="yes" />
<Variable Name="Include_tcltk" Value="1" Persisted="yes" bal:Overridable="yes" />
<Variable Name="Include_pip" Value="1" Persisted="yes" bal:Overridable="yes" />
<Variable Name="Include_launcher" Value="1" Persisted="yes" bal:Overridable="yes" />
<Variable Name="Include_symbols" Value="0" Persisted="yes" bal:Overridable="yes" />
<Variable Name="Include_debug" Value="0" Persisted="yes" bal:Overridable="yes" />
<Variable Name="AssociateFiles" Value="1" Persisted="yes" bal:Overridable="yes" />
<Variable Name="PrependPath" Value="0" Persisted="yes" bal:Overridable="yes" />
<Variable Name="CompileAll" Value="0" Persisted="yes" bal:Overridable="yes" />
<Variable Name="SimpleInstall" Value="0" bal:Overridable="yes" />
<Chain ParallelCache="yes">
<PackageGroupRef Id="crt" />
<PackageGroupRef Id="core" />
<PackageGroupRef Id="dev" />
<PackageGroupRef Id="exe" />
<PackageGroupRef Id="lib" />
<PackageGroupRef Id="test" />
<PackageGroupRef Id="doc" />
<PackageGroupRef Id="tools" />
<PackageGroupRef Id="tcltk" />
<PackageGroupRef Id="launcher" />
<PackageGroupRef Id="postinstall" />
</Chain>
</Bundle>
</Wix>

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{3E204ADD-238D-4D10-852C-4F859325C839}</ProjectGuid>
<OutputName>python</OutputName>
<OutputSuffix>full</OutputSuffix>
</PropertyGroup>
<Import Project="..\msi.props" />
<PropertyGroup>
<DefineConstants>
$(DefineConstants);
CompressMSI=yes;
CompressPDB=yes;
CompressMSI_D=yes;
</DefineConstants>
</PropertyGroup>
<Import Project="bundle.targets" />
</Project>

View File

@ -0,0 +1,56 @@
<?xml version="1.0"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<PackageGroup Id="core">
<MsiPackage Id="core_AllUsers"
SourceFile="core.msi"
Compressed="$(var.CompressMSI)"
DownloadUrl="$(var.DownloadUrl)"
ForcePerMachine="yes"
InstallCondition="InstallAllUsers and (Include_core or Include_exe or Include_launcher or Include_pip)">
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
</MsiPackage>
<MsiPackage Id="core_AllUsers_pdb"
SourceFile="core_pdb.msi"
Compressed="$(var.CompressPDB)"
DownloadUrl="$(var.DownloadUrl)"
ForcePerMachine="yes"
InstallCondition="InstallAllUsers and (Include_core or Include_exe or Include_launcher or Include_pip) and Include_symbols">
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
</MsiPackage>
<MsiPackage Id="core_AllUsers_d"
SourceFile="core_d.msi"
Compressed="$(var.CompressMSI_D)"
DownloadUrl="$(var.DownloadUrl)"
ForcePerMachine="yes"
InstallCondition="InstallAllUsers and (Include_core or Include_exe or Include_launcher or Include_pip) and Include_debug">
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
</MsiPackage>
<MsiPackage Id="core_JustForMe"
SourceFile="core.msi"
Compressed="$(var.CompressMSI)"
DownloadUrl="$(var.DownloadUrl)"
ForcePerMachine="no"
InstallCondition="not InstallAllUsers and (Include_core or Include_exe or Include_launcher or Include_pip)">
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
</MsiPackage>
<MsiPackage Id="core_JustForMe_pdb"
SourceFile="core_pdb.msi"
Compressed="$(var.CompressPDB)"
DownloadUrl="$(var.DownloadUrl)"
ForcePerMachine="no"
InstallCondition="not InstallAllUsers and (Include_core or Include_exe or Include_launcher or Include_pip) and Include_symbols">
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
</MsiPackage>
<MsiPackage Id="core_JustForMe_d"
SourceFile="core_d.msi"
Compressed="$(var.CompressMSI_D)"
DownloadUrl="$(var.DownloadUrl)"
ForcePerMachine="no"
InstallCondition="not InstallAllUsers and (Include_core or Include_exe or Include_launcher or Include_pip) and Include_debug">
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
</MsiPackage>
</PackageGroup>
</Fragment>
</Wix>

View File

@ -0,0 +1,25 @@
<?xml version="1.0"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<PackageGroup Id="crt">
<MsiPackage Id="crt_AllUsers"
SourceFile="crt.msi"
Compressed="$(var.CompressMSI)"
DownloadUrl="$(var.DownloadUrl)"
ForcePerMachine="yes"
InstallCondition="InstallAllUsers and (Include_core or Include_exe or Include_launcher or Include_pip)">
<!-- TARGETDIR will be ignored, but must still be provided -->
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
</MsiPackage>
<MsiPackage Id="crt_JustForMe"
SourceFile="crt.msi"
Compressed="$(var.CompressMSI)"
DownloadUrl="$(var.DownloadUrl)"
ForcePerMachine="no"
InstallCondition="not InstallAllUsers and (Include_core or Include_exe or Include_launcher or Include_pip)">
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
</MsiPackage>
</PackageGroup>
</Fragment>
</Wix>

View File

@ -0,0 +1,40 @@
<?xml version="1.0"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<PackageGroup Id="dev">
<MsiPackage Id="dev_AllUsers"
SourceFile="dev.msi"
Compressed="$(var.CompressMSI)"
DownloadUrl="$(var.DownloadUrl)"
ForcePerMachine="yes"
InstallCondition="InstallAllUsers and Include_dev">
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
</MsiPackage>
<MsiPackage Id="dev_AllUsers_d"
SourceFile="dev_d.msi"
Compressed="$(var.CompressMSI_D)"
DownloadUrl="$(var.DownloadUrl)"
ForcePerMachine="yes"
InstallCondition="InstallAllUsers and Include_dev and Include_debug">
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
</MsiPackage>
<MsiPackage Id="dev_JustForMe"
SourceFile="dev.msi"
Compressed="$(var.CompressMSI)"
DownloadUrl="$(var.DownloadUrl)"
ForcePerMachine="no"
InstallCondition="not InstallAllUsers and Include_dev">
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
</MsiPackage>
<MsiPackage Id="dev_JustForMe_d"
SourceFile="dev_d.msi"
Compressed="$(var.CompressMSI_D)"
DownloadUrl="$(var.DownloadUrl)"
ForcePerMachine="no"
InstallCondition="not InstallAllUsers and Include_dev and Include_debug">
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
</MsiPackage>
</PackageGroup>
</Fragment>
</Wix>

View File

@ -0,0 +1,24 @@
<?xml version="1.0"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<PackageGroup Id="doc">
<MsiPackage Id="doc_AllUsers"
SourceFile="doc.msi"
Compressed="$(var.CompressMSI)"
DownloadUrl="$(var.DownloadUrl)"
ForcePerMachine="yes"
InstallCondition="InstallAllUsers and Include_doc">
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
</MsiPackage>
<MsiPackage Id="doc_JustForMe"
SourceFile="doc.msi"
Compressed="$(var.CompressMSI)"
DownloadUrl="$(var.DownloadUrl)"
ForcePerMachine="no"
InstallCondition="not InstallAllUsers and Include_doc">
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
</MsiPackage>
</PackageGroup>
</Fragment>
</Wix>

View File

@ -0,0 +1,56 @@
<?xml version="1.0"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<PackageGroup Id="exe">
<MsiPackage Id="exe_AllUsers"
SourceFile="exe.msi"
ForcePerMachine="yes"
Compressed="$(var.CompressMSI)"
DownloadUrl="$(var.DownloadUrl)"
InstallCondition="InstallAllUsers and (Include_exe or Include_launcher or Include_pip)">
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
</MsiPackage>
<MsiPackage Id="exe_AllUsers_pdb"
SourceFile="exe_pdb.msi"
ForcePerMachine="yes"
Compressed="$(var.CompressPDB)"
DownloadUrl="$(var.DownloadUrl)"
InstallCondition="InstallAllUsers and (Include_exe or Include_launcher or Include_pip) and Include_symbols">
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
</MsiPackage>
<MsiPackage Id="exe_AllUsers_d"
SourceFile="exe_d.msi"
ForcePerMachine="yes"
Compressed="$(var.CompressMSI_D)"
DownloadUrl="$(var.DownloadUrl)"
InstallCondition="InstallAllUsers and (Include_exe or Include_launcher or Include_pip) and Include_debug">
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
</MsiPackage>
<MsiPackage Id="exe_JustForMe"
SourceFile="exe.msi"
ForcePerMachine="no"
Compressed="$(var.CompressMSI)"
DownloadUrl="$(var.DownloadUrl)"
InstallCondition="not InstallAllUsers and (Include_exe or Include_launcher or Include_pip)">
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
</MsiPackage>
<MsiPackage Id="exe_JustForMe_pdb"
SourceFile="exe_pdb.msi"
ForcePerMachine="no"
Compressed="$(var.CompressPDB)"
DownloadUrl="$(var.DownloadUrl)"
InstallCondition="not InstallAllUsers and (Include_exe or Include_launcher or Include_pip) and Include_symbols">
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
</MsiPackage>
<MsiPackage Id="exe_JustForMe_d"
SourceFile="exe_d.msi"
ForcePerMachine="no"
Compressed="$(var.CompressMSI_D)"
DownloadUrl="$(var.DownloadUrl)"
InstallCondition="not InstallAllUsers and (Include_exe or Include_launcher or Include_pip) and Include_debug">
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
</MsiPackage>
</PackageGroup>
</Fragment>
</Wix>

View File

@ -0,0 +1,23 @@
<?xml version="1.0"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<PackageGroup Id="launcher">
<!-- The All Users launcher is always the 32-bit version -->
<MsiPackage Id="launcher_AllUsers"
SourceFile="launcher.msi"
Compressed="$(var.CompressMSI)"
DownloadUrl="$(var.DownloadUrl)"
ForcePerMachine="yes"
EnableFeatureSelection="yes"
InstallCondition="InstallAllUsers and Include_launcher" />
<MsiPackage Id="launcher_JustForMe"
SourceFile="launcher.msi"
Compressed="$(var.CompressMSI)"
DownloadUrl="$(var.DownloadUrl)"
ForcePerMachine="no"
EnableFeatureSelection="yes"
InstallCondition="not InstallAllUsers and Include_launcher" />
</PackageGroup>
</Fragment>
</Wix>

View File

@ -0,0 +1,56 @@
<?xml version="1.0"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<PackageGroup Id="lib">
<MsiPackage Id="lib_AllUsers"
SourceFile="lib.msi"
Compressed="$(var.CompressMSI)"
DownloadUrl="$(var.DownloadUrl)"
ForcePerMachine="yes"
InstallCondition="InstallAllUsers and Include_lib">
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
</MsiPackage>
<MsiPackage Id="lib_AllUsers_pdb"
SourceFile="lib_pdb.msi"
Compressed="$(var.CompressPDB)"
DownloadUrl="$(var.DownloadUrl)"
ForcePerMachine="yes"
InstallCondition="InstallAllUsers and Include_lib and Include_symbols">
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
</MsiPackage>
<MsiPackage Id="lib_AllUsers_d"
SourceFile="lib_d.msi"
Compressed="$(var.CompressMSI_D)"
DownloadUrl="$(var.DownloadUrl)"
ForcePerMachine="yes"
InstallCondition="InstallAllUsers and Include_lib and Include_debug">
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
</MsiPackage>
<MsiPackage Id="lib_JustForMe"
SourceFile="lib.msi"
Compressed="$(var.CompressMSI)"
DownloadUrl="$(var.DownloadUrl)"
ForcePerMachine="no"
InstallCondition="not InstallAllUsers and Include_lib">
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
</MsiPackage>
<MsiPackage Id="lib_JustForMe_pdb"
SourceFile="lib_pdb.msi"
Compressed="$(var.CompressPDB)"
DownloadUrl="$(var.DownloadUrl)"
ForcePerMachine="no"
InstallCondition="not InstallAllUsers and Include_lib and Include_symbols">
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
</MsiPackage>
<MsiPackage Id="lib_JustForMe_d"
SourceFile="lib_d.msi"
Compressed="$(var.CompressMSI_D)"
DownloadUrl="$(var.DownloadUrl)"
ForcePerMachine="no"
InstallCondition="not InstallAllUsers and Include_lib and Include_debug">
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
</MsiPackage>
</PackageGroup>
</Fragment>
</Wix>

View File

@ -0,0 +1,62 @@
<?xml version="1.0"?>
<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">
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
</MsiPackage>
<MsiPackage Id="pip_JustForMe"
SourceFile="pip.msi"
Compressed="$(var.CompressMSI)"
DownloadUrl="$(var.DownloadUrl)"
ForcePerMachine="no"
InstallCondition="not InstallAllUsers and Include_pip">
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
</MsiPackage>
<MsiPackage Id="path_AllUsers"
SourceFile="path.msi"
Compressed="$(var.CompressMSI)"
DownloadUrl="$(var.DownloadUrl)"
ForcePerMachine="yes"
InstallCondition="InstallAllUsers and PrependPath">
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
</MsiPackage>
<MsiPackage Id="path_JustForMe"
SourceFile="path.msi"
Compressed="$(var.CompressMSI)"
DownloadUrl="$(var.DownloadUrl)"
ForcePerMachine="no"
InstallCondition="not InstallAllUsers and PrependPath">
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
</MsiPackage>
<?define CompileAllCommand=-$(var.ShortVersion)$(var.Suffix32) -Wi "[TargetDir]\Lib\compileall.py" -f -x "bad_coding|badsyntax|site-packages|py2_|lib2to3\\tests|venv\\scripts" "[TargetDir]\Lib"?>
<ExePackage Id="compileall_AllUsers"
SourceFile="py.exe"
Compressed="yes"
DisplayName="!(loc.CompileAllDescription)"
InstallCommand='$(var.CompileAllCommand)'
RepairCommand='$(var.CompileAllCommand)'
Permanent="yes"
PerMachine="yes"
Vital="no"
InstallCondition="InstallAllUsers and CompileAll" />
<ExePackage Id="compileall_JustForMe"
SourceFile="py.exe"
Compressed="yes"
DisplayName="!(loc.CompileAllDescription)"
InstallCommand='$(var.CompileAllCommand)'
RepairCommand='$(var.CompileAllCommand)'
Permanent="yes"
PerMachine="no"
Vital="no"
InstallCondition="not InstallAllUsers and CompileAll" />
</PackageGroup>
</Fragment>
</Wix>

View File

@ -0,0 +1,62 @@
<?xml version="1.0"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<PackageGroup Id="tcltk">
<MsiPackage Id="tcltk_AllUsers"
SourceFile="tcltk.msi"
Compressed="$(var.CompressMSI)"
DownloadUrl="$(var.DownloadUrl)"
ForcePerMachine="yes"
EnableFeatureSelection="yes"
InstallCondition="InstallAllUsers and Include_tcltk">
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
</MsiPackage>
<MsiPackage Id="tcltk_AllUsers_pdb"
SourceFile="tcltk_pdb.msi"
Compressed="$(var.CompressPDB)"
DownloadUrl="$(var.DownloadUrl)"
ForcePerMachine="yes"
EnableFeatureSelection="yes"
InstallCondition="InstallAllUsers and Include_tcltk and Include_symbols">
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
</MsiPackage>
<MsiPackage Id="tcltk_AllUsers_d"
SourceFile="tcltk_d.msi"
Compressed="$(var.CompressMSI_D)"
DownloadUrl="$(var.DownloadUrl)"
ForcePerMachine="yes"
EnableFeatureSelection="yes"
InstallCondition="InstallAllUsers and Include_tcltk and Include_debug">
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
</MsiPackage>
<MsiPackage Id="tcltk_JustForMe"
SourceFile="tcltk.msi"
Compressed="$(var.CompressMSI)"
DownloadUrl="$(var.DownloadUrl)"
ForcePerMachine="no"
EnableFeatureSelection="yes"
InstallCondition="not InstallAllUsers and Include_tcltk">
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
</MsiPackage>
<MsiPackage Id="tcltk_JustForMe_pdb"
SourceFile="tcltk_pdb.msi"
Compressed="$(var.CompressPDB)"
DownloadUrl="$(var.DownloadUrl)"
ForcePerMachine="no"
EnableFeatureSelection="yes"
InstallCondition="not InstallAllUsers and Include_tcltk and Include_symbols">
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
</MsiPackage>
<MsiPackage Id="tcltk_JustForMe_d"
SourceFile="tcltk_d.msi"
Compressed="$(var.CompressMSI_D)"
DownloadUrl="$(var.DownloadUrl)"
ForcePerMachine="no"
EnableFeatureSelection="yes"
InstallCondition="not InstallAllUsers and Include_tcltk and Include_debug">
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
</MsiPackage>
</PackageGroup>
</Fragment>
</Wix>

View File

@ -0,0 +1,56 @@
<?xml version="1.0"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<PackageGroup Id="test">
<MsiPackage Id="test_AllUsers"
SourceFile="test.msi"
Compressed="$(var.CompressMSI)"
DownloadUrl="$(var.DownloadUrl)"
ForcePerMachine="yes"
InstallCondition="InstallAllUsers and Include_test">
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
</MsiPackage>
<MsiPackage Id="test_AllUsers_pdb"
SourceFile="test_pdb.msi"
Compressed="$(var.CompressPDB)"
DownloadUrl="$(var.DownloadUrl)"
ForcePerMachine="yes"
InstallCondition="InstallAllUsers and Include_test and Include_symbols">
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
</MsiPackage>
<MsiPackage Id="test_AllUsers_d"
SourceFile="test_d.msi"
Compressed="$(var.CompressMSI_D)"
DownloadUrl="$(var.DownloadUrl)"
ForcePerMachine="yes"
InstallCondition="InstallAllUsers and Include_test and Include_debug">
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
</MsiPackage>
<MsiPackage Id="test_JustForMe"
SourceFile="test.msi"
Compressed="$(var.CompressMSI)"
DownloadUrl="$(var.DownloadUrl)"
ForcePerMachine="no"
InstallCondition="not InstallAllUsers and Include_test">
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
</MsiPackage>
<MsiPackage Id="test_JustForMe_pdb"
SourceFile="test_pdb.msi"
Compressed="$(var.CompressPDB)"
DownloadUrl="$(var.DownloadUrl)"
ForcePerMachine="no"
InstallCondition="not InstallAllUsers and Include_test and Include_symbols">
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
</MsiPackage>
<MsiPackage Id="test_JustForMe_d"
SourceFile="test_d.msi"
Compressed="$(var.CompressMSI_D)"
DownloadUrl="$(var.DownloadUrl)"
ForcePerMachine="no"
InstallCondition="not InstallAllUsers and Include_test and Include_debug">
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
</MsiPackage>
</PackageGroup>
</Fragment>
</Wix>

View File

@ -0,0 +1,24 @@
<?xml version="1.0"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<PackageGroup Id="tools">
<MsiPackage Id="tools_AllUsers"
SourceFile="tools.msi"
Compressed="$(var.CompressMSI)"
DownloadUrl="$(var.DownloadUrl)"
ForcePerMachine="yes"
InstallCondition="InstallAllUsers and Include_tools">
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
</MsiPackage>
<MsiPackage Id="tools_JustForMe"
SourceFile="tools.msi"
Compressed="$(var.CompressMSI)"
DownloadUrl="$(var.DownloadUrl)"
ForcePerMachine="no"
InstallCondition="not InstallAllUsers and Include_tools">
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
</MsiPackage>
</PackageGroup>
</Fragment>
</Wix>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<WixLocalization Culture="en-us" xmlns="http://schemas.microsoft.com/wix/2006/localization">
<String Id="CompileAllDescription">Precompiling standard library</String>
</WixLocalization>

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{FCD43AC9-969F-49A1-8AC5-EDC27599D1EB}</ProjectGuid>
<OutputName>python</OutputName>
<OutputSuffix></OutputSuffix>
</PropertyGroup>
<Import Project="..\msi.props" />
<PropertyGroup>
<DefineConstants>
$(DefineConstants);
CompressMSI=yes;
CompressPDB=no;
CompressMSI_D=no
</DefineConstants>
</PropertyGroup>
<Import Project="bundle.targets" />
</Project>

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{71CDE213-CB39-4BD9-B89D-BBB878689144}</ProjectGuid>
<OutputName>python</OutputName>
<OutputSuffix>webinstall</OutputSuffix>
</PropertyGroup>
<Import Project="..\msi.props" />
<PropertyGroup>
<DefineConstants>
$(DefineConstants);
CompressMSI=no;
CompressPDB=no;
CompressMSI_D=no
</DefineConstants>
</PropertyGroup>
<Import Project="bundle.targets" />
</Project>

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{8A4A1162-4BF9-4FF6-9A98-315F01E44932}</ProjectGuid>
<OutputName>python</OutputName>
<OutputSuffix></OutputSuffix>
</PropertyGroup>
<Import Project="..\msi.props" />
<PropertyGroup>
<DefineConstants>
$(DefineConstants);
CompressMSI=no;
CompressPDB=no;
CompressMSI_D=no;
</DefineConstants>
</PropertyGroup>
<Import Project="bundle.targets" />
</Project>

101
Tools/msi/common.wxs Normal file
View File

@ -0,0 +1,101 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<Property Id="REGISTRYKEY" Value="Software\$(var.TestPrefix)Python\PythonCore\$(var.ShortVersion)$(var.Suffix32)" />
</Fragment>
<Fragment>
<Property Id="UpgradeTable" Value="1" />
<Upgrade Id="$(var.UpgradeCode)">
<UpgradeVersion Property="DOWNGRADE" Minimum="$(var.Version)" IncludeMinimum="no" OnlyDetect="yes" />
<UpgradeVersion Property="UPGRADE" Minimum="$(var.UpgradeMinimumVersion)" IncludeMinimum="yes" Maximum="$(var.Version)" IncludeMaximum="no" />
</Upgrade>
<?if $(var.UpgradeCode)!=$(var.CoreUpgradeCode) ?>
<Upgrade Id="$(var.CoreUpgradeCode)">
<UpgradeVersion Property="MISSING_CORE" Minimum="$(var.Version)" Maximum="$(var.Version)" OnlyDetect="yes" />
</Upgrade>
<?endif ?>
<Condition Message="!(loc.NoDowngrade)">Installed OR NOT DOWNGRADE</Condition>
<Condition Message="!(loc.IncorrectCore)">Installed OR NOT MISSING_CORE</Condition>
<Condition Message="!(loc.NoTargetDir)">Installed OR TARGETDIR OR Suppress_TARGETDIR_Check</Condition>
<InstallExecuteSequence>
<RemoveExistingProducts After="InstallInitialize">UPGRADE</RemoveExistingProducts>
</InstallExecuteSequence>
</Fragment>
<Fragment>
<!-- Include an icon for the Programs and Features dialog -->
<Icon Id="ARPIcon" SourceFile="!(bindpath.src)PC\pycon.ico" />
<Property Id="ARPPRODUCTICON" Value="ARPIcon" />
<Property Id="ARPNOMODIFY" Value="1" />
<Property Id="DISABLEADVTSHORTCUTS" Value="1" />
</Fragment>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="InstallDirectory" ComponentGuidGenerationSeed="$(var.InstallDirectoryGuidSeed)" />
</Directory>
</Fragment>
<!-- Top-level directories -->
<Fragment>
<DirectoryRef Id="InstallDirectory">
<Directory Id="DLLs" Name="DLLs" />
</DirectoryRef>
</Fragment>
<Fragment>
<DirectoryRef Id="InstallDirectory">
<Directory Id="Doc" Name="Doc" />
</DirectoryRef>
</Fragment>
<Fragment>
<DirectoryRef Id="InstallDirectory">
<Directory Id="include" Name="include" />
</DirectoryRef>
</Fragment>
<Fragment>
<DirectoryRef Id="InstallDirectory">
<Directory Id="Lib" Name="Lib" />
</DirectoryRef>
</Fragment>
<Fragment>
<DirectoryRef Id="InstallDirectory">
<Directory Id="libs" Name="libs" />
</DirectoryRef>
</Fragment>
<Fragment>
<DirectoryRef Id="InstallDirectory">
<Directory Id="Scripts" Name="Scripts" />
</DirectoryRef>
</Fragment>
<Fragment>
<DirectoryRef Id="InstallDirectory">
<Directory Id="tcl" Name="tcl" />
</DirectoryRef>
</Fragment>
<Fragment>
<DirectoryRef Id="InstallDirectory">
<Directory Id="Tools" Name="Tools" />
</DirectoryRef>
</Fragment>
<!-- Start Menu folder -->
<Fragment>
<DirectoryRef Id="TARGETDIR">
<Directory Id="ProgramMenuFolder">
<Directory Id="MenuDir" Name="!(loc.ProductName)" />
</Directory>
</DirectoryRef>
</Fragment>
</Wix>

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<WixLocalization Culture="en-us" xmlns="http://schemas.microsoft.com/wix/2006/localization">
<String Id="LCID">1033</String>
<String Id="Culture">en-us</String>
<String Id="ProductName">Python {{ShortVersion}}</String>
<String Id="FullProductName">Python {{LongVersion}} ({{Bitness}})</String>
<String Id="Title">Python {{LongVersion}} !(loc.Descriptor) ({{Bitness}})</String>
<String Id="Description">Python {{LongVersion}} !(loc.Descriptor) ({{Bitness}})</String>
<String Id="TitlePdb">Python {{LongVersion}} !(loc.Descriptor) ({{Bitness}} symbols)</String>
<String Id="DescriptionPdb">Python {{LongVersion}} !(loc.Descriptor) ({{Bitness}} symbols)</String>
<String Id="Title_d">Python {{LongVersion}} !(loc.Descriptor) ({{Bitness}} debug)</String>
<String Id="Description_d">Python {{LongVersion}} !(loc.Descriptor) ({{Bitness}} debug)</String>
<String Id="Manufacturer">Python Software Foundation</String>
<String Id="NoDowngrade">A newer version of !(loc.ProductName) is already installed.</String>
<String Id="IncorrectCore">An incorrect version of a prerequisite package is installed. Please uninstall any other versions of !(loc.ProductName) and try installing this again.</String>
<String Id="NoTargetDir">The TARGETDIR variable must be provided when invoking this installer.</String>
</WixLocalization>

12
Tools/msi/core/core.props Normal file
View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\msi.props" />
<ItemGroup>
<Compile Include="*.wxs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="*.wxl" />
</ItemGroup>
<Import Project="..\msi.targets" />
</Project>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{1B4502D5-B627-4F50-ABEA-4CC5A8E88265}</ProjectGuid>
<SchemaVersion>2.0</SchemaVersion>
<OutputName>core</OutputName>
<OutputType>Package</OutputType>
<DefineConstants>IncludeDefaultFeature=1;$(DefineConstants)</DefineConstants>
</PropertyGroup>
<Import Project="core.props" />
</Project>

25
Tools/msi/core/core.wxs Normal file
View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Language="!(loc.LCID)" Name="!(loc.Title)" Version="$(var.Version)" Manufacturer="!(loc.Manufacturer)" UpgradeCode="$(var.UpgradeCode)">
<Package InstallerVersion="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" />
<MediaTemplate EmbedCab="yes" CompressionLevel="high" />
<PropertyRef Id="UpgradeTable" />
<?ifdef IncludeDefaultFeature ?>
<Feature Id="DefaultFeature" AllowAdvertise="no" Title="!(loc.Title)" Description="!(loc.Description)">
<ComponentGroupRef Id="core_dll" />
</Feature>
<?endif ?>
<?ifdef IncludeSymbols ?>
<Feature Id="Symbols" AllowAdvertise="no" Title="!(loc.TitlePdb)" Description="!(loc.DescriptionPdb)">
<ComponentGroupRef Id="core_symbols" />
</Feature>
<?endif ?>
<?ifdef IncludeDebugBinaries ?>
<Feature Id="DebugBinaries" AllowAdvertise="no" Title="!(loc.Title_d)" Description="!(loc.Description_d)">
<ComponentGroupRef Id="core_dll_d" />
</Feature>
<?endif ?>
</Product>
</Wix>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{D3677DCF-098A-4398-9FA5-8E74AC37E0DF}</ProjectGuid>
<SchemaVersion>2.0</SchemaVersion>
<OutputName>core_d</OutputName>
<OutputType>Package</OutputType>
<DefineConstants>IncludeDebugBinaries=1;$(DefineConstants)</DefineConstants>
</PropertyGroup>
<Import Project="core.props" />
</Project>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<WixLocalization Culture="en-us" xmlns="http://schemas.microsoft.com/wix/2006/localization">
<String Id="Descriptor">Core Interpreter</String>
<String Id="ShortDescriptor">core</String>
</WixLocalization>

View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<ComponentGroup Id="core_dll">
<Component Id="python_stable.dll" Directory="InstallDirectory" Guid="*">
<File Id="python_stable.dll" Name="python$(var.MajorVersionNumber).dll" KeyPath="yes" />
</Component>
<Component Id="python.dll" Directory="InstallDirectory" Guid="*">
<File Id="python.dll" Name="python$(var.MajorVersionNumber)$(var.MinorVersionNumber).dll" KeyPath="yes" />
</Component>
</ComponentGroup>
</Fragment>
<Fragment>
<ComponentGroup Id="core_symbols">
<Component Id="python.pdb" Directory="InstallDirectory" Guid="*">
<File Id="python.pdb" Name="python$(var.MajorVersionNumber)$(var.MinorVersionNumber).pdb" KeyPath="yes" />
</Component>
</ComponentGroup>
</Fragment>
<Fragment>
<ComponentGroup Id="core_dll_d">
<Component Id="python_stable_d.dll" Directory="InstallDirectory" Guid="*">
<File Id="python_stable_d.dll" Name="python$(var.MajorVersionNumber)_d.dll" KeyPath="yes" />
</Component>
<Component Id="python_d.dll" Directory="InstallDirectory" Guid="*">
<File Id="python_d.dll" Name="python$(var.MajorVersionNumber)$(var.MinorVersionNumber)_d.dll" KeyPath="yes" />
<File Id="python_d.pdb" Name="python$(var.MajorVersionNumber)$(var.MinorVersionNumber)_d.pdb" KeyPath="no" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{E98E7539-64E7-4DCE-AACD-01E3ADE40EFD}</ProjectGuid>
<SchemaVersion>2.0</SchemaVersion>
<OutputName>core_pdb</OutputName>
<OutputType>Package</OutputType>
<DefineConstants>IncludeSymbols=1;$(DefineConstants)</DefineConstants>
</PropertyGroup>
<Import Project="core.props" />
</Project>

20
Tools/msi/crt/crt.wixproj Normal file
View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{91C99298-8E2E-4422-A5AF-CC4FFF9A58D3}</ProjectGuid>
<SchemaVersion>2.0</SchemaVersion>
<OutputName>crt</OutputName>
<OutputType>Package</OutputType>
<SuppressIces>ICE71</SuppressIces>
</PropertyGroup>
<Import Project="..\msi.props" />
<ItemGroup>
<Compile Include="crt.wxs" />
<Compile Include="crt_files.$(VisualStudioVersion).wxs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="*.wxl" />
</ItemGroup>
<Import Project="..\msi.targets" />
</Project>

26
Tools/msi/crt/crt.wxs Normal file
View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Language="!(loc.LCID)" Name="!(loc.Title)" Version="$(var.Version)" Manufacturer="!(loc.Manufacturer)" UpgradeCode="$(var.UpgradeCode)">
<Package InstallerVersion="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" />
<MediaTemplate EmbedCab="yes" CompressionLevel="high" />
<PropertyRef Id="UpgradeTable" />
<?if $(var.Platform)~=x64 ?>
<?define DirName=System64?>
<?else ?>
<?define DirName=System?>
<?endif ?>
<DirectoryRef Id="TARGETDIR">
<Directory Id="$(var.DirName)Folder" Name="$(var.DirName)">
<Directory Id="SystemInstallDirectory" Name="." />
</Directory>
</DirectoryRef>
<?undef DirName ?>
<Feature Id="DefaultFeature" AllowAdvertise="no" Title="!(loc.Title)" Description="!(loc.Description)">
<ComponentGroupRef Id="crt_files" />
</Feature>
</Product>
</Wix>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<WixLocalization Culture="en-us" xmlns="http://schemas.microsoft.com/wix/2006/localization">
<String Id="Descriptor">C Runtime</String>
<String Id="ShortDescriptor">crt</String>
</WixLocalization>

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<?if $(var.Platform)~=x64 ?>
<?define msvcr120Guid={0835C947-D6D2-4E52-AF14-0231D04E88EA}?>
<?else ?>
<?define msvcr120Guid={E5B92048-5859-4AF1-AEAD-B97EBF00B087} ?>
<?endif ?>
<ComponentGroup Id="crt_files">
<Component Id="msvcr120.dll_LM" Directory="SystemInstallDirectory" Guid="$(var.msvcr120Guid)" Shared="yes" SharedDllRefCount="yes">
<Condition>ALLUSERS=1</Condition>
<File Id="msvcr120.dll_LM" Source="!(bindpath.crt)\msvcr120.dll" />
</Component>
<Component Id="msvcr120.dll_CU" Directory="InstallDirectory" Guid="*">
<Condition>NOT ALLUSERS=1</Condition>
<File Id="msvcr120.dll_CU" Source="!(bindpath.crt)\msvcr120.dll" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>

View File

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<?if $(var.Platform)~=x64 ?>
<?define appcrt140Guid={CC160FA9-B519-38EC-B358-B4146E8506C8}?>
<?define desktopcrt140Guid={4DB78A79-8D7F-35DD-B0E8-736DE44D25F3}?>
<?define vcruntime140Guid={B33258FD-750C-3B42-8BE4-535B48E97DB4}?>
<?else ?>
<?define appcrt140Guid={E3854F9C-4CFB-3B85-90BD-86AA22D82DC8}?>
<?define desktopcrt140Guid={46EAB1CD-C362-3139-BD7E-D8782E65253A}?>
<?define vcruntime140Guid={E8E39D3B-4F35-36D8-B892-4B28336FE041}?>
<?endif ?>
<ComponentGroup Id="crt_files">
<Component Id="appcrt140.dll_LM" Directory="SystemInstallDirectory" Guid="$(var.appcrt140Guid)" Shared="yes" SharedDllRefCount="yes">
<Condition>ALLUSERS=1</Condition>
<File Id="appcrt140.dll_LM" Source="!(bindpath.crt)\appcrt140.dll" />
</Component>
<Component Id="desktopcrt140.dll_LM" Directory="SystemInstallDirectory" Guid="$(var.desktopcrt140Guid)" Shared="yes" SharedDllRefCount="yes">
<Condition>ALLUSERS=1</Condition>
<File Id="desktopcrt140.dll_LM" Source="!(bindpath.crt)\desktopcrt140.dll" />
</Component>
<Component Id="vcruntime140.dll_LM" Directory="SystemInstallDirectory" Guid="$(var.vcruntime140Guid)" Shared="yes" SharedDllRefCount="yes">
<Condition>ALLUSERS=1</Condition>
<File Id="vcruntime140.dll_LM" Source="!(bindpath.crt)\vcruntime140.dll" />
</Component>
<Component Id="appcrt140.dll_CU" Directory="InstallDirectory" Guid="*">
<Condition>NOT ALLUSERS=1</Condition>
<File Id="appcrt140.dll_CU" Source="!(bindpath.crt)\appcrt140.dll" />
</Component>
<Component Id="desktopcrt140.dll_CU" Directory="InstallDirectory" Guid="*">
<Condition>NOT ALLUSERS=1</Condition>
<File Id="desktopcrt140.dll_CU" Source="!(bindpath.crt)\desktopcrt140.dll" />
</Component>
<Component Id="vcruntime140.dll_CU" Directory="InstallDirectory" Guid="*">
<Condition>NOT ALLUSERS=1</Condition>
<File Id="vcruntime140.dll_CU" Source="!(bindpath.crt)\vcruntime140.dll" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>

View File

@ -0,0 +1,47 @@
Additional Conditions for this Windows binary build
---------------------------------------------------
This program is linked with and uses Microsoft Distributable Code,
copyrighted by Microsoft Corporation. The Microsoft Distributable Code
includes the following files:
appcrt140.dll
desktopcrt140.dll
vcruntime140.dll
msvcp140.dll
concrt140.dll
vccorlib140.dll
If you further distribute programs that include the Microsoft
Distributable Code, you must comply with the restrictions on
distribution specified by Microsoft. In particular, you must require
distributors and external end users to agree to terms that protect the
Microsoft Distributable Code at least as much as Microsoft's own
requirements for the Distributable Code. See Microsoft's documentation
(included in its developer tools and on its website at microsoft.com)
for specific details.
Redistribution of the Windows binary build of the Python interpreter
complies with this agreement, provided that you do not:
- alter any copyright, trademark or patent notice in Microsoft's
Distributable Code;
- use Microsoft's trademarks in your programs' names or in a way that
suggests your programs come from or are endorsed by Microsoft;
- distribute Microsoft's Distributable Code to run on a platform other
than Microsoft operating systems, run-time technologies or application
platforms; or
- include Microsoft Distributable Code in malicious, deceptive or
unlawful programs.
These restrictions apply only to the Microsoft Distributable Code as
defined above, not to Python itself or any programs running on the
Python interpreter. The redistribution of the Python interpreter and
libraries is governed by the Python Software License included with this
file, or by other licenses as marked.

127
Tools/msi/csv_to_wxs.py Normal file
View File

@ -0,0 +1,127 @@
'''
Processes a CSV file containing a list of files into a WXS file with
components for each listed file.
The CSV columns are:
source of file, target for file, group name
Usage::
py txt_to_wxs.py [path to file list .csv] [path to destination .wxs]
This is necessary to handle structures where some directories only
contain other directories. MSBuild is not able to generate the
Directory entries in the WXS file correctly, as it operates on files.
Python, however, can easily fill in the gap.
'''
__author__ = "Steve Dower <steve.dower@microsoft.com>"
import csv
import re
import sys
from collections import defaultdict
from itertools import chain, zip_longest
from pathlib import PureWindowsPath
from uuid import uuid1
ID_CHAR_SUBS = {
'-': '_',
'+': '_P',
}
def make_id(path):
return re.sub(
r'[^A-Za-z0-9_.]',
lambda m: ID_CHAR_SUBS.get(m.group(0), '_'),
str(path).rstrip('/\\'),
flags=re.I
)
DIRECTORIES = set()
def main(file_source, install_target):
with open(file_source, 'r', newline='') as f:
files = list(csv.reader(f))
assert len(files) == len(set(make_id(f[1]) for f in files)), "Duplicate file IDs exist"
directories = defaultdict(set)
cache_directories = defaultdict(set)
groups = defaultdict(list)
for source, target, group, disk_id, condition in files:
target = PureWindowsPath(target)
groups[group].append((source, target, disk_id, condition))
if target.suffix.lower() in {".py", ".pyw"}:
cache_directories[group].add(target.parent)
for dirname in target.parents:
parent = make_id(dirname.parent)
if parent and parent != '.':
directories[parent].add(dirname.name)
lines = [
'<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">',
' <Fragment>',
]
for dir_parent in sorted(directories):
lines.append(' <DirectoryRef Id="{}">'.format(dir_parent))
for dir_name in sorted(directories[dir_parent]):
lines.append(' <Directory Id="{}_{}" Name="{}" />'.format(dir_parent, make_id(dir_name), dir_name))
lines.append(' </DirectoryRef>')
for dir_parent in (make_id(d) for group in cache_directories.values() for d in group):
lines.append(' <DirectoryRef Id="{}">'.format(dir_parent))
lines.append(' <Directory Id="{}___pycache__" Name="__pycache__" />'.format(dir_parent))
lines.append(' </DirectoryRef>')
lines.append(' </Fragment>')
for group in sorted(groups):
lines.extend([
' <Fragment>',
' <ComponentGroup Id="{}">'.format(group),
])
for source, target, disk_id, condition in groups[group]:
lines.append(' <Component Id="{}" Directory="{}" Guid="*">'.format(make_id(target), make_id(target.parent)))
if condition:
lines.append(' <Condition>{}</Condition>'.format(condition))
if disk_id:
lines.append(' <File Id="{}" Name="{}" Source="{}" DiskId="{}" />'.format(make_id(target), target.name, source, disk_id))
else:
lines.append(' <File Id="{}" Name="{}" Source="{}" />'.format(make_id(target), target.name, source))
lines.append(' </Component>')
create_folders = {make_id(p) + "___pycache__" for p in cache_directories[group]}
remove_folders = {make_id(p2) for p1 in cache_directories[group] for p2 in chain((p1,), p1.parents)}
create_folders.discard(".")
remove_folders.discard(".")
if create_folders or remove_folders:
lines.append(' <Component Id="{}__pycache__folders" Directory="TARGETDIR" Guid="{}">'.format(group, uuid1()))
lines.extend(' <CreateFolder Directory="{}" />'.format(p) for p in create_folders)
lines.extend(' <RemoveFile Id="Remove_{0}_files" Name="*" On="uninstall" Directory="{0}" />'.format(p) for p in create_folders)
lines.extend(' <RemoveFolder Id="Remove_{0}_folder" On="uninstall" Directory="{0}" />'.format(p) for p in create_folders | remove_folders)
lines.append(' </Component>')
lines.extend([
' </ComponentGroup>',
' </Fragment>',
])
lines.append('</Wix>')
# Check if the file matches. If so, we don't want to touch it so
# that we can skip rebuilding.
try:
with open(install_target, 'r') as f:
if all(x.rstrip('\r\n') == y for x, y in zip_longest(f, lines)):
print('File is up to date')
return
except IOError:
pass
with open(install_target, 'w') as f:
f.writelines(line + '\n' for line in lines)
print('Wrote {} lines to {}'.format(len(lines), install_target))
if __name__ == '__main__':
main(sys.argv[1], sys.argv[2])

42
Tools/msi/dev/dev.props Normal file
View File

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\msi.props" />
<PropertyGroup>
<DefineConstants Condition="$(BuildForRelease)">
$(DefineConstants);
IncludeMinGWLib=1;
</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Compile Include="*.wxs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="*.wxl" />
</ItemGroup>
<ItemGroup>
<InstallFiles Include="$(PySourcePath)include\*.h">
<SourceBase>$(PySourcePath)</SourceBase>
<Source>!(bindpath.src)</Source>
<TargetBase>$(PySourcePath)</TargetBase>
<Target_></Target_>
<Group>dev_include</Group>
</InstallFiles>
</ItemGroup>
<Target Name="BuildMinGWLib"
Inputs="$(BuildPath)$(PyDllName).dll"
Outputs="$(BuildPath)lib$(PyDllName).a"
AfterTargets="PrepareForBuild"
Condition="$(BuildForRelease)">
<!-- Build libpython##.a as part of this project. This requires gendef and dlltool on the path. -->
<PropertyGroup>
<_GenDefPlatform>i386</_GenDefPlatform>
<_GenDefPlatform Condition="$(Platform) == 'x64'">i386:x86-64</_GenDefPlatform>
</PropertyGroup>
<Exec Command='gendef - "$(BuildPath)$(PyDllName).dll" &gt; "$(IntermediateOutputPath)mingwlib.def"' ContinueOnError="false" />
<Exec Command='dlltool --dllname $(PyDllName).dll --def "$(IntermediateOutputPath)mingwlib.def" --output-lib "$(BuildPath)lib$(PyDllName).a" -m $(_GenDefPlatform)' />
</Target>
<Import Project="..\msi.targets" />
</Project>

11
Tools/msi/dev/dev.wixproj Normal file
View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{5F23F608-D74B-4259-A0CE-8DC65CC7FE53}</ProjectGuid>
<SchemaVersion>2.0</SchemaVersion>
<OutputName Condition="'$(OutputName)' == ''">dev</OutputName>
<OutputType>Package</OutputType>
<DefineConstants>IncludeDefaultFeature=1;$(DefineConstants)</DefineConstants>
</PropertyGroup>
<Import Project="dev.props" />
</Project>

25
Tools/msi/dev/dev.wxs Normal file
View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Language="!(loc.LCID)" Name="!(loc.Title)" Version="$(var.Version)" Manufacturer="!(loc.Manufacturer)" UpgradeCode="$(var.UpgradeCode)">
<Package InstallerVersion="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" />
<MediaTemplate EmbedCab="yes" CompressionLevel="high" />
<PropertyRef Id="UpgradeTable" />
<?ifdef IncludeDefaultFeature ?>
<Feature Id="DefaultFeature" AllowAdvertise="no" Title="!(loc.Title)" Description="!(loc.Description)">
<ComponentGroupRef Id="dev_include" />
<ComponentGroupRef Id="dev_pyconfig" />
<ComponentGroupRef Id="dev_libs" />
<?ifdef IncludeMinGWLib ?>
<ComponentGroupRef Id="dev_mingw" />
<?endif ?>
</Feature>
<?endif ?>
<?ifdef IncludeDebugBinaries ?>
<Feature Id="DebugBinaries" AllowAdvertise="no" Title="!(loc.Title_d)" Description="!(loc.Description_d)">
<ComponentGroupRef Id="dev_libs_d" />
</Feature>
<?endif ?>
</Product>
</Wix>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{C11B4945-76BD-4137-B2E3-649460117A77}</ProjectGuid>
<SchemaVersion>2.0</SchemaVersion>
<OutputName>dev_d</OutputName>
<OutputType>Package</OutputType>
<DefineConstants>IncludeDebugBinaries=1;$(DefineConstants)</DefineConstants>
</PropertyGroup>
<Import Project="dev.props" />
</Project>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<WixLocalization Culture="en-us" xmlns="http://schemas.microsoft.com/wix/2006/localization">
<String Id="Descriptor">Development Libraries</String>
<String Id="ShortDescriptor">dev</String>
</WixLocalization>

View File

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<ComponentGroup Id="dev_pyconfig">
<Component Id="include_pyconfig.h" Directory="include" Guid="*">
<File Id="include_pyconfig.h" Name="pyconfig.h" Source="!(bindpath.src)PC\pyconfig.h" KeyPath="yes" />
</Component>
</ComponentGroup>
</Fragment>
<Fragment>
<ComponentGroup Id="dev_libs">
<Component Id="libs_python3.lib" Directory="libs" Guid="*">
<File Id="libs_python_stable.lib" Name="python$(var.MajorVersionNumber).lib" KeyPath="yes" />
</Component>
<Component Id="libs_python.lib" Directory="libs" Guid="*">
<File Id="libs_python.lib" Name="python$(var.MajorVersionNumber)$(var.MinorVersionNumber).lib" KeyPath="yes" />
</Component>
</ComponentGroup>
</Fragment>
<Fragment>
<ComponentGroup Id="dev_libs_d">
<Component Id="libs_python3_d.lib" Directory="libs" Guid="*">
<File Id="libs_python_stable_d.lib" Name="python$(var.MajorVersionNumber)_d.lib" />
</Component>
<Component Id="libs_python_d.lib" Directory="libs" Guid="*">
<File Id="libs_python_d.lib" Name="python$(var.MajorVersionNumber)$(var.MinorVersionNumber)_d.lib" />
</Component>
</ComponentGroup>
</Fragment>
<?ifdef IncludeMinGWLib ?>
<Fragment>
<ComponentGroup Id="dev_mingw">
<Component Id="libs_libpython.a" Directory="libs" Guid="*">
<File Id="libs_libpython.a" Name="libpython$(var.MajorVersionNumber)$(var.MinorVersionNumber).a" KeyPath="yes" />
</Component>
</ComponentGroup>
</Fragment>
<?endif ?>
</Wix>

30
Tools/msi/doc/doc.wixproj Normal file
View File

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{0D62A2BB-5F71-4447-8C8C-9708407B3674}</ProjectGuid>
<SchemaVersion>2.0</SchemaVersion>
<OutputName>doc</OutputName>
<OutputType>Package</OutputType>
<!-- Shortcut validation is not necessary -->
<SuppressICEs>ICE43</SuppressICEs>
</PropertyGroup>
<Import Project="..\msi.props" />
<PropertyGroup>
<DocFilename>python$(MajorVersionNumber)$(MinorVersionNumber)$(MicroVersionNumber)$(ReleaseLevelName).chm</DocFilename>
<IncludeDocFile>false</IncludeDocFile>
<IncludeDocFile Condition="$(BuildForRelease) or Exists('$(PySourcePath)Doc\build\htmlhelp\$(DocFilename)')">true</IncludeDocFile>
</PropertyGroup>
<PropertyGroup Condition="$(IncludeDocFile)">
<DefineConstants>$(DefineConstants);DocFilename=$(DocFilename);</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Compile Include="doc.wxs" />
<Compile Include="doc_files.wxs" Condition="$(IncludeDocFile)" />
<Compile Include="doc_no_files.wxs" Condition="!$(IncludeDocFile)" />
</ItemGroup>
<ItemGroup>
<WxlTemplate Include="*.wxl_template" />
</ItemGroup>
<Import Project="..\msi.targets" />
</Project>

26
Tools/msi/doc/doc.wxs Normal file
View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Language="!(loc.LCID)" Name="!(loc.Title)" Version="$(var.Version)" Manufacturer="!(loc.Manufacturer)" UpgradeCode="$(var.UpgradeCode)">
<Package InstallerVersion="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" />
<MediaTemplate EmbedCab="yes" CompressionLevel="high" />
<PropertyRef Id="UpgradeTable" />
<PropertyRef Id="REGISTRYKEY" />
<Feature Id="DefaultFeature" AllowAdvertise="no" Title="!(loc.Title)" Description="!(loc.Description)">
<ComponentGroupRef Id="doc" />
<Component Id="doc_shortcut" Directory="MenuDir" Guid="*">
<RegistryKey Root="HKMU" Key="[REGISTRYKEY]">
<RegistryValue Key="Help\Main Python Documentation" Type="string" Value="[#python.chm]" KeyPath="yes" />
</RegistryKey>
<Shortcut Id="python.chm"
Target="[#python.chm]"
Name="!(loc.ShortcutName)"
Description="!(loc.ShortcutDescription)" />
<RemoveFolder Id="Remove_MenuDir" On="uninstall" />
</Component>
</Feature>
</Product>
</Wix>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<WixLocalization Culture="en-us" xmlns="http://schemas.microsoft.com/wix/2006/localization">
<String Id="ShortDescriptor">doc</String>
<String Id="Descriptor">Documentation</String>
<String Id="ShortcutName">Python {{ShortVersion}} {{Bitness}} Manuals</String>
<String Id="ShortcutDescription">View the !(loc.ProductName) documentation.</String>
</WixLocalization>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<PropertyRef Id="REGISTRYKEY" />
<ComponentGroup Id="doc">
<Component Id="python.chm" Directory="Doc" Guid="*">
<File Id="python.chm" Name="$(var.DocFilename)" KeyPath="yes" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<ComponentGroup Id="doc">
<!--
This file is included when the CHM is not available.
This way, snapshot builds can succeed without having to
build the docs.
-->
<Component Id="EmptyDocFolder" Directory="Doc" Guid="{22FD42DB-EC66-4B1C-B1FC-44E0CF7B2462}">
<CreateFolder />
<RemoveFolder Id="Remove_EmptyDocFolder" On="uninstall" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>

36
Tools/msi/exe/exe.props Normal file
View File

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!-- Shortcut validation is not necessary -->
<SuppressICEs>ICE43</SuppressICEs>
</PropertyGroup>
<Import Project="..\msi.props" />
<ItemGroup>
<Compile Include="*.wxs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="*.wxl" />
<WxlTemplate Include="*.wxl_template" />
</ItemGroup>
<Target Name="_GenerateLicense" AfterTargets="PrepareForBuild">
<ItemGroup>
<LicenseFiles Include="$(PySourcePath)LICENSE;
crtlicense.txt;
$(bz2Dir)LICENSE;
$(opensslDir)LICENSE;
$(tclDir)license.terms;
$(tkDir)license.terms;
$(tixDir)license.terms" />
<_LicenseFiles Include="@(LicenseFiles)">
<Content>$([System.IO.File]::ReadAllText(%(FullPath)))</Content>
</_LicenseFiles>
</ItemGroup>
<WriteLinesToFile File="$(BuildPath)LICENSE"
Overwrite="true"
Lines="@(_LicenseFiles->'%(Content)')" />
</Target>
<Import Project="..\msi.targets" />
</Project>

11
Tools/msi/exe/exe.wixproj Normal file
View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{6BD53305-B03E-49DC-85FB-5551B8CCC843}</ProjectGuid>
<SchemaVersion>2.0</SchemaVersion>
<OutputName>exe</OutputName>
<OutputType>Package</OutputType>
<DefineConstants>IncludeDefaultFeature=1;$(DefineConstants)</DefineConstants>
</PropertyGroup>
<Import Project="exe.props" />
</Project>

40
Tools/msi/exe/exe.wxs Normal file
View File

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Language="!(loc.LCID)" Name="!(loc.Title)" Version="$(var.Version)" Manufacturer="!(loc.Manufacturer)" UpgradeCode="$(var.UpgradeCode)">
<Package InstallerVersion="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" />
<MediaTemplate EmbedCab="yes" CompressionLevel="high" />
<PropertyRef Id="UpgradeTable" />
<PropertyRef Id="REGISTRYKEY" />
<?ifdef IncludeDefaultFeature ?>
<Feature Id="DefaultFeature" AllowAdvertise="no" Title="!(loc.Title)" Description="!(loc.Description)">
<ComponentGroupRef Id="exe_python" />
<ComponentGroupRef Id="exe_txt" />
<ComponentGroupRef Id="exe_icons" />
<Component Id="exe_shortcut" Directory="MenuDir" Guid="*">
<Shortcut Id="python.exe"
Target="[#python.exe]"
Name="!(loc.ShortcutName)"
Description="!(loc.ShortcutDescription)" />
<RemoveFolder Id="Remove_MenuDir" Directory="MenuDir" On="uninstall" />
<RegistryKey Root="HKMU" Key="[REGISTRYKEY]">
<RegistryValue Key="InstallPath" Type="string" Value="[InstallDirectory]" KeyPath="yes" />
<RegistryValue Key="InstallPath\InstallGroup" Type="string" Value="Python $(var.ShortVersion)" />
</RegistryKey>
</Component>
</Feature>
<?endif ?>
<?ifdef IncludeSymbols ?>
<Feature Id="Symbols" AllowAdvertise="no" Title="!(loc.TitlePdb)" Description="!(loc.DescriptionPdb)">
<ComponentGroupRef Id="exe_python_symbols" />
</Feature>
<?endif ?>
<?ifdef IncludeDebugBinaries ?>
<Feature Id="DebugBinaries" AllowAdvertise="no" Title="!(loc.Title_d)" Description="!(loc.Description_d)">
<ComponentGroupRef Id="exe_python_d" />
</Feature>
<?endif ?>
</Product>
</Wix>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{B1CA739C-8DB0-403B-9010-D79507507CE9}</ProjectGuid>
<SchemaVersion>2.0</SchemaVersion>
<OutputName>exe_d</OutputName>
<OutputType>Package</OutputType>
<DefineConstants>IncludeDebugBinaries=1;$(DefineConstants)</DefineConstants>
</PropertyGroup>
<Import Project="exe.props" />
</Project>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<WixLocalization Culture="en-us" xmlns="http://schemas.microsoft.com/wix/2006/localization">
<String Id="Descriptor">Executables</String>
<String Id="ShortDescriptor">executable</String>
<String Id="ShortcutName">Python {{ShortVersion}} ({{Bitness}})</String>
<String Id="ShortcutDescription">Launches the !(loc.ProductName) interpreter.</String>
<String Id="PathTitle">Add to PATH</String>
<String Id="PathDescription">Adds the install directory to PATH and .py to PATHEXT.</String>
</WixLocalization>

View File

@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<ComponentGroup Id="exe_txt">
<Component Id="LICENSE.txt" Directory="InstallDirectory" Guid="*">
<File Name="LICENSE.txt" Source="LICENSE" KeyPath="yes" />
</Component>
<Component Id="NEWS.txt" Directory="InstallDirectory" Guid="*">
<File Name="NEWS.txt" Source="!(bindpath.src)Misc\NEWS" KeyPath="yes" />
</Component>
<Component Id="README.txt" Directory="InstallDirectory" Guid="*">
<File Name="README.txt" Source="!(bindpath.src)README" KeyPath="yes" />
</Component>
</ComponentGroup>
</Fragment>
<Fragment>
<PropertyRef Id="REGISTRYKEY" />
<ComponentGroup Id="exe_python">
<Component Id="python.exe" Directory="InstallDirectory" Guid="$(var.PythonExeComponentGuid)">
<File Name="python.exe" KeyPath="yes" />
</Component>
<Component Id="pythonw.exe" Directory="InstallDirectory" Guid="$(var.PythonwExeComponentGuid)">
<File Name="pythonw.exe" KeyPath="yes" />
</Component>
</ComponentGroup>
</Fragment>
<Fragment>
<ComponentGroup Id="exe_python_symbols">
<Component Id="python.pdb" Directory="InstallDirectory" Guid="*">
<File Name="python.pdb" />
</Component>
<Component Id="pythonw.pdb" Directory="InstallDirectory" Guid="*">
<File Name="pythonw.pdb" />
</Component>
</ComponentGroup>
</Fragment>
<Fragment>
<ComponentGroup Id="exe_python_d">
<Component Id="python_d.exe" Directory="InstallDirectory" Guid="*">
<File Name="python_d.exe" />
</Component>
<Component Id="python_d.pdb" Directory="InstallDirectory" Guid="*">
<File Name="python_d.pdb" />
</Component>
<Component Id="pythonw_d.exe" Directory="InstallDirectory" Guid="*">
<File Name="pythonw_d.exe" />
</Component>
<Component Id="pythonw_d.pdb" Directory="InstallDirectory" Guid="*">
<File Name="pythonw_d.pdb" />
</Component>
</ComponentGroup>
</Fragment>
<Fragment>
<ComponentGroup Id="exe_icons">
<Component Id="py.ico" Directory="DLLs" Guid="*">
<File Name="py.ico" Source="!(bindpath.src)PC\py.ico" KeyPath="yes" />
</Component>
<Component Id="pyc.ico" Directory="DLLs" Guid="*">
<File Name="pyc.ico" Source="!(bindpath.src)PC\pyc.ico" KeyPath="yes" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{4A1F7045-8EE2-4276-ABB8-5E0C40E5F38B}</ProjectGuid>
<SchemaVersion>2.0</SchemaVersion>
<OutputName>exe_pdb</OutputName>
<OutputType>Package</OutputType>
<DefineConstants>IncludeSymbols=1;$(DefineConstants)</DefineConstants>
</PropertyGroup>
<Import Project="exe.props" />
</Project>

49
Tools/msi/get_wix.py Normal file
View File

@ -0,0 +1,49 @@
'''
Downloads and extracts WiX to a local directory
'''
__author__ = 'Steve Dower <steve.dower@microsoft.com>'
import io
import os
import sys
from pathlib import Path
from subprocess import Popen
from zipfile import ZipFile
EXTERNALS_DIR = None
for p in Path(__file__).parents:
if any(p.glob("PCBuild/*.vcxproj")):
EXTERNALS_DIR = p / "externals"
break
if not EXTERNALS_DIR:
print("Cannot find project root")
sys.exit(1)
WIX_BINARIES_ZIP = 'http://wixtoolset.org/downloads/v3.10.1124.0/wix310-binaries.zip'
TARGET_BIN_ZIP = EXTERNALS_DIR / "wix.zip"
TARGET_BIN_DIR = EXTERNALS_DIR / "wix"
POWERSHELL_COMMAND = "[IO.File]::WriteAllBytes('{}', (Invoke-WebRequest {} -UseBasicParsing).Content)"
if __name__ == '__main__':
if TARGET_BIN_DIR.exists() and any(TARGET_BIN_DIR.glob("*")):
print('WiX is already installed')
sys.exit(0)
try:
TARGET_BIN_DIR.mkdir()
except FileExistsError:
pass
print('Downloading WiX to', TARGET_BIN_ZIP)
p = Popen(["powershell.exe", "-Command", POWERSHELL_COMMAND.format(TARGET_BIN_ZIP, WIX_BINARIES_ZIP)])
p.wait()
print('Extracting WiX to', TARGET_BIN_DIR)
with ZipFile(str(TARGET_BIN_ZIP)) as z:
z.extractall(str(TARGET_BIN_DIR))
TARGET_BIN_ZIP.unlink()
print('Extracted WiX')

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\msi.props" />
<ItemGroup>
<Compile Include="*.wxs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="*.wxl" />
</ItemGroup>
<Import Project="..\msi.targets" />
</Project>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{921CF0E6-AEBC-4376-BA1D-CD46EBFE6DA5}</ProjectGuid>
<SchemaVersion>2.0</SchemaVersion>
<OutputName>launcher</OutputName>
<OutputType>Package</OutputType>
<DefineConstants>IncludeDefaultFeature=1;$(DefineConstants)</DefineConstants>
</PropertyGroup>
<Import Project="launcher.props" />
</Project>

View File

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Language="!(loc.LCID)" Name="!(loc.Title)" Version="$(var.Version)" Manufacturer="!(loc.Manufacturer)" UpgradeCode="$(var.UpgradeCode)">
<Package InstallerVersion="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" />
<MediaTemplate EmbedCab="yes" CompressionLevel="high" />
<Property Id="Suppress_TARGETDIR_Check" Value="1" />
<PropertyRef Id="UpgradeTable" />
<PropertyRef Id="ARPPRODUCTICON" />
<?ifdef IncludeDefaultFeature ?>
<Feature Id="DefaultFeature" AllowAdvertise="no" Title="!(loc.Title)" Description="!(loc.Description)">
<ComponentGroupRef Id="launcher_exe" Primary="yes" />
</Feature>
<Feature Id="AssociateFiles" AllowAdvertise="no" Title="!(loc.Title)" Description="!(loc.Description)">
<ComponentGroupRef Id="launcher_exe" />
<ComponentGroupRef Id="launcher_reg" />
</Feature>
<?endif ?>
<?ifdef IncludeSymbols ?>
<Feature Id="Symbols" AllowAdvertise="no" Title="!(loc.TitlePdb)" Description="!(loc.DescriptionPdb)">
<ComponentGroupRef Id="launcher_pdb" />
</Feature>
<?endif ?>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="LauncherInstallDirectory" />
</Directory>
<CustomAction Id="SetLauncherInstallDirectoryLM" Property="LauncherInstallDirectory" Value="[WindowsFolder]" />
<CustomAction Id="SetLauncherInstallDirectoryCU" Property="LauncherInstallDirectory" Value="[LocalAppDataFolder]Programs\Python\Launcher" />
<InstallExecuteSequence>
<Custom Before="SetLauncherInstallDirectoryLM" Action="SetLauncherInstallDirectoryCU">NOT Installed AND NOT ALLUSERS=1</Custom>
<Custom Before="CostFinalize" Action="SetLauncherInstallDirectoryLM">NOT Installed AND ALLUSERS=1</Custom>
</InstallExecuteSequence>
</Product>
</Wix>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<WixLocalization Culture="en-us" xmlns="http://schemas.microsoft.com/wix/2006/localization">
<String Id="Descriptor">Launcher</String>
<String Id="ShortDescriptor">launcher</String>
<String Id="PythonFileDescription">Python File</String>
<String Id="PythonNoConFileDescription">Python File (no console)</String>
<String Id="PythonCompiledFileDescription">Compiled Python File</String>
</WixLocalization>

View File

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<ComponentGroup Id="launcher_exe">
<Component Id="py.exe" Directory="LauncherInstallDirectory" Guid="{B5107402-6958-461B-8B0A-4037D3327160}">
<File Id="py.exe" Name="py.exe" Source="py.exe" KeyPath="yes" />
</Component>
<Component Id="pyw.exe" Directory="LauncherInstallDirectory" Guid="{8E52B8CD-48BB-4D74-84CD-6238BCD11F20}">
<File Id="pyw.exe" Name="pyw.exe" Source="pyw.exe" KeyPath="yes" />
</Component>
<Component Id="launcher_path_cu" Directory="LauncherInstallDirectory" Guid="{95AEB930-367C-475C-A17E-A89BFCD4C670}">
<Condition>NOT ALLUSERS=1</Condition>
<RegistryValue KeyPath="yes" Root="HKMU" Key="Software\Python\PyLauncher\InstallDir" Value="[LauncherInstallDirectory]" Type="string" />
<Environment Id="PATH_CU" Action="set" Name="PATH" Part="first" Value="[LauncherInstallDirectory]" />
</Component>
<Component Id="launcher_path_lm" Directory="LauncherInstallDirectory" Guid="{4A41C365-4E27-4D38-A6D1-4A01B4A6500C}">
<Condition>ALLUSERS=1</Condition>
<RegistryValue KeyPath="yes" Root="HKMU" Key="Software\Python\PyLauncher\InstallDir" Value="[LauncherInstallDirectory]" Type="string" />
</Component>
</ComponentGroup>
</Fragment>
<Fragment>
<ComponentGroup Id="launcher_pdb">
<Component Id="py.pdb" Directory="LauncherInstallDirectory" Guid="*">
<File Id="py.pdb" Name="py.pdb" Source="py.pdb" />
</Component>
<Component Id="pyw.pdb" Directory="LauncherInstallDirectory" Guid="*">
<File Id="pyw.pdb" Name="pyw.pdb" Source="pyw.pdb" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{A21D4A23-483F-4822-A0B1-FCB14D8CEBA7}</ProjectGuid>
<SchemaVersion>2.0</SchemaVersion>
<OutputName>launcher_pdb</OutputName>
<OutputType>Package</OutputType>
<DefineConstants>IncludeSymbols=1;$(DefineConstants)</DefineConstants>
</PropertyGroup>
<Import Project="launcher.props" />
</Project>

View File

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<ComponentGroup Id="launcher_reg">
<Component Id="file_association" Directory="LauncherInstallDirectory" Guid="{5AF84D9A-D820-456B-B230-6E0105A50276}">
<RegistryValue KeyPath="yes" Root="HKMU" Key="Software\Python\PyLauncher\AssociateFiles" Value="1" Type="integer" />
<ProgId Id="$(var.TestPrefix)Python.File" Description="!(loc.PythonFileDescription)" Advertise="no" Icon="py.exe" IconIndex="1">
<Extension Id="$(var.FileExtension)" ContentType="text/plain">
<Verb Id="open" TargetFile="py.exe" Argument="&quot;%L&quot; %*" />
</Extension>
</ProgId>
<RegistryValue Root="HKCR" Key="$(var.TestPrefix)Python.File\shellex\DropHandler" Value="{60254CA5-953B-11CF-8C96-00AA00B8708C}" Type="string" />
<ProgId Id="$(var.TestPrefix)Python.NoConFile" Description="!(loc.PythonNoConFileDescription)" Advertise="no" Icon="py.exe" IconIndex="1">
<Extension Id="$(var.FileExtension)w" ContentType="text/plain">
<Verb Id="open" TargetFile="pyw.exe" Argument="&quot;%L&quot; %*" />
</Extension>
</ProgId>
<RegistryValue Root="HKCR" Key="$(var.TestPrefix)Python.NoConFile\shellex\DropHandler" Value="{60254CA5-953B-11CF-8C96-00AA00B8708C}" Type="string" />
<ProgId Id="$(var.TestPrefix)Python.CompiledFile" Description="!(loc.PythonCompiledFileDescription)" Advertise="no" Icon="py.exe" IconIndex="2">
<Extension Id="$(var.FileExtension)c">
<Verb Id="open" TargetFile="py.exe" Argument="&quot;%L&quot; %*" />
</Extension>
<Extension Id="$(var.FileExtension)o" />
</ProgId>
<RegistryValue Root="HKCR" Key="$(var.TestPrefix)Python.CompiledFile\shellex\DropHandler" Value="{60254CA5-953B-11CF-8C96-00AA00B8708C}" Type="string" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>

27
Tools/msi/lib/lib.props Normal file
View File

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\msi.props" />
<ItemGroup>
<Compile Include="*.wxs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="*.wxl" />
</ItemGroup>
<ItemGroup>
<ExcludeFolders Include="Lib\test;Lib\tests;Lib\tkinter;Lib\idlelib;Lib\turtledemo" />
<InstallFiles Include="$(PySourcePath)Lib\**\*"
Exclude="$(PySourcePath)Lib\**\*.pyc;
$(PySourcePath)Lib\**\*.pyo;
$(PySourcePath)Lib\site-packages\README;
@(ExcludeFolders->'$(PySourcePath)%(Identity)\*');
@(ExcludeFolders->'$(PySourcePath)%(Identity)\**\*')">
<SourceBase>$(PySourcePath)Lib</SourceBase>
<Source>!(bindpath.src)Lib\</Source>
<TargetBase>$(PySourcePath)Lib</TargetBase>
<Target_>Lib\</Target_>
<Group>lib_py</Group>
</InstallFiles>
</ItemGroup>
<Import Project="..\msi.targets" />
</Project>

11
Tools/msi/lib/lib.wixproj Normal file
View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{11367E76-3337-4602-8F1E-77DB4F370D7E}</ProjectGuid>
<SchemaVersion>2.0</SchemaVersion>
<OutputName>lib</OutputName>
<OutputType>Package</OutputType>
<DefineConstants>IncludeDefaultFeature=1;$(DefineConstants)</DefineConstants>
</PropertyGroup>
<Import Project="lib.props" />
</Project>

28
Tools/msi/lib/lib.wxs Normal file
View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Language="!(loc.LCID)" Name="!(loc.Title)" Version="$(var.Version)" Manufacturer="!(loc.Manufacturer)" UpgradeCode="$(var.UpgradeCode)">
<Package InstallerVersion="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" />
<MediaTemplate EmbedCab="yes" CompressionLevel="high" />
<PropertyRef Id="UpgradeTable" />
<PropertyRef Id="REGISTRYKEY" />
<?ifdef IncludeDefaultFeature ?>
<Feature Id="DefaultFeature" AllowAdvertise="no" Title="!(loc.Title)" Description="!(loc.Description)">
<ComponentGroupRef Id="lib_py" />
<ComponentGroupRef Id="lib_files" />
<ComponentGroupRef Id="lib_extensions" />
</Feature>
<?endif ?>
<?ifdef IncludeSymbols ?>
<Feature Id="Symbols" AllowAdvertise="no" Title="!(loc.TitlePdb)" Description="!(loc.DescriptionPdb)">
<ComponentGroupRef Id="lib_extensions_symbols" />
</Feature>
<?endif ?>
<?ifdef IncludeDebugBinaries ?>
<Feature Id="DebugBinaries" AllowAdvertise="no" Title="!(loc.Title_d)" Description="!(loc.Description_d)">
<ComponentGroupRef Id="lib_extensions_d" />
</Feature>
<?endif ?>
</Product>
</Wix>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{6C443CD3-8258-4335-BA03-49DA9C34CE4D}</ProjectGuid>
<SchemaVersion>2.0</SchemaVersion>
<OutputName>lib_d</OutputName>
<OutputType>Package</OutputType>
<DefineConstants>IncludeDebugBinaries=1;$(DefineConstants)</DefineConstants>
</PropertyGroup>
<Import Project="lib.props" />
</Project>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<WixLocalization Culture="en-us" xmlns="http://schemas.microsoft.com/wix/2006/localization">
<String Id="Descriptor">Standard Library</String>
<String Id="ShortDescriptor">lib</String>
</WixLocalization>

View File

@ -0,0 +1,72 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<?define exts=pyexpat;select;unicodedata;winsound;_bz2;_elementtree;_socket;_ssl;_msi;_ctypes;_hashlib;_multiprocessing;_lzma;_decimal;_overlapped;_sqlite3 ?>
<Fragment>
<ComponentGroup Id="lib_extensions">
<?foreach ext in $(var.exts)?>
<Component Id="$(var.ext).pyd" Directory="DLLs" Guid="*">
<File Name="$(var.ext).pyd" KeyPath="yes" />
</Component>
<?endforeach ?>
<Component Id="sqlite3.dll" Directory="DLLs" Guid="*">
<File Name="sqlite3.dll" KeyPath="yes" />
</Component>
</ComponentGroup>
</Fragment>
<Fragment>
<ComponentGroup Id="lib_extensions_symbols">
<?foreach ext in $(var.exts)?>
<Component Id="$(var.ext).pdb" Directory="DLLs" Guid="*">
<Condition>SYMBOLS=1</Condition>
<File Name="$(var.ext).pdb" />
</Component>
<?endforeach ?>
<Component Id="sqlite3.pdb" Directory="DLLs" Guid="*">
<File Name="sqlite3.pdb" />
</Component>
</ComponentGroup>
</Fragment>
<Fragment>
<ComponentGroup Id="lib_extensions_d">
<?foreach ext in $(var.exts)?>
<Component Id="$(var.ext)_d.pyd" Directory="DLLs" Guid="*">
<File Name="$(var.ext)_d.pyd" />
</Component>
<Component Id="$(var.ext)_d.pdb" Directory="DLLs" Guid="*">
<File Name="$(var.ext)_d.pdb" />
</Component>
<?endforeach ?>
</ComponentGroup>
</Fragment>
<Fragment>
<PropertyRef Id="REGISTRYKEY" />
<ComponentGroup Id="lib_files">
<Component Id="PythonPathRegistry" Directory="Lib" Guid="*">
<RegistryKey Root="HKMU" Key="[REGISTRYKEY]">
<RegistryValue Key="PythonPath" Type="string" Value="[Lib];[DLLs]" />
</RegistryKey>
</Component>
<Component Id="Lib_site_packages_README" Directory="Lib_site_packages" Guid="*">
<File Id="Lib_site_packages_README" Name="README.txt" Source="!(bindpath.src)Lib\site-packages\README" KeyPath="yes" />
</Component>
<Component Id="Lib2to3_pickle_remove" Directory="Lib_lib2to3" Guid="$(var.RemoveLib2to3PickleComponentGuid)">
<RemoveFile Id="Lib2to3_pickle_remove_files" Name="*.pickle" On="uninstall" />
<RemoveFolder Id="Lib2to3_pickle_remove_folder" On="uninstall" />
</Component>
</ComponentGroup>
<DirectoryRef Id="Lib">
<Directory Id="Lib_site_packages" Name="site-packages" />
</DirectoryRef>
</Fragment>
</Wix>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{5E0BCE93-D1AC-4591-BBCB-3A2BE5A4B3D1}</ProjectGuid>
<SchemaVersion>2.0</SchemaVersion>
<OutputName>lib_pdb</OutputName>
<OutputType>Package</OutputType>
<DefineConstants>IncludeSymbols=1;$(DefineConstants)</DefineConstants>
</PropertyGroup>
<Import Project="lib.props" />
</Project>

161
Tools/msi/msi.props Normal file
View File

@ -0,0 +1,161 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" TreatAsLocalProperty="ReleaseUri">
<PropertyGroup>
<DefineSolutionProperties>false</DefineSolutionProperties>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<SuppressIces>$(SuppressIces);ICE03;ICE57;ICE61</SuppressIces>
<CompilerSuppressSpecificWarnings>1026</CompilerSuppressSpecificWarnings>
<BuildForRelease Condition="'$(BuildForRelease)' == ''">false</BuildForRelease>
<SignOutput Condition="'$(SigningCertificate)' != ''">true</SignOutput>
<Configuration Condition="'$(Configuration)' == ''">Release</Configuration>
<Platform Condition="'$(Platform)' == ''">x86</Platform>
<InstallScope Condition="'$(InstallScope)' != 'perMachine'">perUser</InstallScope>
<!--
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
when attempting to downgrade.
By default, this is the local computer name, which will produce
installers that do not interfere with other installers. Products
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/.
This is not the same as the DownloadUrl property used in the bundle
projects.
-->
<ReleaseUri Condition="'$(ReleaseUri)' == ''">$(ComputerName)</ReleaseUri>
<ReleaseUri Condition="!$(ReleaseUri.EndsWith(`/`))">$(ReleaseUri)/</ReleaseUri>
</PropertyGroup>
<Import Project="wix.props" />
<Import Project="..\..\PCBuild\tcltk.props" />
<ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)common.wxs" />
<WxlTemplate Include="$(MSBuildThisFileDirectory)\*.wxl_template" />
<WixExtension Include="WixUtilExtension">
<HintPath>WixUtilExtension</HintPath>
<Name>WixUtilExtension</Name>
</WixExtension>
</ItemGroup>
<PropertyGroup>
<IntermediateOutputPath>$(MSBuildThisFileDirectory)\obj\$(Configuration)_$(Platform)\$(OutputName)</IntermediateOutputPath>
<IntermediateOutputPath Condition="'$(OutputSuffix)' != ''">$(IntermediateOutputPath)_$(OutputSuffix)</IntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)' == ''">$(BuildPath)</OutputPath>
<OutputPath Condition="!HasTrailingSlash($(OutputPath))">$(OutputPath)\</OutputPath>
<OutDir>$(OutputPath)</OutDir>
<ReuseCabinetCache>true</ReuseCabinetCache>
<CRTModule Condition="'$(VisualStudioVersion)' == '12.0'">$(CommonProgramFiles)\Merge Modules\Microsoft_VC120_CRT_$(Platform).msm</CRTModule>
<CRTModule Condition="'$(VisualStudioVersion)' == '14.0'">$(CommonProgramFiles)\Merge Modules\Microsoft_VC140_CRT_$(Platform).msm</CRTModule>
<CRTRedist Condition="'$(VisualStudioVersion)' == '12.0'">$([System.IO.Path]::GetFullPath(`$(VS120COMNTOOLS)\..\..\VC\redist\$(Platform)\Microsoft.VC120.CRT`))</CRTRedist>
<CRTRedist Condition="'$(VisualStudioVersion)' == '14.0'">$([System.IO.Path]::GetFullPath(`$(VS140COMNTOOLS)\..\..\VC\redist\$(Platform)\Microsoft.VC140.CRT`))</CRTRedist>
<CRTRedist Condition="'$(CRTRedist)' != '' and !Exists($(CRTRedist))"></CRTRedist>
<RevisionNumber>$(ReleaseLevelNumber)</RevisionNumber>
<RevisionNumber Condition="!$(BuildForRelease)">$([System.Math]::Floor($([System.DateTime]::Now.Subtract($([System.DateTime]::new(2001, 1, 1))).TotalDays)))</RevisionNumber>
</PropertyGroup>
<PropertyGroup>
<Bitness>32-bit</Bitness>
<Bitness Condition="$(Platform) == 'x64'">64-bit</Bitness>
<DefineConstants>
$(DefineConstants);
Version=$(MajorVersionNumber).$(MinorVersionNumber).$(MicroVersionNumber).$(RevisionNumber);
ShortVersion=$(MajorVersionNumber).$(MinorVersionNumber);
LongVersion=$(PythonVersion);
MajorVersionNumber=$(MajorVersionNumber);
MinorVersionNumber=$(MinorVersionNumber);
UpgradeMinimumVersion=$(MajorVersionNumber).$(MinorVersionNumber).0.0;
UpgradeMaximumVersion=$(MajorVersionNumber).$(MinorVersionNumber).150.0;
NextMajorVersionNumber=$(MajorVersionNumber).$([msbuild]::Add($(MinorVersionNumber), 1)).0.0;
PyDebugExt=$(PyDebugExt);
</DefineConstants>
<DefineConstants Condition="'$(CRTModule)' != '' and Exists($(CRTModule))">
$(DefineConstants);CRTModule=$(CRTModule);
</DefineConstants>
<DefineConstants Condition="'$(CRTRedist)' != ''">
$(DefineConstants);CRTRedist=$(CRTRedist);
</DefineConstants>
<DefineConstants Condition="$(Configuration) != 'Debug'">
$(DefineConstants);TestPrefix=;FileExtension=py;
</DefineConstants>
<DefineConstants Condition="$(Configuration) == 'Debug'">
$(DefineConstants);TestPrefix=x;FileExtension=px;
</DefineConstants>
<DefineConstants Condition="$(Platform) != 'x64'">
$(DefineConstants);Suffix32=-32;
</DefineConstants>
<DefineConstants Condition="$(Platform) == 'x64'">
$(DefineConstants);Suffix32=;
</DefineConstants>
</PropertyGroup>
<ItemDefinitionGroup>
<InstallFiles>
<Group>generated_filelist</Group>
<Condition></Condition>
<DiskId></DiskId>
</InstallFiles>
<LinkerBindInputPaths>
<Visible>false</Visible>
</LinkerBindInputPaths>
</ItemDefinitionGroup>
<ItemGroup>
<LinkerBindInputPaths Include="$(BuildPath);$(PySourcePath)Doc\build\htmlhelp">
<BindName></BindName>
</LinkerBindInputPaths>
<LinkerBindInputPaths Include="$(PySourcePath)">
<BindName>src</BindName>
</LinkerBindInputPaths>
<LinkerBindInputPaths Include="$(tcltkDir)">
<BindName>tcltk</BindName>
</LinkerBindInputPaths>
<LinkerBindInputPaths Include="$(CRTRedist)" Condition="'$(CRTRedist)' != ''">
<BindName>crt</BindName>
</LinkerBindInputPaths>
</ItemGroup>
<Target Name="_ValidateMsiProps" BeforeTargets="PrepareForBuild">
<Error Text="Platform '$(Platform)' is not supported. Use 'x86' or 'x64'." Condition="$(Platform) != 'x86' and $(Platform) != 'x64'" />
</Target>
<ItemGroup>
<_Uuid Include="CoreUpgradeCode">
<Uri>upgradecode</Uri>
</_Uuid>
<_Uuid Include="UpgradeCode">
<Uri>upgradecode/$(OutputName)</Uri>
</_Uuid>
<_Uuid Include="InstallDirectoryGuidSeed">
<Uri>installdirectoryseed</Uri>
</_Uuid>
<_Uuid Include="PythonExeComponentGuid">
<Uri>python.exe</Uri>
</_Uuid>
<_Uuid Include="PythonwExeComponentGuid">
<Uri>pythonw.exe</Uri>
</_Uuid>
<_Uuid Include="RemoveLib2to3PickleComponentGuid">
<Uri>lib2to3/pickles</Uri>
</_Uuid>
</ItemGroup>
<Target Name="_GenerateGuids" AfterTargets="PrepareForBuild">
<PropertyGroup>
<_Uuids>@(_Uuid->'("%(Identity)", "%(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>
</PropertyGroup>
<Exec Command='"$(PythonExe)" -c "$(_GenerateCommand)" &gt; "$(IntermediateOutputPath)$(OutputName)guids.txt"' IgnoreExitCode="false" />
<ReadLinesFromFile File="$(IntermediateOutputPath)$(OutputName)guids.txt">
<Output TaskParameter="Lines" ItemName="_UuidValue" />
</ReadLinesFromFile>
<PropertyGroup>
<DefineConstants>$(DefineConstants);@(_UuidValue,';');</DefineConstants>
</PropertyGroup>
</Target>
</Project>

Some files were not shown because too many files have changed in this diff Show More