VSTO & .NET & Excel

March 10, 2007

Creating and Deploying Managed COM Add-ins with VSTO 2005 SE – Part VII

Filed under: VSTO & Excel — Dennis M Wallentin @ 12:33 am

To read previously blogposts on the subject please see:

Deployment
MSFT has recently updated their articles about deployment of VSTO solutions:

It’s good that the articles have been updated to review Office 2007 and VSTO 2005 SE. In my opinion it would have been even better if they had included the difficulties and shortcomings that actually do exist (see MSDN’s VSTO forum).

When it comes to deployment of managed VSTO created COM add-ins we have two alternatives to consider. The add-ins can be stored on the local hard disks or in network-accessible locations (although the later require some additional work).

If we develop general free and commercial add-ins the only option is to install them on the targeting computer’s disks. For custom specific solutions network-accessible locations in the intranet can be considered.

In the following we will create the deployment package for the VSTO project. The first decision we need to make is about the prerequisites and where these should be available. I prefer to make them available as:

  • Part of the deployment package or
  • Downloadable from a web location controlled by me.  

The above assures that the correct versions of the prerequisites are always available for my add-ins. In addition, the PIAs can’t be downloaded and installed from a web location. As for the VSTO project in the series the prerequisites would be part of the deployment package.

Next we need to work with the Setup project itself. This is easy as the Setup project was created and added to the VSTO project when we created it. What we need to do in order to create the release version of the add-in is the following:

  1. Right click on Setup project and select the menu item ‘Properties’.
  2. In the dialog form click on the button ‘Configuration Manager’.
  3. In the field for ‘Active solution configuration’ select the ‘Release’ option.
  4. Close the dialogform.
  5. Right click on the Setup project and select the menu item ‘Build’.
  6. Done!

After these steps we have a deployment package to distribute that includes the following:

  setup.png

As we can see from this screenshot we have both an exe file as well as a msi file. When executing the setup.exe file everything works as expected and if the prerequisites don’t exist on the targeting computers they will be installed first and then the add-in.

If we execute the msi file the solution will be installed but it will not check if the prerequisites exist or not on the targeting machines. That’s why the above mentioned MSFT’s articles discuss launch conditions when msi files are being executed. On the other hand, in a 100 % controlled environment msi files are preferred to use.

Q: Are there any other aspects to consider before we start to distribute the installation package?
A: Yes…

Windows Vista & Error 2869

Believe or not but it exist a major issue when it comes to Windows Vista and installing VSTO solutions – The Error 2869:

 error2869.png

I have spent considerable time to figure out how to solve it as I initially thought it was related to my VSTO setups. It finally turned out to be related to VSTO and Windows Vista.

Instead of discuss it more in detail here I refer to the following sources:

Instead of downloading the whole Windows SDK kit the necessary file can be downloaded here.

If You experience this problem then see if it can be resolved by downloading and installing the Visual Studio 2005 SP-1 Update for Vista. In the next release of Visual Studio.NET this issue will be solved.

Finally
This series has been trying to give more information on using the latest technology – VSTO – to create and distribute managed COM add-ins.

Being an early adopter comes with a price in terms of:

  • Heavy time consumption with no or little outcome 
  • Lack of relevant and updated documentation
  • Bugs
  • Frustration

Q: Is VSTO created COM add-ins ready for production?
A: In a 100 % controlled environment where the add-ins leverages the core and workable part of VSTO then the answer is ‘yes’. For other scenarios the answer will still be ‘no’.

But it should not prevent us from explore and discuss VSTO!

Kind regards,
Dennis

4 Comments »

  1. Wow, wow, wow… This really is all astoundingly complex. My head really is swimming now.

    So far I have avoided VSTO… I don’t know if I can do so forever, but until deployment is smoother I don’t think I have any choice. I think the key interfaces for the Ribbon, ActionPanes etc. are COM interfaces so although VSTO makes these things easier (and shims for us as well), I don’t know that it is a help in the big picture while deployment is so complex.

    I’m sure it will get better though… I am guessing that 3.0 will start to turn the corner and complexity will start to decrease, not increase. I hope that this is not wishful thinking…

    In the meantime, I personally thank you Dennis for kicking the tires on this and giving such detailed feedback. I wouldn’t have a clue about this stuff if not for your blog.

    Mike

    Comment by Mike Rosenblum — March 12, 2007 @ 2:23 pm

  2. Mike,

    First of all, thanks for Your kind words about this series and my efforts so far on the subject.

    The complexity of VSTO is, at the same time, both its strength and weakness. The development platform VSTO gives is powerful but only to those of us who have accepted the challenge to try to understand it.

    From a general wide point of view what VSTO offer can be achieved with VBA/COM except for the security and server side solutions. The security model offered by .NET is, compared with VBA/COM, superior.

    The most welcome improvement in coming versions, at least for me, would be more wizards and a simplified procedure to create ‘bullet proof’ deployment’s packages.

    Compared with the classic VBA platform VSTO raise much more demands on the developers, i e VBA developers need to become more ‘professional coders’.

    As for this series I think it should be considered as a ‘compliment’ to MSFT’s articles about deployment.

    The series cover only managed COM add-ins but keep in mind that we can create workbook level solutions (templates and workbooks).

    To create these kind of solutions we need additional knowledge and understanding about application and deployment manifests, server side solutions, data islands and more advanced security settings.

    I have sheduled to cover it in a coming series, hopefully with the coming 3.0 version.

    Kind regards,
    Dennis

    Comment by Dennis Wallentin — March 12, 2007 @ 3:23 pm

  3. Hi,
    I have a serious problem. please do help me..
    I created a MS word 2003 Addin in VSTO 2005 SE in Windows Vista. The Addin has a reference to the Microsoft Speech object Library. When I install the set up created in an Windows Xp system it installs.
    All the registry keys have been set according to XP needs and the assemblies have been copied. But when MS word 2003 is opened in the end computer i dont see my Add in in action. Plz tell me where I would have gone wrong..
    Expecting reply Plz

    cheers
    shriram

    Comment by Shriram — July 29, 2008 @ 6:26 pm

  4. Hi Shriram,

    What about the Code Access Security (CAS)?

    Kind regards,
    Dennis

    Comment by Dennis Wallentin — July 29, 2008 @ 11:28 pm


RSS feed for comments on this post. TrackBack URI

Leave a comment

Blog at WordPress.com.