Include missing dependencies in VSTO setup - c#

I created a basic install for my VSTO Excel plug-in by publishing my project.
It pretty much worked ok except for some reason it missed 2 dependencies, dll's which are needed to communicate with our SAP system.
Did loads of Googling but I can't find a way to add them in Visual Studio.
I tried downloading the setup project type from MSDN, but wierdly when I built the install it included the SAP dll's but it didn't install my plug-in! There doesn't seem to be much info on how to do this with VSTO, or at least I couldn't find it.
However I note from MSDN that there are a lot of problems with that template, so it's possible it doesn't work for VSTO stuff.
So, a workaround is obviously to run both - and that works ok - but it isn't ideal and (understandably) not satisfactory for our support team.
I would think there are several ways to fix this problem, so if anyone could answer one or two of the following that would really help!
How can I make sure that my dependency files are included in my setup when I use Publish?
What is the correct way to create a Visual Studio 2013 Installer Project
that works correctly with VSTO?

This looks like an answer to question 2:
https://msdn.microsoft.com/en-us/library/ff937654.aspx

1.How can I make sure that my dependency files are included in my setup when I use Publish?
You need to add them as a content to the target folder or make sure that files are copied to the output folder with the add-in assembly. Right click on the reference in the Solution Explorer window and see the reference's Properties. Pay special attention to the Build Action, copy to the output folder properties and etc.
2.What is the correct way to create a Visual Studio 2013 Installer Project that works correctly with VSTO?
The Deploying an Office Solution by Using Windows Installer article describes all the required steps for deploying Office add-ins.

Related

Really struggling to get how WiX works

