bpo-42802: Remove distutils bdist_wininst command

The distutils bdist_wininst command deprecated in Python 3.8 has been
removed. The distutils bidst_wheel command is now recommended to
distribute binary packages on Windows.

* Remove Lib/distutils/command/bdist_wininst.py
* Remove PC/bdist_wininst/ project
* Remove Lib/distutils/command/wininst-*.exe programs
* Remove all references to bdist_wininst
This commit is contained in:
Victor Stinner 2021-01-01 15:23:57 +01:00
parent ec3165320e
commit 196b64b70b
40 changed files with 17 additions and 4057 deletions

View File

@ -1862,11 +1862,6 @@ Subclasses of :class:`Command` must define the following methods.
.. _Windows Installer: https://msdn.microsoft.com/en-us/library/cc185688(VS.85).aspx .. _Windows Installer: https://msdn.microsoft.com/en-us/library/cc185688(VS.85).aspx
In most cases, the ``bdist_msi`` installer is a better choice than the
``bdist_wininst`` installer, because it provides better support for
Win64 platforms, allows administrators to perform non-interactive
installations, and allows installation through group policies.
:mod:`distutils.command.bdist_rpm` --- Build a binary distribution as a Redhat RPM and SRPM :mod:`distutils.command.bdist_rpm` --- Build a binary distribution as a Redhat RPM and SRPM
=========================================================================================== ===========================================================================================
@ -1878,19 +1873,6 @@ Subclasses of :class:`Command` must define the following methods.
.. % todo .. % todo
:mod:`distutils.command.bdist_wininst` --- Build a Windows installer
====================================================================
.. module:: distutils.command.bdist_wininst
:synopsis: Build a Windows installer
.. deprecated:: 3.8
Use bdist_wheel (wheel packages) instead.
.. % todo
:mod:`distutils.command.sdist` --- Build a source distribution :mod:`distutils.command.sdist` --- Build a source distribution
============================================================== ==============================================================

View File

@ -96,9 +96,6 @@ The available formats for built distributions are:
+-------------+------------------------------+---------+ +-------------+------------------------------+---------+
| ``sdux`` | HP-UX :program:`swinstall` | | | ``sdux`` | HP-UX :program:`swinstall` | |
+-------------+------------------------------+---------+ +-------------+------------------------------+---------+
| ``wininst`` | self-extracting ZIP file for | \(4) |
| | Windows | |
+-------------+------------------------------+---------+
| ``msi`` | Microsoft Installer. | | | ``msi`` | Microsoft Installer. | |
+-------------+------------------------------+---------+ +-------------+------------------------------+---------+
@ -141,14 +138,9 @@ generated by each, are:
+--------------------------+-------------------------------------+ +--------------------------+-------------------------------------+
| :command:`bdist_rpm` | rpm, srpm | | :command:`bdist_rpm` | rpm, srpm |
+--------------------------+-------------------------------------+ +--------------------------+-------------------------------------+
| :command:`bdist_wininst` | wininst |
+--------------------------+-------------------------------------+
| :command:`bdist_msi` | msi | | :command:`bdist_msi` | msi |
+--------------------------+-------------------------------------+ +--------------------------+-------------------------------------+
.. note::
bdist_wininst is deprecated since Python 3.8.
.. note:: .. note::
bdist_msi is deprecated since Python 3.9. bdist_msi is deprecated since Python 3.9.
@ -190,8 +182,7 @@ The former allows you to specify RPM-specific options; the latter allows you to
easily specify multiple formats in one run. If you need to do both, you can easily specify multiple formats in one run. If you need to do both, you can
explicitly specify multiple :command:`bdist_\*` commands and their options:: explicitly specify multiple :command:`bdist_\*` commands and their options::
python setup.py bdist_rpm --packager="John Doe <jdoe@example.org>" \ python setup.py bdist_rpm --packager="John Doe <jdoe@example.org>"
bdist_wininst --target-version="2.0"
Creating RPM packages is driven by a :file:`.spec` file, much as using the Creating RPM packages is driven by a :file:`.spec` file, much as using the
Distutils is driven by the setup script. To make your life easier, the Distutils is driven by the setup script. To make your life easier, the
@ -299,61 +290,6 @@ file winds up deep in the "build tree," in a temporary directory created by
.. % to the \file{.spec} file.) .. % to the \file{.spec} file.)
.. _creating-wininst:
Creating Windows Installers
===========================
.. warning::
bdist_wininst is deprecated since Python 3.8.
.. warning::
bdist_msi is deprecated since Python 3.9.
Executable installers are the natural format for binary distributions on
Windows. They display a nice graphical user interface, display some information
about the module distribution to be installed taken from the metadata in the
setup script, let the user select a few options, and start or cancel the
installation.
Since the metadata is taken from the setup script, creating Windows installers
is usually as easy as running::
python setup.py bdist_wininst
or the :command:`bdist` command with the :option:`!--formats` option::
python setup.py bdist --formats=wininst
If you have a pure module distribution (only containing pure Python modules and
packages), the resulting installer will be version independent and have a name
like :file:`foo-1.0.win32.exe`. Note that creating ``wininst`` binary
distributions in only supported on Windows systems.
If you have a non-pure distribution, the extensions can only be created on a
Windows platform, and will be Python version dependent. The installer filename
will reflect this and now has the form :file:`foo-1.0.win32-py2.0.exe`. You
have to create a separate installer for every Python version you want to
support.
The installer will try to compile pure modules into :term:`bytecode` after installation
on the target system in normal and optimizing mode. If you don't want this to
happen for some reason, you can run the :command:`bdist_wininst` command with
the :option:`!--no-target-compile` and/or the :option:`!--no-target-optimize`
option.
By default the installer will display the cool "Python Powered" logo when it is
run, but you can also supply your own 152x261 bitmap which must be a Windows
:file:`.bmp` file with the :option:`!--bitmap` option.
The installer will also display a large title on the desktop background window
when it is run, which is constructed from the name of your distribution and the
version number. This can be changed to another text by using the
:option:`!--title` option.
The installer file will be written to the "distribution directory" --- normally
:file:`dist/`, but customizable with the :option:`!--dist-dir` option.
.. _cross-compile-windows: .. _cross-compile-windows:
Cross-compiling on Windows Cross-compiling on Windows
@ -370,10 +306,7 @@ For example, on a 32bit version of Windows, you could execute::
python setup.py build --plat-name=win-amd64 python setup.py build --plat-name=win-amd64
to build a 64bit version of your extension. The Windows Installers also to build a 64bit version of your extension.
support this option, so the command::
python setup.py build --plat-name=win-amd64 bdist_wininst
would create a 64bit installation executable on your 32bit version of Windows. would create a 64bit installation executable on your 32bit version of Windows.
@ -462,18 +395,3 @@ built-in functions in the installation script.
and *iconindex* is the index of the icon in the file *iconpath*. Again, for and *iconindex* is the index of the icon in the file *iconpath*. Again, for
details consult the Microsoft documentation for the :class:`IShellLink` details consult the Microsoft documentation for the :class:`IShellLink`
interface. interface.
Vista User Access Control (UAC)
===============================
Starting with Python 2.6, bdist_wininst supports a :option:`!--user-access-control`
option. The default is 'none' (meaning no UAC handling is done), and other
valid values are 'auto' (meaning prompt for UAC elevation if Python was
installed for all users) and 'force' (meaning always prompt for elevation).
.. note::
bdist_wininst is deprecated since Python 3.8.
.. note::
bdist_msi is deprecated since Python 3.9.

