B µÛÏTò¾âTã @ sp d Z ddlZddlZddlmZ ddlmZ ddlmZm Z ddl T ddlmZ ddl mZ G d d „ d eƒZdS )zzdistutils.command.bdist_wininst Implements the Distutils 'bdist_wininst' command: create a windows installer exe-program.é N)ÚCommand)Úget_platform)Úcreate_treeÚremove_tree)Ú*)Úget_python_version)Úlogc @ sŠ e Zd ZdZddddeƒ fdddd d ddd dddg ZddddgZejdkZ dd„ Z dd„ Zdd„ Zdd„ Z d%dd „Zd!d"„ Zd#d$„ ZdS )&Ú 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))z keep-tempÚkzPkeep the pseudo-installation tree around after creating the distribution archive)ztarget-version=Nz6require a specific python version on the target system)zno-target-compileÚcz/do not compile .py to .pyc on the target system)zno-target-optimizeÚoz;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)z 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=NzŠspecify Vista's UAC handling - 'none'/default=no handling, 'auto'=use UAC if target Python installed for all users, 'force'=always use UACz keep-tempzno-target-compilezno-target-optimizez skip-buildÚwin32c C sR d | _ d | _d| _d| _d| _d | _d | _d | _d | _d | _ d | _ d | _d | _d S )Nr ) Ú bdist_dirÚ plat_nameÚ keep_tempÚno_target_compileÚno_target_optimizeÚtarget_versionÚdist_dirÚbitmapÚtitleÚ skip_buildÚinstall_scriptÚpre_install_scriptÚuser_access_control)Úself© r úD/opt/alt/python37/lib64/python3.7/distutils/command/bdist_wininst.pyÚinitialize_options= s z bdist_wininst.initialize_optionsc C sä | dd¡ | jd krR| jr6| jr6| j d¡}| j|_| d¡j}tj |d¡| _| js^d| _| js˜| j ¡ r˜t ƒ }| jr’| j|kr’td|f ƒ‚|| _| ddd¡ | jràx2| jjD ]}| jtj |¡kr¶P q¶W td| j ƒ‚d S ) NÚbdist)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)Zset_undefined_optionsr r r ÚdistributionZget_command_objÚget_finalized_commandÚ bdist_baseÚosÚpathÚjoinr Úhas_ext_modulesr ZDistutilsOptionErrorr ÚscriptsÚbasename)r r# r' Z short_versionÚscriptr r r! Úfinalize_optionsM s4 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¬| jsštd ƒ‚d t jd d… }d| j|f }| d¡}tj |jd | ¡|_x4dD ],}| ¡ }|dkrü|d }t|d| |ƒ qàW t d| j ¡ | ¡ t j dtj | j d¡¡ | ¡ t jd= ddlm } |ƒ } | j !¡ } | j"| d| j d}| #|| | j$¡ | j ¡ r¢t%ƒ }nd}| jj& 'd|| (| ¡f¡ t )d|¡ t *|¡ | j+sît,| j | j-d d S )Nr z^distribution contains extensions and/or C libraries; must be compiled on a Windows 32 platformÚbuildÚinstallé )Zreinit_subcommandsr Úinstall_libz Should have already checked thisz%d.%dé z.%s-%sÚlib)ZpurelibZplatlibÚheadersr, Údatar6 z/Include/$dist_nameZinstall_zinstalling to %sZPURELIB)ÚmktempÚzip)Zroot_dirÚanyr zremoving temporary file '%s')Údry_run).ÚsysÚplatformr% r+ Zhas_c_librariesZDistutilsPlatformErrorr Zrun_commandZreinitialize_commandr ÚrootZwarn_dirr ÚcompileÚoptimizer ÚAssertionErrorÚversion_infor&