Office 2010 Add-in deployment - c#

I'm searching the way in order to properly deploy a Visio 2010 Add-in.
I tried to publish it via ClickOnce, and it does the job. But I would like to have just one file, in Setup.exe style.
So I oped for a Setup Project, unfortunately with no success. The files are copied, I see it under the Programs list, but the add in is not registered.
Perhaps you know how to check if Visio 2010 is installed during the installation process, if not abort it, and then register the add in?
Any other solution?

After a long research I found this guide that explains everything, step by step and has an working example! Well done Microsoft!
http://msdn.microsoft.com/en-us/library/ff937654.aspx
Thanks

In order to deploy the addin you have to
Create entry in registry form
installer in
HKCU\Software\Microsoft\Office... (manifest, loadBehavior, friendlyname, culuture etc)
Attach to the installed files .VSTO
and .manifest file
Add VSTO runtime and proper .NET version to the pre-requisites

Related

Issues getting a 2010 VSTO outlook plugin working on Outlook 2013?

I have an outlook plugin built with Visual Studio 2010 (.net 4.0 Client Profile), that works fine in Outlook 2007 and Outlook 2010. I just tested on 2013 and even installing the addin seems to crash. After googling, I see a few examples of issues people have faced but fundamentally can't get a straight answer to this question:
Is there any prerequisite that would not allow a VS 2010 Outlook addin to just work on 2013 or do I need to upgrade Visual Studio and Create an Outlook 2013 specific version of my addin?
The Running Solutions in Different Versions of Microsoft Office article describes all details. It states the following:
If you developed solutions for Office 2010, you can run the same solutions in Microsoft Office 2013. Solutions that were created by using Visual Studio 2013, Visual Studio 2012 or Visual Studio 2010 can run in Office 2013, Office 2010, or the 2007 Microsoft Office system.
What is the target .Net framework of your add-in? Did you try to debug the code? Do you get any exceptions?
Do you have Outlook 2013 on the machine you have the add-in project on? If you do, you can debug from VS 2010 by setting the "Start external program" in the Debug tab of the project properties window to the Outlook 2013 .exe. When I created my add-in I was able to debug it using whatever version of Outlook was on my development computer and I don't remember changing anything other than the external program path.
If you are using setup project for the installation it needs a different ComponenedId when you create its launch conditions. You'll need two different setup projects to install on Outlook 2010 and 2013. Here are the Office 2013 PIA keys and Office 2010 keys.
Did you try enabling the add-in again? It won't run after its in the disabled queue. After you re-enable it from the disabled add-in screen, you can then check the box in the COM-AddIn screen to have it load which then should prompt you more detail since you set the VSTO_SUPPRESSDISPLAYALERTS variable about what may have happened in the first place.
The problem can be that the add-in had been hard disabled by Outlook. Notice that the add-in did not show up under Inactive Application Add-Ins, but rather under Disabled Application Add-Ins. That makes a difference: In the latter case, just going to the COM-AddIn screen and ticking the check box is not enough to solve the problem.
Follow these steps for hard disabled add-in?
Goto the Manage box, change COM Add-ins to Disabled Add-ins, and then
click Go. Select the add-in and click Enable. Click Close. OK, now
the add-in can be loaded again:
In the Manage box, change Disabled Add-ins to COM Add-ins, and then
click Go. select the check box next to the disabled add-in. Click
OK.
Reference THIS site for further details.
I vaguely remember encountering an AddIn crashing on installation in the past... resolution is:
Install Visual Studio 2010 Tools for Office Runtime on the target machine.
Try the VSTO AddIn install again and you wont get the crash during installation.
Before trying to install it, you can try to run it trought the debugger to have more info on the real problem. As far as I remember, you just need to go to your project properties and change the launched version of outlook while debugging...
You can follow this link for more info : http://www.greycastle.se/vsto-project-office-target-version/
Assembly Loading issues are difficult to debug because there are at least two layers to this when dealing with Managed and Native code.
When an executable is started the native loader must find the file, load it into memory along with all the dependent DLLs to make it run.
The native loader looks into the assembly manifest to determine this information and then simply hunts down all the DLLs and load them into memory (in order).
You can easily see this process using WINDBG and pointing to an EXE and running it from Windbg. The list of modules being loaded is the native loader at work.
If a dependency is a .NET managed code assembly then the native loader transfers the loading request directly to the managed loader, known as "Fusion".
You can easily set up the FusionLOG viewer to see what is happening http://msdn.microsoft.com/en-us/library/vstudio/e74a18c4%28v=vs.100%29.aspx
Failures of loading at either the managed layer or within the managed layer are easily spotted either through WINDBG for Native or the Fusion Log View for Managed code.
A few hints on Managed DLL loading: If an assembly holds a reference to a dll that is not included in that assembly, there is a strict order of "probing" which is followed to find the dll. There will be a minimum of three attempts to find the DLLs in different places such as in the assembly, in the program root path and in the GAC. If the three attempts fail, loading is stopped at that point and the program will not run. When this happens it is often considered a system level environmental issue; however, in reality it's a programming issue because unless pre-requisites are fully know by the system administrator there is no way they can guess at this stuff. If you are a programmer who is including other dependent dlls you should always consider whether or not to place them into the assembly to stop this problem. Otherwise you, the system admins, and folks using your program will have to wait until the root cause is determined which takes a long time.
You may say, well I was told by another department to use this dll and I have no idea what the other dependencies are! This is no excuse, as there are excellent tools such as ILDASM and even managed code Dependency walkers that will tell you everything that's needed. The best way to package these "other" dlls is to simply include them in your assembly.