View File

@ -101,6 +101,5 @@ anything except backslash or colon.
.. % \subsection{\protect\command{bdist}} .. % \subsection{\protect\command{bdist}}
.. % \subsection{\protect\command{bdist\_dumb}} .. % \subsection{\protect\command{bdist\_dumb}}
.. % \subsection{\protect\command{bdist\_rpm}} .. % \subsection{\protect\command{bdist\_rpm}}
.. % \subsection{\protect\command{bdist\_wininst}}

View File

@ -112,17 +112,6 @@ the setup script. The difference is which Distutils *commands* they use: the
:command:`install` is more often for installers (although most developers will :command:`install` is more often for installers (although most developers will
want to install their own code occasionally). want to install their own code occasionally).
If you want to make things really easy for your users, you can create one or
more built distributions for them. For instance, if you are running on a
Windows machine, and want to make things easy for other Windows users, you can
create an executable installer (the most appropriate type of built distribution
for this platform) with the :command:`bdist_wininst` command. For example::
python setup.py bdist_wininst
will create an executable installer, :file:`foo-1.0.win32.exe`, in the current
directory.
Other useful built distribution formats are RPM, implemented by the Other useful built distribution formats are RPM, implemented by the
:command:`bdist_rpm` command, Solaris :program:`pkgtool` :command:`bdist_rpm` command, Solaris :program:`pkgtool`
(:command:`bdist_pkgtool`), and HP-UX :program:`swinstall` (:command:`bdist_pkgtool`), and HP-UX :program:`swinstall`

View File

@ -162,6 +162,5 @@ If the source distribution has been built successfully, maintainers can also
create binary distributions. Depending on the platform, one of the following create binary distributions. Depending on the platform, one of the following
commands can be used to do so. :: commands can be used to do so. ::
python setup.py bdist_wininst
python setup.py bdist_rpm python setup.py bdist_rpm
python setup.py bdist_dumb python setup.py bdist_dumb

View File

@ -214,6 +214,14 @@ by :func:`curses.color_content`, :func:`curses.init_color`,
support is provided by the underlying ncurses library. support is provided by the underlying ncurses library.
(Contributed by Jeffrey Kintscher and Hans Petter Jansson in :issue:`36982`.) (Contributed by Jeffrey Kintscher and Hans Petter Jansson in :issue:`36982`.)
distutils
---------
The ``bdist_wininst`` command deprecated in Python 3.8 has been removed.
The ``bidst_wheel`` command is now recommended to distribute binary packages
on Windows.
(Contributed by Victor Stinner in :issue:`42802`.)
doctest doctest
------- -------

View File

