2
votes

We have developed a .Net 4.0 VSTO Excel AddIn in VS2010 that we are deploying via ClickOnce. Our deployable seems fine on Windows XP but is extremely problematic when installed on Windows 7. The problems all seem to relate to when the AddIn needs to be removed via Excel (i.e. it has been soft deleted by Excel [eg. due to failure, etc] and it is then 'Remove'd by the user via the Excel | Options | AddIns | Manage | COM AddIns dialog.

The above leads to a situation where an AddIn is re-installed after the above has occurred, it is not exposed within Excel - i.e. the Excel AddIns tab (which would normally appear if there is one or more AddIns installed) vanishes forever. It becomes even more of a problem when we are developing/debugging, as we are renaming/removing AddIn instances on the fly - so much so that developing VSTO on Windows 7 is no longer feasible

Note that the AddIn is not in the hard deleted (disabled) list - it has been removed. I have tried installing/re-installing/uninstalling, rebooting, removing registry items (cleaning up cache/after-uninstall), removing file system files from C:\Documents and Settings\\Local Settings\Apps\2.0, clearing cache (via mage and/or rundll32 as per Clear the .NET-downloaded application cache without Mage?). There seems to be a clear difference of behaviour between XP and Windows 7.

Has anyone had similar problems ?

The only alternative I can see is a deployment project with a fully blown MSI, however this is no where near as neat - requires local Admin access, etc

Many thanks
Travis

3

3 Answers

1
votes

Not sure if you have read about the tutorials about publishing Office solution using Clickonce. If you haven't, you can find them via the links below. Worth reading.

http://msdn.microsoft.com/en-us/library/vstudio/bb772100(v=vs.100).aspx
http://msdn.microsoft.com/en-us/library/vstudio/bb608591(v=vs.100).aspx

Regarding using windows installer, it's not extremely hard to do, especially with Visual Studio 2010 setup project. Here's a very detailed tutorial that can guide you through all these. It helped me a lot when I was trying to deploy the Excel add-in, and I hope it'd help you too in some way.

http://msdn.microsoft.com/en-us/library/ff937654.aspx

Also you might want to ask yourself these questions to determine whether or not using Clickonce/Windows installer is the right choice.

When it comes to your choice in deployment technologies, you don't need to limit yourself to just one option. The key is to choose the right tool for the right job. While there is no single rule or simple answer, there are some general guidelines you can use to help make the best decision for your specific needs.

  • Does the application install any COM components?
  • Does the application require registering any components for COM-Interop?
  • Does the application install any services? Does the application have to install to a specific location or to the Global Assembly Cache (GAC)?
  • Does the application have any components that are conditionally installed, based on the operating system or runtime environment?
  • Does the application require user input at installation time?
  • Does the application require configuration of system-level services such as Active Directory or COM+?
  • After the application is installed, does it create files, write to the registry, or affect the system in some way that would leave resources behind when the application is removed?

If you answered yes to any of these questions, then Windows Installer is the best choice for your needs. However, if you don't need to address the scenarios described in the list above, then ClickOnce is an excellent candidate for your deployment solution. If you want to leverage the distinct benefits provided by ClickOnce, then understanding the capabilities of ClickOnce early in your application design process is critical. Deploying an early version of an application with ClickOnce, but then belatedly realizing a need to move to Windows Installer, would create a difficult upgrade path that can be avoided through careful up-front planning.

1
votes

From my experience, on one of my production projects we have also used MSI. And problems with click once were avoided. So my answer - yes you need to have MSI Project or MSI installations. And with MSI installations you can either use default MSI Project or external, e.g. Wix or Wise Installer or something else. Second way with custom installer is much more harder.

For situations with removing I've used mage and manual delete add-in from cache and registry. It helps, but looks like hacks.

Also each time when dealing with VSTO ClickOnce unclear, I've thought to use some external libraries. Unfortunately I haven't such opportunity to use something 3rd party to make my work easier due to requirement to project. But you can check and try. May be Add-in-Express libraries will help you, especially when they have good technical support.

0
votes

What we found was that the way to get ClickOnce working for VSTO on Windows 7 was to do this within Excel - i.e.

  • Add/Remove Programs : uninstall
  • Excel | Options | AddIns | COM | Go
  • Add | browse to the ClickOnce setup.exe | OK | etc
  • Close down Excel
  • Go into Excel
  • AddIn appears

I'm sure you can play with the Add/Remove programs uninstall (versioning) so the user doesn't necessarily have to manually uninstall

ClickOnce is gr8 when it works - it's journey to get there tho and needs to be tightened up big style