Rmdir ../../../Engine/Config/Redist on game startup

My game was rejected from the Mac App Store for trying to get read/write access to directories that aren’t permitted. I have investigated it thoroughly and found that when I start my game it tries to remove these folders “…/…/…/Engine/Config/Redist” 50 times, and then it tries to remove “…/…/…/GameName/Intermediate/Shaders/tmp” and “…/…/…/GameName/Intermediate/Shaders/WorkingDirectory”.

My game started with the Third Person template, so then I created a Third Person Template project with no changes and built a Mac app from it. I ran the same tests on it and it also tried to delete “…/…/…/Engine/Config/Redist” but only 3 times.

What is causing this? I need to stop my projects from attempting to delete directories outside of the app, or Apple will not accept it.

I used Xcode, Developer Tools, Instruments, and then chose File Activity and my app. In the Directory I/O tab, it showed the access to the folders happening. I will attach a screenshot of it.

One more thing, I just tested it with the FPS Template, and it does it too. I thought that it didn’t do it.

Hey SKH Apps,

Thank you for bringing this to our attention. Is this occurring with each project that you’ve attempted or has it only been this one project you’ve tested? Did you create your project in Source or Binary, and which version were you on 4.9, 4.9.1 or 4.9.2? (please include the changelist as well). Have you been able to replicate this in 4.10.2?

Looking forward to hearing back from you, thanks!

Hello ,

Thank you for responding. :slight_smile:

The project is from Binary. It happens in all 4.9 and 4.10 including 4.10.2. (It is also in the source version as well.)

I have downloaded the source and searched through it. With the help of two others on the forums (romfeo and fxtentacle) we located the two areas in the source that causes the problems.

In this file:

These two lines need to be removed or commented out in order to stop the “…/…/…/Engine/Config/Redist” deletions.

IFileManager::Get().Delete(*FString::Printf(TEXT(“%sNoRedist/Base%s.ini”), EngineConfigDir, InBaseIniName), false, true, true);
IFileManager::Get().DeleteDirectory(*FString::Printf(TEXT(“%sNoRedist”), EngineConfigDir), false, false);

Then in:

This line:
return FPaths::GameDir() + TEXT(“Intermediate/”);

needs to be changed to this:
return GameUserDir() + TEXT(“Intermediate/”);

Those lines of code don’t really hurt the game, but Apple’s rules don’t allow writing to or deleting directories outside of the sandbox. So the code must be changed to get a game approved for the Mac App Store.

I already recompiled the engine and I am trying to get approved for the Mac App Store again. Hopefully they accept it this time around.


Hey ,

Thank you so much for giving so much information and a probable solution to this issue. I have submitted this information in a report to our Developers. UE-25742 is what you’ll reference if you’d like to check on this bug.

Thanks again!

You are welcome. I couldn’t have found it all without Romfeo and Fxtentacle’s help. Here’s the post about packaging, submitting and getting approved on the Mac App Store to help others: How to create the proper .pkg file for deployment to the MacStore - Community & Industry Discussion - Unreal Engine Forums