Microsoft Visual C++ Runtime no longer automatically included in V5.1 Builds?

Hello,
Ever since our Upgrade to 5.1, some PC’s won’t run our game builds anymore, throwing an Error Message saying " The following components are required to run this game: Microsoft Visual C++ Runtime". As I understand, past UE 5 Versions automatically built Microsoft Visual C++ Runtime into their builds (or automatically downloaded them for players).

Is Epic Games planning on automatically including Microsoft Visual C++ Runtime again in future versions? We would prefer to hold off on fixing this ourselves if it will be fixed on Epics side in a few months anyways since our game hasn’t launched yet.

4 Likes

I still get it even on 5.0.3

Same error message with version 5.2. Has anyone found a solution??

Hi, guys, I resolved it with adding to DefaultGame.ini (you can do it with Editor → Project Settings → Package ->…):

[/Script/UnrealEd.ProjectPackagingSettings]
ApplocalPrerequisitesDirectory=(Path="$(EngineDir)/Binaries/ThirdParty/AppLocalDependencies")

And the main: -prereqs word in build command:

call "%UE_PATH%\Engine\Build\BatchFiles\RunUAT.bat" BuildCookRun -project="%CI_PROJECT_DIR%\%PROJECT_NAME%.uproject" -noP4 -clientconfig=%BUILD_CONFIGURATION% -serverconfig=%BUILD_CONFIGURATION% -installed -unrealexe="%UE_PATH%%UE_RELATIVE_EXE%" -utf8output -platform=Win64 -build -cook -allmaps -CookCultures=en -unversionedcookedcontent -prereqs -stage -package -stagingdirectory="%BUILDS_PATH%\%PROJECT_NAME%"

Or 2nd variant if you are using Custom Launch Profile then:

2 Likes

Hi @Vityoki
What did you mean “And the main: -prereqs word in build command:”
Where do i have to write that code?

rem Consider:
rem -applocaldirectory="$%UE_PATH%\Engine\Binaries\ThirdParty\AppLocalDependencies"
rem -skipdeploy
rem -skipcook 
rem maps one by one, not -allmaps
call "%UE_PATH%\Engine\Build\BatchFiles\RunUAT.bat" BuildCookRun -project="%CI_PROJECT_DIR%\%PROJECT_NAME%.uproject" -noP4 -clientconfig=%BUILD_CONFIGURATION% -serverconfig=%BUILD_CONFIGURATION% -installed -unrealexe="%UE_PATH%%UE_RELATIVE_EXE%" -utf8output -platform=Win64 -build -cook -allmaps -CookCultures=en -unversionedcookedcontent -prereqs -stage -package -stagingdirectory="%BUILDS_PATH%\%PROJECT_NAME%"

@ SerkanAyhan1973 Sorry for the late reply, try this. See here ‘-prereqs’ arg inside the command above. You can add it also through Custom Launch Profile. I think all that is needed for C++ redistributables included in to package - is this argument for the build command.
After that, if C++ redistributables are absent on the end computer - Epic will raise the installation process (when you click on yourgame.exe) with the installation wizard.

Thank you for your answer @Vityoki

In my case the installer already does the installation. I am looking for a solution that the installation does not come at all

then firstly build an ordinary c++ sln (not ue) with such depency, maybe need to update somehow project setting there. and only after maybe you can find compiler arguments that you need. and after that you can add them in some apropriate cs file of unreal , which build it (so maybe some custom ue needed, or custom UBT, idk).
it looks like it’s not needed, because sometime redistr already installed by other programs like games and all okay after that, they don’t need to be included with every game. it’s usual process to install it once on a machine (bad design, yeah)

Was normal until UE 5.1.0, started in later versions

Hey man are you able to dumb this down for me please?? I’m trying to sort this out so I can package my entry for a game jam… Where do I paste that second wall of code please?