Changing the install directory for a C# program in Visual Studio 2013

I am kind of new to Visual Studio and have found no solutions online, so this may be a simple problem nobody has bothered to post about.
I am working with a system that requires certain browser settings on a very specific version of Internet Explorer and am trying to create a launcher that can be installed on all users of a domain computer that establishes all these settings and creates a simple IE window (to dissuade people from using it more than needed).
I have written this application, but when I run the installer it a) gives me no option to change the install directory, and b) does not give me the option to change the default install directory in the project properties.
Other sources continue to say to change the 'Install Folder URL' to something else, but whenever I change it to say '\\localhost\c$\A_File_Directory', nothing ever changes and it continues to install in an unknown location.
Any help would be appreciated (perhaps a location with in-depth examples for VS)
EDIT -- It seems there is no way to do what I am looking for through Visual Studio, so I think I will be just deploying the ClickOnce installer through Group Policy so it can run on a per-user basis. Thanks to all who helped!
As of VS 2010 the ClickOnce Installer does not let you choose where to install the application. It controls that. I have found it rather irritating and if you really need to control where something is installed you need to use a different installer.
Here's another answer for VS 2012
Settting the ClickOnce installation folder URL in Visual Studio 2012

Distributing Outlook Add-In from Visual Studio 2012

I've written an Outlook add-in for our office that I'd like to make available to others for testing.
My Googling has indicated that I should make an InstallShield project in the solution and use that, however my Visual Studio install only opens an InstallShield download page for which there is a dead link.
Following this failure, I attempted to manually add the add-in to Outlook by utilizing the files in the bin directory, but it tells me that it is an invalid add-in.
I'm at a bit of a loss here on how to proceed in making this add-in available for distribution.
You could use click-once, right click the outlook project in solution explorer and select publish and follow the wizard. The only problem would be that you will need to sign the click-once app because office addins are particular about security.
This question has further details.

create exe from visual studio 2012 c#

I made a little app with c# which I wanted to send to a friend to get an opinion. Problem is when I selected release configuration and click rebuild I get 7 additional files(3 dll's, 1 exes,...) along with the exe I want. Am I doing something wrong? I used to get single .exe files back when I used c++ with VS 2005.
You are not doing anything wrong. Its just that at release additional files are generated like AppConfig.xml for instange that holds your application settings, or a ClickOnce deployment package so that your friend can install the app. To get more used to c# you can start by googling articles about the differences between debug and release
Have you considered using the Click Once facility built into Visual Studio 2012?
Click Once Deployment - MSDN
Click Once will generate an installer that will that your friend can execute. It will automatcially download and install any dependencies (such as a specific .NET Runtime) if necessary.
To distribute referenced DLLs look at the following URL as it suggests the correct configuration settings:
How to: Specify Which Files Are Published by ClickOnce
It's been an horrible hour. Couldn't get Clickonce working for such a simple app. Moving just the 3 referenced dlls and the exe to another folder worked. Wix on the other hand...is difficult to say the least.
However, this allowed me to create a single setup file if not an exe in 10 mins. I sent a shortcut to the desktop which is more or less what I want.

c# Excel 2007 Addin - install on other pc

I create a software with vs2010. Its an Excel 2007 add-in.
Its working perfectly.
But I want to install it on another pc. All installer packgage installed without error. I added the .vsto file, but it isn't working, just "Inactive Plugin"...
I followed step-by-step the official msdn and unofficial but full vsto-installer article write. But it isn't working. The install step ran successfully. All needed packages installed (vsto4.0, .net framework, interop office) and if I add the .vsto via double-click self-install, it is running correctly. But - as I wrote at the beginning - it isn't working, the vsto addin lists as an inactive plugin.
What did I do wrong, how can I install the vsto on another pc?
UPDATE
I found the answer. Just simple re-install the whole pc (windows, office) then its gonna work. So the problem not just the installer was, the system integration too.
I try the OneClick solution too, its work too.
At msdn (links at up) sol very important the correct register keys and correct installer-pre-req (if something missing its never run/installed correctly).

Categories