a  ze@sddlZddlZddlZddlmZddlmZddlmZddl m Z ddl m Z ddl mZddlmZddlZdd lmZmZmZdd lmZmZmZmZGd d d eZGd ddeZdS)N)Command) remove_tree)get_python_version) StrictVersion)DistutilsOptionError) get_platform)log)schemasequencetext) DirectoryFeatureDialogadd_datac@sBeZdZddZddZdddZdd d Zdd dZddZdS)PyDialogcOs@tj|g|R|jd}d|d}|dd||jddS)N$iHZ BottomLiner)r__init__hlinew)selfargskwZrulerZbmwidthrO/opt/bitninja-python-dojo/embedded/lib/python3.9/distutils/command/bdist_msi.pyrs  zPyDialog.__init__c Cs|ddddddd|dS)NTitle @<z{\VerdanaBold10}%s)r )rtitlerrrr"%szPyDialog.titleBackc Cs,|r d}nd}||d|jddd|||S)Nr$8 pushbuttonrrr"nextnameactiveflagsrrrback,sz PyDialog.backCancelc Cs,|r d}nd}||d|jddd|||S)Nr%r$i0r'r(r)r*r,rrrcancel7szPyDialog.cancelNextc Cs,|r d}nd}||d|jddd|||S)Nr%r$r'r(r)r*r,rrrr-Bsz PyDialog.nextc Cs,||t|j|d|jdddd||S)Nr'r(r)r%)r+intrr)rr.r"r-ZxposrrrxbuttonMszPyDialog.xbuttonN)r#r$)r2r$)r4r$) __name__ __module__ __qualname__rr"r1r3r-r8rrrrrs   rc seZdZdZddddefdddd d d d d g ZgdZgdZdZfddZ ddZ ddZ ddZ ddZ ddZddZdd Zd!d"ZZS)# 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-tempkzPkeep the pseudo-installation tree around after creating the distribution archive)ztarget-version=Nz6require a specific python version on the target system)no-target-compilecz/do not compile .py to .pyc on the target system)no-target-optimizeoz;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>r@rBrE)z2.0z2.1z2.2z2.3z2.4z2.5z2.6z2.7z2.8z2.9z3.0z3.1z3.2z3.3z3.4z3.5z3.6z3.7z3.8z3.9Xcs$tj|i|tdtddS)NzZbdist_msi command is deprecated since Python 3.9, use bdist_wheel (wheel packages) instead)superrwarningswarnDeprecationWarning)rrr __class__rrrszbdist_msi.__init__cCsFd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_ d|_ dS)Nr) bdist_dir plat_name keep_tempZno_target_compileZno_target_optimizetarget_versiondist_dir skip_buildinstall_scriptpre_install_scriptversions)rrrrinitialize_optionsszbdist_msi.initialize_optionscCs|dd|jdur2|dj}tj|d|_t}|jsN|j rN||_|jr|jg|_ |j s|j r|j|krt d|fn t|j|_ |ddd|jrt d|jr|j jD]}|jtj|krqqt d|jd|_dS) NZbdist)rSrSZmsizMtarget version can only be %s, or the '--skip-build' option must be specified)rRrR)rOrOz5the pre-install-script feature is not yet implementedz(install_script '%s' not found in scripts)Zset_undefined_optionsrNget_finalized_command bdist_baseospathjoinrrQ distributionhas_ext_modulesrVrSrlist all_versionsrUrTZscriptsbasenameinstall_script_key)rrYZ short_versionZscriptrrrfinalize_optionssH      zbdist_msi.finalize_optionscCsz|js|d|jddd}|j|_|j|_d|_|d}d|_d|_|j r|j }|spdt j dd}d |j |f}|d}tj|jd ||_td |j|t jdtj|jd |t jd=||j|j}||}tj|}tj|r"t||jj }|j!} | s<|j"} | sFd } |#} 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*6t7|jdr^d|j pJd|f}|jj8/||j9svt:|j|j;ddS)Nbuildinstallr$)Zreinit_subcommandsr install_libz%d.%drGz.%s-%slibzinstalling to %sZPURELIBZUNKNOWNz%d.%d.%dz Python %s %sz Python %sZ DistVersionZ ARPCONTACTZARPURLINFOABOUTProperty dist_filesr<any)dry_run)d?d!d@dz [TARGETDIR]z [SourceDir])Zorderingz [TARGETDIR%s]z FEATURE_SELECTED AND &Python%s=3ZSpawnWaitDialogrGZFeaturesZ SelectionTreer ZFEATUREZPathEditz[FEATURE_SELECTED]1z!FEATURE_SELECTED AND &Python%s<>3ZOtherz$Provide an alternate Python locationZEnableZShowZDisableZHiderZ 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 VolumeListZVolumeCostListdiz{120}{70}{70}{70}{70}g?rZ AdminInstallzGSelect whether to install [ProductName] for all users of this computer.rrzInstall for all usersZJUSTMEzInstall just for mez [ALLUSERS]zWhichUsers="ALL"rz({\DlgFontBold8}[Progress1] [ProductName]#AzYPlease wait while the Installer [Progress2] [ProductName]. This may take several minutes.Z StatusLabelzStatus:Z ProgressBariz Progress doneZ SetProgressZProgressrz)Welcome to the [ProductName] Setup WizardZBodyText?z:Select whether you want to repair or remove [ProductName].ZRepairRadioGrouplrrrz&Repair [ProductName]ZRemoverzRe&move [ProductName]z [REINSTALL]zMaintenanceForm_Action="Repair"z [Progress1]Z Repairingz [Progress2]ZrepairsZ Reinstallrz[REMOVE]zMaintenanceForm_Action="Remove" ZRemoving Zremoves z MaintenanceForm_Action<>"Change")r}rr rrrr"r1r3r-eventZcontrolrr+mappingr]rtrVrZ conditionr8Z radiogroupadd)rr}xyrrr"ZmodalZmodelessZtrack_disk_spacefatalrAZ user_exitZ exit_dialogZinuseerrorr3ZcostingZprepZseldlgorderr{rZinstall_other_condZdont_install_other_condZcostZ whichusersgZprogressZmaintrrrrs                                                    zbdist_msi.add_uicCs<|jrd||j|jf}nd||jf}tj|j|}|S)Nz%s.%s-py%s.msiz %s.%s.msi)rQrOrZr[r\rR)rr base_namerrrrrusz bdist_msi.get_installer_filename)r9r:r; descriptionrZ user_optionsZboolean_optionsr`rrrWrcrsrrrrru __classcell__rrrLrr<Us<  ([66&@r<)rZrorIZdistutils.corerZdistutils.dir_utilrZdistutils.sysconfigrZdistutils.versionrZdistutils.errorsrZdistutils.utilrZ distutilsrr|r r r r r rrrr<rrrr s       >