Delpoying Visio 2007 Addin with VSTO 2005 SE
http://blogs.msdn.com/chcast/archive/2007/03/28/creating-visio-add-ins-with-vsto-2005-se.aspx0 Creating a VSTO add-in for Visio
1 Deployment
Steps
1. Install .NET 2.0 Framework
2(*) Install VSTO SE Runtime
3(*) Install Visio 2007 Primary Interop Assembly
4. Add required add-in registry settings
5. Copy add-in assembly.
6. Copy any Visio templates and stencils
7(*). Grant full trust to add-in
1.1 install OfficeVSTO2005SEWindowsInstaller.msi.
http://go.microsoft.com/fwlink/?linkid=837211.2 Adding the Visual Studio Tools for Office Packages to the Bootstrapper
1.2.1 Preparing the Runtime
The default location of the {SamplesDir} token below is “C:\Program Files\Microsoft Visual Studio 2005 Tools for Office SE Resources\VSTO2005SE Windows Installer Sample” or something like that
Microsoft Visual Studio 2005 Tools for Office Second Edition runtime
http://go.microsoft.com/fwlink/?linkid=49612Copy vstor.exe into the {SamplesDir}\packages\VSTOSERuntime directory.
Microsoft Visual Studio 2005 Tools for the Microsoft Office System (VSTO2005) Language Package
http://go.microsoft.com/fwlink/?linkid=56602Copy the file vstolp20.exe into the directory {SamplesDir}\packages\VSTOLP.
1.2.2 Preparing the Office Component Check
In Visual Studio 2005 Command Prompt, change the directory to {SamplesDir}\projects\Checks
cl.exe /Oxs /MT /GS ComponentCheck.cpp advapi32.lib
copy the executable file ComponentCheck.exe into {SamplesDir}\packages\Office2003PIA and {SamplesDir}\packages\Office2007PIA
1.2.3 Preparing for the Release of Office2007 Microsoft Office System Update: Redistributable Primary Interop Assemblies
http://www.microsoft.com/downloads/details.aspx?familyid=59daebaa-bed4-4282-a28c-b864d8bfa513Copy O2007PIA.msi into the directory {SamplesDir}\packages\Office2007PIA
1.2.4 Copying the Packages into the Bootstrapper Directory
default Bootstrapper directory: C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages
Copy the contents of the directory {SamplesDir}\packages into the bootstrapper directory.
1.3 Enhancing the Visio Add-in Setup Project
1.3.1 Signing the Assembly
1.3.2 Adding the Prerequisites to the Setup Project
1.3.3 Adding a Custom Action to Grant Trust to the Assembly
1.3.3.1 add the supplied SetSecurity project
copy the SetSecurity project from the {SamplesDir}\projects directory to the directory that contains your Addin solution.
1.3.3.2 add the primary output of the custom action project to the Setup project
Right click on Setup project --> View -->Custom Actions
In the Custom Actions editor, right-click Custom Actions --> Add Custom ActionIn the Look
In list, click Application Folder --> Add Output
The Add Project Output Group dialog box opens.
In the Project list, click SetSecurity.
Select Primary output from the list of output types --> OK.
Verify that Primary output from SetSecurity (Active) is added
1.3.3.3 add the custom action data for the Install method
In the Custom Actions editor, expand Install.Right-click Primary output from SetSecurity (Active) --> Properties Window.
In the Properties window, set the CustomActionData property to the following string. Enter this as one long string, and change MyCompanyName to your company name.
/assemblyName="MyVisioVSTOAddin.dll" /targetDir="[TARGETDIR]\" /solutionCodeGroupName="MyCompanyName.MyVisioVSTOAddin" /solutionCodeGroupDescription="Code group for MyVisioVSTOAddin" /assemblyCodeGroupName="MyVisioVSTOAddin" /assemblyCodeGroupDescription="Code group for MyVisioVSTOAddin" /allUsers=[ALLUSERS]
1.3.3.4 add the custom action data for the Rollback method
In the Custom Actions editor, expand Rollback.
Right-click Primary output from SetSecurity (Active) --> Properties Window.
In the Properties window, set the CustomActionData property to the following string:
/solutionCodeGroupName="MyCompanyName.MyVisioVSTOAddin"
1.3.3.5 add the custom action data for the Uninstall method
In the Custom Actions editor, expand Uninstall.Right-click Primary output from SetSecurity (Active) --> Properties Window.
In the Properties window, set the CustomActionData property to the following string:
/solutionCodeGroupName="MyCompanyName.MyVisioVSTOAddin"
1.3.4 Adding Launch Conditions to the Windows Installer File
1.3.4.1 add a launch condition for the VSTO 2005 SE runtimeIn the Launch Conditions editor, right-click Requirements on Target Machine --> Add Registry Launch Condition.
Select the newly added search condition, Search for RegistryEntry1.
Rename the search condition to Search for VSTO 2005 SE Runtime.
In the Properties window, change the value of Property to VSTORTVERSION.
Also in the Properties window, set the value of RegKey to the following string.
Software\Microsoft\vsto runtime Setup\v2.0.50727
Leave the Root property set to vsdrrHKLM and change the Value property to Update.
Select the newly added launch condition, Condition1.
Rename it to Display message if the Visual Studio 2005 Tools for Office SE Runtime is not installed.
In the Properties window, change the value of the Condition property to the following string.
VSTORTVERSION >= "#2"
Leave the InstallURL property blank.
Change the value of the Message property to The Visual Studio 2005 Tools for Office SE Runtime is not installed. Please run Setup.exe.
1.3.4.2 add a launch condition for the Visual Studio 2005 Tools for Office Language Pack
In the Launch Conditions editor, right-click Requirements on Target Machine --> Add Windows Installer Launch Condition.
Select the newly added search condition, Search for Component1.
Rename the search condition to Search for VSTO Language Pack.
In the Properties window, in the ComponentId property, type the following GUID:
{2E3A394E-C9BD-40C3-9990-BA7AF7C8B4AF}
Change the value of Property to COMPONENTEXISTS_VSTOLP.
Select the newly added launch condition, (Condition1).
Rename it to Display message if the Visual Studio 2005 Tools for Office Language Pack is not installed.
In the Properties window, change the value of the Condition property to COMPONENTEXISTS_VSTOLP.
Leave the InstallURL property blank.
Change the value of the Message property to The Visual Studio 2005 Tools for Office Language Pack is not installed. Please run Setup.exe.
1.4 Testing
References
1. Deploying Visual Studio 2005 Tools for Office Second Edition Solutions Using Windows Installer (Part 1 of 2)
http://msdn2.microsoft.com/en-us/library/bb332051.aspx2. Deploying Visual Studio 2005 Tools for Office Second Edition Solutions Using Windows Installer: Walkthroughs (Part 2 of 2)
http://msdn2.microsoft.com/en-us/library/bb332052.aspx