Visual Studio Tools for Applications
Microsoft Visual Studio Tools for Applications 2.0 gives you a way to enable end users to customize your existing applications using Visual Basic and Visual C#. You can incorporate a custom integrated development environment (IDE) that is similar to the Visual Studio IDE into the application. End-user developers can use the IDE to customize the application by creating add-ins that extend the functionality of the application to meet their needs.
Updating
To update a host application to support Microsoft Visual Studio Tools for Applications 2.0, you must update registry settings, modify your code in the host application, and create new project templates for add-in developers to use.
Migrating Add-ins
Add-in developers who created add-ins for the previous version of the host application must migrate their add-ins to the new version to be able to use them. After add-in developers migrate an add-in, they can rebuild the project and deploy the add-in to the updated host application.
You can incorporate the ability to migrate add-ins into the Visual Studio Tools for Applications IDE. The migration process for add-ins includes creating a new class and adding two registry entries. The class provides information that Visual Studio Tools for Applications uses to update assembly references and project settings.
Registering Host Application
You must register your host application on the development computer before you can generate project templates and use the project templates in the integrated development environment (IDE). To register the host application, you create several registry keys that provide information about your host application.
When you deploy Visual Studio Tools for Applications along with your host application, the Visual Studio Tools for Applications Windows Installer package performs some of the registration steps for you. Visual Studio Tools for Applications uses two areas in the registry to store information about your host application and to distinguish host applications from one another: the host configuration registry key, and the host context registry hive. You are responsible for creating subkeys for your application under the host configuration key. Visual Studio Tools for Applications automatically generates the host context hive for you. To register your application, you must create a hostID\2.0 subkey under the host configuration key. The hostID key identifies your host application, and the 2.0 key specifies the version of Visual Studio Tools for Applications that you are integrating with the application. When you integrate Microsoft Visual Studio Tools for Applications 2.0 with an application, you must use 2.0 for the name of this key. For example, the ShapeAppCSharp sample uses the following host configuration subkey on a 32-bit platform.
HKEY_LOCAL_MACHINE\Software\Microsoft\VSTAHostConfig\ShapeAppCSharp\2.0
The Visual Studio Tools for Applications SDK includes an installer package (vsta20.exe) that you can run from your application's Setup program to install the Visual Studio Tools for Applications IDE and runtime assemblies on end user computers. Your Setup program must create the host configuration registry key on the end user computer, but vsta20.exe performs the rest of the registration for you:
· If your Setup program passes the HOSTID=host ID argument to vsta20.exe, it runs vsta.exe (that is, the executable program for the Visual Studio Tools for Applications IDE) with the /hostid and /setup arguments to create and populate the host context registry hive.
· If the end user computer already has Visual Studio 2008 installed, vsta20.exe also runs devenv.exe with the /setupargument to install any included Visual Studio templates to the appropriate folders.