How to do it so that when you start the program, a message appears about the absence of the required Microsoft Visual C ++ package for the program to work instead of messages about missing DLLs? How to implement it, if without the necessary MVC ++ program just can not start?

  • So usually just an error comes out about, for example, the missing dll, isn't it? - Matty
  • @Matty, well, it’s necessary that it was the message about the missing MVC that appeared, and not about the not found DLL - Anton
  • one
    It may be worthwhile to think about creating setup.exe, for example, using Inno Setup. And in the process of installing your program to say that the computer must be installed MSVC. By the way, the studio also has some kind of tool for creating an installation exe - Matty

2 answers 2

Check for relevant registry entries:
See: Detect if Visual C ++ Redistributable for Visual Studio 2012 is installed

In the absence of the required package, issue a warning.

  • Sublihim, but how will the warning come out if the program does not start without the necessary MVC? - Anton
  • @ Anton. WinAPI has not been canceled. MessageBox, for example. Or own simple dialog box on pure WinAPI. Ie, as an option, your program consists of 2 parts: a simple bootloader on WinAPI and, in fact, your program. Bootloader starts, verifies that it is necessary. In the case of "everything is bad" shows a message, in the case of "everything is good" starts your program. - Sublihim

In order for the program to cease to depend on VCRT * .dll, it needs to be built with a static runtime. See the details of the project ./ C / C ++ / Code generation / Runtime library. Select runtime NOT containing in the name of the DLL.

It is clear that no window library can be built with it (neither MFC, nor Qt ...), but the only MessageBox can be shown using pure WinApi.

  • To do this, change / MD to / MT and / MDd to / MTd. - Matty