AlkantarClanX12

Your IP : 18.119.137.175


Current Path : /opt/alt/python35/lib64/python3.5/distutils/command/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/distutils/command/__pycache__/bdist_msi.cpython-35.opt-1.pyc



��Yf���@sdZddlZddlZddlmZddlmZddlmZddl	m
Z
ddlmZddl
mZdd	lmZddlZdd
lmZmZmZddlmZmZmZmZGdd
�d
e�ZGdd�de�ZdS)z#
Implements the bdist_msi command.
�N)�Command)�remove_tree)�get_python_version)�
StrictVersion)�DistutilsOptionError)�get_platform)�log)�schema�sequence�text)�	Directory�Feature�Dialog�add_datac@speZdZdZdd�Zdd�Zdddd	�Zd
ddd�Zd
ddd�Zdd�Z	dS)�PyDialogz�Dialog class with a fixed layout: controls at the top, then a ruler,
    then a list of buttons: back, next, cancel. Optionally a bitmap at the
    left.cOsKtj||�|jd}d|d}|jdd||jd�dS)zbDialog(database, name, x, y, w, h, attributes, title, first,
        default, cancel, bitmap=true)�$�iHZ
BottomLinerN)r�__init__�h�line�w)�self�args�kwZrulerZbmwidth�r�@/opt/alt/python35/lib64/python3.5/distutils/command/bdist_msi.pyrs
zPyDialog.__init__c	Cs'|jddddddd|�dS)	z,Set the title text of the dialog at the top.�Title��
i@�<iz{\VerdanaBold10}%sN)r)r�titlerrrr #szPyDialog.title�Back�c	Cs>|rd}nd}|j|d|jddd|||�S)z�Add a back button with a given title, the tab-next button,
        its name in the Control table, possibly initially disabled.

        Return the button, so that events can be associated�r"���8�)�
pushbuttonr)rr �next�name�active�flagsrrr�back*s	z
PyDialog.back�Cancelc	Cs>|rd}nd}|j|d|jddd|||�S)z�Add a cancel button with a given title, the tab-next button,
        its name in the Control table, possibly initially disabled.

        Return the button, so that events can be associatedr#r"i0r%r&r')r(r)rr r)r*r+r,rrr�cancel5s	zPyDialog.cancel�Nextc	Cs>|rd}nd}|j|d|jddd|||�S)z�Add a Next button with a given title, the tab-next button,
        its name in the Control table, possibly initially disabled.

        Return the button, so that events can be associatedr#r"��r%r&r')r(r)rr r)r*r+r,rrrr)@s	z
PyDialog.nextc	Cs:|j|t|j|d�|jdddd||�S)z�Add a button with a given title, the tab-next button,
        its name in the Control table, giving its x position; the
        y-position is aligned with the other buttons.

        Return the button, so that events can be associated�r%r&r'r#)r(�intrr)rr*r r)Zxposrrr�xbuttonKszPyDialog.xbuttonN)