@ -19,7 +19,6 @@ __all__ = ['build',
'bdist', 'bdist',
'bdist_dumb', 'bdist_dumb',
'bdist_rpm', 'bdist_rpm',
'bdist_wininst',
'check', 'check',
'upload', 'upload',
# These two are reserved for future use: # These two are reserved for future use:

View File

@ -62,7 +62,7 @@ class bdist(Command):
# Establish the preferred order (for the --help-formats option). # Establish the preferred order (for the --help-formats option).
format_commands = ['rpm', 'gztar', 'bztar', 'xztar', 'ztar', 'tar', format_commands = ['rpm', 'gztar', 'bztar', 'xztar', 'ztar', 'tar',
'wininst', 'zip', 'msi'] 'zip', 'msi']
# And the real information. # And the real information.
format_command = {'rpm': ('bdist_rpm', "RPM distribution"), format_command = {'rpm': ('bdist_rpm', "RPM distribution"),
@ -71,8 +71,6 @@ class bdist(Command):
'xztar': ('bdist_dumb', "xz'ed tar file"), 'xztar': ('bdist_dumb', "xz'ed tar file"),
'ztar': ('bdist_dumb', "compressed tar file"), 'ztar': ('bdist_dumb', "compressed tar file"),
'tar': ('bdist_dumb', "tar file"), 'tar': ('bdist_dumb', "tar file"),
'wininst': ('bdist_wininst',
"Windows executable installer"),
'zip': ('bdist_dumb', "ZIP file"), 'zip': ('bdist_dumb', "ZIP file"),
'msi': ('bdist_msi', "Microsoft Installer") 'msi': ('bdist_msi', "Microsoft Installer")
} }

View File

@ -1,7 +1,5 @@
# Copyright (C) 2005, 2006 Martin von Löwis # Copyright (C) 2005, 2006 Martin von Löwis
# Licensed to PSF under a Contributor Agreement. # Licensed to PSF under a Contributor Agreement.
# The bdist_wininst command proper
# based on bdist_wininst
""" """
Implements the bdist_msi command. Implements the bdist_msi command.
""" """

View File

@ -1,377 +0,0 @@
"""distutils.command.bdist_wininst
Implements the Distutils 'bdist_wininst' command: create a windows installer
exe-program."""
import os
import sys
import warnings
from distutils.core import Command
from distutils.util import get_platform
from distutils.dir_util import remove_tree
from distutils.errors import *
from distutils.sysconfig import get_python_version
from distutils import log
class bdist_wininst(Command):
description = "create an executable installer for MS Windows"
user_options = [('bdist-dir=', None,
"temporary directory for creating the distribution"),
('plat-name=', 'p',
"platform name to embed in generated filenames "
"(default: %s)" % get_platform()),
('keep-temp', 'k',
"keep the pseudo-installation tree around after " +
"creating the distribution archive"),
('target-version=', None,
"require a specific python version" +
" on the target system"),
('no-target-compile', 'c',
"do not compile .py to .pyc on the target system"),
('no-target-optimize', 'o',
"do not compile .py to .pyo (optimized) "
"on the target system"),
('dist-dir=', 'd',
"directory to put final built distributions in"),
('bitmap=', 'b',
"bitmap to use for the installer instead of python-powered logo"),
('title=', 't',
"title to display on the installer background instead of default"),
('skip-build', None,
"skip rebuilding everything (for testing/debugging)"),
('install-script=', None,
"basename of installation script to be run after "
"installation or before deinstallation"),
('pre-install-script=', None,
"Fully qualified filename of a script to be run before "
"any files are installed. This script need not be in the "
"distribution"),
('user-access-control=', None,
"specify Vista's UAC handling - 'none'/default=no "
"handling, 'auto'=use UAC if target Python installed for "
"all users, 'force'=always use UAC"),
]
boolean_options = ['keep-temp', 'no-target-compile', 'no-target-optimize',
'skip-build']
# bpo-10945: bdist_wininst requires mbcs encoding only available on Windows
_unsupported = (sys.platform != "win32")
def __init__(self, *args, **kw):
super().__init__(*args, **kw)
warnings.warn("bdist_wininst command is deprecated since Python 3.8, "
"use bdist_wheel (wheel packages) instead",
DeprecationWarning, 2)
def initialize_options(self):
self.bdist_dir = None
self.plat_name = None
self.keep_temp = 0
self.no_target_compile = 0
self.no_target_optimize = 0
self.target_version = None
self.dist_dir = None
self.bitmap = None
self.title = None
self.skip_build = None
self.install_script = None
self.pre_install_script = None
self.user_access_control = None
def finalize_options(self):
self.set_undefined_options('bdist', ('skip_build', 'skip_build'))
if self.bdist_dir is None:
if self.skip_build and self.plat_name:
# If build is skipped and plat_name is overridden, bdist will
# not see the correct 'plat_name' - so set that up manually.
bdist = self.distribution.get_command_obj('bdist')
bdist.plat_name = self.plat_name
# next the command will be initialized using that name
bdist_base = self.get_finalized_command('bdist').bdist_base
self.bdist_dir = os.path.join(bdist_base, 'wininst')
if not self.target_version:
self.target_version = ""
if not self.skip_build and self.distribution.has_ext_modules():
short_version = get_python_version()
if self.target_version and self.target_version != short_version:
raise DistutilsOptionError(
"target version can only be %s, or the '--skip-build'" \
" option must be specified" % (short_version,))
self.target_version = short_version
self.set_undefined_options('bdist',
('dist_dir', 'dist_dir'),
('plat_name', 'plat_name'),
)
if self.install_script:
for script in self.distribution.scripts:
if self.install_script == os.path.basename(script):
break
else:
raise DistutilsOptionError(
"install_script '%s' not found in scripts"
% self.install_script)
def run(self):
if (sys.platform != "win32" and
(self.distribution.has_ext_modules() or
self.distribution.has_c_libraries())):
raise DistutilsPlatformError \
("distribution contains extensions and/or C libraries; "
"must be compiled on a Windows 32 platform")
if not self.skip_build:
self.run_command('build')
install = self.reinitialize_command('install', reinit_subcommands=1)
install.root = self.bdist_dir
install.skip_build = self.skip_build
install.warn_dir = 0
install.plat_name = self.plat_name
install_lib = self.reinitialize_command('install_lib')
# we do not want to include pyc or pyo files
install_lib.compile = 0
install_lib.optimize = 0
if self.distribution.has_ext_modules():
# If we are building an installer for a Python version other
# than the one we are currently running, then we need to ensure
# our build_lib reflects the other Python version rather than ours.
# Note that for target_version!=sys.version, we must have skipped the
# build step, so there is no issue with enforcing the build of this
# version.
target_version = self.target_version
if not target_version:
assert self.skip_build, "Should have already checked this"
target_version = '%d.%d' % sys.version_info[:2]
plat_specifier = ".%s-%s" % (self.plat_name, target_version)
build = self.get_finalized_command('build')
build.build_lib = os.path.join(build.build_base,
'lib' + plat_specifier)
# Use a custom scheme for the zip-file, because we have to decide
# at installation time which scheme to use.
for key in ('purelib', 'platlib', 'headers', 'scripts', 'data'):
value = key.upper()
if key == 'headers':
value = value + '/Include/$dist_name'
setattr(install,
'install_' + key,
value)
log.info("installing to %s", self.bdist_dir)
install.ensure_finalized()
# avoid warning of 'install_lib' about installing
# into a directory not in sys.path
sys.path.insert(0, os.path.join(self.bdist_dir, 'PURELIB'))
install.run()
del sys.path[0]
# And make an archive relative to the root of the
# pseudo-installation tree.
from tempfile import mktemp
archive_basename = mktemp()
fullname = self.distribution.get_fullname()
arcname = self.make_archive(archive_basename, "zip",
root_dir=self.bdist_dir)
# create an exe containing the zip-file
self.create_exe(arcname, fullname, self.bitmap)
if self.distribution.has_ext_modules():
pyversion = get_python_version()
else:
pyversion = 'any'
self.distribution.dist_files.append(('bdist_wininst', pyversion,
self.get_installer_filename(fullname)))
# remove the zip-file again
log.debug("removing temporary file '%s'", arcname)
os.remove(arcname)
if not self.keep_temp:
remove_tree(self.bdist_dir, dry_run=self.dry_run)
def get_inidata(self):
# Return data describing the installation.
lines = []
metadata = self.distribution.metadata
# Write the [metadata] section.
lines.append("[metadata]")
# 'info' will be displayed in the installer's dialog box,
# describing the items to be installed.
info = (metadata.long_description or '') + '\n'
# Escape newline characters
def escape(s):
return s.replace("\n", "\\n")
for name in ["author", "author_email", "description", "maintainer",
"maintainer_email", "name", "url", "version"]:
data = getattr(metadata, name, "")
if data:
info = info + ("\n %s: %s" % \
(name.capitalize(), escape(data)))
lines.append("%s=%s" % (name, escape(data)))
# The [setup] section contains entries controlling
# the installer runtime.
lines.append("\n[Setup]")
if self.install_script:
lines.append("install_script=%s" % self.install_script)
lines.append("info=%s" % escape(info))
lines.append("target_compile=%d" % (not self.no_target_compile))
lines.append("target_optimize=%d" % (not self.no_target_optimize))
if self.target_version:
lines.append("target_version=%s" % self.target_version)
if self.user_access_control:
lines.append("user_access_control=%s" % self.user_access_control)
title = self.title or self.distribution.get_fullname()
lines.append("title=%s" % escape(title))
import time
import distutils
build_info = "Built %s with distutils-%s" % \
(time.ctime(time.time()), distutils.__version__)
lines.append("build_info=%s" % build_info)
return "\n".join(lines)
def create_exe(self, arcname, fullname, bitmap=None):
import struct
self.mkpath(self.dist_dir)
cfgdata = self.get_inidata()
installer_name = self.get_installer_filename(fullname)
self.announce("creating %s" % installer_name)
if bitmap:
with open(bitmap, "rb") as f:
bitmapdata = f.read()
bitmaplen = len(bitmapdata)
else:
bitmaplen = 0
with open(installer_name, "wb") as file:
file.write(self.get_exe_bytes())
if bitmap:
file.write(bitmapdata)
# Convert cfgdata from unicode to ascii, mbcs encoded
if isinstance(cfgdata, str):
cfgdata = cfgdata.encode("mbcs")
# Append the pre-install script
cfgdata = cfgdata + b"\0"
if self.pre_install_script:
# We need to normalize newlines, so we open in text mode and
# convert back to bytes. "latin-1" simply avoids any possible
# failures.
with open(self.pre_install_script, "r",
encoding="latin-1") as script:
script_data = script.read().encode("latin-1")
cfgdata = cfgdata + script_data + b"\n\0"
else:
# empty pre-install script
cfgdata = cfgdata + b"\0"
file.write(cfgdata)
# The 'magic number' 0x1234567B is used to make sure that the
# binary layout of 'cfgdata' is what the wininst.exe binary
# expects. If the layout changes, increment that number, make
# the corresponding changes to the wininst.exe sources, and
# recompile them.
header = struct.pack("<iii",
0x1234567B, # tag
len(cfgdata), # length
bitmaplen, # number of bytes in bitmap
)
file.write(header)
with open(arcname, "rb") as f:
file.write(f.read())
def get_installer_filename(self, fullname):
# Factored out to allow overriding in subclasses
if self.target_version:
# if we create an installer for a specific python version,
# it's better to include this in the name
installer_name = os.path.join(self.dist_dir,
"%s.%s-py%s.exe" %
(fullname, self.plat_name, self.target_version))
else:
installer_name = os.path.join(self.dist_dir,
"%s.%s.exe" % (fullname, self.plat_name))
return installer_name
def get_exe_bytes(self):
# If a target-version other than the current version has been
# specified, then using the MSVC version from *this* build is no good.
# Without actually finding and executing the target version and parsing
# its sys.version, we just hard-code our knowledge of old versions.
# NOTE: Possible alternative is to allow "--target-version" to
# specify a Python executable rather than a simple version string.
# We can then execute this program to obtain any info we need, such
# as the real sys.version string for the build.
cur_version = get_python_version()
# If the target version is *later* than us, then we assume they
# use what we use
# string compares seem wrong, but are what sysconfig.py itself uses
if self.target_version and self.target_version < cur_version:
if self.target_version < "2.4":
bv = '6.0'
elif self.target_version == "2.4":
bv = '7.1'
elif self.target_version == "2.5":
bv = '8.0'
elif self.target_version <= "3.2":
bv = '9.0'
elif self.target_version <= "3.4":
bv = '10.0'
else:
bv = '14.0'
else:
# for current version - use authoritative check.
try:
from msvcrt import CRT_ASSEMBLY_VERSION
except ImportError:
# cross-building, so assume the latest version
bv = '14.0'
else:
# as far as we know, CRT is binary compatible based on
# the first field, so assume 'x.0' until proven otherwise
major = CRT_ASSEMBLY_VERSION.partition('.')[0]
bv = major + '.0'
# wininst-x.y.exe is in the same directory as this file
directory = os.path.dirname(__file__)
# we must use a wininst-x.y.exe built with the same C compiler
# used for python. XXX What about mingw, borland, and so on?
# if plat_name starts with "win" but is not "win32"
# we want to strip "win" and leave the rest (e.g. -amd64)
# for all other cases, we don't want any suffix
if self.plat_name != 'win32' and self.plat_name[:3] == 'win':
sfix = self.plat_name[3:]
else:
sfix = ''
filename = os.path.join(directory, "wininst-%s%s.exe" % (bv, sfix))
f = open(filename, "rb")
try:
return f.read()
finally:
f.close()

View File

@ -2,7 +2,6 @@
import os import os
import unittest import unittest
from test.support import run_unittest from test.support import run_unittest
import warnings
from distutils.command.bdist import bdist from distutils.command.bdist import bdist
from distutils.tests import support from distutils.tests import support
@ -22,7 +21,7 @@ class BuildTestCase(support.TempdirManager,
# what formats does bdist offer? # what formats does bdist offer?
formats = ['bztar', 'gztar', 'msi', 'rpm', 'tar', formats = ['bztar', 'gztar', 'msi', 'rpm', 'tar',
'wininst', 'xztar', 'zip', 'ztar'] 'xztar', 'zip', 'ztar']
found = sorted(cmd.format_command) found = sorted(cmd.format_command)
self.assertEqual(found, formats) self.assertEqual(found, formats)
@ -34,15 +33,12 @@ class BuildTestCase(support.TempdirManager,
cmd.ensure_finalized() cmd.ensure_finalized()
dist.command_obj['bdist'] = cmd dist.command_obj['bdist'] = cmd
names = ['bdist_dumb', 'bdist_wininst'] # bdist_rpm does not support --skip-build names = ['bdist_dumb'] # bdist_rpm does not support --skip-build
if os.name == 'nt': if os.name == 'nt':
names.append('bdist_msi') names.append('bdist_msi')
for name in names: for name in names:
with warnings.catch_warnings(): subcmd = cmd.get_finalized_command(name)
warnings.filterwarnings('ignore', 'bdist_wininst command is deprecated',
DeprecationWarning)
subcmd = cmd.get_finalized_command(name)
if getattr(subcmd, '_unsupported', False): if getattr(subcmd, '_unsupported', False):
# command is not supported on this build # command is not supported on this build
continue continue

View File

@ -1,39 +0,0 @@
"""Tests for distutils.command.bdist_wininst."""
import sys
import platform
import unittest
from test.support import run_unittest
from test.support.warnings_helper import check_warnings
from distutils.command.bdist_wininst import bdist_wininst
from distutils.tests import support
@unittest.skipIf(sys.platform == 'win32' and platform.machine() == 'ARM64',
'bdist_wininst is not supported in this install')
@unittest.skipIf(getattr(bdist_wininst, '_unsupported', False),
'bdist_wininst is not supported in this install')
class BuildWinInstTestCase(support.TempdirManager,
support.LoggingSilencer,
unittest.TestCase):
def test_get_exe_bytes(self):
# issue5731: command was broken on non-windows platforms
# this test makes sure it works now for every platform
# let's create a command
pkg_pth, dist = self.create_dist()
with check_warnings(("", DeprecationWarning)):
cmd = bdist_wininst(dist)
cmd.ensure_finalized()
# let's run the code that finds the right wininst*.exe file
# and make sure it finds it and returns its content
# no matter what platform we have
exe_file = cmd.get_exe_bytes()
self.assertGreater(len(exe_file), 10)
def test_suite():
return unittest.makeSuite(BuildWinInstTestCase)
if __name__ == '__main__':
run_unittest(test_suite())

View File

@ -32,7 +32,6 @@ class TestUntestedModules(unittest.TestCase):
import distutils.command.bdist_msi import distutils.command.bdist_msi
import distutils.command.bdist import distutils.command.bdist
import distutils.command.bdist_rpm import distutils.command.bdist_rpm
import distutils.command.bdist_wininst
import distutils.command.build_clib import distutils.command.build_clib
import distutils.command.build_ext import distutils.command.build_ext
import distutils.command.build import distutils.command.build

View File

@ -1524,7 +1524,6 @@ libinstall: build_all $(srcdir)/Modules/xxmodule.c
*CVS) ;; \ *CVS) ;; \
*.py[co]) ;; \ *.py[co]) ;; \
*.orig) ;; \ *.orig) ;; \
*wininst-*.exe) ;; \
*~) ;; \ *~) ;; \
*) \ *) \
if test -d $$i; then continue; fi; \ if test -d $$i; then continue; fi; \

