Outlook 2013 Addin not creating entry in HKEY_Local_Machine - c#

I am using VIsual Studio 2013 to create Addin for Outlook 2013. My VSTO itself is creating a registry entry for HKCU. So the user who installed it can use the Addin. Since it is not creating a entry for HKLM , other users cannot see the Addin while the outlook is open in their own profile.
I went through all related topics tagged here and tried everything.But everything was disappointing for me.
I tried to create a set up project and created the registry path as below.
HKLM\Software\Microsoft\Office\Outlook\Addins\Addin_ID
But the Windows is creating the entry in the below location.
HKLM\Software\Wow6432Node\Microsoft\Office\Outlook\Addins\Addin_ID
Just wondering if the VSTO alone could create an entry HKLM like it is creating an entry in HKCU now. Or it always need a set up project to create entry in HKLM. Please advise on how it can be done.
Your replies will be highly appreciated

No, ClickOnce deployment is a user specific way of deploying. You don't needs administrator rights and that is the pretty part. The problem is: you have to install every user separately. Not only the registry is a problem here, the location of the files is too (the files are stored in the user profile).
You can use a MSI package instead if you want to install it for all users at once.

Related

Outlook Addin not appearing in the COM Add-ins list

I've developed an Add-in for outlook in Visual Studio. When I run it, it opens up outlook correctly but does not show the Add-in within the COM list of add-ins.
I assume it's something to do with the registry, but can't seem to find the problem. When running the application I can see it creates a registry within the HKEY_CURRENT_USER\SOFTWARE\Microsoft\VSTO path and another within HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\Outlook\Addins that contains the Manifest with the correct file path to the VSTO project.
Am I missing something?
Thank you in advance.
It is not clear where your windows registry keys were added.
If the installer is targeting all users on 64-bit Windows, it is recommended that it includes two registry entries, one under the HKEY_LOCAL_MACHINE\Software\Microsoft and one under the HKEY_LOCAL_MACHINE\Software\WOW6432Node\Microsoft hive. This is because it's possible for users to use either 32-bit or 64-bit versions of Office on the computer.
If the Installer is targeting the current user, it doesn't need to install to the WOW6432Node because the HKEY_CURRENT_USER\Software path is shared. For more information, see 32-bit and 64-bit Application Data in the Registry.
The Deploying a VSTO Solution Using Windows Installer article describes all required steps for creating MSI installers for Office COM add-ins. Also take a look at the Registry entries for VSTO Add-ins article which explains where windows registry keys should be added for VSTO/COM add-ins.
Answering my own question for someone facing the same issue.
Running a repair on Office fixed my issue. To my understanding it repaired some registry key mappings.

How do you create a ClickOnce MS Office Outlook add-in?

The Outlook add-ins I have created using Visual Studio 2005 don't use the ClickOnce installer, just the regular Windows Installer.
(File -> New Project -> Extensibility -> Shared Add-In)
I need to create the add-ins using the ClickOnce installer because as far as I know that's the only way there is to sign the add-ins so they can run in spite of Macro Security settings on the clients' computers.
Can someone tell me how to create an Outlook add-in installer using ClickOnce?
Add an installer project to your solution. That will install the application to your program files directory which is trusted by default. It will require the end user to have admin privileged to install, but it does not require the installer files to be signed. It is not technically a click-once install, but it works very well for office add-ins.
Edit: You also need to add a reference to the addin to the registry. Check out Deploying a Visual Studio 2010 Tools for Office Solution Using
Windows Installer on MSDN. Figure 6 and the instructions preceding it describe how this is done.
The actual values to add to the registry key can be a bit confusing, so here are the ones that I used which work fine:
Description: "Provides functionality to access data from ..."
FriendlyName: "CompanyTools"
LoadBehavior: 3 (indicates that the add-in should be loaded at startup of the host application)
Manifest: "file:///[ProgramFilesFolder][Manufacturer]/[ProductName]/T360.Office.CompanyTools.vsto|vstolocal"
Also, I think that you need to add Microsoft.VisualStudio.Tools.Applications.Runtime.dll as a dependency. I don't think that it is by default.
Go to the project properties/Signing tab. Check "Sign the ClickOnce manifests" and provide your signing certificate.
Now go to the Publish tab. You need to fill in the publishing file location, which should be a URL or a file share. If the installation location is the same as the publish location, you can leave it blank.
Click the Prerequisites button and make sure the necessary prerequisites are selected.
Click the Updates button and pick how frequently to check or updates.
Click Options. Fill in the publisher name (typically your company), product name (how you want it to look in the uninstall page, and in the Add-Ins list in the Office product), and a support URL if you want. Check the Office Settings, too.
Fill in a publish version.
Click Publish Now. It will publish your deployment to the publishing file location.
You should be able to use the installation URL or publishing location to install the add-in. Note that if you have the Office product running, you need to close it and re-open it to load the add-in.

