If we talk about "normal" Desktop applications,
not "Microsoft Store" crap, then: No!
You have to take care of
installing the Visual C++ Runtime, and maybe other 3rd-party dependencies, that are needed to run your application, on the user's machine. Microsoft offers "Redistributable" packages, which you can ship to the end-user alongside with your application, for exactly that purpose:
https://docs.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170
On Windows, applications are usually distributed as an
installer (
setup.exe
). So, the Visual C++ Runtime can simply be included in the application's installer. Note that you can invoke the Visual C++ Runtime installer from your "main" installer in a way that it runs in the background and requires
no user interaction.
When games are installed through a "launcher" application, such as
Steam or
Epic Launcher, things are a bit different. There will be some kind of "first run" setup procedure, when you start the game
for the first time. During this "first run" setup procedure, the required dependencies, e.g. Visual C++ Runtime or DirectX Runtime, are installed on the local machine. This all is handled by the "launcher" application,
not by the game itself!
(Take care: The "debug" version of the Visual C++ Runtime is
not redistributable)
________
For example, if you build your installer with
NSIS, then you can include (embed) the Visual C++ Runtime installer in
your "main" installer, and automatically invoke it during the installation process, like this:
1 2 3 4 5 6
|
Section "Visual Studio Runtime"
SetOutPath "$INSTDIR"
File "redist\msvc\vcredist_x86.exe"
ExecWait '"$INSTDIR\vcredist_x86.exe" /install /quiet'
Delete "$INSTDIR\vcredist_x86.exe"
SectionEnd
|
This will extract
vcredist_x86.exe
to the installation directory, invoke it with the required arguments, wait for the sub-process (Visual C++ Runtime installer) to finish, and finally delete
vcredist_x86.exe
.
________
BTW: I much recommend to use a tool like
Dependencies to figure out which dependencies your application actually has. Any dependencies, which are
not standard Windows system DLLs, must be redistributed!
https://github.com/lucasg/Dependencies#readme