View File

@ -0,0 +1,3 @@
The distutils ``bdist_wininst`` command deprecated in Python 3.8 has been
removed. The distutils ``bidst_wheel`` command is now recommended to
distribute binary packages on Windows.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -1,5 +0,0 @@
XXX Write description
XXX Dont't forget to mention upx
XXX Add pointer to this file into PC/README.txt

View File

@ -1,104 +0,0 @@
/*
IMPORTANT NOTE: IF THIS FILE IS CHANGED, PCBUILD\BDIST_WININST.VCXPROJ MUST
BE REBUILT AS WELL.
IF CHANGES TO THIS FILE ARE CHECKED IN, THE RECOMPILED BINARIES MUST BE
CHECKED IN AS WELL!
*/
#pragma pack(1)
/* zip-archive headers
* See: http://www.pkware.com/appnote.html
*/
struct eof_cdir {
long tag; /* must be 0x06054b50 */
short disknum;
short firstdisk;
short nTotalCDirThis;
short nTotalCDir;
long nBytesCDir;
long ofsCDir;
short commentlen;
};
struct cdir {
long tag; /* must be 0x02014b50 */
short version_made;
short version_extract;
short gp_bitflag;
short comp_method;
short last_mod_file_time;
short last_mod_file_date;
long crc32;
long comp_size;
long uncomp_size;
short fname_length;
short extra_length;
short comment_length;
short disknum_start;
short int_file_attr;
long ext_file_attr;
long ofs_local_header;
};
struct fhdr {
long tag; /* must be 0x04034b50 */
short version_needed;
short flags;
short method;
short last_mod_file_time;
short last_mod_file_date;
long crc32;
long comp_size;
long uncomp_size;
short fname_length;
short extra_length;
};
struct meta_data_hdr {
int tag;
int uncomp_size;
int bitmap_size;
};
#pragma pack()
/* installation scheme */
typedef struct tagSCHEME {
char *name;
char *prefix;
} SCHEME;
typedef int (*NOTIFYPROC)(int code, LPSTR text, ...);
extern BOOL
extract_file(char *dst, char *src, int method, int comp_size,
int uncomp_size, NOTIFYPROC notify);
extern BOOL
unzip_archive(SCHEME *scheme, char *dirname, char *data,
DWORD size, NOTIFYPROC notify);
extern char *
map_new_file(DWORD flags, char *filename, char
*pathname_part, int size,
WORD wFatDate, WORD wFatTime,
NOTIFYPROC callback);
extern BOOL
ensure_directory (char *pathname, char *new_part,
NOTIFYPROC callback);
/* codes for NOITIFYPROC */
#define DIR_CREATED 1
#define CAN_OVERWRITE 2
#define FILE_CREATED 3
#define ZLIB_ERROR 4
#define SYSTEM_ERROR 5
#define NUM_FILES 6
#define FILE_OVERWRITTEN 7

