How do I deploy and register a VSPackage that supports multiple versions of Visual Studio (2005, 2008, 2010)?

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 am trying to figure out how to create an installer and how to register a package with each release of Visual Studio.

The deployment research I have done indicates that the best option for the installer is VSIX inside MSI.

The research I have done is much less clear. VSPackage registration appears to be different for each version (VS2005 uses regpkg, VS2008 uses pkgdef, VS2010 uses VSIX).

Can anyone share their experience and / or point me to any information on the best approach to targeting multiple versions of Visual Studio? I am looking for the lightest implementation and it is advisable to keep it in the same installer if possible.

Any help would be greatly appreciated!

+2


a source to share


1 answer


Short answer . If you want one installer to target / register from 2005, 2008 and 2010, the choice is actually pretty straightforward. You must create an MSI-based installer and register at HKLM \ Software \ Microsoft \ VisualStudio \ (8.0 | 9.0 | 10.0).

Explanation . For the MSI / VSIX question ... remember that VSIX is new for 2010. A VS 2005/2008 machine will not know what to do with the VSIX file.

VSIX note .... you should never put a VSIX file (i.e. a zip container) inside an MSI. If you want an MSI based extension that also appears in the Extension Manager dialog box, you must include the <InstalledByMSI> tag in the extension.vsixmanifest file and run the files already deployed under <VisualStudio2010InstallDir> \ Common7 \ IDE \ Extensions \ <YourExtensionDirectory >.



Regarding registration ... you have a couple of wrong things in your question. For both 2005 and 2008, installers that register packages with Visual Studio must always register with HKEY_LOCAL_MACHINE. (PKgdef in 2008 was for sandboxed applications only). In addition to the registry, Visual Studio 2010 now supports the pkgdef file.

RegPkg is a utility included in the Visual Studio SDK for 2005/2008/2010 that mirrors your package build and outputs the corresponding registration information in several different formats. It is intended to be used during the development / build process to create your login information and should not be used as part of the installer.

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

+4


a source







All Articles