0

I have a program and tool that we are currently using for testing/interacting with an embedded device. The program is written in C++/CLI.

Previously, I was building in Visual Studios 2010, in which case I could send out the EXE with only a single .DLL - msvcr100d.dll - being required for most computers. This was still not desirable but still pretty reasonable to ask users to put that DLL in the same directory.

However, I've just sent the program, developed in Visual Studios 2015, to another PC, and it's asking for a lot of DLL files. So far:

  • ucrtbased.dll
  • vcruntime140d.dll

I have tried the /MT option suggested here and it's incompatible with /CLR for reasons I don't fully understand.

I have not changed the code substantially in any way, so why are extra DLLs required? The very same project, compiled from Visual Studios 2010, did not require them.

Is there any way to avoid having to include all these DLLs?

Ultimately we would like to give this application to customers, potentially even executives who may not have a complete technical background. What is the best option to make it easy for them? It is embarrassing to send a program and have it not run, as well as wasting valuable time.

Ideally I would like to maintain the flexibility that it doesn't require administrative privileges to install. I suppose it's not a core requirement, but really it would be great so it could be run just from a thumb drive or by someone who's just an employee without having to go get their administrator. I really want to make this as easy as possible.

Community
  • 1
  • 1
azoundria
  • 940
  • 1
  • 8
  • 24
  • This is kind of a silly question. If it was a native C++ application, you could just statically link the runtime and be done with it. But you can't do that, since it's a C++/CLI application. Of course, that means you have to distribute the entire .NET Framework with the application to be sure that it will run, so worrying about distributing a relatively tiny C Runtime Library seems rather comical. Just bundle the CRT along with the .NET Framework in your installer. Installers are pretty easy to run, even for executives. Downloading and installing the .NET Framework OTOH is a non-starter. – Cody Gray - on strike Jun 28 '16 at 16:57
  • I don't have an 'installer' presently and it hasn't been a problem yet. I wouldn't mind a pointer on how to set this up, but I'm sure I could figure it out. My only concern is that would that then require administrative privileges to install? I want to avoid that requirement, so couldn't I just send the DLLs and EXE in a ZIP and instruct the user to just extract it to a directory of their choosing? Or is there a possibility more DLLs would be required? It's not directly necessary to solve, but I was curious to understand why the DLLs changed in the first place. – azoundria Jun 28 '16 at 17:43
  • Yes, as far as I understand it, app-local deployment is still supported for the Universal CRT in VS 2015. Which means that you could just put the required DLLs in the same folder as your EXE, zip it up, and distribute it. No administrative privileges required. Problem is, you cannot distribute the .NET Framework this way, and C++/CLI applications require the .NET Framework. You haven't run into this problem yet because all of your test machines have .NET installed, but that won't be the case in the real world. That's why you use an installer to make sure dependencies are installed properly. – Cody Gray - on strike Jun 29 '16 at 11:09
  • So it seems like I need to package up the executable with a bunch of DLLs, which I get by running a program named depends.exe. However, as you say, the user may not have .NET, so I should also have an installer. I was trying to follow instructions here http://www.advancedinstaller.com/user-guide/tutorial-ai-ext-vs.html however I don't see the advanced installer project. Where do you recommend I go to find information on how to create an installer? Also, my assumption is that an installer will require admin, so I really need both options. (A zip with install.exe and a folder names /extract/) – azoundria Jul 05 '16 at 16:47
  • @azoundria Look into http://wixtoolset.org/ – fabspro Mar 20 '18 at 10:47

0 Answers0