�__name__�
__module__�__qualname__�__doc__rr r-r/r)r4rrrrrs
rc@s]eZdZdZdddfddde�fdd	d
dfddd
dfdddfdddfdddfdddfdddfdddfg
ZddddgZddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1gZd2Zd3d4�Z	d5d6�Z
d7d8�Zd9d:�Zd;d<�Z
d=d>�Zd?d@�ZdAdB�ZdS)C�	bdist_msiz7create a Microsoft Installer (.msi) binary distributionz
bdist-dir=Nz1temporary directory for creating the distributionz
plat-name=�pz;platform name to embed in generated filenames (default: %s)z	keep-temp�kz/keep the pseudo-installation tree around after z!creating the distribution archiveztarget-version=z!require a specific python versionz on the target systemzno-target-compile�cz/do not compile .py to .pyc on the target systemzno-target-optimize�oz:do not compile .py to .pyo (optimized)on the target systemz	dist-dir=�dz-directory to put final built distributions inz
skip-buildz2skip rebuilding everything (for testing/debugging)zinstall-script=zTbasename of installation script to be run afterinstallation or before deinstallationzpre-install-script=z{Fully qualified filename of a script to be run before any files are installed.  This script need not be in the distributionz2.0z2.1z2.2z2.3z2.4z2.5z2.6z2.7z2.8z2.9z3.0z3.1z3.2z3.3z3.4z3.5z3.6z3.7z3.8z3.9�XcCsgd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
dS)Nr)�	bdist_dir�	plat_name�	keep_tempZno_target_compileZno_target_optimize�target_version�dist_dir�
skip_build�install_script�pre_install_script�versions)rrrr�initialize_options}s										zbdist_msi.initialize_optionscCs`|jdd	�|jdkrI|jd�j}tjj|d�|_t�}|jrt|j	j
�rt||_|jr�|jg|_|jr�|j	j
�r�|j|kr�t
d|f��nt|j�|_|jdd
d�|jrt
d��|jrSxC|j	jD]"}|jtjj|�krPqWt
d|j��d|_dS)NZbdistrEZmsizMtarget version can only be %s, or the '--skip-build' option must be specifiedrDrAz5the pre-install-script feature is not yet implementedz(install_script '%s' not found in scripts)rErE)rDrD)rArA)Zset_undefined_optionsr@�get_finalized_command�
bdist_base�os�path�joinrrC�distribution�has_ext_modulesrHrEr�list�all_versionsrGrF�scripts�basename�install_script_key)rrKZ
short_versionZscriptrrr�finalize_options�s:							
zbdist_msi.finalize_optionscCs\|js|jd�|jddd�}|j|_|j|_d|_|jd�}d|_d|_|jj	�r�|j
}|s�tjdd�}d|j
|f}|jd�}tjj|jd	|�|_tjd
|j�|j�tjjdtjj|jd��|j�tjd=|j|j�|jj�}|j|�}tjj|�}tjj|�r�tj|�|jj }|j!}	|	s�|j"}	|	s�d}	|j#�}
d
t$|
�j}|jj�}|j
rd|j
|f}n
d|}t%j&|t'|t%j(�||	�|_)t%j*|j)t+�d|
fg}
|j,ps|j-}|r�|
j.d|f�|j/r�|
j.d|j/f�|
r�t0|j)d|
�|j1�|j2�|j3�|j4�|j)j5�t6|jd�r9d|j
pd|f}|jj7j.|�|j8sXt9|jd|j:�dS)N�build�installZreinit_subcommandsr"r�install_libr#z.%s-%s�libzinstalling to %sZPURELIBZUNKNOWNz%d.%d.%dzPython %s %sz	Python %sZDistVersionZ
ARPCONTACTZARPURLINFOABOUT�Property�
dist_filesr9�any�dry_run);rEZrun_commandZreinitialize_commandr@�prefixZwarn_dir�compile�optimizerOrPrC�sys�versionrArJrLrMrNZ
build_baseZ	build_libr�infoZensure_finalized�insert�runZmkpathrD�get_fullname�get_installer_filename�abspath�exists�unlink�metadata�authorZ
maintainerZget_versionr�msilibZ
init_databaser	Zgen_uuid�dbZ
add_tablesr
Zauthor_emailZmaintainer_email�appendZurlr�add_find_python�	add_files�add_scripts�add_ui�Commit�hasattrr\rBrr^)rrXrYrCZplat_specifierrW�fullname�installer_namerlrmrcZsversionZproduct_nameZpropsZemail�tuprrrrf�s|	
				
%


			
	




	z
bdist_msi.runc
Cs�|j}tjd�}tjj|j�}t||d|dd�}t|ddddddd�}||d	fg}x�|j	|j
gD]�}d|}d|}	}
d}||j
kr�d
}d}
nd|}d}
t||	||d|
d|�}t||||||
�}|j|||f�q�W|j�i}x�|D]�\}}}|g}x^|r�|j
�}xEtj|j�D]1}tjj|j|�}tjj|�rd
|j|�|f}||}
t|||||
|�}|j|�q�|js+|j|j|d�||kr�|j|�}||<||jkr�|jrvtd|��d||_q�||}t|jd|||j|d|jfg�q�WqiW|j�qNW|j|�dS)NZ	distfiles�	TARGETDIRZ	SourceDir�PythonZ
Everythingrr"Z	directory�zPython from another location�zPython %s from registryz%s|%szMultiple files with name %sz[#%s]Z
DuplicateFile)rornZCABrLrMrir@rr
rH�
other_versionrpru�pop�listdirZabsoluterN�isdirZ
make_shortZ	componentZstart_componentZlogicalZadd_filerFrUrrZcommit)rroZcabZrootdir�root�f�itemsrc�targetr*�defaultZdescr �level�dir�seenZfeatureZtodo�fileZafileZshortZnewdir�keyrrrrr
s\	
	
!
		
		

+zbdist_msi.add_filescCs�d}x�|jD]�}d|}d|}d|}d|}d|}d|}d|}	d	|}
d
|}d|}tjr�d}
nd}
t|jd|d|d|
f|d|d|
fg�t|jd||f||fg�t|jd|d |d|df|	d!|d|df|
d"|d|dfg�t|jd|||f|	||df|
d|dfg�t|jd|||f|	||df|
d|dfg�t|jdd|dd|fg�|d7}qWdS)#asAdds code to the installer to compute the location of Python.

        Properties PYTHON.MACHINE.X.Y and PYTHON.USER.X.Y will be set from the
        registry for each version of Python.

        Properties TARGETDIRX.Y will be set from PYTHON.USER.X.Y if defined,
        else from PYTHON.MACHINE.X.Y.

        Properties PYTHONX.Y will be set to TARGETDIRX.Y\python.exei�z)SOFTWARE\Python\PythonCore\%s\InstallPathzpython.machine.zpython.user.zPYTHON.MACHINE.zPYTHON.USER.ZPythonFromMachineZPythonFromUserZ	PythonExerz�PYTHONr}�Z
RegLocatorNr"Z	AppSearch�CustomAction�3��[�]z]\python.exe�InstallExecuteSequence�InstallUISequenceZ	Conditionr{rz
NOT TARGETDIR��i3i3i3)rHrnZWin64rro)r�start�verZinstall_pathZmachine_regZuser_regZmachine_propZ	user_propZmachine_actionZuser_actionZ
exe_actionZtarget_dir_prop�exe_propZTyperrrrqCsJ









			
zbdist_msi.add_find_pythoncCsK|jr�d}x�|j|jgD]l}d|}d|}t|jd|d||jfg�t|jd|d||fg�|d7}q#W|jrGtjj	|j
d	�}t|d
�}|jd�|jt|j�j
��|j�t|jdd
tj|�fg�t|jddg�t|jddg�dS)Ni�zinstall_script.r�r��2r�z&Python%s=3r"zpreinstall.batrzrem ="""
%1 %0
exit
"""
�Binary�
PreInstallr}�
NOT Installed��)r�r}r�N)r�r�r�)rFrHr~rrorUrGrLrMrNr@�open�write�read�closernr�)rr�r�Zinstall_actionr�Zscriptfnr�rrrrsys,	

		


zbdist_msi.add_scriptscCsG|j}d}}d}d}d}d}d}d}	t|dd�d�d�d�d�d�g�t|dd�d�d�d�g�t|d d�d�d�d�dg�t|d/tj�t|d0tj�t|d1||||||d2d2d2�}
|
jd3�|
jd4d2d5d�|
jd6d7d5d�|
jd8d9d:d;d<d=d>�|
jd?d9d@d;dAd=dB�|
j	d2d6dCd2�}|j
dDdE�t|dF||||||d2d2d2�}|jdG�|jd4d2d5d�|jd6d7d5d�|jd8d9d:d;d<d=dH�|jd?d9d@d;dAd=dB�|j	d2d6dCd2�}|j
dDdE�t|dI||||||d2d2d2�}
|
jdJ�|
jd4d2d5d�|
jd6d7d5d�|
jdKd9dLd;dAd=dB�|
j	d2d6dCd2�}|j
dDdM�t|dN||||dO|dPdPdPdQdR�}|jdSd9dTdUd9d=dV�|jdKdAdWdXdAd=dY�|jdZdAd[d\ddd]�|jd^d_dAd`d\dadbdcddd�|jdEdddCdE�}|j
dDdE�|j	dddPdCdd�}|j
dDdd�|jdPdEdCdP�}|j
dDdP�t|dddd\dedf|dgdd�}|jdgdddXdhddi�|j
djdkdldmdnddod�j
dDdp�|j
dqdrdldmdnddsd�j
dDdt�|j
duddldmdnddvd�j
dDdw�|j
dxdydldmdndd6d�j
dDdz�|j
d{dmdldmdndddd�j
dDd|�|j
d}d~dldmdnddd�j
dDd��|j
d�d�dldmdnddPd�j
dDd��t|d�ddd�d�d|dododo�}|jdZdhd9d�d�dd��|j
dsdld�d�d�ddsdo�}|j
dDdE�|j
dod�d�d�d�ddods�}|j
dDdM�t|d�ddd�d�||dMdMdM�}|jdZdhd9d�d�dd��|j
dMd�d�d�d�ddMd�}|j
dDdE�t|d!||||||d6d6d6�}|jdKd9d:d;d�d=d��|jd��|jd/d9d�d;dAd=d��}|jd/dZ�|jd�d9d�d;d�d=d�}|jd�dZ�|jd7dd5d�|j	d�dd5d�|jd6d�}|j
d�d��t|d'||||||d�d�d6�}|jd��|jd�d9d�ddAdd�|jj��|jd4dd5d�|j	d�d6�}d}|j
d�d�d�|�xF|j|jgD]1}|d7}|j
d�d�|d�|d�|�q�W|j
d�d�d�|d�|j
dDdMd�|d��|jd6d��}|j
d�d��|jd�d�d9d�ddkdd�dd�d�}|j
d�d��|j}d�|}d�|}|jd�d9dUdd9dd��}|jd�|�|jd�|�|jd�|�|jd�|�|jd�d�d9d�dd�dd�|dd�d�}|jd�|�|jd�|�|jd�|�|jd�|�t|d�||||||d�d�d�dQdR�}|jdSd9dTdUd9d=d��|jdKdAdAdXdAd=d��|jdZdAd�d\d�dd��|jd�d�dAd�d\d�d�dd�dd�|jd�ddd��j
dDdM�t|d$||||||d�d�d6�}|jd��|jd�d9d�d�ddddid��	}|jddd�d�dAd��|jd�dd�d�dAd��|jd7dd5d�|j	d�d6�}|j
d�d�d�d�|j
dDdMd�d��|jd6d��}|j
d�d��t|d-||||||d6d6d6dQdR�}|jdSdAd9dUd9d=d��|jdZd�d�dd�dd��|jd�d�d�d�dAdd��|jd/d:d�|d:dAdd��}|jd/dZ�|jd�d�d�dkddd�dd�dd�}|jd�d��|jd4d�d5dR�|j	d�d6d5dR�|jd6d7�j
d�d��t|d*||||||d�d�d6�}|jd��|jd�d9d�d\dydd��|jd�d9d�d\d�dddid��	}|jddd�dUd�d��|jd�dd�dUd�d��|jd4dd5dR�|j	d2d6�}|j
d�dd�d��|j
d�d�d�dT�|j
d�d�d�db�|j
d�dd�d�|j
d�dd�d��|j
d�d�d�d��|j
d�d�d�d��|j
d�dd�d��|j
dDdMd�dA�|jd6d��j
d�d��dS(Nr�iri,z[ProductName] Setupr#r"� r[�
DefaultUIFont�DlgFont8�ErrorDialog�ErrorDlg�	Progress1�Install�	Progress2�installs�MaintenanceForm_Action�Repair�
WhichUsers�ALLZ	TextStyle�Tahoma�	r�DlgFontBold8��
VerdanaBold10�Verdanar�VerdanaRed9�r��
PrepareDlg�(Not Privileged or Windows9x or Installed��
WhichUsersDlg�.Privileged and not Windows9x and not Installed��SelectFeaturesDlg�
Not Installed���MaintenanceTypeDlg�,Installed AND NOT RESUME AND NOT Preselected���ProgressDlg��
ActionText�UITextZ
FatalErrorZFinishz)[ProductName] Installer ended prematurelyz< Backr+r.r!ZDescription1r�Fi@�Piz�[ProductName] setup ended prematurely because of an error.  Your system has not been modified.  To install this program at a later time, please run the installation again.ZDescription2��z.Click the Finish button to exit the Installer.r*Z	EndDialogZExitZUserExitz'[ProductName] Installer was interruptedz�[ProductName] setup was interrupted.  Your system has not been modified.  To install this program at a later time, please run the installation again.Z
ExitDialogz&Completing the [ProductName] InstallerZDescription��ZReturnZ
FilesInUse�ZRetryZbitmapFr���z{\DlgFontBold8}Files in Use�iz8Some files that need to be updated are currently in use.ZText�7iJz�The following applications are using files that need to be updated by this setup. Close these applications and then click Retry to continue the installation or Cancel to exit it.ZListZListBox�k��ZFileInUseProcess�Ignore�eiZ	ErrorText�0r|�N�x�H�Q�ZNoZErrorNo�Y��ZYesZErrorYes�AZAbortZ
ErrorAbort�C�*ZErrorCancel�IZErrorIgnore�O�ZOkZErrorOk�R��Z
ErrorRetryZ	CancelDlgi�U���z;Are you sure you want to cancel [ProductName] installation?�9r&r'�ZWaitForCostingDlgzRPlease wait while the installer finishes determining your disk space requirements.�f�(zOPlease wait while the Installer prepares to guide you through the installation.z&Welcome to the [ProductName] Installer�nzPondering...Z
ActionData�r0ZSpawnDialogzSelect Python InstallationsZHintz9Select the Python locations where %s should be installed.zNext >z[TARGETDIR]z[SourceDir]Zorderingz
[TARGETDIR%s]z FEATURE_SELECTED AND &Python%s=3ZSpawnWaitDialogr}ZFeaturesZ
SelectionTreerZFEATUREZPathEditz[FEATURE_SELECTED]�1z!FEATURE_SELECTED AND &Python%s<>3ZOtherz$Provide an alternate Python locationZEnableZShowZDisableZHide��r�rzZDiskCostDlgZOKz&{\DlgFontBold8}Disk Space RequirementszFThe disk space required for the installation of the selected features.�5aThe highlighted volumes (if any) do not have enough disk space available for the currently selected features.  You can either remove some files from the highlighted volumes, or choose to install less features onto local drive(s), or select different destination drive(s).Z
VolumeListZVolumeCostList�d�iz{120}{70}{70}{70}{70}g�?ZAdminInstallzGSelect whether to install [ProductName] for all users of this computer.�zInstall for all usersZJUSTME�zInstall just for mez
[ALLUSERS]zWhichUsers="ALL"z({\DlgFontBold8}[Progress1] [ProductName]�#�AzYPlease wait while the Installer [Progress2] [ProductName]. This may take several minutes.ZStatusLabelzStatus:ZProgressBariz
Progress doneZSetProgressZProgressz)Welcome to the [ProductName] Setup WizardZBodyText�?z:Select whether you want to repair or remove [ProductName].ZRepairRadioGroup�lr�z&Repair [ProductName]ZRemoverzRe&move [ProductName]z[REINSTALL]zMaintenanceForm_Action="Repair"z[Progress1]Z	Repairingz[Progress2]ZrepairsZ	Reinstallz[REMOVE]zMaintenanceForm_Action="Remove"�ZRemoving�Zremoves�
�z MaintenanceForm_Action<>"Change")r�r�)r�r�)r�r�)r�r�)r�r�)r�r�)r�r�r�Nr)r�r�r�Nr")r�r�rNr")r�r�r�r�r)r�r�r�)r�r�r�)r�r�r�)r�r�r�)r�Nr�)rorrr�r�rr r-r/r)ZeventZcontrolrr(�mappingrOrgrHr~Z	conditionr4Z
radiogroup�add)rro�x�yrrr ZmodalZmodelessZtrack_disk_spaceZfatalr<Z	user_exitZexit_dialogZinuse�errorr/ZcostingZprepZseldlg�orderrcr�Zinstall_other_condZdont_install_other_condZcostZ
whichusers�gZprogressZmaintrrrrt�s�	
	
	
	



	
	.......$$$
!!


	

	"

%
zbdist_msi.add_uicCsT|jr%d||j|jf}nd||jf}tjj|j|�}|S)Nz%s.%s-py%s.msiz	%s.%s.msi)rCrArLrMrNrD)rrwZ	base_namerxrrrrh�s	z bdist_msi.get_installer_filename)r5r6r7ZdescriptionrZuser_optionsZboolean_optionsrRr~rIrVrfrrrqrsrtrhrrrrr9SsP
		
([66&�?r9)r8rbrLZdistutils.corerZdistutils.dir_utilrZdistutils.sysconfigrZdistutils.versionrZdistutils.errorsrZdistutils.utilrZ	distutilsrrnr	r
rrr
rrrr9rrrr�<module>s">