View File

@ -1,125 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM">
<Configuration>Debug</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="PGInstrument|ARM">
<Configuration>PGInstrument</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="PGInstrument|Win32">
<Configuration>PGInstrument</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="PGInstrument|x64">
<Configuration>PGInstrument</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="PGUpdate|ARM">
<Configuration>PGUpdate</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="PGUpdate|Win32">
<Configuration>PGUpdate</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="PGUpdate|x64">
<Configuration>PGUpdate</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM">
<Configuration>Release</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{EB1C19C1-1F18-421E-9735-CAEE69DC6A3C}</ProjectGuid>
<RootNamespace>wininst</RootNamespace>
<SupportPGO>false</SupportPGO>
</PropertyGroup>
<Import Project="..\..\PCbuild\python.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\PCbuild\pyproject.props" />
</ImportGroup>
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<OutDir>$(PySourcePath)lib\distutils\command\</OutDir>
<LinkIncremental>false</LinkIncremental>
<TargetName>wininst-$(VisualStudioVersion)</TargetName>
<TargetName Condition="$(PlatformToolset) == 'v140'">wininst-14.0</TargetName>
<TargetName Condition="$(PlatformToolset) == 'v120'">wininst-12.0</TargetName>
<TargetName Condition="$(PlatformToolset) == 'v110'">wininst-11.0</TargetName>
<TargetName Condition="$(PlatformToolset) == 'v100'">wininst-10.0</TargetName>
<TargetName Condition="$(Platform) == 'x64'">$(TargetName)-amd64</TargetName>
<TargetExt>.exe</TargetExt>
</PropertyGroup>
<ItemDefinitionGroup>
<Midl>
<TypeLibraryName>$(OutDir)wininst.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<Optimization>MinSpace</Optimization>
<AdditionalIncludeDirectories>$(zlibDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary Condition="'$(Configuration)'=='Debug'">MultiThreadedDebug</RuntimeLibrary>
<RuntimeLibrary Condition="'$(Configuration)'=='Release'">MultiThreaded</RuntimeLibrary>
</ClCompile>
<ResourceCompile>
<AdditionalIncludeDirectories>$(PySourcePath)PC\bdist_wininst;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
<AdditionalDependencies>comctl32.lib;imagehlp.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="extract.c" />
<ClCompile Include="install.c" />
<ClCompile Include="$(zlibDir)\adler32.c" />
<ClCompile Include="$(zlibDir)\crc32.c" />
<ClCompile Include="$(zlibDir)\inffast.c" />
<ClCompile Include="$(zlibDir)\inflate.c" />
<ClCompile Include="$(zlibDir)\inftrees.c" />
<ClCompile Include="$(zlibDir)\zutil.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="archive.h" />
<ClInclude Include="$(zlibDir)\zlib.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="install.rc" />
</ItemGroup>
<ItemGroup>
<None Include="PythonPowered.bmp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -1,67 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{293b1092-03ad-4b7c-acb9-c4ab62e52f55}</UniqueIdentifier>
<Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>
</Filter>
<Filter Include="Source Files\zlib">
<UniqueIdentifier>{0edc0406-282f-4dbc-b60e-a867c34a2a31}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{ea0c0f0e-3b73-474e-a999-e9689d032ccc}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{0c77c1cf-3f87-4f87-bd86-b425211c2181}</UniqueIdentifier>
<Extensions>ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
</Filter>
<Filter Include="Header Files\zlib">
<UniqueIdentifier>{d10220c7-69e3-47c5-8d82-c8e0d4d2ac88}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="extract.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="install.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="$(zlibDir)\adler32.c">
<Filter>Source Files\zlib</Filter>
</ClCompile>
<ClCompile Include="$(zlibDir)\crc32.c">
<Filter>Source Files\zlib</Filter>
</ClCompile>
<ClCompile Include="$(zlibDir)\inffast.c">
<Filter>Source Files\zlib</Filter>
</ClCompile>
<ClCompile Include="$(zlibDir)\inflate.c">
<Filter>Source Files\zlib</Filter>
</ClCompile>
<ClCompile Include="$(zlibDir)\inftrees.c">
<Filter>Source Files\zlib</Filter>
</ClCompile>
<ClCompile Include="$(zlibDir)\zutil.c">
<Filter>Source Files\zlib</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="install.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="archive.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="$(zlibDir)\zlib.h">
<Filter>Header Files\zlib</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="PythonPowered.bmp">
<Filter>Resource Files</Filter>
</None>
</ItemGroup>
</Project>

View File

@ -1,19 +0,0 @@
@echo off
setlocal
set D=%~dp0
set PCBUILD=%~dp0..\..\PCbuild\
echo Building Lib\distutils\command\wininst-xx.0.exe
call "%PCBUILD%find_msbuild.bat" %MSBUILD%
if ERRORLEVEL 1 (echo Cannot locate MSBuild.exe on PATH or as MSBUILD variable & exit /b 2)
%MSBUILD% "%D%bdist_wininst.vcxproj" "/p:SolutionDir=%PCBUILD%\" /p:Configuration=Release /p:Platform=Win32
if errorlevel 1 goto :eof
echo Building Lib\distutils\command\wininst-xx.0-amd64.exe
%MSBUILD% "%D%bdist_wininst.vcxproj" "/p:SolutionDir=%PCBUILD%\" /p:Configuration=Release /p:Platform=x64

View File

@ -1,320 +0,0 @@
/*
IMPORTANT NOTE: IF THIS FILE IS CHANGED, PCBUILD\BDIST_WININST.VCXPROJ MUST
BE REBUILT AS WELL.
IF CHANGES TO THIS FILE ARE CHECKED IN, THE RECOMPILED BINARIES MUST BE
CHECKED IN AS WELL!
*/
#include <windows.h>
#include "zlib.h"
#include <stdio.h>
#include <stdarg.h>
#include "archive.h"
/* Convert unix-path to dos-path */
static void normpath(char *path)
{
while (path && *path) {
if (*path == '/')
*path = '\\';
++path;
}
}
BOOL ensure_directory(char *pathname, char *new_part, NOTIFYPROC notify)
{
while (new_part && *new_part && (new_part = strchr(new_part, '\\'))) {
DWORD attr;
*new_part = '\0';
attr = GetFileAttributes(pathname);
if (attr == -1) {
/* nothing found */
if (!CreateDirectory(pathname, NULL) && notify)
notify(SYSTEM_ERROR,
"CreateDirectory (%s)", pathname);
else
notify(DIR_CREATED, pathname);
}
if (attr & FILE_ATTRIBUTE_DIRECTORY) {
;
} else {
SetLastError(183);
if (notify)
notify(SYSTEM_ERROR,
"CreateDirectory (%s)", pathname);
}
*new_part = '\\';
++new_part;
}
return TRUE;
}
/* XXX Should better explicitly specify
* uncomp_size and file_times instead of pfhdr!
*/
char *map_new_file(DWORD flags, char *filename,
char *pathname_part, int size,
WORD wFatDate, WORD wFatTime,
NOTIFYPROC notify)
{
HANDLE hFile, hFileMapping;
char *dst;
FILETIME ft;
try_again:
if (!flags)
flags = CREATE_NEW;
hFile = CreateFile(filename,
GENERIC_WRITE | GENERIC_READ,
0, NULL,
flags,
FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE) {
DWORD x = GetLastError();
switch (x) {
case ERROR_FILE_EXISTS:
if (notify && notify(CAN_OVERWRITE, filename))
hFile = CreateFile(filename,
GENERIC_WRITE|GENERIC_READ,
0, NULL,
CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL,
NULL);
else {
if (notify)
notify(FILE_OVERWRITTEN, filename);
return NULL;
}
break;
case ERROR_PATH_NOT_FOUND:
if (ensure_directory(filename, pathname_part, notify))
goto try_again;
else
return FALSE;
break;
default:
SetLastError(x);
break;
}
}
if (hFile == INVALID_HANDLE_VALUE) {
if (notify)
notify (SYSTEM_ERROR, "CreateFile (%s)", filename);
return NULL;
}
if (notify)
notify(FILE_CREATED, filename);
DosDateTimeToFileTime(wFatDate, wFatTime, &ft);
SetFileTime(hFile, &ft, &ft, &ft);
if (size == 0) {
/* We cannot map a zero-length file (Also it makes
no sense */
CloseHandle(hFile);
return NULL;
}
hFileMapping = CreateFileMapping(hFile,
NULL, PAGE_READWRITE, 0, size, NULL);
CloseHandle(hFile);
if (hFileMapping == NULL) {
if (notify)
notify(SYSTEM_ERROR,
"CreateFileMapping (%s)", filename);
return NULL;
}
dst = MapViewOfFile(hFileMapping,
FILE_MAP_WRITE, 0, 0, 0);
CloseHandle(hFileMapping);
if (!dst) {
if (notify)
notify(SYSTEM_ERROR, "MapViewOfFile (%s)", filename);
return NULL;
}
return dst;
}
BOOL
extract_file(char *dst, char *src, int method, int comp_size,
int uncomp_size, NOTIFYPROC notify)
{
z_stream zstream;
int result;
if (method == Z_DEFLATED) {
int x;
memset(&zstream, 0, sizeof(zstream));
zstream.next_in = src;
zstream.avail_in = comp_size+1;
zstream.next_out = dst;
zstream.avail_out = uncomp_size;
/* Apparently an undocumented feature of zlib: Set windowsize
to negative values to suppress the gzip header and be compatible with
zip! */
result = TRUE;
if (Z_OK != (x = inflateInit2(&zstream, -15))) {
if (notify)
notify(ZLIB_ERROR,
"inflateInit2 returns %d", x);
result = FALSE;
goto cleanup;
}
if (Z_STREAM_END != (x = inflate(&zstream, Z_FINISH))) {
if (notify)
notify(ZLIB_ERROR,
"inflate returns %d", x);
result = FALSE;
}
cleanup:
if (Z_OK != (x = inflateEnd(&zstream))) {
if (notify)
notify (ZLIB_ERROR,
"inflateEnd returns %d", x);
result = FALSE;
}
} else if (method == 0) {
memcpy(dst, src, uncomp_size);
result = TRUE;
} else
result = FALSE;
UnmapViewOfFile(dst);
return result;
}
/* Open a zip-compatible archive and extract all files
* into the specified directory (which is assumed to exist)
*/
BOOL
unzip_archive(SCHEME *scheme, char *dirname, char *data, DWORD size,
NOTIFYPROC notify)
{
int n;
char pathname[MAX_PATH];
char *new_part;
/* read the end of central directory record */
struct eof_cdir *pe = (struct eof_cdir *)&data[size - sizeof
(struct eof_cdir)];
int arc_start = size - sizeof (struct eof_cdir) - pe->nBytesCDir -
pe->ofsCDir;
/* set position to start of central directory */
int pos = arc_start + pe->ofsCDir;
/* make sure this is a zip file */
if (pe->tag != 0x06054b50)
return FALSE;
/* Loop through the central directory, reading all entries */
for (n = 0; n < pe->nTotalCDir; ++n) {
int i;
char *fname;
char *pcomp;
char *dst;
struct cdir *pcdir;
struct fhdr *pfhdr;
pcdir = (struct cdir *)&data[pos];
pfhdr = (struct fhdr *)&data[pcdir->ofs_local_header +
arc_start];
if (pcdir->tag != 0x02014b50)
return FALSE;
if (pfhdr->tag != 0x04034b50)
return FALSE;
pos += sizeof(struct cdir);
fname = (char *)&data[pos]; /* This is not null terminated! */
pos += pcdir->fname_length + pcdir->extra_length +
pcdir->comment_length;
pcomp = &data[pcdir->ofs_local_header
+ sizeof(struct fhdr)
+ arc_start
+ pfhdr->fname_length
+ pfhdr->extra_length];
/* dirname is the Python home directory (prefix) */
strcpy(pathname, dirname);
if (pathname[strlen(pathname)-1] != '\\')
strcat(pathname, "\\");
new_part = &pathname[lstrlen(pathname)];
/* we must now match the first part of the pathname
* in the archive to a component in the installation
* scheme (PURELIB, PLATLIB, HEADERS, SCRIPTS, or DATA)
* and replace this part by the one in the scheme to use
*/
for (i = 0; scheme[i].name; ++i) {
if (0 == strnicmp(scheme[i].name, fname,
strlen(scheme[i].name))) {
char *rest;
int len;
/* length of the replaced part */
int namelen = strlen(scheme[i].name);
strcat(pathname, scheme[i].prefix);
rest = fname + namelen;
len = pfhdr->fname_length - namelen;
if ((pathname[strlen(pathname)-1] != '\\')
&& (pathname[strlen(pathname)-1] != '/'))
strcat(pathname, "\\");
/* Now that pathname ends with a separator,
* we must make sure rest does not start with
* an additional one.
*/
if ((rest[0] == '\\') || (rest[0] == '/')) {
++rest;
--len;
}
strncat(pathname, rest, len);
goto Done;
}
}
/* no prefix to replace found, go unchanged */
strncat(pathname, fname, pfhdr->fname_length);
Done:
normpath(pathname);
if (pathname[strlen(pathname)-1] != '\\') {
/*
* The local file header (pfhdr) does not always
* contain the compressed and uncompressed sizes of
* the data depending on bit 3 of the flags field. So
* it seems better to use the data from the central
* directory (pcdir).
*/
dst = map_new_file(0, pathname, new_part,
pcdir->uncomp_size,
pcdir->last_mod_file_date,
pcdir->last_mod_file_time, notify);
if (dst) {
if (!extract_file(dst, pcomp, pfhdr->method,
pcdir->comp_size,
pcdir->uncomp_size,
notify))
return FALSE;
} /* else ??? */
}
if (notify)
notify(NUM_FILES, new_part, (int)pe->nTotalCDir,
(int)n+1);
}
return TRUE;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,77 +0,0 @@
/*
IMPORTANT NOTE: IF THIS FILE IS CHANGED, PCBUILD\BDIST_WININST.VCXPROJ MUST
BE REBUILT AS WELL.
IF CHANGES TO THIS FILE ARE CHECKED IN, THE RECOMPILED BINARIES MUST BE
CHECKED IN AS WELL!
*/
#include <winres.h>
#include "resource.h"
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
#pragma code_page(1252)
IDB_BITMAP BITMAP DISCARDABLE "PythonPowered.bmp"
IDD_INTRO DIALOGEX 0, 0, 379, 178
STYLE WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "Setup"
FONT 8, "MS Sans Serif", 0, 0, 0x1
BEGIN
LTEXT "This Wizard will install %s on your computer. Click Next to continue or Cancel to exit the Setup Wizard.",
IDC_TITLE,125,10,247,20,NOT WS_GROUP
EDITTEXT IDC_INTRO_TEXT,125,31,247,131,ES_MULTILINE | ES_READONLY |
WS_VSCROLL | WS_HSCROLL | NOT WS_TABSTOP
CONTROL 110,IDC_BITMAP,"Static",SS_BITMAP | SS_CENTERIMAGE,6,8,
104,163,WS_EX_CLIENTEDGE
LTEXT "",IDC_BUILD_INFO,125,163,247,8
END
IDD_SELECTPYTHON DIALOGEX 0, 0, 379, 178
STYLE WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "Setup"
FONT 8, "MS Sans Serif", 0, 0, 0x1
BEGIN
LTEXT "Select python installation to use:",IDC_TITLE,125,10,
247,12,NOT WS_GROUP
EDITTEXT IDC_PATH,191,136,181,14,ES_AUTOHSCROLL | ES_READONLY
LTEXT "Python Directory:",IDC_STATIC,125,137,55,8
LISTBOX IDC_VERSIONS_LIST,125,24,247,106,LBS_SORT |
LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
CONTROL 110,IDC_BITMAP,"Static",SS_BITMAP | SS_CENTERIMAGE,6,8,
104,163,WS_EX_CLIENTEDGE
EDITTEXT IDC_INSTALL_PATH,191,157,181,14,ES_AUTOHSCROLL |
ES_READONLY
LTEXT "Installation Directory:",IDC_STATIC,125,158,66,8
PUSHBUTTON "Find other ...",IDC_OTHERPYTHON,322,7,50,14,NOT
WS_VISIBLE
END
IDD_INSTALLFILES DIALOGEX 0, 0, 379, 178
STYLE WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "Setup"
FONT 8, "MS Sans Serif", 0, 0, 0x1
BEGIN
LTEXT "Click Next to begin the installation. If you want to review or change any of your installation settings, click Back. Click Cancel to exit the Wizard.",
IDC_TITLE,125,10,246,31,NOT WS_GROUP
CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",WS_BORDER,
125,157,246,14
CTEXT "Installation progress:",IDC_INFO,125,137,246,8
CONTROL 110,IDC_BITMAP,"Static",SS_BITMAP | SS_CENTERIMAGE,6,8,
104,163,WS_EX_CLIENTEDGE
END
IDD_FINISHED DIALOGEX 0, 0, 379, 178
STYLE WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "Setup"
FONT 8, "MS Sans Serif"
BEGIN
LTEXT "Click the Finish button to exit the Setup wizard.",
IDC_TITLE,125,10,247,31,NOT WS_GROUP
CONTROL 110,IDC_BITMAP,"Static",SS_BITMAP | SS_CENTERIMAGE,6,8,
104,163,WS_EX_CLIENTEDGE
EDITTEXT IDC_INFO,125,40,247,131,ES_MULTILINE | ES_READONLY |
WS_VSCROLL | WS_HSCROLL | NOT WS_TABSTOP
END

View File

@ -1,31 +0,0 @@
/*
IMPORTANT NOTE: IF THIS FILE IS CHANGED, PCBUILD\BDIST_WININST.VCXPROJ MUST
BE REBUILT AS WELL.
IF CHANGES TO THIS FILE ARE CHECKED IN, THE RECOMPILED BINARIES MUST BE
CHECKED IN AS WELL!
*/
#define IDD_DIALOG1 101
#define IDB_BITMAP1 103
#define IDD_INTRO 107
#define IDD_SELECTPYTHON 108
#define IDD_INSTALLFILES 109
#define IDD_FINISHED 110
#define IDB_BITMAP 110
#define IDC_EDIT1 1000
#define IDC_TITLE 1000
#define IDC_START 1001
#define IDC_PROGRESS 1003
#define IDC_INFO 1004
#define IDC_PYTHON15 1006
#define IDC_PATH 1007
#define IDC_PYTHON16 1008
#define IDC_INSTALL_PATH 1008
#define IDC_PYTHON20 1009
#define IDC_BROWSE 1010
#define IDC_INTRO_TEXT 1021
#define IDC_VERSIONS_LIST 1022
#define IDC_BUILD_INFO 1024
#define IDC_BITMAP 1025
#define IDC_OTHERPYTHON 1026

View File

@ -33,9 +33,6 @@ from .support.pip import *
from .support.props import * from .support.props import *
from .support.nuspec import * from .support.nuspec import *
BDIST_WININST_FILES_ONLY = FileNameSet("wininst-*", "bdist_wininst.py")
BDIST_WININST_STUB = "PC/layout/support/distutils.command.bdist_wininst.py"
TEST_PYDS_ONLY = FileStemSet("xxlimited", "xxlimited_35", "_ctypes_test", "_test*") TEST_PYDS_ONLY = FileStemSet("xxlimited", "xxlimited_35", "_ctypes_test", "_test*")
TEST_DIRS_ONLY = FileNameSet("test", "tests") TEST_DIRS_ONLY = FileNameSet("test", "tests")
@ -100,17 +97,11 @@ def get_lib_layout(ns):
else: else:
if f in TCLTK_FILES_ONLY: if f in TCLTK_FILES_ONLY:
return ns.include_tcltk return ns.include_tcltk
if f in BDIST_WININST_FILES_ONLY:
return ns.include_bdist_wininst
return True return True
for dest, src in rglob(ns.source / "Lib", "**/*", _c): for dest, src in rglob(ns.source / "Lib", "**/*", _c):
yield dest, src yield dest, src
if not ns.include_bdist_wininst:
src = ns.source / BDIST_WININST_STUB
yield Path("distutils/command/bdist_wininst.py"), src
def get_tcltk_lib(ns): def get_tcltk_lib(ns):
if not ns.include_tcltk: if not ns.include_tcltk:

View File

@ -1,25 +0,0 @@
"""distutils.command.bdist_wininst
Suppress the 'bdist_wininst' command, while still allowing
setuptools to import it without breaking."""
from distutils.core import Command
from distutils.errors import DistutilsPlatformError
class bdist_wininst(Command):
description = "create an executable installer for MS Windows"
# Marker for tests that we have the unsupported bdist_wininst
_unsupported = True
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
raise DistutilsPlatformError(
"bdist_wininst is not supported in this Python distribution"
)

View File

@ -26,7 +26,6 @@ OPTIONS = {
"venv": {"help": "venv"}, "venv": {"help": "venv"},
"dev": {"help": "headers and libs"}, "dev": {"help": "headers and libs"},
"symbols": {"help": "symbols"}, "symbols": {"help": "symbols"},
"bdist-wininst": {"help": "bdist_wininst support"},
"underpth": {"help": "a python._pth file", "not-in-all": True}, "underpth": {"help": "a python._pth file", "not-in-all": True},
"launchers": {"help": "specific launchers"}, "launchers": {"help": "specific launchers"},
"appxmanifest": {"help": "an appxmanifest"}, "appxmanifest": {"help": "an appxmanifest"},
@ -81,7 +80,6 @@ PRESETS = {
"venv", "venv",
"dev", "dev",
"symbols", "symbols",
"bdist-wininst",
"chm", "chm",
], ],
}, },

