与微软的visual studio定位工具vswhere的接口

vswhere的Python项目详细描述


python vswhere

这个模块提供了一个到微软的visual studio定位工具的接口, vswhere

如果安装了Visual Studio 15.2或更高版本,则将使用vswhere 与Visual Studio一起安装的二进制文件。否则,它将下载最新的 第一次调用函数时释放vswhere。

用法

findfind_first是最通用的函数。他们支持 command line options 去vswhere。find返回已安装的Visual Studio匹配副本的列表 给定的选项和find_first只返回第一个结果。

如果您只对最新版本的visual studio感兴趣,请使用 get_latest。要获得安装路径,请使用get_latest_path。得到 只有版本号,使用get_latest_versionget_latest_major_version

如果要使用自己的vswhere.exe版本而不是安装的版本 在visual studio中,使用set_vswhere_path提供其位置。

如果要使用镜像而不是github下载vswhere.exe,则 例如,在不能访问github的intranet上,使用 set_download_mirror并提供镜像的url。

示例

>>>importpprint,vswhere>>>vswhere.get_latest_path()'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community'>>>vswhere.get_latest_version()'15.8.28010.2003'>>>vswhere.get_latest_major_version()15>>>vswhere.find(legacy=True,prop='installationPath')['C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community','C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\']>>>pp=pprint.PrettyPrinter(indent=4,width=200)>>>pp.pprint(vswhere.find(legacy=True))[{...'description':'Free, fully-featured IDE for students, open-source and individual developers','displayName':'Visual Studio Community 2017','enginePath':'C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\resources\\app\\ServiceHub\\Services\\Microsoft.VisualStudio.Setup.Service','installDate':'2018-04-26T04:49:29Z','installationName':'VisualStudio/15.8.1+28010.2003','installationPath':'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community','installationVersion':'15.8.28010.2003','instanceId':'ee7ea828','isPrerelease':False,'productId':'Microsoft.VisualStudio.Product.Community','productPath':'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\Common7\\IDE\\devenv.exe','properties':...,'releaseNotes':'https://go.microsoft.com/fwlink/?LinkId=660692#15.8.1','thirdPartyNotices':'https://go.microsoft.com/fwlink/?LinkId=660708','updateDate':'2018-08-19T20:49:30.0058548Z'},{'installationPath':'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\','installationVersion':'14.0','instanceId':'VisualStudio.14.0'}]

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何强制用户在允许访问活动之前处理对话框?我的许可证代码怎么了?   java ArraysList作为JSON   mysql如何在java中创建包含多个可选where子句的搜索语句?   java如何让Apache Camel在“直接”路径的末尾删除文件?   使用socket在两个Androids之间进行java实时数据传输。IO(websocket)和4G   如何在java中实现两个CORBA服务器之间的通信   会话树xml表示为java对象   java Skype4Java编号swtwin323325   java RecyclerView getAdapterPosition()不工作:第一次单击返回正确位置,第二次单击返回1   java在$TOMCAT/conf/context上为JNDI设置资源。xml   java为什么第二个矩形冲突在第一个矩形冲突时不起作用?   JScrollPane上的java JTextArea未出现在JPanel上   java如何将实现的PriorityQueue打印为字符串?   jpa使用Jersey更新用户角色RESTJava(JAXRS)