包:用于检测VS 2017是否已安装包的代码失败 [英] Package: Code to detect if package is already installed failing for VS 2017

查看:208
本文介绍了包:用于检测VS 2017是否已安装包的代码失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发VS Package的自定义安装程序。这个自定义安装程序只是一个嵌入.vsix文件的cs win表单应用程序。我们的想法是通过单击setup.exe为每台计算机(对于计算机上的所有用户)安装/安装开发人员UI选项/卸载
。该软件包支持VS 2012至VS 2017. 

I am working on Custom installer for VS Package. This custom installer is nothing but a cs win form application embedding the .vsix file. The idea is to provide developers UI options to install / install per machine (for all users on a machine) / uninstall the package by clicking on setup.exe. The package supports VS 2012 through to VS 2017. 

仅当setup.exe检测到软件包已安装在用户计算机上时,才会启用seup.exe中的卸载选项。此检测通过检测所有可用的Visual Studio IDE版本,然后动态加载相应版本的Microsoft.VisualStudio.ExtensionManager.dll
,然后按名称/ guid搜索IInstalledExtension。

Uninstall option in seup.exe is enabled only when setup.exe detects if the package is already installed on user's machine. This detection works by detecting all versions of available Visual Studio IDEs, and then dynamically loading Microsoft.VisualStudio.ExtensionManager.dll of corresponding versions, and then searching for IInstalledExtension by name / guid.

直到VS 2012到VS 2015,这个工作正常。但是,对于VS 2017,它无法找到/加载v 15.0的dll Microsoft.VisualStudio.ExtensionManager。 DLL。显然,在安装VS 2017时,此dll不会保存在
gac中。

我只想检查如何在VS 2017中进行此检测。我在我的系统上找不到安装了VS 2017专业版的Microsoft.VisualStudio.ExtensionManager.dll。这个dll /界面在VS 2017中更改了
/更换了吗?

或者如果有的话检测扩展程序是否已安装的其他更好方法。

我们将非常感谢任何帮助。

Any help will be greatly appreciated.

谢谢&此致,

Manjeet Singh

Manjeet Singh

推荐答案

Hi Manjeet,

Hi Manjeet,

VS2017不再是GAC的组件,VS 2017的安装方可能有多种变种旁边。所以你的安装/卸载将需要考虑VS 2017。

VS2017 no longer GAC's it's components, and there can be multiple variants of VS 2017 installed side by side. So you're install/uninstall will need to take this into account for VS 2017.

一些链接/细节让你指向正确的方向:

Some links/details to get you pointed in the right direction:

  • Breaking Changes in Extensibility
  • Changes to Visual Studio "15" Setup
  • vswhere Available (blog)
  • vswhere (wiki)
  • Visual Studio Locator (GitHub)

此致,

这篇关于包:用于检测VS 2017是否已安装包的代码失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