8

I just created my first VSTO Add-In for Excel. I'm trying to find a way to install the add-in on the end users machine easily.

If I copy the the .dll and try to add it from the COM Add-Ins manager in Excel I get this error:

<ProjectName>.dll is not a valid Office Add-in.

If I use the publish wizard, it does not give me an option to select where to install the files on the client PC. Instead, it uses the path to the installation files.

So, how can I install my VSTO add-in without using the publish wizard (AKA clickonce)?

Drew Chapin
  • 7,779
  • 5
  • 58
  • 84

2 Answers2

6

You should be using Visual Studio Setup Project and add your vsto project output. See this deployment walkthrough guide on using VSTO 4.0.

SliverNinja - MSFT
  • 31,051
  • 11
  • 110
  • 173
  • This worked! Thank you! Something I don't understand though. The registry keys it instructs you to make, I did them exactly like that manually and it didn't work. The only thing I can think is that Visual Studio detects something and does something for you automatically to register the Addin. Is this the case? – Drew Chapin Feb 11 '12 at 01:36
  • 1
    You should be able to [manually create the VSTO registry keys](http://msdn.microsoft.com/en-us/library/bb386106.aspx). The keys themselves are dependent upon whether you want it installed for All Users vs. Single User and whether you have Office 2007 or 2010 installed. The other thing to consider is that you [Clean your solution](http://msdn.microsoft.com/en-us/library/bb386179.aspx#DeploymentDuringDevelopment) before deploying to your development machine. You also need to restart your office application to locate the new registry keys. – SliverNinja - MSFT Feb 13 '12 at 14:46
  • The first link is no longer valid. :( – Konrad Viltersten May 20 '13 at 18:24
  • 1
    @KonradViltersten Thanks - updated now. Setup Projects are now deprecated in VS 2012. =) – SliverNinja - MSFT May 20 '13 at 18:51
  • Cool, thanks for the update. For some reason, in my VS12 I only have Instal Shield LE. No other installer projects are there... Any thoughts on that? – Konrad Viltersten May 20 '13 at 22:50
  • With VS 2012, you have to use a [3rd party installer (*i.e. InstallShield*) or WiX](http://stackoverflow.com/a/12284425/175679). **Setup Projects** are no longer available. – SliverNinja - MSFT May 21 '13 at 13:36
  • 1
    Thanks. I've had huge headache with this. It starts to come along now. Way too complicated IM-not-so-HO. – Konrad Viltersten May 21 '13 at 23:39
0

Visual Studio Setup Project overwrites the registry keys with its own. I used Installshield which worked perfectly fine.

KKishore
  • 452
  • 5
  • 12