Developping for the translation industry RSS 2.0



 Monday, 22 October 2007

At the office, we use an Outlook addin (that I originally developed in Visual Studio 2002 targeting the 1.0 .NET Framework).  Finding that technology to be a little obsolete (all of our others internal applications are on the 2.0 Framework), we’ve decided to migrate it to 2.0 and add some news features while we’re at it.

The migration and installation went fine at first on my Vista development PC but I couldn’t get the addin to load on the users computers (that are on WinXP).  Every thing I tried, didn’t work and the addin couldn’t load at all.  What I ended up doing is a complete rebuild of the application using VSTO SE (Visual Studio Tools for Office Second Edition).  Since everything works well now, I’ll share with you every resource that I came across about creating an addin with VSTO.

1. Get the prerequisites:

In order to deploy a VSTO addin, you need the following prerequisites installed on every user’s computer:

 

2. Code the addin:

Pretty straightforward step, depending on your company’s requirements.  I’ll write another article about that part soon with some code examples.

 

3. Prepare for deployment:

In order to prepare for the deployment of your solution, you need to set the code access security policy for your assemblies.  To do so, you need to do the following tasks:

  • Get the “SetSecurity” project here and add it to your project.
  • Sign your assembly (or assemblies) in the Signing section of the project’s properties.  All you need to do is to check the Sign the assembly check box and create a new strong name file.  You need to make sure that every assembly that you deploy is signed (including the SetSecurity.dll assembly).

 Sshot-1

Sshot-02

 

  • Add the SetSecurity project output to your deployment project and add a custom action for Installation, Rollback and Uninstall.

Sshot-3

In the custom action data for the Install custom action, you need to enter the following data, replacing “OutlookAddin” with the name of your addin:

/assemblyName="OutlookAddin.dll" /targetDir="[TARGETDIR]\" /solutionCodeGroupName="MyCompany.OutlookAddin" /solutionCodeGroupDescription="Code group for OutlookAddin" /assemblyCodeGroupName="OutlookAddin" /assemblyCodeGroupDescription="Code group for OutlookAddin" /allUsers=[ALLUSERS]

For the Rollback and Uninstall, all you need to provide in the custom action data is:

/solutionCodeGroupName="MyCompany.OutlookAddin"

 

That’s a wrapper of about everything useful I found in my research.  I hope this helps you!  If there is something you think would be a good addition to this article, feel free to email me at: stan AT stanbiron DOT com.

Some more useful resources:

  • If you don’t have VSTO as part of your Visual Studio Installation, here is the link to download it separately.
  • If you code on a Vista PC and you use Visual Studio 2005 (with the Vista service pack), you won’t be able to debug into a VSTO addin for Office 2003.  Microsoft has issued an hotfix to resolve this problem.
  • If you can’t get the addin to work on the target computer, you can use this really great Outlook Addin Checker that looks for missing registry keys, prerequisites or Code Access Security policies.
  • There is a two-part article on MSDN for every step needed to deploy an VSTO addin or document customization: part 1 and part 2.  These article are somewhat long but every bit of information for the deployment part is there.  They also explain how to set custom deployment conditions to ensure that the prerequisites are installed.

 

Monday, 22 October 2007 16:14:29 (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
General | Office Interop | Tools

Navigation
Advertisement
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2017
Stanislas Biron
Sign In
Statistics
Total Posts: 135
This Year: 0
This Month: 0
This Week: 0
Comments: 1
All Content © 2017, Stanislas Biron