a (Re> @ st d Z ddlZddlZddlZddlmZ ddlmZ ddlm Z ddl T ddlmZ ddl mZ G d d d eZdS )zzdistutils.command.bdist_wininst Implements the Distutils 'bdist_wininst' command: create a windows installer exe-program. N)Command)get_platform)remove_tree)*)get_python_version)logc s e Zd ZdZdddde fdddd d ddd dddg Zg dZejdkZ fddZ dd Zdd Zdd Z dd Zd$ddZd d! Zd"d# Z ZS )% bdist_wininstz-create an executable installer for MS Windows)z bdist-dir=Nz1temporary directory for creating the distributionz plat-name=pz;platform name to embed in generated filenames (default: %s)) keep-tempkzPkeep the pseudo-installation tree around after creating the distribution archive)ztarget-version=Nz6require a specific python version on the target system)no-target-compilecz/do not compile .py to .pyc on the target system)no-target-optimizeoz;do not compile .py to .pyo (optimized) on the target system)z dist-dir=dz-directory to put final built distributions in)zbitmap=bz>bitmap to use for the installer instead of python-powered logo)ztitle=tz?title to display on the installer background instead of default) skip-buildNz2skip rebuilding everything (for testing/debugging))zinstall-script=NzUbasename of installation script to be run after installation or before deinstallation)zpre-install-script=Nz{Fully qualified filename of a script to be run before any files are installed. This script need not be in the distribution)zuser-access-control=Nzspecify Vista's UAC handling - 'none'/default=no handling, 'auto'=use UAC if target Python installed for all users, 'force'=always use UAC)r r r r win32c s$ t j|i | tdtd d S )Nz^bdist_wininst command is deprecated since Python 3.8, use bdist_wheel (wheel packages) instead )super__init__warningswarnDeprecationWarning)selfargskw __class__ /builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_distutils/command/bdist_wininst.pyr ? s zbdist_wininst.__init__c C sR d | _ d | _d| _d| _d| _d | _d | _d | _d | _d | _ d | _ d | _d | _d S )Nr ) bdist_dir plat_name keep_tempno_target_compileno_target_optimizetarget_versiondist_dirbitmaptitle skip_buildinstall_scriptpre_install_scriptuser_access_control)r r r r! initialize_optionsE s z bdist_wininst.initialize_optionsc C s | dd | jd u rR| jr6| jr6| jd}| j|_| dj}tj |d| _| js^d| _| js| j rt }| jr| j|krtd|f || _| ddd | jr| jjD ]}| jtj |kr qqtd| j d S ) Nbdist)r+ r+ Zwininst zMtarget version can only be %s, or the '--skip-build' option must be specified)r( r( )r# r# z(install_script '%s' not found in scripts)set_undefined_optionsr" r+ r# distributionget_command_objget_finalized_command bdist_baseospathjoinr' has_ext_modulesr DistutilsOptionErrorr, scriptsbasename)r r0 r6 Z short_versionscriptr r r! finalize_optionsU s> zbdist_wininst.finalize_optionsc C s t jdkr&| j s| j r&td| js6| d | jddd}| j |_ | j|_d|_| j|_| d}d|_ d|_| j r| j}|s| jsJ d d t jd d }d| j|f }| d}tj|jd | |_dD ],}| }|dkr|d }t|d| | qtd| j | t jdtj| j d | t jd= ddlm} | } | j } | j!| d| j d}| "|| | j# | j rt$ }nd}| jj%&d|| '| f t(d| t)| | j*st+| j | j,d d S )Nr z^distribution contains extensions and/or C libraries; must be compiled on a Windows 32 platformbuildinstall )reinit_subcommandsr install_libz Should have already checked thisz%d.%dr z.%s-%slib)purelibplatlibheadersr<