View File

@ -162,7 +162,6 @@
<Compile Include="distutils\command\bdist_dumb.py" /> <Compile Include="distutils\command\bdist_dumb.py" />
<Compile Include="distutils\command\bdist_msi.py" /> <Compile Include="distutils\command\bdist_msi.py" />
<Compile Include="distutils\command\bdist_rpm.py" /> <Compile Include="distutils\command\bdist_rpm.py" />
<Compile Include="distutils\command\bdist_wininst.py" />
<Compile Include="distutils\command\build.py" /> <Compile Include="distutils\command\build.py" />
<Compile Include="distutils\command\build_clib.py" /> <Compile Include="distutils\command\build_clib.py" />
<Compile Include="distutils\command\build_ext.py" /> <Compile Include="distutils\command\build_ext.py" />
@ -204,7 +203,6 @@
<Compile Include="distutils\tests\test_bdist_dumb.py" /> <Compile Include="distutils\tests\test_bdist_dumb.py" />
<Compile Include="distutils\tests\test_bdist_msi.py" /> <Compile Include="distutils\tests\test_bdist_msi.py" />
<Compile Include="distutils\tests\test_bdist_rpm.py" /> <Compile Include="distutils\tests\test_bdist_rpm.py" />
<Compile Include="distutils\tests\test_bdist_wininst.py" />
<Compile Include="distutils\tests\test_build.py" /> <Compile Include="distutils\tests\test_build.py" />
<Compile Include="distutils\tests\test_build_clib.py" /> <Compile Include="distutils\tests\test_build_clib.py" />
<Compile Include="distutils\tests\test_build_ext.py" /> <Compile Include="distutils\tests\test_build_ext.py" />

