Visual c++ libraries - c#

I'm currently working in VS2017 on a solution with multiple C# and C++ projects.
The installer project has the C++ redistributable as a prerequisite, with the option to download it from the component vendor's site.
Some of the clients want to be able to install the application without an internet connection.
The normal thing would be to put the package in the bootstraper and check the download from the same location as my application; the problem is every time Microsoft updates something with this library, compiling the application would work, but installation will have the old redistributable.
Is there any check to include Visual Studio libraries that are used when building the application, which ever version these may be?

Related

Visual Studio 2015, C# and creating releases

This is a question for which I need someone to give me some pointers and point me in the right direction. Not a "suggest-a-sulution-code" question:
How do I create a stand-alone release of a C# Windows Froms application that uses a couple of NuGet packages AND an external library (AutoIT)?
The application is a simple forms application which uses Selenium Webdriver for opening and accessing a browser. In addition to this, it uses a library called AutoIt, for handling windows operations.
In my VS project I've installed Selenium Webdriver with NuGet, and added the AutoIt libraries manually as externals.
The resulting .exe file created after build does not work on another computer when I just copy it over. The GUI and functionality works, but the AutoIt library is not included. This is probably logical, and due to my lack of knowledge regarding building windows applications. But how do I do this? How do I build a release which can be used by others, which includes any external libraries used by the application? Do I have to manually get all DLL files relatedt to the project, or is there a way to package things to make it easier?

Install Matlab MCR as part of the C# Installer Wizard

I have wrote a program HelloApp with Matlab and packaged it as .NET Assembly using deploytool as described here. As a result I have got helloapp.dll library, which I included into my Visual Studio 2015 as a reference, so I can run Matlab methods directly from C#. To run the code without Matlab installed, the end user needs Matlab Runtime (MCR) installed at least.
Now I want to create an installer for my C# program. I have came across Visual Studio 2015 Installer Projects which provides some tools to create program setup wizard. The problem is, I don't know how to include download and setup of MCR package as a step in installation process to ensure the user has all the required prerequisites in order for program to run.
Well this is not really an answer, but comment area in question was too short ...
I don't know much about VS2015 Installer as I personnally use innosetup. Anyway to check if runtime is installed on target machine you can look if following key exists in the registry:
HKEY_LOCAL_MACHINE\SOFTWARE\MathWorks\MATLAB Runtime\9.0
See my posts here and here for further details.
NB1: Note that installer for Matlab runtime is very large (about 1 GB). I would not package it with application to deploy, but just warn the user to install it separately.
NB2: I think Mathworks is packaging C:\Program Files\MATLAB\R2015b\toolbox\compiler\deploy\win64\InstallAgent.zip (~66MB) rather than MCRInstall.exe (~1GB) when deploying standalone installer with deploytool for downloading the runtime during install but I don't know how it works.

Redistributable .net framework installer

Is there a redistributable web installer for .net framework 4.0? Preferably, it'd detect the correct language version to install and download it from the internet.
I want to bundle this web installer with my 4.0 application, so that the download size of setup package is as small as possible (40MB of full offline installer could scare users), plus I don't want to deal with detecting the necessary version (x86, x64, which language) to install.
EDIT:
As to how I create the setup. I'll go for the easiest option. My application is really trivial. I just need to copy some files and make shortcuts in Start Menu / Desktop.
What's the simplest/fastest solution to this? The setup project that can be build with VS (I'm using VS 2010).
Visual Studio setup project covers your needs.
check this : http://msdn.microsoft.com/en-us/library/ee942965.aspx
edit fixed the link, you might want to check the web bootstrapper and redistribute framework related sections
Within your setup project you should embed the .Net 4 Framework. But instead of adding the full offline version you simply download and embed this web installer. It checks the currently running machine and downloads only the necessary files. So everyone who already has the .Net framework installed just gets 870kb of death data with your setup (thats the size of the web installer) and anybody else downloads as much as needed for the current machine.

What C++ packages do i need to run a program?

I created a C# application that uses a C++ dll and im trying to create an install package that will allow this to run on other computers whether they have VS or not, the problem is i don't know what C++ libraries i need to let it do this. When i run just the application on a blank virtual machine it says
" xxxx has encountered a problem and needs to close."
If i go and download visual studio 2008 express version and install it on the machine, the my program will run fine. problem is express is 85-185mb to download and 335mb up to 1.1gb to install on a machine, the program that is using it is only 33kb. huge overhead there...
if i install just the C++ redistributable from msdn site, it takes up 4mb, but it wont let me run my program.
what packages from C++ do i need to make this program run on a blanked computer?
That question can be tough to answer. If you have the source of the c++ dll you should be able to see its dependencies unless the person used a lot of com or load library calls. One of the best tools I used to get c++ depencany info was depends.exe. One thing to check if its your code is that you are not using debug version with dependencies on debug dll that I think are not in the redistributable.
caleb, I recommend you a program called Dependency Walker. It will show you all the dll dependencies you have. I'm sure there are much more of them for Windows but that's the one I've been using for quite a while and I like it. So you did right by downloading the redistributable package from the MS web site but your app probably depends on some other libraries. When I tried to build my installer long time ago using Visual Studio I remember it was a way to include a redistributable package in your installer or use side-by-side installation - depending whether the license agreement of your Visual Studio version allowed you to do that or not. Also you could include all the dll dependencies you have in the installer.
Hope that helps
The C++ runtime dlls you need are the ones provided with the compiler as redistributable package and exactly this one! Other redist packages won't necessary work because of the manifests embedded in the executables which require an exact version (checked by a hash value of the binaries in the side by side assembly directory C:\Windows\SxS)
So you are right with the redistributable but you need the one that was installed with the compiler not one from a best guess from the internet. The exact versions can be looked at in the manifest files (XML)

How to export all the dependent DLL files automatically

I used C# to write a program in .NET Framework 3.5.
But when I finished that and moved it to another computer on which .NET Framework 3.5 was installed, the program couldn't be started. It missed some dependent DLL files.
But when I moved this program to a computer that had Visual Studio 2008 installed, it ran perfectly.
So what can I do to export all the dependent DLL files automatically? So my program can run on a computer without installing Visual Studio 2008?
Actually you just need to include the third party component that your project use.
Edit:
To know them you need go to references and check the Added DLL.
Edit2:
Did you try to make a setup for your project it will automatically collect all the library used in your applications?
another point is, are you using win32 libraries, if yes also you should include them?

Categories

Resources