3 \���@s�ddlZddlZddlmZddlmZddlmZddlm Z ddl m Z ddl m Z ddlmZddlZdd lmZmZmZdd lmZmZmZmZGd d �d e�ZGd d�de�ZdS)�N)�Command)� remove_tree)�get_python_version)� StrictVersion)�DistutilsOptionError)� get_platform)�log)�schema�sequence�text)� Directory�Feature�Dialog�add_datac@sBeZdZdd�Zdd�Zddd�Zdd d �Zdd d�Zdd�ZdS)�PyDialogcOs>tj|f|��|jd}d|d}|jdd||jd�dS)N�$�iHZ BottomLiner)r�__init__�h�line�w)�self�args�kwZrulerZbmwidth�r�3/usr/lib64/python3.6/distutils/command/bdist_msi.pyrs  zPyDialog.__init__c Cs|jddddddd|�dS)N�Title�� i@�<iz{\VerdanaBold10}%s)r )r�titlerrrr #szPyDialog.title�Back�c Cs,|r d}nd}|j|d|jddd|||�S)N�r"���8�)� pushbuttonr)rr �next�name�active�flagsrrr�back*sz PyDialog.back�Cancelc Cs,|r d}nd}|j|d|jddd|||�S)Nr#r"i0r%r&r')r(r)rr r)r*r+r,rrr�cancel5szPyDialog.cancel�Nextc Cs,|r d}nd}|j|d|jddd|||�S)Nr#r"��r%r&r')r(r)rr r)r*r+r,rrrr)@sz PyDialog.nextc Cs,|j|t|j|d�|jdddd||�S)N�r%r&r'r#)r(�intrr)rr*r r)Zxposrrr�xbuttonKszPyDialog.xbuttonN)r!r")r.r")r0r") �__name__� __module__� __qualname__rr r-r/r)r4rrrrrs   rc@s�eZdZdZdCddde�fdEdGdHdIdJdKdLdMg ZddddgZddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1gZd2Zd3d4�Z d5d6�Z d7d8�Z d9d:�Z d;d<�Z d=d>�Zd?d@�ZdAdB�ZdS)N� bdist_msiz7create a Microsoft Installer (.msi) binary distribution� bdist-dir=N�1temporary directory for creating the distributionz plat-name=�pz;platform name to embed in generated filenames (default: %s)� keep-temp�kz/keep the pseudo-installation tree around after z!creating the distribution archive�target-version=z!require a specific python versionz on the target system�no-target-compile�c�/do not compile .py to .pyc on the target system�no-target-optimize�o�;do not compile .py to .pyo (optimized) on the target system� dist-dir=�d�-directory to put final built distributions in� skip-build�2skip rebuilding everything (for testing/debugging)�install-script=�Ubasename of installation script to be run after installation or before deinstallation�pre-install-script=�{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�XcCsFd|_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�|jdd �|jdkr2|jd�j}tjj|d�|_t�}|j rP|j j �rP||_|jr�|jg|_ |j r�|j j �r�|j|kr�t d|f��n t|j�|_ |jdd d �|jr�t d��|jr�x2|j jD]}|jtjj|�kr�Pq�Wt d|j��d|_dS) NZbdistrTZmsizMtarget version can only be %s, or the '--skip-build' option must be specifiedrSrPz5the pre-install-script feature is not yet implementedz(install_script '%s' not found in scripts)rTrT)rSrS)rPrP)Zset_undefined_optionsrO�get_finalized_command� bdist_base�os�path�joinrrR� distribution�has_ext_modulesrWrTr�list� all_versionsrVrU�scripts�basename�install_script_key)rrZZ short_versionZscriptrrr�finalize_options�s:        zbdist_msi.finalize_optionscCsz|js|jd�|jddd�}|j|_|j|_d|_|jd�}d|_d|_|jj �r�|j }|spdt j dd�}d |j |f}|jd�}tjj|jd |�|_tjd |j�|j�t jjdtjj|jd ��|j�t jd=|j|j�|jj�}|j|�}tjj|�}tjj|��r"tj|�|jj }|j!} | �s<|j"} | �sFd } |j#�} dt$| �j%} |jj�}|j �r~d|j |f} nd|} t&j'|t(| t&j)�| | �|_*t&j+|j*t,�d| fg} |j-�p�|j.}|�r�| j/d|f�|j0�r�| j/d|j0f�| �rt1|j*d| �|j2�|j3�|j4�|j5�|j*j6�t7|jd��r^d|j �pJd|f}|jj8j/|�|j9�svt:|j|j;d�dS)N�build�installr")Zreinit_subcommandsr� install_libz%d.%d�z.%s-%s�libzinstalling to %sZPURELIBZUNKNOWNz%d.%d.%dz Python %s %sz Python %sZ DistVersionZ ARPCONTACTZARPURLINFOABOUT�Property� dist_filesr8�any)�dry_run)�| jd?d9d@d;dAd=dB�| j d2d6d2dC�} | j dDdE�t|dF||||||d2d2d2� } | jdG�| jd4d2dd5�| jd6d7dd5�| jd8d9d:d;dz [TARGETDIR]z [SourceDir])Zorderingz [TARGETDIR%s]z FEATURE_SELECTED AND &Python%s=3ZSpawnWaitDialogriZFeaturesZ SelectionTreerZFEATUREZPathEditz[FEATURE_SELECTED]�1z!FEATURE_SELECTED AND &Python%s<>3ZOtherz$Provide an alternate Python locationZEnableZShowZDisableZHide��r�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�?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.Z StatusLabelzStatus:Z ProgressBariz Progress doneZ SetProgressZProgressz)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�)r�rr r�r�rr r-r/r)ZeventZcontrolrr(�mappingr^rwrWr�Z conditionr4Z radiogroup�add)rr��x�yrrr ZmodalZmodelessZtrack_disk_spaceZfatalr@Z user_exitZ exit_dialogZinuse�errorr/ZcostingZprepZseldlg�orderr~r�Zinstall_other_condZdont_install_other_condZcostZ whichusers�gZprogressZmaintrrrr��s�                                                                zbdist_msi.add_uicCs<|jrd||j|jf}nd||jf}tjj|j|�}|S)Nz%s.%s-py%s.msiz %s.%s.msi)rRrPr[r\r]rS)rr�Z base_namer�rrrrx�s  z bdist_msi.get_installer_filename)r9Nr:�Pkeep the pseudo-installation tree around after creating the distribution archive)r<r=r�6require a specific python version on the target system)r>Nr)r?r@rA)rBrCrD)rErFrG)rHNrI)rJNrK)rLNrM)r5r6r7Z descriptionrZ user_optionsZboolean_optionsrar�rXrervr�r�r�r�rxrrrrr8SsR    ([66&@r8)rrr[Zdistutils.corerZdistutils.dir_utilrZdistutils.sysconfigrZdistutils.versionrZdistutils.errorsrZdistutils.utilrZ distutilsrrr r r r r rrrr8rrrr� s       >