a XC?h���@s�dZddlZddlZddlZddlmZddlmZddlm Z ddl m Z ddl m Z ddlmZdd lmZddlZdd lmZmZmZdd lmZmZmZmZGd 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@sFeZdZdZdd�Zdd�Zddd �Zdd d �Zddd�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.cOs@tj|g|�R�|jd}d|d}|�dd||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/python39/lib64/python3.9/distutils/command/bdist_msi.pyrs  zPyDialog.__init__c Cs|�ddddddd|�dS) z,Set the title text of the dialog at the top.�Title�� �@�<�z{\VerdanaBold10}%sN)r )r�titlerrrr"%s�zPyDialog.title�Back�c Cs,|r d}nd}|�|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,sz PyDialog.back�Cancelc Cs,|r d}nd}|�|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,rrr�cancel7szPyDialog.cancel�Nextc Cs,|r d}nd}|�|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,rrrr-Bsz PyDialog.nextc Cs,|�|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�xbuttonMszPyDialog.xbuttonN)r#r$)r2r$)r4r$) �__name__� __module__� __qualname__�__doc__rr"r1r3r-r8rrrrrs  rc s�eZdZdZdddde�fdddd d d d d g Zgd�Zgd�ZdZ�fdd�Z dd�Z dd�Z dd�Z dd�Z dd�Zdd�Zdd �Zd!d"�Z�ZS)#� bdist_msiz7create a Microsoft Installer (.msi) binary distribution)z bdist-dir=Nz1temporary directory for creating the distributionz plat-name=�pz;platform name to embed in generated filenames (default: %s))� keep-temp�kzPkeep the pseudo-installation tree around after creating the distribution archive)ztarget-version=Nz6require a specific python version on the target system)�no-target-compile�cz/do not compile .py to .pyc on the target system)�no-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)� 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)r?rArCrF)z2.0z2.1z2.2z2.3z2.4z2.5z2.6z2.7z2.8z2.9z3.0z3.1z3.2z3.3z3.4z3.5z3.6z3.7z3.8z3.9�Xcs$t�j|i|��t�dtd�dS)NzZbdist_msi command is deprecated since Python 3.9, use bdist_wheel (wheel packages) instead�)�superr�warnings�warn�DeprecationWarning)rrr�� __class__rrrs�zbdist_msi.__init__cCsFd|_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�szbdist_msi.initialize_optionscCs�|�dd�|jdur2|�d�j}tj�|d�|_t�}|jsN|j � �rN||_|jr�|jg|_ |j s�|j � �r�|j|kr�t d|f��n t|j�|_ |�ddd�|jr�t d��|jr�|j jD]}|jtj�|�kr�q�q�t d|j��d|_dS) NZbdist)rTrTZmsizMtarget version can only be %s, or the '--skip-build' option must be specified)rSrS)rPrPz5the pre-install-script feature is not yet implementedz(install_script '%s' not found in scripts)Zset_undefined_optionsrO�get_finalized_command� bdist_base�os�path�joinrrR� distribution�has_ext_modulesrWrTr�list� all_versionsrVrUZscripts�basename�install_script_key)rrZZ short_versionZscriptrrr�finalize_options�sH    ��� �� ��zbdist_msi.finalize_optionscCs�|js|�d�|jddd�}|j|_|j|_d|_|�d�}d|_d|_|j� �r�|j }|s~|jslJd��dt j dd �}d |j |f}|�d�}tj�|jd |�|_t�d |j�|��t j�dtj�|jd ��|��t jd=|�|j�|j��}|�|�}tj�|�}tj�|��r0t�|�|jj }|j!} | �sJ|j"} | �sTd} |�#�} dt$| �j%} |j��}|j �r�d|j |f} nd|} t&�'|t(| t&�)�| | �|_*t&�+|j*t,�d| fg} |j-�p�|j.}|�r�| �/d|f�|j0�r| �/d|j0f�| �rt1|j*d| �|�2�|�3�|�4�|�5�|j*�6�t7|jd��rld|j �pXd|f}|jj8�/|�|j9�s�t:|j|j;d�dS)N�build�installr$)Zreinit_subcommandsr� install_libz Should have already checked thisz%d.%drHz.%s-%s�libzinstalling to %sZPURELIBZUNKNOWNz%d.%d.%dz Python %s %sz Python %sZ DistVersionZ ARPCONTACTZARPURLINFOABOUT�Property� dist_filesr=�any)�dry_run)d?d!d@dz [TARGETDIR]z [SourceDir])Zorderingz [TARGETDIR%s]z FEATURE_SELECTED AND &Python%s=3ZSpawnWaitDialogrHZFeaturesZ SelectionTreer ZFEATUREZPathEditz[FEATURE_SELECTED]�1z!FEATURE_SELECTED AND &Python%s<>3ZOtherz$Provide an alternate Python locationZEnableZShowZDisableZHide���r�Z DiskCostDlgZOKz&{\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�?r�Z AdminInstallzGSelect whether to install [ProductName] for all users of this computer.r�r��zInstall for all usersZJUSTME�zInstall just for mez [ALLUSERS]zWhichUsers="ALL"r�z({\DlgFontBold8}[Progress1] [ProductName]�#�AzYPlease wait while the Installer [Progress2] [ProductName]. This may take several minutes.Z StatusLabelzStatus:Z ProgressBariz Progress doneZ SetProgressZProgressr�z)Welcome to the [ProductName] Setup WizardZBodyText�?z:Select whether you want to repair or remove [ProductName].ZRepairRadioGroup�lr�r�r�z&Repair [ProductName]ZRemoverzRe&move [ProductName]z [REINSTALL]zMaintenanceForm_Action="Repair"z [Progress1]Z Repairingz [Progress2]ZrepairsZ Reinstallr�z[REMOVE]zMaintenanceForm_Action="Remove"� ZRemoving� Zremoves� �z MaintenanceForm_Action<>"Change")r~rr r�r�rr"r1r3r-ZeventZcontrolrr+�mappingr^rurWr�Z conditionr8Z radiogroup�add)rr~�x�yrrr"ZmodalZmodelessZtrack_disk_spaceZfatalrBZ user_exitZ exit_dialogZinuse�errorr3ZcostingZprepZseldlg�orderr|r�Zinstall_other_condZdont_install_other_condZcostZ whichusers�gZprogressZmaintrrrr��s�� � � � �� � �� � � �����   �       ��  �� ��     � ��  �   � �     �    ����� � �   ��� � � �� zbdist_msi.add_uicCs<|jrd||j|jf}nd||jf}tj�|j|�}|S)Nz%s.%s-py%s.msiz %s.%s.msi)rRrPr[r\r]rS)rr�Z base_namer�rrrrv�s�z bdist_msi.get_installer_filename)r9r:r;Z descriptionrZ user_optionsZboolean_optionsrar�rrXrdrtr�r�r�r�rv� __classcell__rrrMrr=Us<���  ([66&@r=)r<r[rprJZdistutils.corerZdistutils.dir_utilrZdistutils.sysconfigrZdistutils.versionrZdistutils.errorsrZdistutils.utilrZ distutilsrr}r r r r r rrrr=rrrr�s       >