View File

@ -53,8 +53,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unicodedata", "unicodedata.
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pyexpat", "pyexpat.vcxproj", "{D06B6426-4762-44CC-8BAD-D79052507F2F}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pyexpat", "pyexpat.vcxproj", "{D06B6426-4762-44CC-8BAD-D79052507F2F}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bdist_wininst", "..\PC\bdist_wininst\bdist_wininst.vcxproj", "{EB1C19C1-1F18-421E-9735-CAEE69DC6A3C}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_hashlib", "_hashlib.vcxproj", "{447F05A8-F581-4CAC-A466-5AC7936E207E}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_hashlib", "_hashlib.vcxproj", "{447F05A8-F581-4CAC-A466-5AC7936E207E}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sqlite3", "sqlite3.vcxproj", "{A1A295E5-463C-437F-81CA-1F32367685DA}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sqlite3", "sqlite3.vcxproj", "{A1A295E5-463C-437F-81CA-1F32367685DA}"

View File

@ -1,23 +0,0 @@
"""distutils.command.bdist_wininst
Suppresses the 'bdist_wininst' command, while still allowing
setuptools to import it without breaking."""
from distutils.core import Command
from distutils.errors import DistutilsPlatformError
class bdist_wininst(Command):
description = "create an executable installer for MS Windows"
# Marker for tests that we have the unsupported bdist_wininst
_unsupported = True
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
raise DistutilsPlatformError("bdist_wininst is not supported "
"in this Python distribution")