I am working on a WPF project. I have created a Wix project which runs along with the main project and has a program.cs component as well as the XML file.
Although I can see it creates the installer upon re-building the project, what is not clear to me is that why don't I have the actual WPF project inside it or as part of it. So really I don't install anything when I run it. Simply a shell program.cs file which is part of the Wix project.
I don't get the actual project at all. So how do I effectively "add" the WPF project to the WiX project so it generates the .exe or .msi file.
When I used the Windows native build project, I was able to get this however it is really tedious.
Thanks,
Ibrahim
Most of understanding how WiX works is understanding how Windows Installer works. WiX is mainly a language and compiler to author and build Windows Installer (.MSI) database files. It does have some additional extensions and the ability to create a bootstrappper / chainer (.EXE) and that is additional tech to understand.
MSI and therefore WiX should be thought of in terms of declarative programming rather then imperative. You describe the product, the UI experience, the feature/component/resources relationships or the "what" needs to be installed and MSI handles the "how" to install it.
WiX newbie here too. I found that this tutorial to be helpful to get started: Create a simple setup. It walks you through creating a new WiX project in the Visual Studio. It creates a really simple installer (e.g. doesn't even add a shortcut to the Start Menu), but I think it will help with your understanding of how WiX works.
After you get the above example working, I'd suggest reading through this tutorial: How To: Create a Shortcut on the Start Menu. Note: I found that it was easier to copy/paste the entire code sample at the bottom of the page, replace everything in the default Product.wxs file in the WiX Visual Studio Project, and then replace references to your own files as needed.

How to successfully move a Visual studio project to a new PC

Returning to Visual studio after a few years away and really stuck with this one.
I inherited an Excel addin project for calling rest services that needs a few tweaks. No problem with code. It uses the NetOffice component which seems quite useful for handling COM interop.
It was on a windows 8 machine 32 bit visual studio 2013 community. I am on windows 10 64 bit Visual studio 2015 community fresh install.
I tried copying all the project files to my PC, open solution file and go:
Just once, the first time, it ran and paused on my breakpoint, but never after that. it still runs on other persons pC- not too big a surprise.
It even complained after the build that did not have permission to unregister the dll from (the old PC)
A text search of the project for the old PC name found nothing.
Edited all references and paths in properties file. Opened solution and project files in notepad and satisfied that nothing now points to previous machine.
It builds again but fails to stop on breakpoints. Then it complains that it can't find the login properties in the login file on (you guessed- the old PC)
I tried building a new project from existing files. That seemed to go well, but it failed to add references and I can't even find the references via add reference dialogue, Most peculiar it complains that a sub namespace of system does not exist. I tried different target .net frameworks without any luck and gave up on this approach.
I suspect part of the problem might be connected to my using 2015 community edition and the template might not be installed that was originally used ti build it.I used a class library when I attempted to build a new project manually.
Is there a safe procedure for inheriting a project like this and getting it set up cleanly on a new PC?
I realise this is a fairly dumb newbie question, but I am really stuck now.
Thanks in advance
If you will use same version of Visual Studio on destination PC than you can just copy/paste your project to the destination PC... but as chandler mentioned the best way to to that is to use some kind of source control like GIT or TFS (Team Foundation Server), with source control method it will be less painful for you to accomplish that movement of projects.
And if you choose the Team Foundation Server you have unlimited number of free repositories as long you are a small team up to five members.
Please see pricing models and additional information here: Visual Studio Team Services Pricing

install manually my word add-in VSTO (Ribbon)? built with c#

Is it possible to manually install my word add-in?
Visual Studio is preparing an installation file for word add-in and it worked great but i want to build more complex installation file. if i knew how to do it manually it would be very easy to build my own installer.
Sure its possible.
If you use Visual Studio 2013, you have two common options to deploy your addin.
One is to use publishing, also known as, Click-Once, this basically does all the dirty work for you, and leaves you with an executable that helps you deploy it on your target machines by simply double clicking it.
The other method is to use the InstallShield.
Go to File > Add > New Project > Other Project Types > Setup and Deployment > Installshield ...
You most likely do not have install shield installed, so once you try to choose that project a webpage will pop up, asking you to register (quickly and freely) to download and install Install-Shield limited edition - do it, its quite fast.
When its done, you may add a setup project to your solution.
now this part is very user-friendly, and allows you to build a custom install to your liking.
Notice that the free "limited edition" as they call it, gives you quite a lot of features, so it should be enough for light weight word addin.
Now, placing the focus on the Word Addin, the whole idea of the install is to place about 4 registry values into the deployed machine to point to the dll you compiled, and describe it.
You can find all the information you need by following microsoft's step-by-step guide on deploying an addin. its very fun and simple. really!
https://msdn.microsoft.com/en-us/library/ff937654.aspx
Good Luck !

Using multiple analyzers in Roslyn

I have done a lot of searching around before asking this question. I am new to developing diagnostic tools and code fixes using Roslyn. I am currently using the Visual Studio 2014 CTP. I have been able to successfully create my first code fix tool. However, when I create another tool in a new solution, it still shows up the Description and fixes for the old diagnostic tool.
Can anyone please explain to me what I am doing wrong? I am rebuilding the solution before I test it out, and as far as I am aware, I am keeping both solutions completely separated. Or can anyone tell me how I can use multiple rules in one solution?
Building the .vsix project created by the templates will install a vsix extension into a special VS hive. These are not automatically uninstalled, so go to Tools | Extensions to uninstall them as necessary.
As SLaks mentioned, you can have multiple diagnostic projects in your solution, but you'll have to update the vsixmanifest in the vsix project to include this new project. If you want the multiple diagnostics to always be distributed together, then just put them in the same project (copy the class structure & exports from the sample).

How to create an installer and uninstaller for a Windows Forms application

I created an installer for my Windows Forms application and I added the project output to programs menu. But now what I want is 'I should have a folder in programs menu in that it should contain both install and uninstall options'.
Please help me. Thanks in advance.
The easiest way is to create a Setup and Deployment project in Visual Studio.
I have to agree with Sir Richard's answer, but I wanted to add the instructions on how add an uninstaller using the Setup and Deployment project found in Visual Studio.
Here's a useful link you can work on: How to add a Uninstall option in Visual Studio Setup project without writing code
If you have advanced scenarios that the Setup and Deployment project can't handle, I'd advise looking into WiX.
WiX is an extremely mature Microsoft opensource project, having first launched in 2004 and is still active today. It even provides a VS extension to assist you with getting started and intellisense for the configuration.
Be warned though: WiX primarily uses XML files that use MSI's domain language. It's certainly not a tool you use if "create an installer" wasn't allocated specifically in your project plan.
You can try with NSIS, is open source and very easy...
"NSIS (Nullsoft Scriptable Install System) is a professional open source system to create Windows installers. It is designed to be as small and flexible as possible and is therefore very suitable for internet distribution."
in his website you can find tutorials and examples, the link is: http://nsis.sourceforge.net/Main_Page
I hope this help you!

Categories

Resources