o Šbc¿Šã@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)é$é˜iHÚ BottomLinerN)rÚ__init__ÚhÚlineÚw)ÚselfÚargsÚkwÚrulerÚbmwidth©rú2/usr/lib/python3.10/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 Có,|rd}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*óz PyDialog.backÚCancelc Cr()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.r0rrrÚcancel5r6zPyDialog.cancelÚNextc Cr()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.r0rrrr1@r6z 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)rr2r%r1ÚxposrrrÚxbuttonKs,zPyDialog.xbuttonN)r&r')r7r')r9r') Ú__name__Ú __module__Ú __qualname__Ú__doc__rr%r5r8r1r>rrrrrs  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)rErGrIrL)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__rrr}sþzbdist_msi.__init__cCsFd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_ d|_ dS)Nr) Ú bdist_dirÚ plat_nameÚ keep_tempÚno_target_compileÚno_target_optimizeÚtarget_versionÚdist_dirÚ skip_buildÚinstall_scriptÚpre_install_scriptÚversions)rrrrÚinitialize_optionsƒs zbdist_msi.initialize_optionscCsò| dd¡|jdur| d¡j}tj |d¡|_tƒ}|js'|j   ¡r'||_|jrD|jg|_ |j sC|j   ¡rC|j|krCt d|fƒ‚nt|jƒ|_ | ddd¡|jrXt dƒ‚|jrt|j jD] }|jtj |¡krlnq_t d|jƒ‚d|_dS) NÚbdist)r\r\ÚmsizMtarget version can only be %s, or the '--skip-build' option must be specified)r[r[)rVrVz5the pre-install-script feature is not yet implementedz(install_script '%s' not found in scripts)Úset_undefined_optionsrUÚget_finalized_commandÚ bdist_baseÚosÚpathÚjoinrrZÚ distributionÚhas_ext_modulesr_r\rÚlistÚ all_versionsr^r]ÚscriptsÚbasenameÚinstall_script_key)rreÚ short_versionÚscriptrrrÚfinalize_optionssJ     ÿÿ€ þÿ ÿÿÿ zbdist_msi.finalize_optionscCs~|js| d¡|jddd}|j|_|j|_d|_| d¡}d|_d|_|j  ¡rV|j }|s?|js6Jdƒ‚dt j dd …}d |j |f}| d¡}tj |jd |¡|_t d |j¡| ¡t j dtj |jd ¡¡| ¡t jd=| |j¡|j ¡}| |¡}tj |¡}tj |¡r—t |¡|jj }|j!} | s£|j"} | s§d} | #¡} dt$| ƒj%} |j ¡}|j rÂd|j |f} nd|} t& '|t(| t& )¡| | ¡|_*t& +|j*t,¡d| fg} |j-pä|j.}|rî|  /d|f¡|j0rù|  /d|j0f¡| rt1|j*d| ƒ| 2¡| 3¡| 4¡| 5¡|j* 6¡t7|jdƒr/d|j p%d|f}|jj8 /|¡|j9s=t:|j|j;ddSdS)NÚbuildÚinstallr')Úreinit_subcommandsrÚ install_libz Should have already checked thisz%d.%drNz.%s-%sÚlibzinstalling to %sÚPURELIBÚUNKNOWNz%d.%d.%dz Python %s %sz Python %sÚ DistVersionÚ ARPCONTACTÚARPURLINFOABOUTÚPropertyÚ dist_filesrCÚany)Údry_run)ÿÿ   ÿ€ö ÿÿÿìzbdist_msi.add_scriptscCs¶ |j}d}}d}d}d}d}d}d} t|dgd ¢ƒt|d gd ¢ƒt|d gd ¢ƒt|dtjƒt|dtjƒt|d||||||dddƒ } |  d¡| jdddd| jdddd|  ddddddd¡|  ddd dd!dd"¡| j dddd#} |   d$d%¡t|d&||||||dddƒ } |  d'¡| jdddd| jdddd|  ddddddd(¡|  ddd dd!dd"¡| j dddd#} |   d$d%¡t|d)||||||dddƒ } |  d*¡| jdddd| jdddd|  d+dd,dd!dd"¡| j dddd#} |   d$d-¡t|d.||||d/|d0d0d0d1d2 }| d3dd4d5ddd6¡| d+d!d7d8d!dd9¡| d:d!d;dd?d!d@dz [TARGETDIR]z [SourceDir])Úorderingz [TARGETDIR%s]z FEATURE_SELECTED AND &Python%s=3ÚSpawnWaitDialogrNÚFeaturesÚ SelectionTreer#ÚFEATUREÚPathEditz[FEATURE_SELECTED]Ú1z!FEATURE_SELECTED AND &Python%s<>3ÚOtherz$Provide an alternate Python locationÚEnableÚShowÚDisableÚHideé×ér²Ú DiskCostDlgÚOKz&{\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).Ú VolumeListÚVolumeCostListédé–iz{120}{70}{70}{70}{70}gà?rÚ AdminInstallzGSelect whether to install [ProductName] for all users of this computer.rrézInstall for all usersÚJUSTMEézInstall just for mez [ALLUSERS]zWhichUsers="ALL"rz({\DlgFontBold8}[Progress1] [ProductName]é#éAzYPlease wait while the Installer [Progress2] [ProductName]. This may take several minutes.Ú StatusLabelzStatus:Ú ProgressBariz Progress doneÚ SetProgressÚProgressrz)Welcome to the [ProductName] Setup WizardÚBodyTexté?z:Select whether you want to repair or remove [ProductName].ÚRepairRadioGroupélrrrÛz&Repair [ProductName]ÚRemoverzRe&move [ProductName]z [REINSTALL]zMaintenanceForm_Action="Repair"z [Progress1]Ú Repairingz [Progress2]ÚrepairsÚ Reinstallr z[REMOVE]zMaintenanceForm_Action="Remove"é ÚRemovingé Úremovesé éz MaintenanceForm_Action<>"Change")rrr rrrr%r5r8r1ÚeventÚcontrolrr/Úmappingrirr_rºÚ conditionr>Ú radiogroupÚadd)rrÚxÚyrrr%ÚmodalÚmodelessÚtrack_disk_spaceÚfatalrHÚ user_exitÚ exit_dialogÚinuseÚerrorr8ÚcostingÚprepÚseldlgÚorderr™rçÚinstall_other_condÚdont_install_other_condÚcostÚ whichusersÚgÚprogressÚmaintrrrr¦¥sîþ ÿ ÿ ÿ ÿÿ ÿ ÿÿ ÿ ÿ üÿÿÿÿ   ü       ÿÿ  ÿÿ ÿÿ     ÿ ÿÿ   þ  ÿ ÿ     ÿ    ÿÿÿÿÿ ÿ ÿ   ÿÿÿ ÿ ÿ ÿÿ zbdist_msi.add_uicCs<|jr d||j|jf}nd||jf}tj |j|¡}|S)Nz%s.%s-py%s.msiz %s.%s.msi)rZrVrfrgrhr[)rrªÚ base_namer«rrrr‘ãsÿz bdist_msi.get_installer_filename)r?r@rAÚ descriptionrÚ user_optionsÚboolean_optionsrlrºrr`rrrŽr¤r£r¥r¦r‘Ú __classcell__rrrSrrCSs>ÿÿé  ([66&@rC)rBrfr‡rPÚdistutils.corerÚdistutils.dir_utilrÚdistutils.sysconfigrÚdistutils.versionrÚdistutils.errorsrÚdistutils.utilrÚ distutilsrršr r r r r rrrrCrrrrÚs        >