mò &U²Ic@sdZdZdkZdkZdkZdklZdklZdk l Z l Z dk Tdk lZdklZd efd „ƒYZdS( szdistutils.command.bdist_wininst Implements the Distutils 'bdist_wininst' command: create a windows installer exe-program.s9$Id: bdist_wininst.py 37828 2004-11-10 22:23:15Z loewis $N(sCommand(s get_platform(s create_trees remove_tree(t*(sget_python_version(slogt bdist_wininstc Bs£tZdZd'ddddfddd d fd(d)d*d+d,d-d.d/g Zdd ddgZd „Zd!„Zd"„Zd#„Z dd$„Z d%„Z d&„Z RS(0Ns-create an executable installer for MS Windowss bdist-dir=s1temporary directory for creating the distributions keep-temptks/keep the pseudo-installation tree around after s!creating the distribution archivestarget-version=s!require a specific python versions on the target systemsno-target-compiletcs/do not compile .py to .pyc on the target systemsno-target-optimizetos:do not compile .py to .pyo (optimized)on the target systems dist-dir=tds-directory to put final built distributions insbitmap=tbs>bitmap to use for the installer instead of python-powered logostitle=tts?title to display on the installer background instead of defaults skip-builds2skip rebuilding everything (for testing/debugging)sinstall-script=sTbasename of installation script to be run afterinstallation or before deinstallationspre-install-script=s{Fully qualified filename of a script to be run before any files are installed. This script need not be in the distributioncCsgd|_d|_d|_d|_d|_d|_d|_d|_ d|_ d|_ d|_ dS(Ni( tNonetselft bdist_dirt keep_temptno_target_compiletno_target_optimizettarget_versiontdist_dirtbitmapttitlet skip_buildtinstall_scripttpre_install_script(R ((t</data/zmath/lib/python2.4/distutils/command/bdist_wininst.pytinitialize_options7s          cCs|idjo.|idƒi}tii|dƒ|_n|ip d|_n|i oT|i i ƒoDt ƒ}|io$|i|jotd|f‚n||_n|iddƒ|ioLxI|i iD]'}|itii|ƒjoPqÛqÛWtd|i‚ndS(NtbdisttwininsttsMtarget version can only be %s, or the '--skip_build' option must be specifiedRs(install_script '%s' not found in scripts(sdist_dirsdist_dir(R R Rtget_finalized_commandt bdist_basetostpathtjoinRRt distributionthas_ext_modulestget_python_versiont short_versiontDistutilsOptionErrortset_undefined_optionsRtscriptstscripttbasename(R R&RR"((Rtfinalize_optionsGs"       c Cstidjo0|iiƒp|iiƒotdƒ‚n|ip|idƒn|i dddƒ}|i |_ |i|_d|_ |i dƒ} d| _d| _|iiƒo}|i}|p(|ip td ‚tidd !}nd tƒ|f} |idƒ}tii|id | ƒ|_nxLdD]D}ti|ƒ}|djo|d}nt!|d||ƒqFWt"i#d|i ƒ|i$ƒtii%dtii|i dƒƒ|i&ƒtid=dk'l(}|ƒ}|ii*ƒ} |i,|dd|i ƒ}|i.|| |i/ƒt"i0d|ƒti1|ƒ|i2pt3|i d|i4ƒndS(Ntwin32s^distribution contains extensions and/or C libraries; must be compiled on a Windows 32 platformtbuildtinstalltreinit_subcommandsiit install_libs Should have already checked thisis.%s-%stlibtpurelibtplatlibtheadersR%tdatas/Include/$dist_nametinstall_sinstalling to %stPURELIB(smktemptziptroot_dirsremoving temporary file '%s'tdry_run(R/R0R1sscriptssdata(5tsystplatformR RR thas_c_librariestDistutilsPlatformErrorRt run_commandtreinitialize_commandR+R troottwarn_dirR-tcompiletoptimizeRtAssertionErrortversiont get_platformtplat_specifierRR*RRRt build_baset build_libtkeytstringtuppertvaluetsetattrtlogtinfotensure_finalizedtinserttrunttempfiletmktemptarchive_basenamet get_fullnametfullnamet make_archivetarcnamet create_exeRtdebugtremoveR t remove_treeR7( R RHRSRXRRKRTR*R+R-RERV((RRQbsV0          %       c CsÙg}|ii} |idƒ| ipdd}d„}xƒddddd d d d gD]c}t | |dƒ}|oD|d t i |ƒ||ƒf}|id|||ƒfƒq[q[W|idƒ|i o|id|i ƒn|id||ƒƒ|id|i ƒ|id|i ƒ|io|id|iƒn|ip |iiƒ}|id||ƒƒdk}dk}d|i|iƒƒ|if} |id| ƒt i|dƒS(Ns [metadata]Rs cCsti|ddƒS(Ns s\n(RItreplacets(R^((Rtescape¼stauthort author_emailt descriptiont maintainertmaintainer_emailtnameturlRCs %s: %ss%s=%ss [Setup]sinstall_script=%ssinfo=%sstarget_compile=%dstarget_optimize=%dstarget_version=%sstitle=%ssBuilt %s with distutils-%ss build_info=%s(tlinesR Rtmetadatatappendtlong_descriptionRNR_RetgetattrR2RIt capitalizeRR R RRRUttimet distutilstctimet __version__t build_infoR( R RNReRnRRmRgR_R2RqRh((Rt get_inidata®s4   #%     "c Cs’dk}|i|iƒ|iƒ}|i|ƒ} |i d| ƒ|o%t |dƒi ƒ}t|ƒ}nd}t | dƒ}|i|iƒƒ|o|i|ƒnytWntj on%Xt|tƒo|idƒ}n|d}|io*t |idƒi ƒ} || d}n |d}|i|ƒ|id d t|ƒ|ƒ} |i| ƒ|it |dƒi ƒƒdS( Ns creating %strbitwbtmbcsttrs s          cCsS|io)tii|id||ifƒ}ntii|id|ƒ}|S(Ns%s.win32-py%s.exes %s.win32.exe(R RRRRRRVR|(R RVR|((RR{s   cCs¸dkl}tƒ}|ioQ|i|joA|i|jo |ƒ}qz|idjo d}qzd}n |ƒ}tii t ƒ}tii |d|ƒ}t|dƒiƒS(N(sget_build_versions2.4t6s7.1swininst-%s.exeRs(tdistutils.msvccompilertget_build_versionR!t cur_versionR RtbvRRtdirnamet__file__t directoryRtfilenameR~R(R RRR‘R”R•((RR…"s     (s bdist-dir=Ns1temporary directory for creating the distribution(sno-target-compileRs/do not compile .py to .pyc on the target system(sno-target-optimizeRs:do not compile .py to .pyo (optimized)on the target system(s dist-dir=Rs-directory to put final built distributions in(sbitmap=Rs>bitmap to use for the installer instead of python-powered logo(stitle=Rs?title to display on the installer background instead of default(s skip-buildNs2skip rebuilding everything (for testing/debugging)(sinstall-script=NsTbasename of installation script to be run afterinstallation or before deinstallation(spre-install-script=Ns{Fully qualified filename of a script to be run before any files are installed. This script need not be in the distribution( t__name__t __module__RbRt user_optionstboolean_optionsRR(RQRrRYR{R…(((RRsA   L / 7 (t__doc__t __revision__R8RRItdistutils.coretCommandtdistutils.utilRDtdistutils.dir_utilt create_treeR\tdistutils.errorstdistutils.sysconfigR!RnRMR( R›RIR!R\R8RRDR RRRM((Rt?s