• File: bdist_wininst.cpython-37.pyc
  • Full Path: /home3/farmfre2/public_html/ALFA_DATA/alfasymlink/root/opt/alt/python37/lib64/python3.7/distutils/command/__pycache__/bdist_wininst.cpython-37.pyc
  • Date Modified: 10/26/2026 8:08 PM
  • File size: 7.86 KB
  • MIME-type: text/x-bytecode.python
  • Charset: 8 bit
B

Mj<@spdZddlZddlZddlmZddlmZddlmZm	Z	ddl
TddlmZddl
mZGd	d
d
eZdS)zzdistutils.command.bdist_wininst

Implements the Distutils 'bdist_wininst' command: create a windows installer
exe-program.N)Command)get_platform)create_treeremove_tree)*)get_python_version)logc
@seZdZdZddddefdddd	d
ddd
dddg
ZddddgZejdkZ	ddZ
ddZddZddZ
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-tempkzPkeep the pseudo-installation tree around after creating the distribution archive)ztarget-version=Nz6require a specific python version on the target system)zno-target-compilecz/do not compile .py to .pyc on the target system)zno-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)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=Nzspecify 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-buildwin32cCsRd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_dS)Nr)
	bdist_dir	plat_name	keep_tempno_target_compileno_target_optimizetarget_versiondist_dirbitmaptitle
skip_buildinstall_scriptpre_install_scriptuser_access_control)selfr D/opt/alt/python37/lib64/python3.7/distutils/command/bdist_wininst.pyinitialize_options=sz bdist_wininst.initialize_optionscCs|dd|jdkrR|jr6|jr6|jd}|j|_|dj}tj	
|d|_|js^d|_|js|jrt
}|jr|j|krtd|f||_|ddd|jrx2|jjD]}|jtj	|krPqWtd|jdS)	Nbdist)rrZwininstzMtarget version can only be %s, or the '--skip-build' option must be specified)rr)rrz(install_script '%s' not found in scripts)Zset_undefined_optionsrrrdistributionZget_command_objget_finalized_command
bdist_baseospathjoinrhas_ext_modulesrZDistutilsOptionErrorrscriptsbasename)rr#r'Z
short_versionscriptr r r!finalize_optionsMs4

zbdist_wininst.finalize_optionsc
Cstjdkr&|js|jr&td|js6|d|jddd}|j	|_
|j|_d|_|j|_|d}d|_
d|_|jr|j}|s|jstd	d
tjdd}d|j|f}|d}tj|jd
||_x4dD],}|}|dkr|d}t|d||qWtd|j	|tjdtj|j	d|tjd=ddlm }|}	|j!}
|j"|	d|j	d}|#||
|j$|jrt%}nd}|jj&'d||(|
ft)d|t*||j+st,|j	|j-ddS)Nrz^distribution contains extensions and/or C libraries; must be compiled on a Windows 32 platformbuildinstall)Zreinit_subcommandsrinstall_libz Should have already checked thisz%d.%dz.%s-%slib)ZpurelibZplatlibheadersr,datar6z/Include/$dist_nameZinstall_zinstalling to %sZPURELIB)mktempzip)Zroot_diranyr	zremoving temporary file '%s')dry_run).sysplatformr%r+Zhas_c_librariesZDistutilsPlatformErrorrZrun_commandZreinitialize_commandrrootZwarn_dirrcompileoptimizerAssertionErrorversion_infor&r(r)r*Z
build_baseZ	build_libuppersetattrrinfoZensure_finalizedinsertrunZtempfiler8get_fullnameZmake_archive
create_exerrZ
dist_filesappendget_installer_filenamedebugremoverrr;)
rr1r3rZplat_specifierr0keyvaluer8Zarchive_basenamefullnamearcnameZ	pyversionr r r!rGssf












zbdist_wininst.runcCs^g}|jj}|d|jpdd}dd}xJdD]B}t||d}|r2|d|||f}|d|||fq2W|d	|jr|d
|j|d|||d|j|d
|j|j	r|d|j	|j
r|d|j
|jp
|j}|d||ddl
}ddl}	d||
|	jf}
|d|
d|S)Nz
[metadata]r$
cSs|ddS)NrRz\n)replace)sr r r!escapesz)bdist_wininst.get_inidata.<locals>.escape)ZauthorZauthor_emaildescriptionZ
maintainerZmaintainer_emailnameZurlversionz
    %s: %sz%s=%sz
[Setup]zinstall_script=%szinfo=%sztarget_compile=%dztarget_optimize=%dztarget_version=%szuser_access_control=%sztitle=%srzBuilt %s with distutils-%sz
build_info=%s)r%metadatarJZlong_descriptiongetattr
capitalizerrrrrrrHtime	distutilsZctime__version__r*)rlinesrYrErUrWr7rr\r]Z
build_infor r r!get_inidatas:


zbdist_wininst.get_inidataNc
	Csddl}||j|}||}|d||rPt|d}t|}nd}t|d}	|		|
|rz|		|t|tr|
d}|d}|jrt|jddd	}
|

d}WdQRX||d
}n|d}|		||ddt||}|		||		t|ddS)
Nrzcreating %srbwbmbcsrzlatin-1)encodings
z<iiii{V4)structZmkpathrr`rKZannounceopenreadlenwrite
get_exe_bytes
isinstancestrencoderZpack)
rrQrPrrgZcfgdatainstaller_nameZ
bitmapdataZ	bitmaplenfiler.Zscript_dataheaderr r r!rIs:








zbdist_wininst.create_execCsD|jr&tj|jd||j|jf}ntj|jd||jf}|S)Nz%s.%s-py%s.exez	%s.%s.exe)rr(r)r*rr)rrPrpr r r!rK's

z$bdist_wininst.get_installer_filenamec	Cs t}|jrl|j|krl|jdkr&d}q|jdkr6d}q|jdkrFd}q|jdkrVd}q|jdkrfd	}qd
}n@yddlm}Wntk
rd
}YnX|d
d}|d}tjt	}|j
dkr|j
dddkr|j
dd}nd}tj|d||f}t|d}z|
S|XdS)Nz2.4z6.0z7.1z2.5z8.0z3.2z9.0z3.4z10.0z14.0r)CRT_ASSEMBLY_VERSION.z.0rwinr$zwininst-%s%s.exera)rrZmsvcrtrsImportError	partitionr(r)dirname__file__rr*rhriclose)	rZcur_versionZbvrsmajorZ	directoryZsfixfilenamefr r r!rl4s8	






zbdist_wininst.get_exe_bytes)N)__name__
__module____qualname__rVrZuser_optionsZboolean_optionsr<r=Z_unsupportedr"r/rGr`rIrKrlr r r r!r	s4
&Q.
5
r	)__doc__r<r(Zdistutils.corerZdistutils.utilrZdistutils.dir_utilrrZdistutils.errorsZdistutils.sysconfigrr]rr	r r r r!<module>s