ef>dZddlZddlmZddlmZmZddlmZm Z m Z m Z ddl m Z ddlZddlZddlZddl Z ddlZddlmZejdkr ddlZdd lmZnGd d ZeZd Zd ZdddddZdZdZdZd dZGddZ GddZ!GddZ"GddZ#dS)!a Improved support for Microsoft Visual C++ compilers. Known supported compilers: -------------------------- Microsoft Visual C++ 14.X: Microsoft Visual C++ Build Tools 2015 (x86, x64, arm) Microsoft Visual Studio Build Tools 2017 (x86, x64, arm, arm64) Microsoft Visual Studio Build Tools 2019 (x86, x64, arm, arm64) This may also support compilers shipped with compatible Visual Studio versions. N)open)listdirpathsep)joinisfileisdirdirname)CalledProcessError)unique_everseenWindows)environceZdZdZdZdZdZdS)winregN)__name__ __module__ __qualname__ HKEY_USERSHKEY_CURRENT_USERHKEY_LOCAL_MACHINEHKEY_CLASSES_ROOTo/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/setuptools/msvc.pyrr s'  ! rrc, tjtjddtjtjz}n#t $rYdSwxYwd}d}|5t jD]} tj||\}}}n#t $rYnkwxYw|rd|tj krTt|rE tt|}n#ttf$rYwxYw|dkr ||kr||}}dddn #1swxYwY||fS)0Python 3.8 "distutils/_msvccompiler.py" backportz'Software\Microsoft\VisualStudio\SxS\VC7rNNN)rOpenKeyrKEY_READKEY_WOW64_32KEYOSError itertoolscount EnumValueREG_SZrintfloat ValueError TypeError)key best_versionbest_dirivvc_dirvtversions r_msvc14_find_vc2015r2)sn  % 6 Of4 4    zzLH = ="" = =A  & 0a 8 8 622     =R6=((U6]](!%((mmGG"I.Hb==W|%;%;-4f(L = = = = = = = = = = = = = = =  !!si8; A A D)BD B DB$D6CDC'$D&C''DD D c tjdptjd}|sdSd}|D]}tjtt t 5tjt|ddddd d |d d d dg  dd }t|ddd}t|rd|fcdddcS dddn #1swxYwYdS)aPython 3.8 "distutils/_msvccompiler.py" backport Returns "15, path" based on the result of invoking vswhere.exe If no install is found, returns "None, None" The version is returned to avoid unnecessarily changing the function result. It may be ignored when the path is not None. If vswhere.exe is not available, by definition, VS 2017 is not installed. ProgramFiles(x86) ProgramFilesr)z1Microsoft.VisualStudio.Component.VC.Tools.x86.x64z)Microsoft.VisualStudio.Workload.WDExpresszMicrosoft Visual Studio Installerz vswhere.exez-latestz -prereleasez -requiresz -propertyinstallationPathz -products*mbcsstrict)encodingerrorsVC AuxiliaryBuildN) r get contextlibsuppressr r!UnicodeDecodeError subprocess check_outputrdecodestripr)rootsuitable_components componentpaths r_msvc14_find_vc2017rMGs ;* + + Jw{>/J/JD z )   !3W>P Q Q  ' ";[-"%#!#*# 99# (dK99DT{{ 4x/          , -               2 :sA9C--C1 4C1 x86x64armarm64)rN x86_amd64x86_arm x86_arm64c t\}}d}|tvrt|}nd|vrdnd}|rYt|ddddd|d d } d dl}||d d}n#tt t f$rd}YnwxYw|s&t\}}|rt|d|dd }|sdSt|d}t|sdS|rt|sd}||fS)rNamd64rOrNz..redistMSVCz**zMicrosoft.VC14*.CRTzvcruntime140.dllrT) recursivezMicrosoft.VC140.CRTrz vcvarsall.bat) rMPLAT_SPEC_TO_RUNTIMErglob ImportErrorr! LookupErrorr2r) plat_spec_r, vcruntimevcruntime_platvcredistr\r+ vcvarsalls r_msvc14_find_vcvarsallresb%''KAxI(((-i8")Y"6"6E        !      KKK (d ;;B?IIWk2   III   !4!6!6 h  %" I zX//I )  z F9-- i s !A//B  B cJdtvrdtjDSt|\}}|stjd t jd||t j  dd}nO#t j $r=}tjd |j |d }~wwxYwd d | DD}|r||d <|S)rDISTUTILS_USE_SDKc>i|]\}}||Srlower).0r*values r z&_msvc14_get_vc_env..s&EEEzsE UEEErzUnable to find vcvarsall.batzcmd /u /c "{}" {} && set)stderrzutf-16lereplace)r<zError executing {}NcHi|]\}}}|| || Srri)rkr*r`rls rrmz&_msvc14_get_vc_env..sH    CE    U   rc3@K|]}|dVdS)=N) partition)rklines r z%_msvc14_get_vc_env..s.OOddnnS11OOOOOOrpy_vcruntime_redist)r itemsre distutilsr<DistutilsPlatformErrorrErFformatSTDOUTrGr cmd splitlines)r_rdraoutexcenvs r_msvc14_get_vc_envrsLg%%EEW]__EEEE1)<<Iy V556TUUU% & - -i C C$    &I& . .   (55 ' ' 0 0      OOcnn>N>NOOO   C /%. !" JsA B%%C148C,,C1c| t|S#tjj$r}t |dd}~wwxYw)a* Patched "distutils._msvccompiler._get_vc_env" for support extra Microsoft Visual C++ 14.X compilers. Set environment without use of "vcvarsall.bat". Parameters ---------- plat_spec: str Target architecture. Return ------ dict environment ,@N)rrxr<ry_augment_exception)r_rs rmsvc14_get_vc_envrsM&!),,,   23%%% s;6;cz|jd}d|vsd|vryd}|jdit}d}|dkr7|ddkr|d z }n%|d z }n|d kr|d z }||d zz }n |dkr|dz }|f|_dS)zl Add details to the exception message to help guide the user as to what action will resolve it. rrdzvisual cz;Microsoft Visual C++ {version:0.1f} or greater is required.z-www.microsoft.com/download/details.aspx?id=%d"@ia64rZz( Get it with "Microsoft Windows SDK 7.0"z% Get it from http://aka.ms/vcpython27$@z* Get it with "Microsoft Windows SDK 7.1": iW rzd Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/Nr)argsrjrzlocalsfind)rr1archmessagetmpl msdownloads rrrs hqkGgmmoo%%w}})F)FL$+))))D c>>zz||  ((2--EE BB __ C CG zD( (GG __ , G zCHHHrceZdZdZejddZdZe dZ dZ dZ d d Z d d Zdd Zd S) PlatformInfoz Current and Target Architectures information. Parameters ---------- arch: str Target architecture. processor_architecturerc`|dd|_dS)NrOrV)rjror)selfrs r__init__zPlatformInfo.__init__"s%JJLL((88 rcV|j|jddzdS)zs Return Target CPU architecture. Return ------ str Target CPU r`N)rrrs r target_cpuzPlatformInfo.target_cpu%s*y,,q02233rc|jdkS)z Return True if target CPU is x86 32 bits.. Return ------ bool CPU is x86 32 bits rNrrs r target_is_x86zPlatformInfo.target_is_x861s%''rc|jdkS)z Return True if current CPU is x86 32 bits.. Return ------ bool CPU is x86 32 bits rN current_cpurs rcurrent_is_x86zPlatformInfo.current_is_x86<s5((rFcR|jdkr|rdn|jdkr|rdn d|jzS)uk Current platform specific subfolder. Parameters ---------- hidex86: bool return '' and not '†' if architecture is x86. x64: bool return 'd' and not 'md64' if architecture is amd64. Return ------ str subfolder: ' arget', or '' (see hidex86 parameter) rNrrV\x64\%srrhidex86rOs r current_dirzPlatformInfo.current_dirGsJ$ E))g) B G+++$**  rcR|jdkr|rdn|jdkr|rdn d|jzS)ar Target platform specific subfolder. Parameters ---------- hidex86: bool return '' and not '\x86' if architecture is x86. x64: bool return '\x64' and not '\amd64' if architecture is amd64. Return ------ str subfolder: '\current', or '' (see hidex86 parameter) rNrrVrrrrs r target_dirzPlatformInfo.target_dir_sG$5((W( B7**s*$/)  rc|rdn|j}|j|krdn*|dd|zS)ap Cross platform specific subfolder. Parameters ---------- forcex86: bool Use 'x86' as current architecture even if current architecture is not x86. Return ------ str subfolder: '' if target architecture is current architecture, '\current_target' if not. rNr\z\%s_)rrrro)rforcex86currents r cross_dirzPlatformInfo.cross_dirwsR $9%%)9')) B""**471BCC rN)FFF)rrr__doc__r rArjrrpropertyrrrrrrrrrrrs'+6;;AACCK999 4 4X 4 ( ( ( ) ) )    0    0      rrc eZdZdZejejejejfZ dZ e dZ e dZ e dZe dZe dZe dZe d Ze d Ze d Zdd ZdZdS) RegistryInfoz Microsoft Visual Studio related registry information. Parameters ---------- platform_info: PlatformInfo "PlatformInfo" instance. c||_dSN)pi)r platform_infos rrzRegistryInfo.__init__s rcdS)z Microsoft Visual Studio root registry key. Return ------ str Registry key VisualStudiorrs r visualstudiozRegistryInfo.visualstudios ~rc,t|jdS)z Microsoft Visual Studio SxS registry key. Return ------ str Registry key SxS)rrrs rsxszRegistryInfo.sxssD%u---rc,t|jdS)z| Microsoft Visual C++ VC7 registry key. Return ------ str Registry key VC7rrrs rvczRegistryInfo.vcDHe$$$rc,t|jdS)z Microsoft Visual Studio VS7 registry key. Return ------ str Registry key VS7rrs rvszRegistryInfo.vsrrcdS)z Microsoft Visual C++ for Python registry key. Return ------ str Registry key zDevDiv\VCForPythonrrs r vc_for_pythonzRegistryInfo.vc_for_pythons %$rcdS)zq Microsoft SDK registry key. Return ------ str Registry key zMicrosoft SDKsrrs r microsoft_sdkzRegistryInfo.microsoft_sdks  rc,t|jdS)z Microsoft Windows/Platform SDK registry key. Return ------ str Registry key r rrrs r windows_sdkzRegistryInfo.windows_sdksD& 222rc,t|jdS)z Microsoft .NET Framework SDK registry key. Return ------ str Registry key NETFXSDKrrs r netfx_sdkzRegistryInfo.netfx_sdksD& 333rcdS)z Microsoft Windows Kits Roots registry key. Return ------ str Registry key zWindows Kits\Installed Rootsrrs rwindows_kits_rootszRegistryInfo.windows_kits_rootss /.rFcd|js|rdnd}td|d|S)a Return key in Microsoft software registry. Parameters ---------- key: str Registry key path where look. x86: str Force x86 software registry. Return ------ str Registry key r Wow6432NodeSoftware Microsoft)rrr)rr*rNnode64s r microsoftzRegistryInfo.microsofts9 w--//I3IMJ S999rc tj}tj}tj}|j}|jD]}d} ||||d|}nV#t $rI|js+ ||||dd|}n#t $rYYgwxYwYmYnwxYw tj ||d|r||cScS#t $rYnwxYw |r ||#|r ||wwxYwdS)a Look for values in registry in Microsoft software registry. Parameters ---------- key: str Registry key path where look. name: str Value name to find. Return ------ str value NrT) rrrCloseKeyrHKEYSr!rr QueryValueEx) rr*namekey_readopenkeyclosekeymshkeybkeys rlookupzRegistryInfo.lookup"s ?.? ^J # #DD wtRRWWa::   w--//!&wtRRT]]AxHH"!!! !H   #*466q9#HTNNNNNN###    #HTNNN#HTNNNN## # #sYA#B#4B  B# BB#BB#"B#'C C!C3 C!!C33DNr)rrrrrrrrrrrrrrrrrrrrrrrrrrrrsd  !  E     X  . .X . % %X % % %X % % %X %   X   3 3X 3 4 4X 4 / /X /::::&&#&#&#&#&#rrceZdZdZejddZejddZejdeZddZ dZ d Z d Z e d Zed Zed ZdZdZedZedZedZedZedZedZedZedZedZedZedZedZedZ dZ!e d dZ"dS)! SystemInfoz Microsoft Windows and Visual Studio related system information. Parameters ---------- registry_info: RegistryInfo "RegistryInfo" instance. vc_ver: float Required Microsoft Visual C++ version. WinDirrr5r4Nc||_|jj|_||_|p|x|_|_dSr)rirfind_programdata_vs_versknown_vs_paths_find_latest_available_vs_vervs_vervc_ver)r registry_infors rrzSystemInfo.__init__]sM'*";;==%+$Rd.P.P.R.RR dkkkrc|}|s&|jstjdt |}||jt|dS)zm Find the latest VC version Return ------ float version z%No Microsoft Visual C++ version foundrZ)find_reg_vs_versrrxr<rysetupdatesorted)r reg_vc_versvc_verss rrz(SystemInfo._find_latest_available_vs_verfsz++--  t2 "997 k""t*+++gr""rc |jj}|jj|jj|jjf}g}t j|jj|D]w\}} tj |||dtj }n#t$rY>wxYw|5tj |\}}} t|D]t} tjt 5t#tj|| d} | |vr|| dddn #1swxYwYut|D]n} tjt 5t#tj|| } | |vr|| dddn #1swxYwYo dddn #1swxYwYyt+|S)z Find Microsoft Visual Studio versions available in registry. Return ------ list of float Versions rN)rrrrrr"productrrrrr! QueryInfoKeyrangerBrCr(r'r$appendEnumKeyr) rrvckeysvs_versrr*rsubkeysvaluesr`r-vers rrzSystemInfo.find_reg_vs_verszsW '*dg3TWZ@"*47=&AA 0 0ID# ~dBBsGGQHH     0 0%+%8%>%>"v00A#,Z8800#F$4T1$=$=a$@AAg--#NN3///000000000000000w00A#,Z8800#FN4$;$;<<g--#NN3///0000000000000000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0gsn*B BBAF=AD&  F=&D* *F=-D* ..F=> > rcB|jdkrdS |j|j}n#t$r |j}YnwxYwt |d} t |d}|||_t ||S#ttf$rYdSwxYw)zl Locate Visual C++ for VS2017+. Return ------ str path rrrrZ) rrr rrrrrr! IndexError)rvs_dirguess_vcrs rrzSystemInfo._guess_vcs ;$  2 '(5FF ' ' '&FFF ' 011 X&&r*F0088DK&)) )$   22 s"66 >B BBc<t|jd|jz}t|jjd|jz}|j|d}|rt|dn|}|j|jjd|jzp|S)z{ Locate Visual C++ for versions prior to 2017. Return ------ str path z Microsoft Visual Studio %0.1f\VCr installdirr=)rrrrrrr)rrreg_path python_vc default_vcs rrzSystemInfo._guess_vc_legacys  "E "S   -w/DEEGNN8\:: .7DT)T***W w~~dgj'DK*?@@NJNrc|jdkrdS|jdkrdS|jdkrdS|jdkrdS|jd krd Sd S) z Microsoft Windows SDK versions for specified MSVC++ version. Return ------ tuple of str versions r)z7.0z6.1z6.0ar)z7.1z7.0a&@)z8.0z8.0a(@)8.1z8.1ar)z10.0r+Nrrs rWindowsSdkVersionzSystemInfo.WindowsSdkVersion+sg ;#  '' [D  = [D  = [D  = [D  =! rcR|t|jdS)zt Microsoft Windows SDK last version. Return ------ str version lib)_use_last_dir_namer WindowsSdkDirrs rWindowsSdkLastVersionz SystemInfo.WindowsSdkLastVersion@s%&&tD,>'F'FGGGrcd}|jD]>}t|jjd|z}|j|d}|rn?|rt |sOt|jjd|jz}|j|d}|rt|d}|rt |sR|jD]J}|d|d}d |z}t|j |}t |r|}K|rt |s5|jD]-}d |z}t|j |}t |r|}.|st|j d }|S) zn Microsoft Windows SDK directory. Return ------ str path rzv%sinstallationfolderrr$WinSDKNrzMicrosoft SDKs\Windows Kits\%szMicrosoft SDKs\Windows\v%s PlatformSDK) r-rrrrrrrrfindr5r)rsdkdirrlocrL install_baseintverds rr1zSystemInfo.WindowsSdkDirLs)  Ctw*ECK88CW^^C)=>>F   6U6]] 6-w/DEED7>>$ ==L 6lH55 U6]] -  -syy~~-.86A*D1188F U6]] -  4s:*D1188F <$+];;F rc|jdkrd}d}n-d}|jdkrdnd}|jd|}d ||d d fz}g}|jd kr)|jD]!}|t |jj||gz }"|jD]$}|t |jj d |z|gz }%|D]#}|j |d}|r|cS$dS)zy Microsoft Windows SDK executable directory. Return ------ str path r)#r(r*TF)rOrzWinSDK-NetFx%dTools%sr-rzv%sAr4N) rrrroNetFxSdkVersionrrrr-rr) rnetfxverrrfxregpathsrrLexecpaths rWindowsSDKExecutablePathz#SystemInfo.WindowsSDKExecutablePathws3 ;$  HDDH"kT11dduG7&&4&AAD $$,,tS2I2I'J J ;$  + ? ?T$'"3S"==>>) F FC dg16C<DDE EHH  Dw~~d,@AAH    rct|jjd|jz}|j|dpdS)zl Microsoft Visual F# directory. Return ------ str path z%0.1f\Setup\F# productdirr)rrrrr)rrLs rFSharpInstallDirzSystemInfo.FSharpInstallDirs;DG(*;dk*IJJw~~dL117R7rc|jdkrdnd}|D]2}|j|jjd|z}|r|pdcS3dS)zt Microsoft Universal CRT SDK directory. Return ------ str path r)1081rz kitsroot%srN)rrrr)rversrr8s rUniversalCRTSdkDirzSystemInfo.UniversalCRTSdkDirsp ${d22|| $ $CW^^DG$> s@RSSF $|### $ $ $rcR|t|jdS)z Microsoft Universal C Runtime SDK last version. Return ------ str version r/)r0rrNrs rUniversalCRTSdkLastVersionz%SystemInfo.UniversalCRTSdkLastVersions%&&tD,CU'K'KLLLrc |jdkrdndS)z Microsoft .NET Framework SDK versions. Return ------ tuple of str versions r) z4.7.2z4.7.1z4.7z4.6.2z4.6.1z4.6z4.5.2z4.5.1z4.5rr,rs rrAzSystemInfo.NetFxSdkVersions"{d"" X W rcd}|jD];}t|jj|}|j|d}|rn<|S)zu Microsoft .NET Framework SDK directory. Return ------ str path rkitsinstallationfolder)rArrrr)rr8rr9s r NetFxSdkDirzSystemInfo.NetFxSdkDirs\'  Ctw(#..CW^^C)ABBF   rczt|jd}|j|jjdp|S)zw Microsoft .NET Framework 32bit directory. Return ------ str path zMicrosoft.NET\Frameworkframeworkdir32rrrrrrguess_fws rFrameworkDir32zSystemInfo.FrameworkDir32s8 %?@@w~~dgj*:;;GxGrczt|jd}|j|jjdp|S)zw Microsoft .NET Framework 64bit directory. Return ------ str path zMicrosoft.NET\Framework64frameworkdir64rWrXs rFrameworkDir64zSystemInfo.FrameworkDir64s8 %ABBw~~dgj*:;;GxGrc,|dS)z Microsoft .NET Framework 32bit versions. Return ------ tuple of str versions _find_dot_net_versionsrs rFrameworkVersion32zSystemInfo.FrameworkVersion32 **2...rc,|dS)z Microsoft .NET Framework 64bit versions. Return ------ tuple of str versions @r`rs rFrameworkVersion64zSystemInfo.FrameworkVersion64rcrcd|j|jjd|z}t|d|z}|p||dpd}|jdkr|dfS|jdkr&|dd d krd n|d fS|jd krdS|jdkrdSdS)z Find Microsoft .NET Framework versions. Parameters ---------- bits: int Platform number of bits: 32 or 64. Return ------ tuple of str versions zframeworkver%dzFrameworkDir%dr.rr*zv4.0rNrv4z v4.0.30319v3.5r)ri v2.0.50727g @)zv3.0rj)rrrgetattrr0rrj)rbitsreg_ver dot_net_dirrs rraz!SystemInfo._find_dot_net_versions!s'..-=-DEEd$4t$;<< H00cBBHb ;$  ;  [D #&99;;rr?d#:#:<<VK K [C  '' [C  '' rc|fdttD}t|dpdS)a) Return name of the last dir in path or '' if no dir found. Parameters ---------- path: str Use dirs in this path prefix: str Use only dirs starting by this prefix Return ------ str name c3K|]8}tt||4|V9dSr)rr startswith)rkdir_namerLprefixs rruz0SystemInfo._use_last_dir_name..Osg  T$))** 08/B/B6/J/J       rNr)reversedrnext)rLrs matching_dirss`` rr0zSystemInfo._use_last_dir_name>sV"     $WT]]33   M4((.B.rrr)#rrrrr rArr5rrrrr staticmethodrrrrrrr-r2r1rFrIrNrPrArTrZr]rbrfrar0rrrrrKs  W[2 & &F7;~r22L!gk"5|DDOSSSS###(>(((T77\7 LLXL"X"<OOO*!!X!( H HX H((X(T   X  D 8 8X 8$$X$$ M MX M  X X" H HX H H HX H / /X / / /X /(((:///\///rrc>eZdZdZd!dZedZedZedZedZ ed Z ed Z ed Z ed Z ed ZedZedZdZedZedZedZedZedZedZedZedZedZedZedZedZedZd"dZd Z dS)#EnvironmentInfoaY Return environment variables for specified Microsoft Visual C++ version and platform : Lib, Include, Path and libpath. This function is compatible with Microsoft Visual C++ 9.0 to 14.X. Script created by analysing Microsoft environment configuration files like "vcvars[...].bat", "SetEnv.Cmd", "vcbuildtools.bat", ... Parameters ---------- arch: str Target architecture. vc_ver: float Required Microsoft Visual C++ version. If not set, autodetect the last version. vc_min_ver: float Minimum Microsoft Visual C++ version. Nrct||_t|j|_t |j||_|j|kr!d}tj |dS)Nz.No suitable Microsoft Visual C++ version found) rrrrrsirrxr<ry)rrr vc_min_vererrs rrzEnvironmentInfo.__init__osft$$tw''TWf-- ; # #BC"99#>> > $ #rc|jjS)zk Microsoft Visual Studio. Return ------ float version )r|rrs rrzEnvironmentInfo.vs_verxw~rc|jjS)zp Microsoft Visual C++ version. Return ------ float version )r|rrs rrzEnvironmentInfo.vc_verrrcddg}jdkr1jdd}|dgz }|dgz }|d|zgz }fd |DS) zu Microsoft Visual Studio Tools. Return ------ list of str paths z Common7\IDEz Common7\ToolsrTrrOz1Common7\IDE\CommonExtensions\Microsoft\TestWindowzTeam Tools\Performance ToolszTeam Tools\Performance Tools%scDg|]}tjj|Srrr|rrkrLrs r z+EnvironmentInfo.VSTools..(CCCTTW)400CCCr)rrr)rpaths arch_subdirs` rVSToolszEnvironmentInfo.VSToolss !12 ;$  '--d-EEK JK KE 56 6E 7+EF FECCCCUCCCCrcjt|jjdt|jjdgS)z Microsoft Visual C++ & Microsoft Foundation Class Includes. Return ------ list of str paths IncludezATLMFC\Includerr|rrs r VCIncludeszEnvironmentInfo.VCIncludess3 %y 1 1 %'8 9 9  rcjdkrjd}njd}d|zd|zg}jdkr |d|zgz }fd |DS) z Microsoft Visual C++ & Microsoft Foundation Class Libraries. Return ------ list of str paths .@TrOrLib%sz ATLMFC\Lib%srz Lib\store%scDg|]}tjj|Srrrs rrz/EnvironmentInfo.VCLibraries..rr)rrr)rrrs` r VCLibrarieszEnvironmentInfo.VCLibrariess ;$  ',,,66KK',,T,::K;&+(EF ;$   n{23 3ECCCCUCCCCrcR|jdkrgSt|jjdgS)z Microsoft Visual C++ store references Libraries. Return ------ list of str paths rzLib\store\references)rrr|rrs r VCStoreRefszEnvironmentInfo.VCStoreRefss/ ;  ITW)+BCCDDrc|j}t|jdg}|jdkrdnd}|j|}|r|t|jd|zgz }|jdkr8d|jdz}|t|j|gz }n|jdkr|jrd nd }|t|j||jd zgz }|jj |jj kr5|t|j||jd zgz }n|t|jd gz }|S) zr Microsoft Visual C++ Tools. Return ------ list of str paths VCPackagesrTFBin%srrrz bin\HostX86%sz bin\HostX64%srBin) r|rrrrrrrrrr)rr|toolsrrrLhost_dirs rVCToolszEnvironmentInfo.VCToolssWbo|445;$..44Eg''11  D d2?Gk,ABBC CE ;$  TW000>>>D d2?D112 2EE [D $(G$:$:$<$<R  BR  d2?Htw7I7Id7I7S7S,STTU UEw"dg&888(TW5H5HT5H5R5R*RSS d2?E223 3E rc0|jdkr:|jdd}t|jjd|zgS|jd}t|jjd}|j}t||d|gS)zw Microsoft Windows SDK Libraries. Return ------ list of str paths rTrrrr/um)rrrrr|r1 _sdk_subdir)rrr/libvers r OSLibrarieszEnvironmentInfo.OSLibrariess ;$  ',,Tt,DDK.+0EFFG G',,,66Ktw,e44C%F&&&++>??@ @rc t|jjd}|jdkr|t|dgS|jdkr|j}nd}t|d|zt|d|zt|d|zgS) zu Microsoft Windows SDK Include. Return ------ list of str paths includerglrrz%ssharedz%sumz%swinrt)rr|r1rr)rrsdkvers r OSIncludeszEnvironmentInfo.OSIncludesstw,i88 ;$  T'4001 1{d"")Wj6122Wfvo..Wi&011 rct|jjd}g}|jdkr ||jz }|jdkr|t|dgz }|jdkru||t|jjdt|ddt|d dt|d dt|jjd d d |jzdddgz }|S)z} Microsoft Windows SDK Libraries Paths. Return ------ list of str paths Referencesrr)zCommonConfiguration\Neutralr UnionMetadataz'Windows.Foundation.UniversalApiContractz1.0.0.0z%Windows.Foundation.FoundationContractz,Windows.Networking.Connectivity.WwanContract ExtensionSDKszMicrosoft.VCLibsrCommonConfigurationneutral)rr|r1rr)rreflibpaths r OSLibpathzEnvironmentInfo.OSLibpath*s47(,77 ;#   t' 'G ;$   S"@AAB BG ;$   TW*O<<SCYOOSA9MMSH)TTG)#&dk) )  G rcDt|S)zs Microsoft Windows SDK Tools. Return ------ list of str paths )list _sdk_toolsrs rSdkToolszEnvironmentInfo.SdkToolsPsDOO%%&&&rc#K|jdkr+|jdkrdnd}t|jj|V|js<|jd}d|z}t|jj|V|jdvrZ|jrd }n|jdd }d |z}t|jj|Vnb|jdkrWt|jjd}|jd}|jj}t|||V|jj r|jj Vd Sd S) z Microsoft Windows SDK Tools paths generator. Return ------ generator of str paths rr)rzBin\x86Trr)rr)rrzBin\NETFX 4.0 Tools%sN) rrr|r1rrrrr2rF)rbin_dirrrLrs rrzEnvironmentInfo._sdk_tools\s ;  #{d22ee Gtw,g66 6 6 6w%%'' 4'--$-77K[(Dtw,d33 3 3 3 ;, & &w$$&& J "g11$D1II +k9Dtw,d33 3 3 3 3 [D -u55D'--$-77KW2Ftvv{{;<< < < < 7 + 3'2 2 2 2 2 2 3 3rc,|jj}|rd|zndS)zu Microsoft Windows SDK version subdir. Return ------ str subdir %s\r)r|r2rucrtvers rrzEnvironmentInfo._sdk_subdirs#'/%,4  "4rcR|jdkrgSt|jjdgS)zs Microsoft Windows SDK Setup. Return ------ list of str paths rSetup)rrr|r1rs rSdkSetupzEnvironmentInfo.SdkSetups. ;  ITW*G4455rct|j}|j|jdkr-d}| o| }n>|p|}|jdkp |jdk}g}|r|fdjDz }|r|fdjDz }|S)zv Microsoft .NET Framework Tools. Return ------ list of str paths rTrVc:g|]}tj|Sr)rrZrkrr|s rrz+EnvironmentInfo.FxTools..&TTTsd2,c22TTTrc:g|]}tj|Sr)rr]rs rrz+EnvironmentInfo.FxTools..rr) rr|rrrrrrbrf)rr include32 include64rr|s @rFxToolszEnvironmentInfo.FxToolssW W ;$  I,,...Jr7H7H7J7J3JII((**Ab.?.?.A.AI'1MR]g5MI  U TTTTb>STTT TE  U TTTTb>STTT TE rc|jdks |jjsgS|jd}t |jjd|zgS)z~ Microsoft .Net Framework SDK Libraries. Return ------ list of str paths rTrzlib\um%s)rr|rTrrr)rrs rNetFxSDKLibrariesz!EnvironmentInfo.NetFxSDKLibrariessU ;  TW%8 Ig((T(22 TW(+ *CDDEErcj|jdks |jjsgSt|jjdgS)z} Microsoft .Net Framework SDK Includes. Return ------ list of str paths rz include\um)rr|rTrrs rNetFxSDKIncludesz EnvironmentInfo.NetFxSDKIncludess8 ;  TW%8 ITW(-8899rc8t|jjdgS)z Microsoft Visual Studio Team System Database. Return ------ list of str paths z VSTSDB\Deployrrs rVsTDbzEnvironmentInfo.VsTDbsTW)+;<<==rc|jdkrgS|jdkr(|jj}|jd}n|jj}d}d|j|fz}t ||g}|jdkr|t ||dgz }|S)zn Microsoft Build Engine. Return ------ list of str paths r*rTrrzMSBuild\%0.1f\bin%sRoslyn)rr|rrrrr)r base_pathrrLbuilds rMSBuildzEnvironmentInfo.MSBuilds ;  I [4  /I'--d-;;KK,IK%k(BBi&&' ;$   d9dH556 6E rcR|jdkrgSt|jjdgS)zt Microsoft HTML Help Workshop. Return ------ list of str paths r)zHTML Help Workshop)rrr|rrs rHTMLHelpWorkshopz EnvironmentInfo.HTMLHelpWorkshops/ ;  ITW,.BCCDDrc|jdkrgS|jd}t|jjd}|j}t||d|gS)z Microsoft Universal C Runtime SDK Libraries. Return ------ list of str paths rTrr/ucrt)rrrrr|rN _ucrt_subdir)rrr/rs r UCRTLibrarieszEnvironmentInfo.UCRTLibraries sh ;  Ig((T(22 47-u55#S=>>??rc|jdkrgSt|jjd}t|d|jzgS)z Microsoft Universal C Runtime SDK Include. Return ------ list of str paths rrz%sucrt)rrr|rNr)rrs r UCRTIncludeszEnvironmentInfo.UCRTIncludessE ;  Itw19==Wh)::;;<> W) j00JGGHH    D{GK,@,@,DEEK d; &B&BC CHT*h//00 !DK"$4 5 C $4$4r$9 :  )08DD  OFG Wi@@Dd||     rTc.t|d|j|j|j|jg||d|j|j|j|j |j g||d|j|j|j |j g||d|j |j|j|j|j|j|j|j|jg |}|jdkrt-|jr |j|d<|S)z Return environment dict. Parameters ---------- exists: bool It True, only return existing paths. Return ------ dict environment rr/rrL)rr/rrLrrv)dict _build_pathsrrrrrrrrrrrrrrrrrrrrrr)rexistsrs r return_envzEnvironmentInfo.return_envosA%%OO%)    !!$$L&*   %%!4<1A4>R ""LLJMMLL)K 7* * * V ;"  (> >&|44 |L)))r)Nr)T)!rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrzrzWs.????  X   X DDXD&   X  DDXD( E EX E##X#JAAXA&X2##X#J ' 'X '!3!3!3F 5 5X 5 6 6X 6X4 F FX F : :X : > >X >X6 E EX E@@X@" = =X = 5 5X 5 * *X *""X"H;;;;z*****rrzrw)$rriorosrros.pathrrrr rEr rBplatformr"distutils.errorsrx setuptools.extern.more_itertoolsr systemrr rr2rMr[rerrrrrrrzrrrrsy   000000000000))))))<<<<<<8? !!MMM!!!!!!!! dffG"""<000h  2 2 2 j<4$$$$Nv v v v v v v v ry#y#y#y#y#y#y#y#xI/I/I/I/I/I/I/I/Xt *t *t *t *t *t *t *t *t *t *r