如何部署和注册支持多个版本的Visual Studio(2005、2008、2010)的VSPackage? [英] How to deploy and register a VSPackage supporting multiple versions of Visual Studio (2005, 2008, 2010)?

查看:139
本文介绍了如何部署和注册支持多个版本的Visual Studio(2005、2008、2010)的VSPackage?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个开放源代码的VSPackage,我希望通过它发布对Visual Studio 2005,Visual Studio 2008和Visual Studio 2010的支持.我试图弄清楚如何创建安装程序以及如何执行程序包注册.每个版本的Visual Studio.

我所做的部署研究表明,我对安装程序最好的选择是在MSI中使用VSIX.

我所做的注册研究还不清楚.各个版本的VSPackage注册似乎有所不同(VS2005使用regpkg,VS2008使用pkgdef,VS2010使用VSIX).

任何人都可以分享他们的经验和/或向我介绍有关针对多个版本的Visual Studio的最佳方法的任何信息吗?我正在寻找最简单的实现,并且在合理可行的情况下,最好将其保存在单个安装程序中.

任何帮助将不胜感激!

解决方案

简短答案:如果您希望使用一个针对2005、2008和& 2010年,选择实际上很简单.您应该创建一个基于MSI的安装程序,然后注册到HKLM \ Software \ Microsoft \ VisualStudio \(8.0 | 9.0 | 10.0).

说明:对于MSI/VSIX问题,请记住VSIX是2010年的新产品.装有VS 2005/2008的计算机将不知道如何处理VSIX文件.

关于VSIX的旁注....永远不要在MSI内放入VSIX文件(即zip容器).如果要在扩展管理器对话框中显示基于MSI的扩展,则应包括< InstalledByMSI>.标记在您的extension.vsixmanifest文件中,然后将已经扩展的文件放在< VisualStudio2010InstallDir> \ Common7 \ IDE \ Extensions \< YourExtensionDirectory>下.

就注册而言...您的问题中有几处不正确.对于2005年和2008年,向Visual Studio注册软件包的安装程序应始终在HKEY_LOCAL_MACHINE下注册. (在2008年,PKgdef仅用于基于隔离外壳"的应用程序.)除了Visual Studio 2010中的注册表之外,现在还支持放置pkgdef文件./p>

RegPkg是Visual Studio SDK中包含的2005/2008/2010实用程序,可反映您的程序包程序集并以几种不同的格式输出适当的注册信息.它应在开发/构建时用于生成您的注册信息,而不应作为安装程序的一部分使用.

CreatePkgDef.exe是2010年的工具,与RegPkg.exe本质上相同,但仅 输出pkgdef文件.

I have an open source VSPackage that I would like to release with support for Visual Studio 2005, Visual Studio 2008, and Visual Studio 2010. I'm trying to figure out how to create the installer and how to perform the package registration with each edition of Visual Studio.

The deployment research I've done indicates my best bet for an installer is a VSIX inside an MSI.

The registration research I've done is a lot less clear. VSPackage registration seems to differ for every edition (VS2005 uses regpkg, VS2008 uses pkgdef, VS2010 uses VSIX).

Can anyone share their experiences and/or point me towards any information about the best approach for targeting multiple versions of Visual Studio? I'm looking for the easiest implementation and preferably keeping it in a single installer if reasonably feasible.

Any help would be greatly appreciated!

解决方案

Short Answer: If you want a single installer that targets/registers with 2005, 2008, & 2010, the choice is quite simple actually. You should create a MSI-based installer and register to HKLM\Software\Microsoft\VisualStudio\(8.0|9.0|10.0).

Explanation: For the MSI/VSIX question...remember that VSIX is new for 2010. A machine with VS 2005/2008 won't know what to do with a VSIX file.

A side note on VSIX....you shouldn't ever put a VSIX file (i.e. the zip container) inside a MSI. If you want a MSI-based extension that also appears in the Extension Manager dialog, you should include a <InstalledByMSI> tag in your extension.vsixmanifest file, and lay down the files already expanded under <VisualStudio2010InstallDir>\Common7\IDE\Extensions\<YourExtensionDirectory>.

As far as registration goes...you have a few things incorrect in your question. For both 2005 and 2008, installers that register packages with Visual Studio should always register under HKEY_LOCAL_MACHINE. (PKgdef in 2008 was only for "Isolated Shell" based applications.) Laying down a pkgdef file is now a supported option in addition to the registry in Visual Studio 2010.

RegPkg is a utility included in the Visual Studio SDK for 2005/2008/2010 that reflects over your package assembly and outputs the appropriate registration information in several different formats. It's meant to be used at development/build time to generate your registration information and shouldn't be used as part of an installer.

CreatePkgDef.exe is a tool in 2010 that is essentially the same as RegPkg.exe, but it only outputs pkgdef files.

这篇关于如何部署和注册支持多个版本的Visual Studio(2005、2008、2010)的VSPackage?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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