Strip editor INI files from Packaged Builds

DefaultEditor.ini contains keys and other sensitive information that we don’t want packaged in our final build. It is strictly meant for the UE4 Editor and the various Modules we’ve developed. Our packaged iOS .ipa includes all config files including Editor .ini files and any other Platform specific .ini files.

Is there a way to prevent these files from being packaged in or strip the content from these files during the package process?

Thanks,

Jared

Hi Jared,

It is not fully fleshed out, but there are some utilities that you can use to strip particular sensitive lines out of your ini files. Please see AutomationTool.InternalUtils.FilterIniFile() in Engine\Source\Programs\AutomationTool\AutomationUtils\Utils.cs. You can add the ini lines to filter to LinesToFilter in that file. To apply the filter, see the example in Engine\Source\Programs\AutomationTool\Scripts\CopyBuildToStagingDirectory.Automation.cs line 869 for DefaultEngine.ini. It sounds like you would want to implement something similar for DefaultEditor.ini. Will this work for your use case?

Best,

Josh @ Epic

Hey Josh,

Thanks for the response. I ended up going with a slightly different approach. Here it is for future reference:

I modified CopyBuildToStagingDirectory.Automation.cs line #419 to:

SC.StageFiles(StagedFileType.UFS, CombinePaths(SC.ProjectRoot, “Config”), “*”, true, new string[] { “EditorOnly.ini” }, CombinePaths(SC.RelativeProjectRootForStage, “Config”), true, !Params.UsePak(SC.StageTargetPlatform));

This black lists any ini file contain ‘EditorOnly’ in the filename in the game project directory.

I stripped the key/editor-only data from the DefaultEditor.ini and placed it into a file named like ‘DefaultEditorOnlyKeys.ini’.

I then fixed up my UCLASS declaration to point to the new config file:

UCLASS(config=EditorOnlyKeys)

Thanks,

Jared

Thanks for the detailed update, Jared. I’m glad you were able to come up with a workable approach. Would it be OK with you for me to mirror your solution on UE4 answerhub for other devs to find?

Sure thing