Outlook Add-In shows as active but isn't available in the ribbon

I've created a simple Outlook add-in and I can't seem to get an install package together correctly.
Specs: Visual Studio 2010 (C#), .Net 4.0, Office 2007
The add-in works perfectly in my development environment and appears to install successfully with the setup file I created (using http://blogs.msdn.com/b/mcsuksoldev/archive/2010/10/01/building-and-deploying-an-outlook-2010-add-in-part-2-of-2.aspx).
The problem is once Outlook is reopened after the install, the Add-in is nowhere to be found. It shows up as an "Active Application Add-in", yet it's not available on the ribbon like it is when I run the add-in through Visual Studio. Do I need to hard-code it in the ribbon somehow? Also, I noticed if I manually open the VSTO file and install it, all seems perfect again. Thanks for your help!
There's a lot that can go wrong with a VSTO installation. Here's what I think may be going wrong in your situation:
If you're installing the add-in on your development machine then try a different machine instead. Debugging the add-in on your development machine sort of registers the add-in with Office via some registry keys but that registration info doesn't get cleaned up. (You can certainly clean those keys up yourself and then try your add-in's installer but I recommend a clean machine just in case.)
Try the installation without |vstolocal in the manifest path. I know Microsoft recommends including it but in my own experience it prevented my add-in from loading, and using a normal path fixed the problem.
If you're installing to Office 32-bit on a 64-bit machine then you'll need to write your registry keys to HKEY_LOCAL_MACHINE\Software\ Wow6432Node\Microsoft\Office...
Consider installing your add-in using VSTOInstaller.exe instead of manually writing the registry keys. (I tried to write the registry keys myself but Microsoft's own documentation -- rather, random blog posts -- for doing this is not thorough enough and sometimes just plain incorrect and misleading.)

Add registry key to HKCU RunOnce for every user from Visual Studio setup project

I need to install an application that will run once for any user that logs in who has a profile on a Windows installation. I don't need it to run for new users. I am using a Visual Studio 2010 Setup Project to create an MSI, and I am happy to make Custom Actions in C# to fiddle with the registry if the MSI registry stuff isn't flexible enough.
I know how to add a registry value to HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce with the MSI, but that will only start the app for the user that ran the installer. I can add the value to HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce but it'll only run the next time a user logs in, not for every user.
So, firstly is it at all possible (with VS Setup Project or C#), and if so, how?
Thanks.
I think Active Setup is what you need: http://www.sepago.de/helge/2010/04/22/active-setup-explained/
Normally advertised shortcuts are used to trigger per-user actions after a package is installed, but this does not fit with your scenario.

How can I uninstall my office add in?

I developed an office add in and a setup application, but after I install it on my computer, and then I uninstall it, it seems everything is OK.
But when I want to reinstall it, I always get nothing. It seems there are some information retained in the registry. Is there any tools can help me to find them out and solve this problem ?
By the way, I used vsto | local to install my office add in.
And I have completed all the added registry in my uninstaller, but seems not work
Rather than programmatically trying to uninstall, do it the old fashioned way. Remove the add-in via office, let it remove the keys and such, and then try again.
I believe an add-in is saved to:
HKEY_CLASSES_ROOT\CLSID{guid}\addin-name\keys
HKEY_CLASSES_ROOT\addinName
HKEY_LOCAL_MACHINE\Software\Microsoft\Office\product\Addins\addinName (all users entry)
HKEY_CURRENT_USER\Software\Microsoft\Office\product\Addins\addinName (current user entry)
and, depending on the system, the Wow6432Node as well under HKLM &/or HKCU
I've found that the click-once cache sometimes hangs on to these old versions and won't let you re-install. You can try a couple of things:
1) run the utility from MS called Mage. You want to run "Mage -cc" which clears the cache.
2) if that doesn't work you can add the environment variable: VSTO_SUPPRESSDISPLAYALERTS and set itto 0. Try the process again. This will give you a more detailed pop-up of information.

Categories

Resources